mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
get_comments() can return int, so a few places need to check if the return value is traversable before passing what is assumed to be an array.
See #32444. git-svn-id: https://develop.svn.wordpress.org/trunk@32600 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1009,7 +1009,7 @@ class WP_Widget_Recent_Comments extends WP_Widget {
|
||||
}
|
||||
|
||||
$output .= '<ul id="recentcomments">';
|
||||
if ( $comments ) {
|
||||
if ( is_array( $comments ) && $comments ) {
|
||||
// Prime cache for associated posts. (Prime post term cache if we need it for permalinks.)
|
||||
$post_ids = array_unique( wp_list_pluck( $comments, 'comment_post_ID' ) );
|
||||
_prime_post_caches( $post_ids, strpos( get_option( 'permalink_structure' ), '%category%' ), false );
|
||||
|
||||
Reference in New Issue
Block a user