Move no_items logic to WP_Comments_Table. See #14579

git-svn-id: http://svn.automattic.com/wordpress/trunk@16108 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
scribu 2010-10-31 01:17:00 +00:00
parent 945115e73a
commit bb99a95284
2 changed files with 11 additions and 23 deletions

View File

@ -204,7 +204,6 @@ if ( isset($_REQUEST['approved']) || isset($_REQUEST['deleted']) || isset($_REQU
<input type="text" id="comment-search-input" name="s" value="<?php _admin_search_query(); ?>" />
<?php submit_button( __( 'Search Comments' ), 'button', 'submit', false ); ?>
</p>
<input type="hidden" name="mode" value="<?php echo esc_attr($mode); ?>" />
<?php if ( $post_id ) : ?>
<input type="hidden" name="p" value="<?php echo esc_attr( intval( $post_id ) ); ?>" />
@ -220,32 +219,12 @@ if ( isset($_REQUEST['approved']) || isset($_REQUEST['deleted']) || isset($_REQU
<input type="hidden" name="paged" value="<?php echo esc_attr( absint( $_REQUEST['paged'] ) ); ?>" />
<?php } ?>
<br class="clear" />
<?php if ( $wp_list_table->has_items() ) { ?>
<?php $wp_list_table->display_table(); ?>
<br class="clear" />
<?php $wp_list_table->display(); ?>
</div>
</form>
<div id="ajax-response"></div>
<?php } elseif ( 'moderated' == $comment_status ) { ?>
<p><?php _e('No comments awaiting moderation&hellip; yet.') ?></p>
</div>
</form>
<?php } else { ?>
<p><?php _e('No comments found.') ?></p>
</div>
</form>
<?php } ?>
</div>
<?php
wp_comment_reply('-1', true, 'detail');
wp_comment_trashnotice();

View File

@ -113,6 +113,15 @@ class WP_Comments_Table extends WP_List_Table {
) );
}
function no_items() {
global $comment_status;
if ( 'moderated' == $comment_status )
_e( 'No comments awaiting moderation&hellip; yet.' );
else
_e( 'No comments found.' );
}
function get_views() {
global $post_id, $comment_status;
@ -507,4 +516,4 @@ class WP_Post_Comments_Table extends WP_Comments_Table {
}
}
?>
?>