diff --git a/xmlrpc.php b/xmlrpc.php index af233a8c1e..e6c7c310f4 100644 --- a/xmlrpc.php +++ b/xmlrpc.php @@ -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.