mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-22 08:11:52 +01:00
XML-RPC wp.getPages Fix: don't restrict to just published pages, props josephscott, fixes #7954
git-svn-id: http://svn.automattic.com/wordpress/trunk@9313 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
978022fd41
commit
9b50d01630
@ -560,6 +560,7 @@ class wp_xmlrpc_server extends IXR_Server {
|
|||||||
$blog_id = (int) $args[0];
|
$blog_id = (int) $args[0];
|
||||||
$username = $args[1];
|
$username = $args[1];
|
||||||
$password = $args[2];
|
$password = $args[2];
|
||||||
|
$num_pages = (int) $args[3];
|
||||||
|
|
||||||
if(!$this->login_pass_ok($username, $password)) {
|
if(!$this->login_pass_ok($username, $password)) {
|
||||||
return($this->error);
|
return($this->error);
|
||||||
@ -571,8 +572,12 @@ class wp_xmlrpc_server extends IXR_Server {
|
|||||||
|
|
||||||
do_action('xmlrpc_call', 'wp.getPages');
|
do_action('xmlrpc_call', 'wp.getPages');
|
||||||
|
|
||||||
// Lookup info on pages.
|
$page_limit = 10;
|
||||||
$pages = get_pages();
|
if( isset( $num_pages ) ) {
|
||||||
|
$page_limit = $num_pages;
|
||||||
|
}
|
||||||
|
|
||||||
|
$pages = get_posts( "post_type=page&post_status=all&numberposts={$page_limit}" );
|
||||||
$num_pages = count($pages);
|
$num_pages = count($pages);
|
||||||
|
|
||||||
// If we have pages, put together their info.
|
// If we have pages, put together their info.
|
||||||
|
Loading…
Reference in New Issue
Block a user