Make WordPress Core


Ignore:
Timestamp:
11/04/2015 09:09:01 PM (9 years ago)
Author:
boonebgorges
Message:

WP_Comment_Query: Fill comment objects from database when cache is unavailable.

This fixes a bug where widgets loaded in a preview or the Customizer are
rendered inside of a wp_suspend_cache_addition() block and thus could not
find comment objects in the cache.

Props rommelxcastro, stevehenty.
Fixes #34138.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-comment-query.php

    r35170 r35512  
    413413        $_comments = array();
    414414        foreach ( $comment_ids as $comment_id ) {
    415             if ( $_comment = wp_cache_get( $comment_id, 'comment' ) ) {
     415            if ( $_comment = get_comment( $comment_id ) ) {
    416416                $_comments[] = $_comment;
    417417            }
Note: See TracChangeset for help on using the changeset viewer.