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:
westi 2012-03-08 11:24:43 +00:00
parent 2281ba2229
commit ba2a634b7c

View File

@ -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'] );