Always output pagination controls. Hide them when they are not needed. Show them upon AJAX result that requires pagination. Props nacin. fixes #15983

git-svn-id: https://develop.svn.wordpress.org/trunk@17156 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2010-12-26 22:06:15 +00:00
parent de1f10c283
commit 3edaa30bed
6 changed files with 13 additions and 7 deletions

View File

@@ -472,9 +472,6 @@ class WP_List_Table {
extract( $this->_pagination_args );
if ( $total_pages < 2 )
return;
$output = '<span class="displaying-num">' . sprintf( _n( '1 item', '%s items', $total_items ), number_format_i18n( $total_items ) ) . '</span>';
$current = $this->get_pagenum();
@@ -522,7 +519,9 @@ class WP_List_Table {
$output .= "\n" . join( "\n", $page_links );
$this->_pagination = "<div class='tablenav-pages'>$output</div>";
$page_class = $total_pages < 2 ? ' one-page' : '';
$this->_pagination = "<div class='tablenav-pages{$page_class}'>$output</div>";
echo $this->_pagination;
}