Skip to content

Commit 2323aba

Browse files
committed
Fix users.php paging. Props DD32. fixes WordPress#4017
git-svn-id: https://develop.svn.wordpress.org/trunk@8195 602fd350-edb4-49c9-b593-d223f7449a82
1 parent f920c9b commit 2323aba

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

wp-admin/includes/user.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,12 +354,18 @@ function prepare_vars_for_template_usage() {
354354

355355
function do_paging() {
356356
if ( $this->total_users_for_query > $this->users_per_page ) { // have to page the results
357+
$args = array();
358+
if( ! empty($this->search_term) )
359+
$args['usersearch'] = urlencode($this->search_term);
360+
if( ! empty($this->role) )
361+
$args['role'] = urlencode($this->role);
362+
357363
$this->paging_text = paginate_links( array(
358364
'total' => ceil($this->total_users_for_query / $this->users_per_page),
359365
'current' => $this->page,
360366
'base' => 'users.php?%_%',
361367
'format' => 'userspage=%#%',
362-
'add_args' => array( 'usersearch' => urlencode($this->search_term) )
368+
'add_args' => $args
363369
) );
364370
}
365371
}

0 commit comments

Comments
 (0)