From c8aeb477bceae1ce3dd040b995b84e35ab102fe5 Mon Sep 17 00:00:00 2001 From: josephscott Date: Mon, 18 Apr 2011 17:27:29 +0000 Subject: [PATCH] Add support to wp.getPostFormats to provide a list of the currently supported post formats in addition to the complete list. Fixes #17094 git-svn-id: http://svn.automattic.com/wordpress/trunk@17650 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-xmlrpc-server.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/wp-includes/class-wp-xmlrpc-server.php b/wp-includes/class-wp-xmlrpc-server.php index afb9592bfa..6d10052447 100644 --- a/wp-includes/class-wp-xmlrpc-server.php +++ b/wp-includes/class-wp-xmlrpc-server.php @@ -1682,7 +1682,24 @@ class wp_xmlrpc_server extends IXR_Server { return $this->error; do_action( 'xmlrpc_call', 'wp.getPostFormats' ); - return get_post_format_strings(); + + $formats = get_post_format_strings(); + + # find out if they want a list of currently supports formats + if ( isset( $args[3] ) && is_array( $args[3] ) ) { + if ( $args[3]['show-supported'] ) { + if ( current_theme_supports( 'post-formats' ) ) { + $supported = get_theme_support( 'post-formats' ); + + $data['all'] = $formats; + $data['supported'] = $supported[0]; + + $formats = $data; + } + } + } + + return $formats; } /* Blogger API functions.