Make WordPress Core


Ignore:
Timestamp:
05/25/2015 05:58:52 PM (10 years ago)
Author:
wonderboymusic
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/default-widgets.php

    r32589 r32600  
    10101010
    10111011        $output .= '<ul id="recentcomments">';
    1012         if ( $comments ) {
     1012        if ( is_array( $comments ) && $comments ) {
    10131013            // Prime cache for associated posts. (Prime post term cache if we need it for permalinks.)
    10141014            $post_ids = array_unique( wp_list_pluck( $comments, 'comment_post_ID' ) );
Note: See TracChangeset for help on using the changeset viewer.