WordPress.org

Make WordPress Core

Changeset 17650


Ignore:
Timestamp:
04/18/11 17:27:29 (3 years ago)
Author:
josephscott
Message:

Add support to wp.getPostFormats to provide a list of the currently supported post formats in addition to the complete list.

Fixes #17094

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/class-wp-xmlrpc-server.php

    r17649 r17650  
    16831683 
    16841684        do_action( 'xmlrpc_call', 'wp.getPostFormats' ); 
    1685         return get_post_format_strings(); 
     1685 
     1686        $formats = get_post_format_strings();  
     1687 
     1688        # find out if they want a list of currently supports formats  
     1689        if ( isset( $args[3] ) && is_array( $args[3] ) ) {  
     1690            if ( $args[3]['show-supported'] ) {  
     1691                if ( current_theme_supports( 'post-formats' ) ) {  
     1692                    $supported = get_theme_support( 'post-formats' );  
     1693 
     1694                    $data['all'] = $formats;  
     1695                    $data['supported'] = $supported[0];  
     1696 
     1697                    $formats = $data;  
     1698                }  
     1699            }  
     1700        }  
     1701 
     1702        return $formats; 
    16861703    } 
    16871704 
Note: See TracChangeset for help on using the changeset viewer.