Ticket #17094: rpc.diff

File rpc.diff, 911 bytes (added by josephscott, 2 years ago)
Line 
1Index: class-wp-xmlrpc-server.php
2===================================================================
3--- class-wp-xmlrpc-server.php  (revision 17627)
4+++ class-wp-xmlrpc-server.php  (working copy)
5@@ -1631,7 +1631,24 @@
6                        return $this->error;
7 
8                do_action( 'xmlrpc_call', 'wp.getPostFormats' );
9-               return get_post_format_strings();
10+
11+               $formats = get_post_format_strings();
12+
13+               # find out if they want a list of currently supports formats
14+               if ( isset( $args[3] ) && is_array( $args[3] ) ) {
15+                       if ( $args[3]['show-supported'] ) {
16+                               if ( current_theme_supports( 'post-formats' ) ) {
17+                                       $supported = get_theme_support( 'post-formats' );
18+
19+                                       $data['all'] = $formats;
20+                                       $data['supported'] = $supported[0];
21+
22+                                       $formats = $data;
23+                               }
24+                       }
25+               }
26+
27+               return $formats;
28        }
29 
30        /* Blogger API functions.
31@@ -3524,4 +3541,4 @@
32                return $pingbacks;
33        }
34 }
35-?>
36\ No newline at end of file
37+?>