Ticket #32619: 32619.diff
File 32619.diff, 28.7 KB (added by , 10 years ago) |
---|
-
src/wp-admin/edit-form-comment.php
161 161 * 162 162 * @since 3.0.0 163 163 * 164 * @param object $comment Comment object.164 * @param WP_Comment $comment Comment object. 165 165 */ 166 166 do_action( 'add_meta_boxes_comment', $comment ); 167 167 -
src/wp-admin/includes/comment.php
74 74 } 75 75 76 76 /** 77 * Returns a comment object based on comment ID.77 * Returns a WP_Comment object based on comment ID. 78 78 * 79 79 * @since 2.0.0 80 80 * 81 81 * @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. 83 83 */ 84 84 function get_comment_to_edit( $id ) { 85 85 if ( !$comment = get_comment($id) ) -
src/wp-admin/includes/dashboard.php
544 544 } 545 545 546 546 /** 547 * @global object $comment547 * @global WP_Comment $comment 548 548 * 549 * @param object $comment550 * @param bool $show_date549 * @param WP_Comment $comment 550 * @param bool $show_date 551 551 */ 552 552 function _wp_dashboard_recent_comments_row( &$comment, $show_date = true ) { 553 553 $GLOBALS['comment'] =& $comment; … … 599 599 * 600 600 * @since 2.6.0 601 601 * 602 * @param array $actions An array of comment actions. Default actions include:603 * 'Approve', 'Unapprove', 'Edit', 'Reply', 'Spam',604 * 'Delete', and 'Trash'.605 * @param object $comment The comment object.602 * @param array $actions An array of comment actions. Default actions include: 603 * 'Approve', 'Unapprove', 'Edit', 'Reply', 'Spam', 604 * 'Delete', and 'Trash'. 605 * @param WP_Comment $comment The comment object. 606 606 */ 607 607 $actions = apply_filters( 'comment_row_actions', array_filter($actions), $comment ); 608 608 -
src/wp-admin/includes/export.php
473 473 </wp:postmeta> 474 474 <?php endforeach; 475 475 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 ); 477 478 foreach ( $comments as $c ) : ?> 478 479 <wp:comment> 479 480 <wp:comment_id><?php echo $c->comment_ID; ?></wp:comment_id> -
src/wp-admin/includes/template.php
743 743 * 744 744 * @since 0.71 745 745 * 746 * @global WP_Locale $wp_locale747 * @global object$comment746 * @global WP_Locale $wp_locale 747 * @global WP_Comment $comment 748 748 * 749 749 * @param int|bool $edit Accepts 1|true for editing the date, 0|false for adding the date. 750 750 * @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
146 146 * 147 147 * @since 3.4.0 148 148 * 149 * @param object $comment Comment object.150 * @param WP_User $userUser 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. 151 151 */ 152 152 do_action( 'set_comment_cookies', $comment, $user ); 153 153 … … 158 158 * 159 159 * @since 2.0.5 160 160 * 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. 163 163 */ 164 164 $location = apply_filters( 'comment_post_redirect', $location, $comment ); 165 165 -
src/wp-includes/class-wp-xmlrpc-server.php
1043 1043 * 1044 1044 * @since 3.4.0 1045 1045 * 1046 * @param array $_comment An array of prepared comment data.1047 * @param object $comment Comment object.1046 * @param array $_comment An array of prepared comment data. 1047 * @param WP_Comment $comment Comment object. 1048 1048 */ 1049 1049 return apply_filters( 'xmlrpc_prepare_comment', $_comment, $comment ); 1050 1050 } -
src/wp-includes/comment-template.php
37 37 * @since 1.5.0 38 38 * @since 4.1.0 The `$comment_ID` and `$comment` parameters were added. 39 39 * 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. 43 43 */ 44 44 return apply_filters( 'get_comment_author', $author, $comment_ID, $comment ); 45 45 } … … 83 83 * @since 1.5.0 84 84 * @since 4.1.0 The `$comment_ID` and `$comment` parameters were added. 85 85 * 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. 89 89 */ 90 90 return apply_filters( 'get_comment_author_email', $comment->comment_author_email, $comment_ID, $comment ); 91 91 } … … 170 170 * @since 1.2.0 171 171 * @since 4.1.0 The `$comment` parameter was added. 172 172 * 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. 175 175 */ 176 176 $email = apply_filters( 'comment_email', $comment->comment_author_email, $comment ); 177 177 if ((!empty($email)) && ($email != '@')) { … … 250 250 * @since 1.5.0 251 251 * @since 4.1.0 The `$comment_ID` and `$comment` parameters were added. 252 252 * 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. 256 256 */ 257 257 return apply_filters( 'get_comment_author_IP', $comment->comment_author_IP, $comment_ID, $comment ); 258 258 } … … 289 289 * @since 1.5.0 290 290 * @since 4.1.0 The `$comment_ID` and `$comment` parameters were added. 291 291 * 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. 295 295 */ 296 296 return apply_filters( 'get_comment_author_url', $url, $comment_ID, $comment ); 297 297 } … … 508 508 * 509 509 * @param string|int $date Formatted date string or Unix timestamp. 510 510 * @param string $d The format of the date. 511 * @param object$comment The comment object.511 * @param WP_Comment $comment The comment object. 512 512 */ 513 513 return apply_filters( 'get_comment_date', $date, $d, $comment ); 514 514 } … … 563 563 * @since 1.5.0 564 564 * @since 4.1.0 The `$comment_ID` and `$comment` parameters were added. 565 565 * 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. 569 569 */ 570 570 return apply_filters( 'get_comment_excerpt', $excerpt, $comment_ID, $comment ); 571 571 } … … 611 611 * @since 1.5.0 612 612 * @since 4.1.0 The `$comment_ID` parameter was added. 613 613 * 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. 616 616 */ 617 617 return apply_filters( 'get_comment_ID', $comment->comment_ID, $comment ); 618 618 } … … 636 636 * @global WP_Rewrite $wp_rewrite 637 637 * @global bool $in_comment_loop 638 638 * 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. 641 641 * @return string The permalink to the given comment. 642 642 */ 643 643 function get_comment_link( $comment = null, $args = array() ) { … … 681 681 * 682 682 * @see get_page_of_comment() 683 683 * 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. 687 687 */ 688 688 return apply_filters( 'get_comment_link', $link, $comment, $args ); 689 689 } … … 825 825 * 826 826 * @see Walker_Comment::comment() 827 827 * 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. 831 831 */ 832 832 return apply_filters( 'get_comment_text', $comment->comment_content, $comment, $args ); 833 833 } … … 853 853 * 854 854 * @see Walker_Comment::comment() 855 855 * 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. 859 859 */ 860 860 echo apply_filters( 'comment_text', $comment_text, $comment, $args ); 861 861 } … … 890 890 * @param string $d Date format. 891 891 * @param bool $gmt Whether the GMT date is in use. 892 892 * @param bool $translate Whether the time is translated. 893 * @param object$comment The comment object.893 * @param WP_Comment $comment The comment object. 894 894 */ 895 895 return apply_filters( 'get_comment_time', $date, $d, $gmt, $translate, $comment ); 896 896 } … … 925 925 * @since 1.5.0 926 926 * @since 4.1.0 The `$comment_ID` and `$comment` parameters were added. 927 927 * 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. 931 931 */ 932 932 return apply_filters( 'get_comment_type', $comment->comment_type, $comment_ID, $comment ); 933 933 } … … 1859 1859 * @see Walker::end_el() 1860 1860 * @see wp_list_comments() 1861 1861 * 1862 * @param string $output Passed by reference. Used to append additional content.1863 * @param object $comment The comment object. Default current comment.1864 * @param int $depth Depth of comment.1865 * @param array $args An array of arguments.1862 * @param string $output Passed by reference. Used to append additional content. 1863 * @param WP_Comment $comment The comment object. Default current comment. 1864 * @param int $depth Depth of comment. 1865 * @param array $args An array of arguments. 1866 1866 */ 1867 1867 public function end_el( &$output, $comment, $depth = 0, $args = array() ) { 1868 1868 if ( !empty( $args['end-callback'] ) ) { … … 1885 1885 * 1886 1886 * @see wp_list_comments() 1887 1887 * 1888 * @param object $comment The comment object.1889 * @param int $depth Depth of comment.1890 * @param array $args An array of arguments.1888 * @param WP_Comment $comment The comment object. 1889 * @param int $depth Depth of comment. 1890 * @param array $args An array of arguments. 1891 1891 */ 1892 1892 protected function ping( $comment, $depth, $args ) { 1893 1893 $tag = ( 'div' == $args['style'] ) ? 'div' : 'li'; … … 2049 2049 * @type bool $short_ping Whether to output short pings. Default false. 2050 2050 * @type bool $echo Whether to echo the output or return it. Default true. 2051 2051 * } 2052 * @param array $comments Optional. Array of comment objects.2052 * @param array $comments Optional. Array of WP_Comment objects. 2053 2053 */ 2054 2054 function wp_list_comments( $args = array(), $comments = null ) { 2055 2055 global $wp_query, $comment_alt, $comment_depth, $comment_thread_alt, $overridden_cpage, $in_comment_loop; -
src/wp-includes/comment.php
164 164 * @global wpdb $wpdb WordPress database abstraction object. 165 165 * @global object $comment 166 166 * 167 * @param object|string|int$comment Comment to retrieve.167 * @param WP_Comment|int|null $comment Comment to retrieve. 168 168 * @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. 170 170 */ 171 function get_comment(&$comment, $output = OBJECT) { 172 global $wpdb; 171 function get_comment( &$comment = null, $output = OBJECT ) { 172 if ( empty( $comment ) && isset( $GLOBALS['comment'] ) ) { 173 $comment = $GLOBALS['comment']; 174 } 173 175 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 ) { 181 177 $_comment = $comment; 178 } elseif ( is_object( $comment ) ) { 179 $_comment = WP_Comment::get_instance( $comment->comment_ID ); 182 180 } 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 ); 191 182 } 192 183 184 if ( ! $_comment ) { 185 return null; 186 } 187 193 188 /** 194 189 * Fires after a comment is retrieved. 195 190 * … … 213 208 } 214 209 215 210 /** 211 * WordPress Comment class 212 * 213 * @since 4.3.0 214 */ 215 final class WP_Comment { 216 /** 217 * @var int 218 */ 219 public $comment_ID; 220 /** 221 * @var int 222 */ 223 public $comment_post_ID = 0; 224 /** 225 * @var int 226 */ 227 public $comment_author; 228 /** 229 * @var string 230 */ 231 public $comment_author_email = ''; 232 /** 233 * @var string 234 */ 235 public $comment_author_url = ''; 236 /** 237 * @var string 238 */ 239 public $comment_author_IP = ''; 240 /** 241 * @var string 242 */ 243 public $comment_date = '0000-00-00 00:00:00'; 244 /** 245 * @var string 246 */ 247 public $comment_date_gmt = '0000-00-00 00:00:00'; 248 /** 249 * @var string 250 */ 251 public $comment_content; 252 /** 253 * @var int 254 */ 255 public $comment_karma = 0; 256 /** 257 * @var string 258 */ 259 public $comment_approved = '1'; 260 /** 261 * @var string 262 */ 263 public $comment_agent = ''; 264 /** 265 * @var string 266 */ 267 public $comment_type = ''; 268 /** 269 * @var int 270 */ 271 public $comment_parent = 0; 272 /** 273 * @var int 274 */ 275 public $user_id = 0; 276 277 /** 278 * Retrieve WP_Comment instance. 279 * 280 * @static 281 * @access public 282 * 283 * @global wpdb $wpdb 284 * 285 * @param int $id Comment ID. 286 * @return WP_Comment|false Comment object, false otherwise. 287 */ 288 public static function get_instance( $id ) { 289 global $wpdb; 290 291 $comment_id = (int) $id; 292 if ( ! $comment_id ) { 293 return false; 294 } 295 296 $_comment = wp_cache_get( $comment_id, 'comment' ); 297 298 if ( ! $_comment ) { 299 $_comment = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->comments WHERE comment_ID = %d LIMIT 1", $comment_id ) ); 300 301 if ( ! $_comment ) { 302 return false; 303 } 304 305 wp_cache_add( $_comment->comment_ID, $_comment, 'comment' ); 306 } 307 308 return new WP_Comment( $_comment ); 309 } 310 311 /** 312 * Constructor. 313 * 314 * @param WP_Comment $comment Comment object. 315 */ 316 public function __construct( $comment ) { 317 foreach ( get_object_vars( $comment ) as $key => $value ) { 318 $this->$key = $value; 319 } 320 } 321 322 /** 323 * Isset-er. 324 * 325 * @param string $key Property to check if set. 326 * @return bool 327 */ 328 public function __isset( $key ) { 329 return metadata_exists( 'comment', $this->comment_ID, $key ); 330 } 331 332 /** 333 * Getter. 334 * 335 * @param string $key Key to get. 336 * @return mixed 337 */ 338 public function __get( $key ) { 339 return get_comment_meta( $this->comment_ID, $key, true ); 340 } 341 } 342 343 /** 216 344 * Retrieve a list of comments. 217 345 * 218 346 * The comment list can be for the blog as a whole or for an individual post. … … 1206 1334 * Sets the cookies used to store an unauthenticated commentator's identity. Typically used 1207 1335 * to recall previous comments by this commentator that are still held in moderation. 1208 1336 * 1209 * @param object $comment Comment object.1210 * @param object $user Comment author's object.1337 * @param WP_Comment $comment Comment object. 1338 * @param object $user Comment author's object. 1211 1339 * 1212 1340 * @since 3.4.0 1213 1341 */ … … 1487 1615 * 1488 1616 * @global WP_Query $wp_query 1489 1617 * 1490 * @param array $comments Optional array of comment objects. Defaults to $wp_query->comments1618 * @param array $comments Optional array of WP_Comment objects. Defaults to $wp_query->comments 1491 1619 * @param int $per_page Optional comments per page. 1492 1620 * @param boolean $threaded Optional control over flat or threaded comments. 1493 1621 * @return int Number of comment pages. … … 2030 2158 * 2031 2159 * @since 2.7.0 2032 2160 * 2033 * @param object $comment Comment object.2161 * @param WP_Comment $comment Comment object. 2034 2162 */ 2035 2163 do_action( "comment_{$old_status}_to_{$new_status}", $comment ); 2036 2164 } … … 2045 2173 * 2046 2174 * @since 2.7.0 2047 2175 * 2048 * @param int $comment_ID The comment ID.2049 * @param obj$comment Comment object.2176 * @param int $comment_ID The comment ID. 2177 * @param WP_Comment $comment Comment object. 2050 2178 */ 2051 2179 do_action( "comment_{$new_status}_{$comment->comment_type}", $comment->comment_ID, $comment ); 2052 2180 } … … 2161 2289 * 2162 2290 * @since 2.8.0 2163 2291 * 2164 * @param int $id The comment ID.2165 * @param obj$comment Comment object.2292 * @param int $id The comment ID. 2293 * @param WP_Comment $comment Comment object. 2166 2294 */ 2167 2295 do_action( 'wp_insert_comment', $id, $comment ); 2168 2296 -
src/wp-includes/feed.php
264 264 * 265 265 * @since 2.5.0 266 266 * 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. 268 269 */ 269 270 function comment_guid($comment_id = null) { 270 271 echo esc_url( get_comment_guid($comment_id) ); … … 275 276 * 276 277 * @since 2.5.0 277 278 * 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. 279 281 * @return false|string false on failure or guid for comment on success. 280 282 */ 281 283 function get_comment_guid($comment_id = null) { … … 642 644 */ 643 645 do_action_ref_array( 'wp_feed_options', array( &$feed, $url ) ); 644 646 $feed->init(); 645 $feed->set_output_encoding( get_option( 'blog_charset' ) ); 647 $feed->set_output_encoding( get_option( 'blog_charset' ) ); 646 648 $feed->handle_content_type(); 647 649 648 650 if ( $feed->error() ) -
src/wp-includes/link-template.php
3439 3439 * @since 4.2.0 3440 3440 * 3441 3441 * @param mixed $id_or_email The Gravatar to retrieve a URL for. Accepts a user_id, gravatar md5 hash, 3442 * user email, WP_User object, WP_Post object, or comment object.3442 * user email, WP_User object, WP_Post object, or WP_Comment object. 3443 3443 * @param array $args { 3444 3444 * Optional. Arguments to return instead of the default arguments. 3445 3445 * … … 3470 3470 * 3471 3471 * @since 4.2.0 3472 3472 * 3473 * @param mixed $id_or_email The Gravatar to check the data against. Accepts a user_id, gravatar md5 hash,3474 * user email, WP_User object, WP_Post object, or comment object.3473 * @param mixed $id_or_email The Gravatar to retrieve. Accepts a user_id, gravatar md5 hash, 3474 * user email, WP_User object, WP_Post object, or WP_Comment object. 3475 3475 * @param array $args { 3476 3476 * Optional. Arguments to return instead of the default arguments. 3477 3477 * … … 3571 3571 * 3572 3572 * @since 4.2.0 3573 3573 * 3574 * @param array $args Arguments passed to get_avatar_data(), after processing. 3575 * @param int|object|string $id_or_email A user ID, email address, or comment object. 3574 * @param array $args Arguments passed to get_avatar_data(), after processing. 3575 * @param mixed $id_or_email The Gravatar to retrieve. Accepts a user_id, gravatar md5 hash, 3576 * user email, WP_User object, WP_Post object, or WP_Comment object. 3576 3577 */ 3577 3578 $args = apply_filters( 'pre_get_avatar_data', $args, $id_or_email ); 3578 3579 … … 3601 3602 } elseif ( $id_or_email instanceof WP_Post ) { 3602 3603 // Post Object 3603 3604 $user = get_user_by( 'id', (int) $id_or_email->post_author ); 3604 } elseif ( is_object( $id_or_email ) && isset( $id_or_email->comment_ID ) ) { 3605 // Comment Object 3606 3605 } elseif ( $id_or_email instanceof WP_Comment ) { 3607 3606 /** 3608 3607 * Filter the list of allowed comment types for retrieving avatars. 3609 3608 * … … 3662 3661 * 3663 3662 * @since 4.2.0 3664 3663 * 3665 * @param string $url The URL of the avatar. 3666 * @param int|object|string $id_or_email A user ID, email address, or comment object. 3667 * @param array $args Arguments passed to get_avatar_data(), after processing. 3664 * @param string $url The URL of the avatar. 3665 * @param mixed $id_or_email The Gravatar to retrieve. Accepts a user_id, gravatar md5 hash, 3666 * user email, WP_User object, WP_Post object, or WP_Comment object. 3667 * @param array $args Arguments passed to get_avatar_data(), after processing. 3668 3668 */ 3669 3669 $args['url'] = apply_filters( 'get_avatar_url', $url, $id_or_email, $args ); 3670 3670 … … 3673 3673 * 3674 3674 * @since 4.2.0 3675 3675 * 3676 * @param array $args Arguments passed to get_avatar_data(), after processing. 3677 * @param int|object|string $id_or_email A user ID, email address, or comment object. 3676 * @param array $args Arguments passed to get_avatar_data(), after processing. 3677 * @param mixed $id_or_email The Gravatar to retrieve. Accepts a user_id, gravatar md5 hash, 3678 * user email, WP_User object, WP_Post object, or WP_Comment object. 3678 3679 */ 3679 3680 return apply_filters( 'get_avatar_data', $args, $id_or_email ); 3680 3681 } -
src/wp-includes/pluggable.php
2146 2146 * @since 4.2.0 Optional `$args` parameter added. 2147 2147 * 2148 2148 * @param mixed $id_or_email The Gravatar to retrieve. Accepts a user_id, gravatar md5 hash, 2149 * user email, WP_User object, WP_Post object, or comment object.2149 * user email, WP_User object, WP_Post object, or WP_Comment object. 2150 2150 * @param int $size Optional. Height and width of the avatar image file in pixels. Default 96. 2151 2151 * @param string $default Optional. URL for the default image or a default type. Accepts '404' 2152 2152 * (return a 404 instead of a default image), 'retro' (8bit), 'monsterid' … … 2214 2214 * 2215 2215 * @since 4.2.0 2216 2216 * 2217 * @param string $avatar HTML for the user's avatar. Default null. 2218 * @param int|object|string $id_or_email A user ID, email address, or comment object. 2219 * @param array $args Arguments passed to get_avatar_url(), after processing. 2217 * @param string $avatar HTML for the user's avatar. Default null. 2218 * @param mixed $id_or_email The Gravatar to retrieve. Accepts a user_id, gravatar md5 hash, 2219 * user email, WP_User object, WP_Post object, or WP_Comment object. 2220 * @param array $args Arguments passed to get_avatar_url(), after processing. 2220 2221 */ 2221 2222 $avatar = apply_filters( 'pre_get_avatar', null, $id_or_email, $args ); 2222 2223 … … 2270 2271 * @since 2.5.0 2271 2272 * @since 4.2.0 The `$args` parameter was added. 2272 2273 * 2273 * @param string $avatar <img> tag for the user's avatar. 2274 * @param int|object|string $id_or_email A user ID, email address, or comment object. 2275 * @param int $size Square avatar width and height in pixels to retrieve. 2276 * @param string $alt Alternative text to use in the avatar image tag. 2274 * @param string $avatar <img> tag for the user's avatar. 2275 * @param mixed $id_or_email The Gravatar to retrieve. Accepts a user_id, gravatar md5 hash, 2276 * user email, WP_User object, WP_Post object, or WP_Comment object. 2277 * @param int $size Square avatar width and height in pixels to retrieve. 2278 * @param string $alt Alternative text to use in the avatar image tag. 2277 2279 * Default empty. 2278 * @param array 2280 * @param array $args Arguments passed to get_avatar_data(), after processing. 2279 2281 */ 2280 2282 return apply_filters( 'get_avatar', $avatar, $id_or_email, $args['size'], $args['default'], $args['alt'], $args ); 2281 2283 } -
src/wp-includes/query.php
3160 3160 $cgroupby = ( ! empty( $cgroupby ) ) ? 'GROUP BY ' . $cgroupby : ''; 3161 3161 $corderby = ( ! empty( $corderby ) ) ? 'ORDER BY ' . $corderby : ''; 3162 3162 3163 $this->comments = (array) $wpdb->get_results("SELECT $distinct $wpdb->comments.* FROM $wpdb->comments $cjoin $cwhere $cgroupby $corderby $climits"); 3163 $comments = (array) $wpdb->get_results("SELECT $distinct $wpdb->comments.* FROM $wpdb->comments $cjoin $cwhere $cgroupby $corderby $climits"); 3164 $this->comments = array_map( 'get_comment', $comments ); 3164 3165 $this->comment_count = count($this->comments); 3165 3166 3166 3167 $post_ids = array(); … … 3786 3787 } 3787 3788 3788 3789 /** 3789 * Iterate current comment index and return comment object.3790 * Iterate current comment index and return WP_Comment object. 3790 3791 * 3791 3792 * @since 2.2.0 3792 3793 * @access public 3793 3794 * 3794 * @return object Comment object.3795 * @return WP_Comment Comment object. 3795 3796 */ 3796 3797 public function next_comment() { 3797 3798 $this->current_comment++;