Skip to content

Commit

Permalink
XML-RPC wp.getPages Fix: don't restrict to just published pages, prop…
Browse files Browse the repository at this point in the history
…s josephscott, fixes #7954

git-svn-id: http://svn.automattic.com/wordpress/trunk@9313 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
azaozz committed Oct 24, 2008
1 parent 978022f commit 9b50d01
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions xmlrpc.php
Expand Up @@ -560,6 +560,7 @@ function wp_getPages($args) {
$blog_id = (int) $args[0];
$username = $args[1];
$password = $args[2];
$num_pages = (int) $args[3];

if(!$this->login_pass_ok($username, $password)) {
return($this->error);
Expand All @@ -571,8 +572,12 @@ function wp_getPages($args) {

do_action('xmlrpc_call', 'wp.getPages');

// Lookup info on pages.
$pages = get_pages();
$page_limit = 10;
if( isset( $num_pages ) ) {
$page_limit = $num_pages;
}

$pages = get_posts( "post_type=page&post_status=all&numberposts={$page_limit}" );
$num_pages = count($pages);

// If we have pages, put together their info.
Expand Down

0 comments on commit 9b50d01

Please sign in to comment.