Ticket #10659: PagesFound.diff
| File PagesFound.diff, 1.2 KB (added by redsweater, 3 years ago) |
|---|
-
xmlrpc.php
596 596 $blog_id = (int) $args[0]; 597 597 $username = $args[1]; 598 598 $password = $args[2]; 599 $num_pages = (int) $args[3];600 599 600 // If a specific page count was provided, use it, otherwise default to 10 pages 601 if (count($args) >= 4) { 602 $page_limit = (int) $args[3]; 603 } 604 else { 605 $page_limit = 10; 606 } 607 601 608 if ( !$user = $this->login($username, $password) ) { 602 609 return $this->error; 603 610 } … … 607 614 608 615 do_action('xmlrpc_call', 'wp.getPages'); 609 616 610 $page_limit = 10;611 if( isset( $num_pages ) ) {612 $page_limit = $num_pages;613 }614 615 617 $pages = get_posts( array('post_type' => 'page', 'post_status' => 'all', 'numberposts' => $page_limit) ); 616 $ num_pages= count($pages);618 $pages_found = count($pages); 617 619 618 620 // If we have pages, put together their info. 619 if($ num_pages>= 1) {621 if($pages_found >= 1) { 620 622 $pages_struct = array(); 621 623 622 for($i = 0; $i < $ num_pages; $i++) {624 for($i = 0; $i < $pages_found; $i++) { 623 625 $page = wp_xmlrpc_server::wp_getPage(array( 624 626 $blog_id, $pages[$i]->ID, $username, $password 625 627 ));
