XML-RPC: Check if category support was added for pages before calling wp_get_post_categories() to avoid unnecessary query in wp.getPage.
props markoheijnen, nprasath002. fixes #17920. git-svn-id: https://develop.svn.wordpress.org/trunk@29731 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
1190ed50a8
commit
5a89372970
|
@ -911,9 +911,11 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||||
|
|
||||||
// Pull the categories info together.
|
// Pull the categories info together.
|
||||||
$categories = array();
|
$categories = array();
|
||||||
|
if ( is_object_in_taxonomy( 'page', 'category' ) ) {
|
||||||
foreach ( wp_get_post_categories( $page->ID ) as $cat_id ) {
|
foreach ( wp_get_post_categories( $page->ID ) as $cat_id ) {
|
||||||
$categories[] = get_cat_name( $cat_id );
|
$categories[] = get_cat_name( $cat_id );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Get the author info.
|
// Get the author info.
|
||||||
$author = get_userdata( $page->post_author );
|
$author = get_userdata( $page->post_author );
|
||||||
|
|
Loading…
Reference in New Issue