Make WordPress Core

Changeset 11850 for trunk/xmlrpc.php


Ignore:
Timestamp:
08/20/2009 04:26:34 PM (17 years ago)
Author:
westi
Message:

Make the number of pages argument to wp.getPages properly optional. See #10659 props redsweater.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/xmlrpc.php

    r11846 r11850  
    602602                $username       = $args[1];
    603603                $password       = $args[2];
    604                 $num_pages      = (int) $args[3];
     604                $num_pages      = isset($args[3]) ? (int) $args[3] : 10;
    605605
    606606                if ( !$user = $this->login($username, $password) ) {
     
    613613                do_action('xmlrpc_call', 'wp.getPages');
    614614
    615                 $page_limit = 10;
    616                 if( isset( $num_pages ) ) {
    617                         $page_limit = $num_pages;
    618                 }
    619 
    620                 $pages = get_posts( array('post_type' => 'page', 'post_status' => 'all', 'numberposts' => $page_limit) );
     615                $pages = get_posts( array('post_type' => 'page', 'post_status' => 'all', 'numberposts' => $num_pages) );
    621616                $num_pages = count($pages);
    622617
Note: See TracChangeset for help on using the changeset viewer.