WordPress.org

Make WordPress Core


Ignore:
Timestamp:
06/15/2008 12:45:01 AM (14 years ago)
Author:
ryan
Message:

Add paging to Manage->Pages. see #6561

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-pages.php

    r7998 r8089  
    118118
    119119<div class="tablenav">
     120
     121<?php
     122$pagenum = absint( $_GET['pagenum'] );
     123if ( empty($pagenum) )
     124    $pagenum = 1;
     125if( !$per_page || $pre_page < 0 )
     126    $per_page = 20;
     127
     128$num_pages = ceil(count($posts) / $per_page);
     129$page_links = paginate_links( array(
     130    'base' => add_query_arg( 'pagenum', '%#%' ),
     131    'format' => '',
     132    'total' => $num_pages,
     133    'current' => $pagenum
     134));
     135
     136if ( $page_links )
     137    echo "<div class='tablenav-pages'>$page_links</div>";
     138?>
    120139
    121140<div class="alignleft">
     
    152171  </thead>
    153172  <tbody>
    154   <?php page_rows($posts); ?>
     173  <?php page_rows($posts, $pagenum, $per_page); ?>
    155174  </tbody>
    156175</table>
     
    170189
    171190<div class="tablenav">
     191<?php
     192if ( $page_links )
     193    echo "<div class='tablenav-pages'>$page_links</div>";
     194?>
    172195<br class="clear" />
    173196</div>
Note: See TracChangeset for help on using the changeset viewer.