Ticket #11243: xmlrpc.php.diff
File xmlrpc.php.diff, 1.2 KB (added by , 14 years ago) |
---|
-
xmlrpc.php
612 612 613 613 do_action('xmlrpc_call', 'wp.getPages'); 614 614 615 $ pages = get_posts( array('post_type' => 'page', 'post_status' => 'all', 'numberposts' => $num_pages) );615 $many_pages = get_posts( array('post_type' => 'page', 'post_status' => 'all', 'numberposts' => ( $num_pages * 3 ) ) ); 616 616 $num_pages = count($pages); 617 617 618 // Remove pages that are in the trash 619 $pages = array( ); 620 foreach ( (array) $many_pages as $a_page ) { 621 if ( $a_page->post_status == 'trash' ) 622 continue; 623 624 $pages[] = $a_page; 625 } 626 627 // Limit page count to the number requested 628 $total_pages = count($pages); 629 if ( $total_pages > $num_pages ) { 630 $pages = array_slice( $pages, 0, $num_pages - 1 ); 631 $total_pages = $num_pages; 632 } 633 618 634 // If we have pages, put together their info. 619 if($ num_pages >= 1) {635 if($total_pages >= 1) { 620 636 $pages_struct = array(); 621 637 622 for($i = 0; $i < $ num_pages; $i++) {638 for($i = 0; $i < $total_pages; $i++) { 623 639 $page = wp_xmlrpc_server::wp_getPage(array( 624 640 $blog_id, $pages[$i]->ID, $username, $password 625 641 ));