mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-22 17:18:32 +01:00
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:
parent
46d7e1dd71
commit
3553ccdbb4
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user