- Timestamp:
- 11/30/2017 11:09:33 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-comments-list-table.php
r41683 r42343 46 46 } 47 47 48 parent::__construct( array( 49 'plural' => 'comments', 50 'singular' => 'comment', 51 'ajax' => true, 52 'screen' => isset( $args['screen'] ) ? $args['screen'] : null, 53 ) ); 48 parent::__construct( 49 array( 50 'plural' => 'comments', 51 'singular' => 'comment', 52 'ajax' => true, 53 'screen' => isset( $args['screen'] ) ? $args['screen'] : null, 54 ) 55 ); 54 56 } 55 57 56 58 public function floated_admin_avatar( $name, $comment_ID ) { 57 59 $comment = get_comment( $comment_ID ); 58 $avatar = get_avatar( $comment, 32, 'mystery' );60 $avatar = get_avatar( $comment, 32, 'mystery' ); 59 61 return "$avatar $name"; 60 62 } … … 64 66 */ 65 67 public function ajax_user_can() { 66 return current_user_can('edit_posts'); 67 } 68 69 /** 70 * 68 return current_user_can( 'edit_posts' ); 69 } 70 71 /** 71 72 * @global int $post_id 72 73 * @global string $comment_status … … 78 79 79 80 $comment_status = isset( $_REQUEST['comment_status'] ) ? $_REQUEST['comment_status'] : 'all'; 80 if ( ! in_array( $comment_status, array( 'all', 'moderated', 'approved', 'spam', 'trash' ) ) )81 if ( ! in_array( $comment_status, array( 'all', 'moderated', 'approved', 'spam', 'trash' ) ) ) { 81 82 $comment_status = 'all'; 82 83 $comment_type = !empty( $_REQUEST['comment_type'] ) ? $_REQUEST['comment_type'] : ''; 83 } 84 85 $comment_type = ! empty( $_REQUEST['comment_type'] ) ? $_REQUEST['comment_type'] : ''; 84 86 85 87 $search = ( isset( $_REQUEST['s'] ) ) ? $_REQUEST['s'] : ''; … … 90 92 91 93 $orderby = ( isset( $_REQUEST['orderby'] ) ) ? $_REQUEST['orderby'] : ''; 92 $order = ( isset( $_REQUEST['order'] ) ) ? $_REQUEST['order'] : '';94 $order = ( isset( $_REQUEST['order'] ) ) ? $_REQUEST['order'] : ''; 93 95 94 96 $comments_per_page = $this->get_per_page( $comment_status ); … … 98 100 if ( isset( $_REQUEST['number'] ) ) { 99 101 $number = (int) $_REQUEST['number']; 100 } 101 else { 102 } else { 102 103 $number = $comments_per_page + min( 8, $comments_per_page ); // Grab a few extra 103 104 } … … 117 118 $status_map = array( 118 119 'moderated' => 'hold', 119 'approved' => 'approve',120 'all' => '',120 'approved' => 'approve', 121 'all' => '', 121 122 ); 122 123 123 124 $args = array( 124 'status' => isset( $status_map[$comment_status] ) ? $status_map[$comment_status] : $comment_status,125 'search' => $search,126 'user_id' => $user_id,127 'offset' => $start,128 'number' => $number,129 'post_id' => $post_id,130 'type' => $comment_type,131 'orderby' => $orderby,132 'order' => $order,125 'status' => isset( $status_map[ $comment_status ] ) ? $status_map[ $comment_status ] : $comment_status, 126 'search' => $search, 127 'user_id' => $user_id, 128 'offset' => $start, 129 'number' => $number, 130 'post_id' => $post_id, 131 'type' => $comment_type, 132 'orderby' => $orderby, 133 'order' => $order, 133 134 'post_type' => $post_type, 134 135 ); … … 138 139 update_comment_cache( $_comments ); 139 140 140 $this->items = array_slice( $_comments, 0, $comments_per_page );141 $this->items = array_slice( $_comments, 0, $comments_per_page ); 141 142 $this->extra_items = array_slice( $_comments, $comments_per_page ); 142 143 … … 146 147 } 147 148 148 $total_comments = get_comments( array_merge( $args, array( 149 'count' => true, 150 'offset' => 0, 151 'number' => 0 152 ) ) ); 153 154 $this->set_pagination_args( array( 155 'total_items' => $total_comments, 156 'per_page' => $comments_per_page, 157 ) ); 158 } 159 160 /** 161 * 149 $total_comments = get_comments( 150 array_merge( 151 $args, array( 152 'count' => true, 153 'offset' => 0, 154 'number' => 0, 155 ) 156 ) 157 ); 158 159 $this->set_pagination_args( 160 array( 161 'total_items' => $total_comments, 162 'per_page' => $comments_per_page, 163 ) 164 ); 165 } 166 167 /** 162 168 * @param string $comment_status 163 169 * @return int … … 177 183 178 184 /** 179 *180 185 * @global string $comment_status 181 186 */ … … 191 196 192 197 /** 193 *194 198 * @global int $post_id 195 199 * @global string $comment_status … … 204 208 $stati = array( 205 209 /* translators: %s: all comments count */ 206 'all' => _nx_noop(210 'all' => _nx_noop( 207 211 'All <span class="count">(%s)</span>', 208 212 'All <span class="count">(%s)</span>', … … 218 222 219 223 /* translators: %s: approved comments count */ 220 'approved' => _nx_noop(224 'approved' => _nx_noop( 221 225 'Approved <span class="count">(%s)</span>', 222 226 'Approved <span class="count">(%s)</span>', … … 225 229 226 230 /* translators: %s: spam comments count */ 227 'spam' => _nx_noop(231 'spam' => _nx_noop( 228 232 'Spam <span class="count">(%s)</span>', 229 233 'Spam <span class="count">(%s)</span>', … … 232 236 233 237 /* translators: %s: trashed comments count */ 234 'trash' => _nx_noop(238 'trash' => _nx_noop( 235 239 'Trash <span class="count">(%s)</span>', 236 240 'Trash <span class="count">(%s)</span>', 237 241 'comments' 238 ) 239 ); 240 241 if ( !EMPTY_TRASH_DAYS ) 242 unset($stati['trash']); 242 ), 243 ); 244 245 if ( ! EMPTY_TRASH_DAYS ) { 246 unset( $stati['trash'] ); 247 } 243 248 244 249 $link = admin_url( 'edit-comments.php' ); 245 if ( ! empty($comment_type) && 'all' != $comment_type )250 if ( ! empty( $comment_type ) && 'all' != $comment_type ) { 246 251 $link = add_query_arg( 'comment_type', $comment_type, $link ); 252 } 247 253 248 254 foreach ( $stati as $status => $label ) { … … 253 259 } 254 260 255 if ( ! isset( $num_comments->$status ) )261 if ( ! isset( $num_comments->$status ) ) { 256 262 $num_comments->$status = 10; 263 } 257 264 $link = add_query_arg( 'comment_status', $status, $link ); 258 if ( $post_id ) 265 if ( $post_id ) { 259 266 $link = add_query_arg( 'p', absint( $post_id ), $link ); 267 } 260 268 /* 261 269 // I toyed with this, but decided against it. Leaving it in here in case anyone thinks it is a good idea. ~ Mark … … 265 273 $status_links[ $status ] = "<a href='$link'$current_link_attributes>" . sprintf( 266 274 translate_nooped_plural( $label, $num_comments->$status ), 267 sprintf( '<span class="%s-count">%s</span>', 275 sprintf( 276 '<span class="%s-count">%s</span>', 268 277 ( 'moderated' === $status ) ? 'pending' : $status, 269 278 number_format_i18n( $num_comments->$status ) … … 284 293 285 294 /** 286 *287 295 * @global string $comment_status 288 296 * … … 293 301 294 302 $actions = array(); 295 if ( in_array( $comment_status, array( 'all', 'approved' ) ) ) 303 if ( in_array( $comment_status, array( 'all', 'approved' ) ) ) { 296 304 $actions['unapprove'] = __( 'Unapprove' ); 297 if ( in_array( $comment_status, array( 'all', 'moderated' ) ) ) 305 } 306 if ( in_array( $comment_status, array( 'all', 'moderated' ) ) ) { 298 307 $actions['approve'] = __( 'Approve' ); 299 if ( in_array( $comment_status, array( 'all', 'moderated', 'approved', 'trash' ) ) ) 308 } 309 if ( in_array( $comment_status, array( 'all', 'moderated', 'approved', 'trash' ) ) ) { 300 310 $actions['spam'] = _x( 'Mark as Spam', 'comment' ); 311 } 301 312 302 313 if ( 'trash' === $comment_status ) { … … 306 317 } 307 318 308 if ( in_array( $comment_status, array( 'trash', 'spam' ) ) || ! EMPTY_TRASH_DAYS )319 if ( in_array( $comment_status, array( 'trash', 'spam' ) ) || ! EMPTY_TRASH_DAYS ) { 309 320 $actions['delete'] = __( 'Delete Permanently' ); 310 else321 } else { 311 322 $actions['trash'] = __( 'Move to Trash' ); 323 } 312 324 313 325 return $actions; … … 315 327 316 328 /** 317 *318 329 * @global string $comment_status 319 330 * @global string $comment_type … … 331 342 <div class="alignleft actions"> 332 343 <?php 333 if ( 'top' === $which ) {344 if ( 'top' === $which ) { 334 345 ?> 335 <label class="screen-reader-text" for="filter-by-comment-type"><?php _e( 'Filter by comment type' ); ?></label>336 <select id="filter-by-comment-type" name="comment_type">337 <option value=""><?php _e( 'All comment types' ); ?></option>346 <label class="screen-reader-text" for="filter-by-comment-type"><?php _e( 'Filter by comment type' ); ?></label> 347 <select id="filter-by-comment-type" name="comment_type"> 348 <option value=""><?php _e( 'All comment types' ); ?></option> 338 349 <?php 339 /** 340 * Filters the comment types dropdown menu. 341 * 342 * @since 2.7.0 343 * 344 * @param array $comment_types An array of comment types. Accepts 'Comments', 'Pings'. 345 */ 346 $comment_types = apply_filters( 'admin_comment_types_dropdown', array( 347 'comment' => __( 'Comments' ), 348 'pings' => __( 'Pings' ), 349 ) ); 350 351 foreach ( $comment_types as $type => $label ) 352 echo "\t" . '<option value="' . esc_attr( $type ) . '"' . selected( $comment_type, $type, false ) . ">$label</option>\n"; 353 ?> 354 </select> 350 /** 351 * Filters the comment types dropdown menu. 352 * 353 * @since 2.7.0 354 * 355 * @param array $comment_types An array of comment types. Accepts 'Comments', 'Pings'. 356 */ 357 $comment_types = apply_filters( 358 'admin_comment_types_dropdown', array( 359 'comment' => __( 'Comments' ), 360 'pings' => __( 'Pings' ), 361 ) 362 ); 363 364 foreach ( $comment_types as $type => $label ) { 365 echo "\t" . '<option value="' . esc_attr( $type ) . '"' . selected( $comment_type, $type, false ) . ">$label</option>\n"; 366 } 367 ?> 368 </select> 355 369 <?php 356 /**357 * Fires just before the Filter submit button for comment types.358 *359 * @since 3.5.0360 */361 do_action( 'restrict_manage_comments' );362 submit_button( __( 'Filter' ), '', 'filter_action', false, array( 'id' => 'post-query-submit' ) );363 }364 365 if ( ( 'spam' === $comment_status || 'trash' === $comment_status ) && current_user_can( 'moderate_comments' ) && $has_items ) {366 wp_nonce_field( 'bulk-destroy', '_destroy_nonce' );367 $title = ( 'spam' === $comment_status ) ? esc_attr__( 'Empty Spam' ) : esc_attr__( 'Empty Trash' );368 submit_button( $title, 'apply', 'delete_all', false );369 }370 /** 371 * Fires just before the Filter submit button for comment types. 372 * 373 * @since 3.5.0 374 */ 375 do_action( 'restrict_manage_comments' ); 376 submit_button( __( 'Filter' ), '', 'filter_action', false, array( 'id' => 'post-query-submit' ) ); 377 } 378 379 if ( ( 'spam' === $comment_status || 'trash' === $comment_status ) && current_user_can( 'moderate_comments' ) && $has_items ) { 380 wp_nonce_field( 'bulk-destroy', '_destroy_nonce' ); 381 $title = ( 'spam' === $comment_status ) ? esc_attr__( 'Empty Spam' ) : esc_attr__( 'Empty Trash' ); 382 submit_button( $title, 'apply', 'delete_all', false ); 383 } 370 384 /** 371 385 * Fires after the Filter submit button for comment types. … … 383 397 */ 384 398 public function current_action() { 385 if ( isset( $_REQUEST['delete_all'] ) || isset( $_REQUEST['delete_all2'] ) ) 399 if ( isset( $_REQUEST['delete_all'] ) || isset( $_REQUEST['delete_all2'] ) ) { 386 400 return 'delete_all'; 401 } 387 402 388 403 return parent::current_action(); … … 390 405 391 406 /** 392 *393 407 * @global int $post_id 394 408 * … … 400 414 $columns = array(); 401 415 402 if ( $this->checkbox ) 416 if ( $this->checkbox ) { 403 417 $columns['cb'] = '<input type="checkbox" />'; 404 405 $columns['author'] = __( 'Author' ); 418 } 419 420 $columns['author'] = __( 'Author' ); 406 421 $columns['comment'] = _x( 'Comment', 'column name' ); 407 422 … … 417 432 418 433 /** 419 *420 434 * @return array 421 435 */ … … 424 438 'author' => 'comment_author', 425 439 'response' => 'comment_post_ID', 426 'date' => 'comment_date' 440 'date' => 'comment_date', 427 441 ); 428 442 } … … 442 456 */ 443 457 public function display() { 444 wp_nonce_field( "fetch-list-". get_class( $this ), '_ajax_fetch_list_nonce' );458 wp_nonce_field( 'fetch-list-' . get_class( $this ), '_ajax_fetch_list_nonce' ); 445 459 446 460 $this->display_tablenav( 'top' ); … … 508 522 } 509 523 510 /**511 * Generate and display row actions links.512 *513 * @since 4.3.0514 *515 * @global string $comment_status Status for the current listed comments.516 *517 * @param WP_Comment $comment The comment object.518 * @param string $column_name Current column name.519 * @param string $primary Primary column name.520 * @return string|void Comment row actions output.521 */522 protected function handle_row_actions( $comment, $column_name, $primary ) {523 global $comment_status;524 /** 525 * Generate and display row actions links. 526 * 527 * @since 4.3.0 528 * 529 * @global string $comment_status Status for the current listed comments. 530 * 531 * @param WP_Comment $comment The comment object. 532 * @param string $column_name Current column name. 533 * @param string $primary Primary column name. 534 * @return string|void Comment row actions output. 535 */ 536 protected function handle_row_actions( $comment, $column_name, $primary ) { 537 global $comment_status; 524 538 525 539 if ( $primary !== $column_name ) { … … 527 541 } 528 542 529 if ( ! $this->user_can ) {530 return;543 if ( ! $this->user_can ) { 544 return; 531 545 } 532 546 … … 535 549 $out = ''; 536 550 537 $del_nonce = esc_html( '_wpnonce=' . wp_create_nonce( "delete-comment_$comment->comment_ID" ) );551 $del_nonce = esc_html( '_wpnonce=' . wp_create_nonce( "delete-comment_$comment->comment_ID" ) ); 538 552 $approve_nonce = esc_html( '_wpnonce=' . wp_create_nonce( "approve-comment_$comment->comment_ID" ) ); 539 553 540 554 $url = "comment.php?c=$comment->comment_ID"; 541 555 542 $approve_url = esc_url( $url . "&action=approvecomment&$approve_nonce" );556 $approve_url = esc_url( $url . "&action=approvecomment&$approve_nonce" ); 543 557 $unapprove_url = esc_url( $url . "&action=unapprovecomment&$approve_nonce" ); 544 $spam_url = esc_url( $url . "&action=spamcomment&$del_nonce" );545 $unspam_url = esc_url( $url . "&action=unspamcomment&$del_nonce" );546 $trash_url = esc_url( $url . "&action=trashcomment&$del_nonce" );547 $untrash_url = esc_url( $url . "&action=untrashcomment&$del_nonce" );548 $delete_url = esc_url( $url . "&action=deletecomment&$del_nonce" );558 $spam_url = esc_url( $url . "&action=spamcomment&$del_nonce" ); 559 $unspam_url = esc_url( $url . "&action=unspamcomment&$del_nonce" ); 560 $trash_url = esc_url( $url . "&action=trashcomment&$del_nonce" ); 561 $untrash_url = esc_url( $url . "&action=untrashcomment&$del_nonce" ); 562 $delete_url = esc_url( $url . "&action=deletecomment&$del_nonce" ); 549 563 550 564 // Preorder it: Approve | Reply | Quick Edit | Edit | Spam | Trash. 551 565 $actions = array( 552 'approve' => '', 'unapprove' => '', 553 'reply' => '', 566 'approve' => '', 567 'unapprove' => '', 568 'reply' => '', 554 569 'quickedit' => '', 555 'edit' => '', 556 'spam' => '', 'unspam' => '', 557 'trash' => '', 'untrash' => '', 'delete' => '' 570 'edit' => '', 571 'spam' => '', 572 'unspam' => '', 573 'trash' => '', 574 'untrash' => '', 575 'delete' => '', 558 576 ); 559 577 … … 566 584 } 567 585 } else { 568 $actions['approve'] = "<a href='$approve_url' data-wp-lists='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=approved' class='vim-a' aria-label='" . esc_attr__( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>';586 $actions['approve'] = "<a href='$approve_url' data-wp-lists='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=approved' class='vim-a' aria-label='" . esc_attr__( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>'; 569 587 $actions['unapprove'] = "<a href='$unapprove_url' data-wp-lists='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=unapproved' class='vim-u' aria-label='" . esc_attr__( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>'; 570 588 } … … 580 598 } 581 599 582 if ( 'spam' === $the_comment_status || 'trash' === $the_comment_status || ! EMPTY_TRASH_DAYS ) {600 if ( 'spam' === $the_comment_status || 'trash' === $the_comment_status || ! EMPTY_TRASH_DAYS ) { 583 601 $actions['delete'] = "<a href='$delete_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID::delete=1' class='delete vim-d vim-destructive' aria-label='" . esc_attr__( 'Delete this comment permanently' ) . "'>" . __( 'Delete Permanently' ) . '</a>'; 584 602 } else { … … 587 605 588 606 if ( 'spam' !== $the_comment_status && 'trash' !== $the_comment_status ) { 589 $actions['edit'] = "<a href='comment.php?action=editcomment&c={$comment->comment_ID}' aria-label='" . esc_attr__( 'Edit this comment' ) . "'>" . __( 'Edit' ) . '</a>';607 $actions['edit'] = "<a href='comment.php?action=editcomment&c={$comment->comment_ID}' aria-label='" . esc_attr__( 'Edit this comment' ) . "'>" . __( 'Edit' ) . '</a>'; 590 608 591 609 $format = '<a data-comment-id="%d" data-post-id="%d" data-action="%s" class="%s" aria-label="%s" href="#">%s</a>'; … … 599 617 $actions = apply_filters( 'comment_row_actions', array_filter( $actions ), $comment ); 600 618 601 $i = 0;619 $i = 0; 602 620 $out .= '<div class="row-actions">'; 603 621 foreach ( $actions as $action => $link ) { … … 606 624 607 625 // Reply and quickedit need a hide-if-no-js span when not added with ajax 608 if ( ( 'reply' === $action || 'quickedit' === $action ) && ! wp_doing_ajax() ) 626 if ( ( 'reply' === $action || 'quickedit' === $action ) && ! wp_doing_ajax() ) { 609 627 $action .= ' hide-if-no-js'; 610 elseif ( ( $action === 'untrash' && $the_comment_status === 'trash' ) || ( $action === 'unspam' && $the_comment_status === 'spam' ) ) {611 if ( '1' == get_comment_meta( $comment->comment_ID, '_wp_trash_meta_status', true ) ) 628 } elseif ( ( $action === 'untrash' && $the_comment_status === 'trash' ) || ( $action === 'unspam' && $the_comment_status === 'spam' ) ) { 629 if ( '1' == get_comment_meta( $comment->comment_ID, '_wp_trash_meta_status', true ) ) { 612 630 $action .= ' approve'; 613 else631 } else { 614 632 $action .= ' unapprove'; 633 } 615 634 } 616 635 … … 625 644 626 645 /** 627 *628 646 * @param WP_Comment $comment The comment object. 629 647 */ 630 648 public function column_cb( $comment ) { 631 if ( $this->user_can ) { ?> 649 if ( $this->user_can ) { 650 ?> 632 651 <label class="screen-reader-text" for="cb-select-<?php echo $comment->comment_ID; ?>"><?php _e( 'Select comment' ); ?></label> 633 652 <input id="cb-select-<?php echo $comment->comment_ID; ?>" type="checkbox" name="delete_comments[]" value="<?php echo $comment->comment_ID; ?>" /> … … 648 667 if ( $parent ) { 649 668 $parent_link = esc_url( get_comment_link( $parent ) ); 650 $name = get_comment_author( $parent );669 $name = get_comment_author( $parent ); 651 670 printf( 652 671 /* translators: %s: comment link */ … … 658 677 659 678 comment_text( $comment ); 660 if ( $this->user_can ) { ?> 679 if ( $this->user_can ) { 680 ?> 661 681 <div id="inline-<?php echo $comment->comment_ID; ?>" class="hidden"> 662 <textarea class="comment" rows="1" cols="1"><?php 682 <textarea class="comment" rows="1" cols="1"> 683 <?php 663 684 /** This filter is documented in wp-admin/includes/comment.php */ 664 685 echo esc_textarea( apply_filters( 'comment_edit_pre', $comment->comment_content ) ); 665 ?></textarea> 686 ?> 687 </textarea> 666 688 <div class="author-email"><?php echo esc_attr( $comment->comment_author_email ); ?></div> 667 689 <div class="author"><?php echo esc_attr( $comment->comment_author ); ?></div> … … 674 696 675 697 /** 676 *677 698 * @global string $comment_status 678 699 * … … 689 710 } 690 711 691 echo "<strong>"; comment_author( $comment ); echo '</strong><br />'; 712 echo '<strong>'; 713 comment_author( $comment ); 714 echo '</strong><br />'; 692 715 if ( ! empty( $author_url_display ) ) { 693 716 printf( '<a href="%s">%s</a><br />', esc_url( $author_url ), esc_html( $author_url_display ) ); … … 706 729 $author_ip = get_comment_author_IP( $comment ); 707 730 if ( $author_ip ) { 708 $author_ip_url = add_query_arg( array( 's' => $author_ip, 'mode' => 'detail' ), admin_url( 'edit-comments.php' ) ); 731 $author_ip_url = add_query_arg( 732 array( 733 's' => $author_ip, 734 'mode' => 'detail', 735 ), admin_url( 'edit-comments.php' ) 736 ); 709 737 if ( 'spam' === $comment_status ) { 710 738 $author_ip_url = add_query_arg( 'comment_status', 'spam', $author_ip_url ); … … 716 744 717 745 /** 718 *719 746 * @param WP_Comment $comment The comment object. 720 747 */ 721 748 public function column_date( $comment ) { 722 749 /* translators: 1: comment date, 2: comment time */ 723 $submitted = sprintf( __( '%1$s at %2$s' ), 750 $submitted = sprintf( 751 __( '%1$s at %2$s' ), 724 752 /* translators: comment date format. See https://secure.php.net/date */ 725 753 get_comment_date( __( 'Y/m/d' ), $comment ), … … 728 756 729 757 echo '<div class="submitted-on">'; 730 if ( 'approved' === wp_get_comment_status( $comment ) && ! empty ( $comment->comment_post_ID ) ) {758 if ( 'approved' === wp_get_comment_status( $comment ) && ! empty( $comment->comment_post_ID ) ) { 731 759 printf( 732 760 '<a href="%s">%s</a>', … … 741 769 742 770 /** 743 *744 771 * @param WP_Comment $comment The comment object. 745 772 */ … … 751 778 } 752 779 753 if ( isset( $this->pending_count[ $post->ID] ) ) {754 $pending_comments = $this->pending_count[ $post->ID];780 if ( isset( $this->pending_count[ $post->ID ] ) ) { 781 $pending_comments = $this->pending_count[ $post->ID ]; 755 782 } else { 756 783 $_pending_count_temp = get_pending_comments_num( array( $post->ID ) ); 757 $pending_comments = $this->pending_count[$post->ID] = $_pending_count_temp[$post->ID];784 $pending_comments = $this->pending_count[ $post->ID ] = $_pending_count_temp[ $post->ID ]; 758 785 } 759 786 760 787 if ( current_user_can( 'edit_post', $post->ID ) ) { 761 $post_link = "<a href='" . get_edit_post_link( $post->ID ) . "' class='comments-edit-item-link'>";788 $post_link = "<a href='" . get_edit_post_link( $post->ID ) . "' class='comments-edit-item-link'>"; 762 789 $post_link .= esc_html( get_the_title( $post->ID ) ) . '</a>'; 763 790 } else { … … 779 806 780 807 /** 781 *782 808 * @param WP_Comment $comment The comment object. 783 809 * @param string $column_name The custom column's name.
Note: See TracChangeset
for help on using the changeset viewer.