From 63bbecb681464b2bb83e6bc621d26110a6374e69 Mon Sep 17 00:00:00 2001 From: Peter Westwood Date: Thu, 8 Mar 2012 11:24:43 +0000 Subject: [PATCH] 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 --- wp-includes/class-wp-xmlrpc-server.php | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/wp-includes/class-wp-xmlrpc-server.php b/wp-includes/class-wp-xmlrpc-server.php index 333fba3b89..0096a0a75a 100644 --- a/wp-includes/class-wp-xmlrpc-server.php +++ b/wp-includes/class-wp-xmlrpc-server.php @@ -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'] );