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
This commit is contained in:
josephscott 2011-04-18 17:27:29 +00:00
parent ca45144dd5
commit c8aeb477bc
1 changed files with 18 additions and 1 deletions

View File

@ -1682,7 +1682,24 @@ class wp_xmlrpc_server extends IXR_Server {
return $this->error; return $this->error;
do_action( 'xmlrpc_call', 'wp.getPostFormats' ); 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. /* Blogger API functions.