WordPress.org

Make WordPress Core


Ignore:
Timestamp:
06/13/2008 11:22:29 PM (12 years ago)
Author:
ryan
Message:

Add paging to Manage->Categories. fixes #7136

File:
1 edited

Legend:

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

    r7883 r8078  
    135135
    136136<div class="tablenav">
     137
     138<?php
     139$pagenum = absint( $_GET['pagenum'] );
     140if ( empty($pagenum) )
     141    $pagenum = 1;
     142if( !$catsperpage || $catsperpage < 0 )
     143    $catsperpage = 20;
     144
     145$page_links = paginate_links( array(
     146    'base' => add_query_arg( 'pagenum', '%#%' ),
     147    'format' => '',
     148    'total' => ceil(wp_count_terms('category') / $catsperpage),
     149    'current' => $pagenum
     150));
     151
     152if ( $page_links )
     153    echo "<div class='tablenav-pages'>$page_links</div>";
     154?>
    137155
    138156<div class="alignleft">
     
    157175    <tbody id="the-list" class="list:cat">
    158176<?php
    159 cat_rows();
     177$categories = array();
     178cat_rows(0, 0, $categories, $pagenum, $catsperpage);
    160179?>
    161180    </tbody>
     
    164183
    165184<div class="tablenav">
     185
     186<?php
     187if ( $page_links )
     188    echo "<div class='tablenav-pages'>$page_links</div>";
     189?>
    166190<br class="clear" />
    167191</div>
Note: See TracChangeset for help on using the changeset viewer.