Make WordPress Core


Ignore:
Timestamp:
02/13/2010 08:49:27 AM (15 years ago)
Author:
nacin
Message:

Consistently hide bulk actions, filters, and subpage links on admin panels when there are no items to show. Fixes #12086

File:
1 edited

Legend:

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

    r12789 r13100  
    193193
    194194foreach ( $stati as $status => $label ) {
    195     $class = '';
    196 
    197     if ( $status == $comment_status )
    198         $class = ' class="current"';
     195    $class = ( $status == $comment_status ) ? ' class="current"' : '';
     196
    199197    if ( !isset( $num_comments->$status ) )
    200198        $num_comments->$status = 10;
     199    if ( empty( $num_comments->$status ) )
     200        continue;
    201201    $link = add_query_arg( 'comment_status', $status, $link );
    202202    if ( $post_id )
     
    271271<div class="tablenav">
    272272
     273<?php if ( $comments ) { ?>
    273274<?php if ( $page_links ) : ?>
    274275<div class="tablenav-pages"><?php $page_links_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s&#8211;%s of %s' ) . '</span>%s',
     
    347348<div class="clear"></div>
    348349
    349 <?php if ( $comments ) { ?>
    350350<table class="widefat comments fixed" cellspacing="0">
    351351<thead>
     
    437437
    438438<?php } else { ?>
    439 <p><?php _e('No results found.') ?></p>
     439<p><?php _e('No comments found.') ?></p>
    440440</form>
    441441
Note: See TracChangeset for help on using the changeset viewer.