- Timestamp:
- 08/17/2018 01:50:26 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-comments-list-table.php
r42871 r43571 159 159 $total_comments = get_comments( 160 160 array_merge( 161 $args, array( 161 $args, 162 array( 162 163 'count' => true, 163 164 'offset' => 0, … … 225 226 226 227 /* translators: %s: current user's comments count */ 227 'mine' => _nx_noop(228 'mine' => _nx_noop( 228 229 'Mine <span class="count">(%s)</span>', 229 230 'Mine <span class="count">(%s)</span>', … … 278 279 if ( 'mine' === $status ) { 279 280 $current_user_id = get_current_user_id(); 280 $num_comments->mine = get_comments( array( 281 'user_id' => $current_user_id, 282 'count' => true, 283 ) ); 284 $link = add_query_arg( 'user_id', $current_user_id, $link ); 281 $num_comments->mine = get_comments( 282 array( 283 'user_id' => $current_user_id, 284 'count' => true, 285 ) 286 ); 287 $link = add_query_arg( 'user_id', $current_user_id, $link ); 285 288 } else { 286 289 $link = remove_query_arg( 'user_id', $link ); … … 368 371 $has_items = $this->has_items(); 369 372 } 370 ?>373 ?> 371 374 <div class="alignleft actions"> 372 <?php373 if ( 'top' === $which ) {374 ?>375 <?php 376 if ( 'top' === $which ) { 377 ?> 375 378 <label class="screen-reader-text" for="filter-by-comment-type"><?php _e( 'Filter by comment type' ); ?></label> 376 379 <select id="filter-by-comment-type" name="comment_type"> 377 380 <option value=""><?php _e( 'All comment types' ); ?></option> 378 <?php 379 /** 380 * Filters the comment types dropdown menu. 381 * 382 * @since 2.7.0 383 * 384 * @param string[] $comment_types An array of comment types. Accepts 'Comments', 'Pings'. 385 */ 386 $comment_types = apply_filters( 387 'admin_comment_types_dropdown', array( 388 'comment' => __( 'Comments' ), 389 'pings' => __( 'Pings' ), 390 ) 391 ); 392 393 foreach ( $comment_types as $type => $label ) { 394 echo "\t" . '<option value="' . esc_attr( $type ) . '"' . selected( $comment_type, $type, false ) . ">$label</option>\n"; 395 } 396 ?> 381 <?php 382 /** 383 * Filters the comment types dropdown menu. 384 * 385 * @since 2.7.0 386 * 387 * @param string[] $comment_types An array of comment types. Accepts 'Comments', 'Pings'. 388 */ 389 $comment_types = apply_filters( 390 'admin_comment_types_dropdown', 391 array( 392 'comment' => __( 'Comments' ), 393 'pings' => __( 'Pings' ), 394 ) 395 ); 396 397 foreach ( $comment_types as $type => $label ) { 398 echo "\t" . '<option value="' . esc_attr( $type ) . '"' . selected( $comment_type, $type, false ) . ">$label</option>\n"; 399 } 400 ?> 397 401 </select> 398 <?php399 /**400 * Fires just before the Filter submit button for comment types.401 *402 * @since 3.5.0403 */404 do_action( 'restrict_manage_comments' );405 submit_button( __( 'Filter' ), '', 'filter_action', false, array( 'id' => 'post-query-submit' ) );406 }407 408 if ( ( 'spam' === $comment_status || 'trash' === $comment_status ) && current_user_can( 'moderate_comments' ) && $has_items ) {409 wp_nonce_field( 'bulk-destroy', '_destroy_nonce' );410 $title = ( 'spam' === $comment_status ) ? esc_attr__( 'Empty Spam' ) : esc_attr__( 'Empty Trash' );411 submit_button( $title, 'apply', 'delete_all', false );412 }402 <?php 403 /** 404 * Fires just before the Filter submit button for comment types. 405 * 406 * @since 3.5.0 407 */ 408 do_action( 'restrict_manage_comments' ); 409 submit_button( __( 'Filter' ), '', 'filter_action', false, array( 'id' => 'post-query-submit' ) ); 410 } 411 412 if ( ( 'spam' === $comment_status || 'trash' === $comment_status ) && current_user_can( 'moderate_comments' ) && $has_items ) { 413 wp_nonce_field( 'bulk-destroy', '_destroy_nonce' ); 414 $title = ( 'spam' === $comment_status ) ? esc_attr__( 'Empty Spam' ) : esc_attr__( 'Empty Trash' ); 415 submit_button( $title, 'apply', 'delete_all', false ); 416 } 413 417 /** 414 418 * Fires after the Filter submit button for comment types. … … 491 495 $this->screen->render_screen_reader_content( 'heading_list' ); 492 496 493 ?>497 ?> 494 498 <table class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>"> 495 499 <thead> … … 517 521 518 522 </table> 519 <?php523 <?php 520 524 521 525 $this->display_tablenav( 'bottom' ); … … 677 681 public function column_cb( $comment ) { 678 682 if ( $this->user_can ) { 679 ?>683 ?> 680 684 <label class="screen-reader-text" for="cb-select-<?php echo $comment->comment_ID; ?>"><?php _e( 'Select comment' ); ?></label> 681 685 <input id="cb-select-<?php echo $comment->comment_ID; ?>" type="checkbox" name="delete_comments[]" value="<?php echo $comment->comment_ID; ?>" /> 682 <?php686 <?php 683 687 } 684 688 } … … 710 714 /** This filter is documented in wp-admin/includes/comment.php */ 711 715 $comment_content = apply_filters( 'comment_edit_pre', $comment->comment_content ); 712 ?>716 ?> 713 717 <div id="inline-<?php echo $comment->comment_ID; ?>" class="hidden"> 714 718 <textarea class="comment" rows="1" cols="1"><?php echo esc_textarea( $comment_content ); ?></textarea> … … 718 722 <div class="comment_status"><?php echo $comment->comment_approved; ?></div> 719 723 </div> 720 <?php724 <?php 721 725 } 722 726 } … … 760 764 's' => $author_ip, 761 765 'mode' => 'detail', 762 ), admin_url( 'edit-comments.php' ) 766 ), 767 admin_url( 'edit-comments.php' ) 763 768 ); 764 769 if ( 'spam' === $comment_status ) {
Note: See TracChangeset
for help on using the changeset viewer.