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

git-svn-id: http://svn.automattic.com/wordpress/trunk@11850 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
westi 2009-08-20 16:26:34 +00:00
parent 46d7e1dd71
commit 3553ccdbb4

View File

@ -601,7 +601,7 @@ class wp_xmlrpc_server extends IXR_Server {
$blog_id = (int) $args[0];
$username = $args[1];
$password = $args[2];
$num_pages = (int) $args[3];
$num_pages = isset($args[3]) ? (int) $args[3] : 10;
if ( !$user = $this->login($username, $password) ) {
return $this->error;
@ -612,12 +612,7 @@ class wp_xmlrpc_server extends IXR_Server {
do_action('xmlrpc_call', 'wp.getPages');
$page_limit = 10;
if( isset( $num_pages ) ) {
$page_limit = $num_pages;
}
$pages = get_posts( array('post_type' => 'page', 'post_status' => 'all', 'numberposts' => $page_limit) );
$pages = get_posts( array('post_type' => 'page', 'post_status' => 'all', 'numberposts' => $num_pages) );
$num_pages = count($pages);
// If we have pages, put together their info.