WordPress.org

Make WordPress Core

Changeset 11251


Ignore:
Timestamp:
05/10/09 08:55:49 (5 years ago)
Author:
westi
Message:

Add paging support to get_pages(). Fixes #4531 props DD32.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/post.php

    r11245 r11251  
    21942194        'exclude' => '', 'include' => '', 
    21952195        'meta_key' => '', 'meta_value' => '', 
    2196         'authors' => '', 'parent' => -1, 'exclude_tree' => '' 
     2196        'authors' => '', 'parent' => -1, 'exclude_tree' => '', 
     2197        'number' => '', offset => '0' 
    21972198    ); 
    21982199 
    21992200    $r = wp_parse_args( $args, $defaults ); 
    22002201    extract( $r, EXTR_SKIP ); 
     2202    $number = (int) $number; 
     2203    $offset = (int) $offset; 
    22012204 
    22022205    $cache = array(); 
     
    22952298    $query .= $author_query; 
    22962299    $query .= " ORDER BY " . $sort_column . " " . $sort_order ; 
     2300 
     2301    if ( !empty($number) ) 
     2302        $query .= ' LIMIT ' . $offset . ',' . $number; 
    22972303 
    22982304    $pages = $wpdb->get_results($query); 
Note: See TracChangeset for help on using the changeset viewer.