mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@35512 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -412,7 +412,7 @@ class WP_Comment_Query {
|
||||
// Fetch full comment objects from the primed cache.
|
||||
$_comments = array();
|
||||
foreach ( $comment_ids as $comment_id ) {
|
||||
if ( $_comment = wp_cache_get( $comment_id, 'comment' ) ) {
|
||||
if ( $_comment = get_comment( $comment_id ) ) {
|
||||
$_comments[] = $_comment;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user