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: https://develop.svn.wordpress.org/trunk@17650 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
a44ccc5b13
commit
0d9e3e95b9
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user