mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-22 17:18:32 +01:00
XMLRPC: Remove the "Backward Compatibility" code from the new api as we don't need to support this older format and it keeps the new api cleaner.
The new Posts API is designed so that you can fetch a post with get, update the data structure returned and submit that with edit and so we need to ensure to only include in get data in a single form - tags and categories are returned as terms. See #18429 git-svn-id: http://svn.automattic.com/wordpress/trunk@20154 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
2281ba2229
commit
ba2a634b7c
@ -591,31 +591,6 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||
}
|
||||
}
|
||||
|
||||
// backward compatiblity
|
||||
if ( $all_taxonomy_fields || in_array( 'tags', $fields ) ) {
|
||||
$tagnames = array();
|
||||
$tags = wp_get_post_tags( $post['ID'] );
|
||||
if ( ! empty( $tags ) ) {
|
||||
foreach ( $tags as $tag ) {
|
||||
$tagnames[] = $tag->name;
|
||||
}
|
||||
$tagnames = implode( ', ', $tagnames );
|
||||
} else {
|
||||
$tagnames = '';
|
||||
}
|
||||
$_post['tags'] = $tagnames;
|
||||
}
|
||||
|
||||
// backward compatiblity
|
||||
if ( $all_taxonomy_fields || in_array( 'categories', $fields ) ) {
|
||||
$categories = array();
|
||||
$catids = wp_get_post_categories( $post['ID'] );
|
||||
foreach ( $catids as $catid ) {
|
||||
$categories[] = get_cat_name( $catid );
|
||||
}
|
||||
$_post['categories'] = $categories;
|
||||
}
|
||||
|
||||
if ( in_array( 'custom_fields', $fields ) )
|
||||
$_post['custom_fields'] = $this->get_custom_fields( $post['ID'] );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user