WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/05/2010 09:26:27 PM (10 years ago)
Author:
scribu
Message:

introduce WP_List_Table::views(). See #14579

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-comments.php

    r15528 r15578  
    195195?>
    196196
     197<?php $wp_list_table->views(); ?>
     198
    197199<form id="comments-form" action="" method="post">
    198 <ul class="subsubsub">
    199 <?php
    200 $status_links = array();
    201 $num_comments = ( $post_id ) ? wp_count_comments( $post_id ) : wp_count_comments();
    202 //, number_format_i18n($num_comments->moderated) ), "<span class='comment-count'>" . number_format_i18n($num_comments->moderated) . "</span>"),
    203 //, number_format_i18n($num_comments->spam) ), "<span class='spam-comment-count'>" . number_format_i18n($num_comments->spam) . "</span>")
    204 $stati = array(
    205         'all' => _nx_noop('All', 'All', 'comments'), // singular not used
    206         'moderated' => _n_noop('Pending <span class="count">(<span class="pending-count">%s</span>)</span>', 'Pending <span class="count">(<span class="pending-count">%s</span>)</span>'),
    207         'approved' => _n_noop('Approved', 'Approved'), // singular not used
    208         'spam' => _n_noop('Spam <span class="count">(<span class="spam-count">%s</span>)</span>', 'Spam <span class="count">(<span class="spam-count">%s</span>)</span>'),
    209         'trash' => _n_noop('Trash <span class="count">(<span class="trash-count">%s</span>)</span>', 'Trash <span class="count">(<span class="trash-count">%s</span>)</span>')
    210     );
    211 
    212 if ( !EMPTY_TRASH_DAYS )
    213     unset($stati['trash']);
    214 
    215 $link = 'edit-comments.php';
    216 if ( !empty($comment_type) && 'all' != $comment_type )
    217     $link = add_query_arg( 'comment_type', $comment_type, $link );
    218 
    219 foreach ( $stati as $status => $label ) {
    220     $class = ( $status == $comment_status ) ? ' class="current"' : '';
    221 
    222     if ( !isset( $num_comments->$status ) )
    223         $num_comments->$status = 10;
    224     $link = add_query_arg( 'comment_status', $status, $link );
    225     if ( $post_id )
    226         $link = add_query_arg( 'p', absint( $post_id ), $link );
    227     /*
    228     // I toyed with this, but decided against it. Leaving it in here in case anyone thinks it is a good idea. ~ Mark
    229     if ( !empty( $_REQUEST['s'] ) )
    230         $link = add_query_arg( 's', esc_attr( stripslashes( $_REQUEST['s'] ) ), $link );
    231     */
    232     $status_links[] = "<li class='$status'><a href='$link'$class>" . sprintf(
    233         _n( $label[0], $label[1], $num_comments->$status ),
    234         number_format_i18n( $num_comments->$status )
    235     ) . '</a>';
    236 }
    237 
    238 $status_links = apply_filters( 'comment_status_links', $status_links );
    239 
    240 echo implode( " |</li>\n", $status_links) . '</li>';
    241 unset($status_links);
    242 ?>
    243 </ul>
    244 
    245200<p class="search-box">
    246201    <label class="screen-reader-text" for="comment-search-input"><?php _e( 'Search Comments' ); ?>:</label>
Note: See TracChangeset for help on using the changeset viewer.