paginate_links() from mdawaffe. fixes #3159
git-svn-id: http://svn.automattic.com/wordpress/trunk@4275 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -84,15 +84,15 @@ class WP_User_Search {
|
||||
|
||||
function do_paging() {
|
||||
if ( $this->total_users_for_query > $this->users_per_page ) { // have to page the results
|
||||
$prev_page = ( $this->page > 1) ? true : false;
|
||||
$next_page = ( ($this->page * $this->users_per_page) < $this->total_users_for_query ) ? true : false;
|
||||
$this->paging_text = '';
|
||||
if ( $prev_page )
|
||||
$this->paging_text .= '<p class="alignleft"><a href="' . add_query_arg(array('usersearch' => $this->search_term, 'userspage' => $this->page - 1), 'users.php?') . '">« Previous Page</a></p>';
|
||||
if ( $next_page )
|
||||
$this->paging_text .= '<p class="alignright"><a href="' . add_query_arg(array('usersearch' => $this->search_term, 'userspage' => $this->page + 1), 'users.php?') . '">Next Page »</a></p>';
|
||||
if ( $prev_page || $next_page )
|
||||
$this->paging_text .= '<br style="clear:both" />';
|
||||
$this->paging_text = paginate_links( array(
|
||||
'total' => ceil($this->total_users_for_query / $this->users_per_page),
|
||||
'current' => $this->page,
|
||||
'prev_text' => '« Previous Page',
|
||||
'next_text' => 'Next Page »',
|
||||
'base' => 'users.php?%_%',
|
||||
'format' => 'userspage=%#%',
|
||||
'add_args' => array( 'usersearch' => urlencode($this->search_term) )
|
||||
) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user