Make WordPress Core


Ignore:
Timestamp:
10/03/2006 07:16:49 AM (18 years ago)
Author:
ryan
Message:

paginate_links() from mdawaffe. fixes #3159

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/users.php

    r4258 r4275  
    8585    function do_paging() {
    8686        if ( $this->total_users_for_query > $this->users_per_page ) { // have to page the results
    87             $prev_page = ( $this->page > 1) ? true : false;
    88             $next_page = ( ($this->page * $this->users_per_page) < $this->total_users_for_query ) ? true : false;
    89             $this->paging_text = '';
    90             if ( $prev_page )
    91                 $this->paging_text .= '<p class="alignleft"><a href="' . add_query_arg(array('usersearch' => $this->search_term, 'userspage' => $this->page - 1), 'users.php?') . '">&laquo; Previous Page</a></p>';
    92             if ( $next_page )
    93                 $this->paging_text .= '<p class="alignright"><a href="' . add_query_arg(array('usersearch' => $this->search_term, 'userspage' => $this->page + 1), 'users.php?') . '">Next Page &raquo;</a></p>';
    94             if ( $prev_page || $next_page )
    95                 $this->paging_text .= '<br style="clear:both" />';
     87            $this->paging_text = paginate_links( array(
     88                'total' => ceil($this->total_users_for_query / $this->users_per_page),
     89                'current' => $this->page,
     90                'prev_text' => '&laquo; Previous Page',
     91                'next_text' => 'Next Page &raquo;',
     92                'base' => 'users.php?%_%',
     93                'format' => 'userspage=%#%',
     94                'add_args' => array( 'usersearch' => urlencode($this->search_term) )
     95            ) );
    9696        }
    9797    }
Note: See TracChangeset for help on using the changeset viewer.