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: https://develop.svn.wordpress.org/trunk@20154 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Peter Westwood 2012-03-08 11:24:43 +00:00
parent 8bbfb2b2ef
commit 63bbecb681
1 changed files with 0 additions and 25 deletions

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