Make WordPress Core

Ticket #32619: 32619.4.diff

File 32619.4.diff, 28.1 KB (added by wonderboymusic, 9 years ago)
  • src/wp-admin/edit-form-comment.php

     
    171171 *
    172172 * @since 3.0.0
    173173 *
    174  * @param object $comment Comment object.
     174 * @param WP_Comment $comment Comment object.
    175175 */
    176176do_action( 'add_meta_boxes_comment', $comment );
    177177
  • src/wp-admin/includes/comment.php

     
    7474}
    7575
    7676/**
    77  * Returns a comment object based on comment ID.
     77 * Returns a WP_Comment object based on comment ID.
    7878 *
    7979 * @since 2.0.0
    8080 *
    8181 * @param int $id ID of comment to retrieve.
    82  * @return object|false Comment if found. False on failure.
     82 * @return WP_Comment|false Comment if found. False on failure.
    8383 */
    8484function get_comment_to_edit( $id ) {
    8585        if ( !$comment = get_comment($id) )
  • src/wp-admin/includes/dashboard.php

     
    548548}
    549549
    550550/**
    551  * @global object $comment
     551 * @global WP_Comment $comment
    552552 *
    553  * @param object $comment
    554  * @param bool   $show_date
     553 * @param WP_Comment $comment
     554 * @param bool       $show_date
    555555 */
    556556function _wp_dashboard_recent_comments_row( &$comment, $show_date = true ) {
    557557        $GLOBALS['comment'] =& $comment;
     
    603603                 *
    604604                 * @since 2.6.0
    605605                 *
    606                  * @param array  $actions An array of comment actions. Default actions include:
    607                  *                        'Approve', 'Unapprove', 'Edit', 'Reply', 'Spam',
    608                  *                        'Delete', and 'Trash'.
    609                  * @param object $comment The comment object.
     606                 * @param array      $actions An array of comment actions. Default actions include:
     607                 *                            'Approve', 'Unapprove', 'Edit', 'Reply', 'Spam',
     608                 *                            'Delete', and 'Trash'.
     609                 * @param WP_Comment $comment The comment object.
    610610                 */
    611611                $actions = apply_filters( 'comment_row_actions', array_filter($actions), $comment );
    612612
  • src/wp-admin/includes/export.php

     
    473473                </wp:postmeta>
    474474<?php   endforeach;
    475475
    476                 $comments = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved <> 'spam'", $post->ID ) );
     476                $_comments = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved <> 'spam'", $post->ID ) );
     477                $comments = array_map( 'get_comment', $_comments );
    477478                foreach ( $comments as $c ) : ?>
    478479                <wp:comment>
    479480                        <wp:comment_id><?php echo $c->comment_ID; ?></wp:comment_id>
  • src/wp-admin/includes/template.php

     
    743743 *
    744744 * @since 0.71
    745745 *
    746  * @global WP_Locale $wp_locale
    747  * @global object    $comment
     746 * @global WP_Locale  $wp_locale
     747 * @global WP_Comment $comment
    748748 *
    749749 * @param int|bool $edit      Accepts 1|true for editing the date, 0|false for adding the date.
    750750 * @param int|bool $for_post  Accepts 1|true for applying the date to a post, 0|false for a comment.
  • src/wp-comments-post.php

     
    146146 *
    147147 * @since 3.4.0
    148148 *
    149  * @param object $comment Comment object.
    150  * @param WP_User $user   User object. The user may not exist.
     149 * @param WP_Comment $comment Comment object.
     150 * @param WP_User    $user    User object. The user may not exist.
    151151 */
    152152do_action( 'set_comment_cookies', $comment, $user );
    153153
     
    158158 *
    159159 * @since 2.0.5
    160160 *
    161  * @param string $location The 'redirect_to' URI sent via $_POST.
    162  * @param object $comment  Comment object.
     161 * @param string     $location The 'redirect_to' URI sent via $_POST.
     162 * @param WP_Comment $comment  Comment object.
    163163 */
    164164$location = apply_filters( 'comment_post_redirect', $location, $comment );
    165165
  • src/wp-includes/class-wp-comment-query.php

     
    665665                 * @param array            $results  An array of comments.
    666666                 * @param WP_Comment_Query &$this    Current instance of WP_Comment_Query, passed by reference.
    667667                 */
    668                 $comments = apply_filters_ref_array( 'the_comments', array( $results, &$this ) );
     668                $_comments = apply_filters_ref_array( 'the_comments', array( $results, &$this ) );
    669669
     670                // Convert to WP_Comment instances
     671                $comments = array_map( 'get_comment', $_comments );
     672
    670673                wp_cache_add( $cache_key, $comments, 'comment' );
    671674                if ( '*' === $fields ) {
    672675                        update_comment_cache( $comments );
  • src/wp-includes/class-wp-xmlrpc-server.php

     
    10421042                 *
    10431043                 * @since 3.4.0
    10441044                 *
    1045                  * @param array  $_comment An array of prepared comment data.
    1046                  * @param object $comment  Comment object.
     1045                 * @param array      $_comment An array of prepared comment data.
     1046                 * @param WP_Comment $comment  Comment object.
    10471047                 */
    10481048                return apply_filters( 'xmlrpc_prepare_comment', $_comment, $comment );
    10491049        }
  • src/wp-includes/comment-functions.php

     
    164164 * @global wpdb   $wpdb WordPress database abstraction object.
    165165 * @global object $comment
    166166 *
    167  * @param object|string|int $comment Comment to retrieve.
     167 * @param WP_Comment|string|int $comment Comment to retrieve.
    168168 * @param string $output Optional. OBJECT or ARRAY_A or ARRAY_N constants.
    169  * @return object|array|null Depends on $output value.
     169 * @return WP_Comment|array|null Depends on $output value.
    170170 */
    171171function get_comment(&$comment, $output = OBJECT) {
    172         global $wpdb;
     172        if ( empty( $comment ) && isset( $GLOBALS['comment'] ) ) {
     173                $comment = $GLOBALS['comment'];
     174        }
    173175
    174         if ( empty($comment) ) {
    175                 if ( isset($GLOBALS['comment']) )
    176                         $_comment = & $GLOBALS['comment'];
    177                 else
    178                         $_comment = null;
    179         } elseif ( is_object($comment) ) {
    180                 wp_cache_add($comment->comment_ID, $comment, 'comment');
     176        if ( $comment instanceof WP_Comment ) {
    181177                $_comment = $comment;
     178        } elseif ( is_object( $comment ) ) {
     179                $_comment = new WP_Comment( $comment );
    182180        } else {
    183                 if ( isset($GLOBALS['comment']) && ($GLOBALS['comment']->comment_ID == $comment) ) {
    184                         $_comment = & $GLOBALS['comment'];
    185                 } elseif ( ! $_comment = wp_cache_get($comment, 'comment') ) {
    186                         $_comment = $wpdb->get_row($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_ID = %d LIMIT 1", $comment));
    187                         if ( ! $_comment )
    188                                 return null;
    189                         wp_cache_add($_comment->comment_ID, $_comment, 'comment');
    190                 }
     181                $_comment = WP_Comment::get_instance( $comment );
    191182        }
    192183
     184        if ( ! $_comment ) {
     185                return null;
     186        }
     187
    193188        /**
    194189         * Fires after a comment is retrieved.
    195190         *
     
    202197        if ( $output == OBJECT ) {
    203198                return $_comment;
    204199        } elseif ( $output == ARRAY_A ) {
    205                 $__comment = get_object_vars($_comment);
    206                 return $__comment;
     200                return $_comment->to_array();
    207201        } elseif ( $output == ARRAY_N ) {
    208                 $__comment = array_values(get_object_vars($_comment));
    209                 return $__comment;
    210         } else {
    211                 return $_comment;
     202                return array_values( $_comment->to_array() );
    212203        }
     204        return $_comment;
    213205}
    214206
    215207/**
     
    479471 * Sets the cookies used to store an unauthenticated commentator's identity. Typically used
    480472 * to recall previous comments by this commentator that are still held in moderation.
    481473 *
    482  * @param object $comment Comment object.
    483  * @param object $user Comment author's object.
     474 * @param WP_Comment $comment Comment object.
     475 * @param object     $user    Comment author's object.
    484476 *
    485477 * @since 3.4.0
    486478 */
     
    760752 *
    761753 * @global WP_Query $wp_query
    762754 *
    763  * @param array $comments Optional array of comment objects. Defaults to $wp_query->comments
     755 * @param array $comments Optional array of WP_Comment objects. Defaults to $wp_query->comments
    764756 * @param int   $per_page Optional comments per page.
    765757 * @param bool  $threaded Optional control over flat or threaded comments.
    766758 * @return int Number of comment pages.
     
    12881280                 *
    12891281                 * @since 2.7.0
    12901282                 *
    1291                  * @param object $comment Comment object.
     1283                 * @param WP_Comment $comment Comment object.
    12921284                 */
    12931285                do_action( "comment_{$old_status}_to_{$new_status}", $comment );
    12941286        }
     
    13031295         *
    13041296         * @since 2.7.0
    13051297         *
    1306          * @param int $comment_ID The comment ID.
    1307          * @param obj $comment    Comment object.
     1298         * @param int        $comment_ID The comment ID.
     1299         * @param WP_Comment $comment    Comment object.
    13081300         */
    13091301        do_action( "comment_{$new_status}_{$comment->comment_type}", $comment->comment_ID, $comment );
    13101302}
     
    14231415         *
    14241416         * @since 2.8.0
    14251417         *
    1426          * @param int $id      The comment ID.
    1427          * @param obj $comment Comment object.
     1418         * @param int        $id      The comment ID.
     1419         * @param WP_Comment $comment Comment object.
    14281420         */
    14291421        do_action( 'wp_insert_comment', $id, $comment );
    14301422
  • src/wp-includes/comment-template.php

     
    3737         * @since 1.5.0
    3838         * @since 4.1.0 The `$comment_ID` and `$comment` parameters were added.
    3939         *
    40          * @param string $author     The comment author's username.
    41          * @param int    $comment_ID The comment ID.
    42          * @param object $comment    The comment object.
     40         * @param string     $author     The comment author's username.
     41         * @param int        $comment_ID The comment ID.
     42         * @param WP_Comment $comment    The comment object.
    4343         */
    4444        return apply_filters( 'get_comment_author', $author, $comment_ID, $comment );
    4545}
     
    8383         * @since 1.5.0
    8484         * @since 4.1.0 The `$comment_ID` and `$comment` parameters were added.
    8585         *
    86          * @param string $comment_author_email The comment author's email address.
    87          * @param int    $comment_ID           The comment ID.
    88          * @param object $comment              The comment object.
     86         * @param string     $comment_author_email The comment author's email address.
     87         * @param int        $comment_ID           The comment ID.
     88         * @param WP_Comment $comment              The comment object.
    8989         */
    9090        return apply_filters( 'get_comment_author_email', $comment->comment_author_email, $comment_ID, $comment );
    9191}
     
    170170         * @since 1.2.0
    171171         * @since 4.1.0 The `$comment` parameter was added.
    172172         *
    173          * @param string $comment_author_email The comment author's email address.
    174          * @param object $comment              The comment object.
     173         * @param string     $comment_author_email The comment author's email address.
     174         * @param WP_Comment $comment              The comment object.
    175175         */
    176176        $email = apply_filters( 'comment_email', $comment->comment_author_email, $comment );
    177177        if ((!empty($email)) && ($email != '@')) {
     
    250250         * @since 1.5.0
    251251         * @since 4.1.0 The `$comment_ID` and `$comment` parameters were added.
    252252         *
    253          * @param string $comment_author_IP The comment author's IP address.
    254          * @param int    $comment_ID        The comment ID.
    255          * @param object $comment           The comment object.
     253         * @param string     $comment_author_IP The comment author's IP address.
     254         * @param int        $comment_ID        The comment ID.
     255         * @param WP_Comment $comment           The comment object.
    256256         */
    257257        return apply_filters( 'get_comment_author_IP', $comment->comment_author_IP, $comment_ID, $comment );
    258258}
     
    289289         * @since 1.5.0
    290290         * @since 4.1.0 The `$comment_ID` and `$comment` parameters were added.
    291291         *
    292          * @param string $url        The comment author's URL.
    293          * @param int    $comment_ID The comment ID.
    294          * @param object $comment    The comment object.
     292         * @param string     $url        The comment author's URL.
     293         * @param int        $comment_ID The comment ID.
     294         * @param WP_Comment $comment    The comment object.
    295295         */
    296296        return apply_filters( 'get_comment_author_url', $url, $comment_ID, $comment );
    297297}
     
    508508         *
    509509         * @param string|int $date    Formatted date string or Unix timestamp.
    510510         * @param string     $d       The format of the date.
    511          * @param object    $comment The comment object.
     511         * @param WP_Comment $comment The comment object.
    512512         */
    513513        return apply_filters( 'get_comment_date', $date, $d, $comment );
    514514}
     
    563563         * @since 1.5.0
    564564         * @since 4.1.0 The `$comment_ID` and `$comment` parameters were added.
    565565         *
    566          * @param string $excerpt    The comment excerpt text.
    567          * @param int    $comment_ID The comment ID.
    568          * @param object $comment    The comment object.
     566         * @param string     $excerpt    The comment excerpt text.
     567         * @param int        $comment_ID The comment ID.
     568         * @param WP_Comment $comment    The comment object.
    569569         */
    570570        return apply_filters( 'get_comment_excerpt', $excerpt, $comment_ID, $comment );
    571571}
     
    611611         * @since 1.5.0
    612612         * @since 4.1.0 The `$comment_ID` parameter was added.
    613613         *
    614          * @param int    $comment_ID The current comment ID.
    615          * @param object $comment    The comment object.
     614         * @param int        $comment_ID The current comment ID.
     615         * @param WP_Comment $comment    The comment object.
    616616         */
    617617        return apply_filters( 'get_comment_ID', $comment->comment_ID, $comment );
    618618}
     
    636636 * @global WP_Rewrite $wp_rewrite
    637637 * @global bool       $in_comment_loop
    638638 *
    639  * @param mixed $comment Comment to retrieve. Default current comment.
    640  * @param array $args    Optional. An array of arguments to override the defaults.
     639 * @param WP_Comment|int|null $comment Comment to retrieve. Default current comment.
     640 * @param array               $args    Optional. An array of arguments to override the defaults.
    641641 * @return string The permalink to the given comment.
    642642 */
    643643function get_comment_link( $comment = null, $args = array() ) {
     
    681681         *
    682682         * @see get_page_of_comment()
    683683         *
    684          * @param string $link    The comment permalink with '#comment-$id' appended.
    685          * @param object $comment The current comment object.
    686          * @param array  $args    An array of arguments to override the defaults.
     684         * @param string     $link    The comment permalink with '#comment-$id' appended.
     685         * @param WP_Comment $comment The current comment object.
     686         * @param array      $args    An array of arguments to override the defaults.
    687687         */
    688688        return apply_filters( 'get_comment_link', $link, $comment, $args );
    689689}
     
    825825         *
    826826         * @see Walker_Comment::comment()
    827827         *
    828          * @param string $comment_content Text of the comment.
    829          * @param object $comment         The comment object.
    830          * @param array  $args            An array of arguments.
     828         * @param string     $comment_content Text of the comment.
     829         * @param WP_Comment $comment         The comment object.
     830         * @param array      $args            An array of arguments.
    831831         */
    832832        return apply_filters( 'get_comment_text', $comment->comment_content, $comment, $args );
    833833}
     
    853853         *
    854854         * @see Walker_Comment::comment()
    855855         *
    856          * @param string $comment_text Text of the current comment.
    857          * @param object $comment      The comment object.
    858          * @param array  $args         An array of arguments.
     856         * @param string     $comment_text Text of the current comment.
     857         * @param WP_Comment $comment      The comment object.
     858         * @param array      $args         An array of arguments.
    859859         */
    860860        echo apply_filters( 'comment_text', $comment_text, $comment, $args );
    861861}
     
    890890         * @param string     $d         Date format.
    891891         * @param bool       $gmt       Whether the GMT date is in use.
    892892         * @param bool       $translate Whether the time is translated.
    893          * @param object    $comment   The comment object.
     893         * @param WP_Comment $comment   The comment object.
    894894         */
    895895        return apply_filters( 'get_comment_time', $date, $d, $gmt, $translate, $comment );
    896896}
     
    925925         * @since 1.5.0
    926926         * @since 4.1.0 The `$comment_ID` and `$comment` parameters were added.
    927927         *
    928          * @param string $comment_type The type of comment, such as 'comment', 'pingback', or 'trackback'.
    929          * @param int    $comment_ID   The comment ID.
    930          * @param object $comment      The comment object.
     928         * @param string     $comment_type The type of comment, such as 'comment', 'pingback', or 'trackback'.
     929         * @param int        $comment_ID   The comment ID.
     930         * @param WP_Comment $comment      The comment object.
    931931         */
    932932        return apply_filters( 'get_comment_type', $comment->comment_type, $comment_ID, $comment );
    933933}
     
    18581858         * @see Walker::end_el()
    18591859         * @see wp_list_comments()
    18601860         *
    1861          * @param string $output  Passed by reference. Used to append additional content.
    1862          * @param object $comment The comment object. Default current comment.
    1863          * @param int    $depth   Depth of comment.
    1864          * @param array  $args    An array of arguments.
     1861         * @param string     $output  Passed by reference. Used to append additional content.
     1862         * @param WP_Comment $comment The comment object. Default current comment.
     1863         * @param int        $depth   Depth of comment.
     1864         * @param array      $args    An array of arguments.
    18651865         */
    18661866        public function end_el( &$output, $comment, $depth = 0, $args = array() ) {
    18671867                if ( !empty( $args['end-callback'] ) ) {
     
    18841884         *
    18851885         * @see wp_list_comments()
    18861886         *
    1887          * @param object $comment The comment object.
    1888          * @param int    $depth   Depth of comment.
    1889          * @param array  $args    An array of arguments.
     1887         * @param WP_Comment $comment The comment object.
     1888         * @param int        $depth   Depth of comment.
     1889         * @param array      $args    An array of arguments.
    18901890         */
    18911891        protected function ping( $comment, $depth, $args ) {
    18921892                $tag = ( 'div' == $args['style'] ) ? 'div' : 'li';
     
    20482048 *     @type bool   $short_ping        Whether to output short pings. Default false.
    20492049 *     @type bool   $echo              Whether to echo the output or return it. Default true.
    20502050 * }
    2051  * @param array $comments Optional. Array of comment objects.
     2051 * @param array $comments Optional. Array of WP_Comment objects.
    20522052 */
    20532053function wp_list_comments( $args = array(), $comments = null ) {
    20542054        global $wp_query, $comment_alt, $comment_depth, $comment_thread_alt, $overridden_cpage, $in_comment_loop;
  • src/wp-includes/comment.php

     
    66 * @subpackage Comment
    77 */
    88
     9require_once( ABSPATH . WPINC . '/class-wp-comment.php' );
    910require_once( ABSPATH . WPINC . '/class-wp-comment-query.php' );
    1011require_once( ABSPATH . WPINC . '/comment-functions.php' );
  • src/wp-includes/feed.php

     
    264264 *
    265265 * @since 2.5.0
    266266 *
    267  * @param int|object $comment_id Optional comment object or id. Defaults to global comment object.
     267 * @param mixed  $id_or_email The Gravatar to retrieve. Accepts a user_id, gravatar md5 hash,
     268 *                            user email, WP_User object, WP_Post object, or WP_Comment object.
    268269 */
    269270function comment_guid($comment_id = null) {
    270271        echo esc_url( get_comment_guid($comment_id) );
     
    275276 *
    276277 * @since 2.5.0
    277278 *
    278  * @param int|object $comment_id Optional comment object or id. Defaults to global comment object.
     279 * @param mixed  $id_or_email The Gravatar to retrieve. Accepts a user_id, gravatar md5 hash,
     280 *                            user email, WP_User object, WP_Post object, or WP_Comment object.
    279281 * @return false|string false on failure or guid for comment on success.
    280282 */
    281283function get_comment_guid($comment_id = null) {
  • src/wp-includes/link-template.php

     
    34543454 * @since 4.2.0
    34553455 *
    34563456 * @param mixed $id_or_email The Gravatar to retrieve a URL for. Accepts a user_id, gravatar md5 hash,
    3457  *                           user email, WP_User object, WP_Post object, or comment object.
     3457 *                           user email, WP_User object, WP_Post object, or WP_Comment object.
    34583458 * @param array $args {
    34593459 *     Optional. Arguments to return instead of the default arguments.
    34603460 *
     
    34853485 *
    34863486 * @since 4.2.0
    34873487 *
    3488  * @param mixed $id_or_email The Gravatar to check the data against. Accepts a user_id, gravatar md5 hash,
    3489  *                           user email, WP_User object, WP_Post object, or comment object.
     3488 * @param mixed $id_or_email The Gravatar to retrieve. Accepts a user_id, gravatar md5 hash,
     3489 *                            user email, WP_User object, WP_Post object, or WP_Comment object.
    34903490 * @param array $args {
    34913491 *     Optional. Arguments to return instead of the default arguments.
    34923492 *
     
    35863586         *
    35873587         * @since 4.2.0
    35883588         *
    3589          * @param array             $args          Arguments passed to get_avatar_data(), after processing.
    3590          * @param int|object|string $id_or_email   A user ID, email address, or comment object.
     3589         * @param array  $args        Arguments passed to get_avatar_data(), after processing.
     3590         * @param mixed  $id_or_email The Gravatar to retrieve. Accepts a user_id, gravatar md5 hash,
     3591         *                            user email, WP_User object, WP_Post object, or WP_Comment object.
    35913592         */
    35923593        $args = apply_filters( 'pre_get_avatar_data', $args, $id_or_email );
    35933594
     
    36163617        } elseif ( $id_or_email instanceof WP_Post ) {
    36173618                // Post Object
    36183619                $user = get_user_by( 'id', (int) $id_or_email->post_author );
    3619         } elseif ( is_object( $id_or_email ) && isset( $id_or_email->comment_ID ) ) {
    3620                 // Comment Object
    3621 
     3620        } elseif ( $id_or_email instanceof WP_Comment ) {
    36223621                /**
    36233622                 * Filter the list of allowed comment types for retrieving avatars.
    36243623                 *
     
    36813680         *
    36823681         * @since 4.2.0
    36833682         *
    3684          * @param string            $url         The URL of the avatar.
    3685          * @param int|object|string $id_or_email A user ID, email address, or comment object.
    3686          * @param array             $args        Arguments passed to get_avatar_data(), after processing.
     3683         * @param string $url         The URL of the avatar.
     3684         * @param mixed  $id_or_email The Gravatar to retrieve. Accepts a user_id, gravatar md5 hash,
     3685         *                            user email, WP_User object, WP_Post object, or WP_Comment object.
     3686         * @param array  $args        Arguments passed to get_avatar_data(), after processing.
    36873687         */
    36883688        $args['url'] = apply_filters( 'get_avatar_url', $url, $id_or_email, $args );
    36893689
     
    36923692         *
    36933693         * @since 4.2.0
    36943694         *
    3695          * @param array             $args        Arguments passed to get_avatar_data(), after processing.
    3696          * @param int|object|string $id_or_email A user ID, email address, or comment object.
     3695         * @param array  $args        Arguments passed to get_avatar_data(), after processing.
     3696         * @param mixed  $id_or_email The Gravatar to retrieve. Accepts a user_id, gravatar md5 hash,
     3697         *                            user email, WP_User object, WP_Post object, or WP_Comment object.
    36973698         */
    36983699        return apply_filters( 'get_avatar_data', $args, $id_or_email );
    36993700}
  • src/wp-includes/pluggable.php

     
    21902190 * @since 4.2.0 Optional `$args` parameter added.
    21912191 *
    21922192 * @param mixed $id_or_email The Gravatar to retrieve. Accepts a user_id, gravatar md5 hash,
    2193  *                           user email, WP_User object, WP_Post object, or comment object.
     2193 *                           user email, WP_User object, WP_Post object, or WP_Comment object.
    21942194 * @param int    $size       Optional. Height and width of the avatar image file in pixels. Default 96.
    21952195 * @param string $default    Optional. URL for the default image or a default type. Accepts '404'
    21962196 *                           (return a 404 instead of a default image), 'retro' (8bit), 'monsterid'
     
    22582258         *
    22592259         * @since 4.2.0
    22602260         *
    2261          * @param string            $avatar      HTML for the user's avatar. Default null.
    2262          * @param int|object|string $id_or_email A user ID, email address, or comment object.
    2263          * @param array             $args        Arguments passed to get_avatar_url(), after processing.
     2261         * @param string $avatar      HTML for the user's avatar. Default null.
     2262         * @param mixed  $id_or_email The Gravatar to retrieve. Accepts a user_id, gravatar md5 hash,
     2263         *                            user email, WP_User object, WP_Post object, or WP_Comment object.
     2264         * @param array  $args        Arguments passed to get_avatar_url(), after processing.
    22642265         */
    22652266        $avatar = apply_filters( 'pre_get_avatar', null, $id_or_email, $args );
    22662267
     
    23142315         * @since 2.5.0
    23152316         * @since 4.2.0 The `$args` parameter was added.
    23162317         *
    2317          * @param string            $avatar      &lt;img&gt; tag for the user's avatar.
    2318          * @param int|object|string $id_or_email A user ID, email address, or comment object.
    2319          * @param int               $size        Square avatar width and height in pixels to retrieve.
    2320          * @param string            $alt         Alternative text to use in the avatar image tag.
     2318         * @param string $avatar      &lt;img&gt; tag for the user's avatar.
     2319         * @param mixed  $id_or_email The Gravatar to retrieve. Accepts a user_id, gravatar md5 hash,
     2320         *                            user email, WP_User object, WP_Post object, or WP_Comment object.
     2321         * @param int    $size        Square avatar width and height in pixels to retrieve.
     2322         * @param string $alt         Alternative text to use in the avatar image tag.
    23212323         *                                       Default empty.
    2322          * @param array             $args        Arguments passed to get_avatar_data(), after processing.
     2324         * @param array  $args        Arguments passed to get_avatar_data(), after processing.
    23232325         */
    23242326        return apply_filters( 'get_avatar', $avatar, $id_or_email, $args['size'], $args['default'], $args['alt'], $args );
    23252327}
  • src/wp-includes/query.php

     
    31863186                        $cgroupby = ( ! empty( $cgroupby ) ) ? 'GROUP BY ' . $cgroupby : '';
    31873187                        $corderby = ( ! empty( $corderby ) ) ? 'ORDER BY ' . $corderby : '';
    31883188
    3189                         $this->comments = (array) $wpdb->get_results("SELECT $distinct $wpdb->comments.* FROM $wpdb->comments $cjoin $cwhere $cgroupby $corderby $climits");
     3189                        $comments = (array) $wpdb->get_results("SELECT $distinct $wpdb->comments.* FROM $wpdb->comments $cjoin $cwhere $cgroupby $corderby $climits");
     3190                        // Convert to WP_Comment
     3191                        $this->comments = array_map( 'get_comment', $comments );
    31903192                        $this->comment_count = count($this->comments);
    31913193
    31923194                        $post_ids = array();
     
    35573559                        $climits = apply_filters_ref_array( 'comment_feed_limits', array( 'LIMIT ' . get_option('posts_per_rss'), &$this ) );
    35583560
    35593561                        $comments_request = "SELECT $wpdb->comments.* FROM $wpdb->comments $cjoin $cwhere $cgroupby $corderby $climits";
    3560                         $this->comments = $wpdb->get_results($comments_request);
     3562                        $comments = $wpdb->get_results($comments_request);
     3563                        // Convert to WP_Comment
     3564                        $this->comments = array_map( 'get_comment', $comments );
    35613565                        $this->comment_count = count($this->comments);
    35623566                }
    35633567
     
    38123816        }
    38133817
    38143818        /**
    3815          * Iterate current comment index and return comment object.
     3819         * Iterate current comment index and return WP_Comment object.
    38163820         *
    38173821         * @since 2.2.0
    38183822         * @access public
    38193823         *
    3820          * @return object Comment object.
     3824         * @return WP_Comment Comment object.
    38213825         */
    38223826        public function next_comment() {
    38233827                $this->current_comment++;