mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-12 04:40:26 +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:
@@ -766,6 +766,9 @@ function wp_dashboard_recent_comments( $total_items = 5 ) {
|
||||
$comments_query['status'] = 'approve';
|
||||
|
||||
while ( count( $comments ) < $total_items && $possible = get_comments( $comments_query ) ) {
|
||||
if ( ! is_array( $possible ) ) {
|
||||
break;
|
||||
}
|
||||
foreach ( $possible as $comment ) {
|
||||
if ( ! current_user_can( 'read_post', $comment->comment_post_ID ) )
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user