WordPress.org

Make WordPress Core

Changeset 20696


Ignore:
Timestamp:
05/02/2012 08:29:34 PM (9 years ago)
Author:
nacin
Message:

Have the $fields argument for XML-RPC's wp.getPostType, getPostTypes, wp.getTaxonomy and wp.getTaxonomies take the names of the post type or taxonomy object keys that will be returned.

  • capabilities becomes cap
  • object_types becomes object_type

fixes #17626.

File:
1 edited

Legend:

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

    r20671 r20696  
    531531            $_taxonomy['labels'] = (array) $taxonomy->labels;
    532532
    533         if ( in_array( 'capabilities', $fields ) )
     533        if ( in_array( 'cap', $fields ) )
    534534            $_taxonomy['cap'] = (array) $taxonomy->cap;
    535535
    536         if ( in_array( 'object_types', $fields ) )
     536        if ( in_array( 'object_type', $fields ) )
    537537            $_taxonomy['object_type'] = array_unique( (array) $taxonomy->object_type );
    538538
     
    706706        }
    707707
    708         if ( in_array( 'capabilities', $fields ) ) {
     708        if ( in_array( 'cap', $fields ) ) {
    709709            $_post_type['cap'] = (array) $post_type->cap;
    710710            $_post_type['map_meta_cap'] = (bool) $post_type->map_meta_cap;
     
    17271727            $fields = $args[4];
    17281728        else
    1729             $fields = apply_filters( 'xmlrpc_default_taxonomy_fields', array( 'labels', 'capabilities', 'object_types' ), 'wp.getTaxonomy' );
     1729            $fields = apply_filters( 'xmlrpc_default_taxonomy_fields', array( 'labels', 'cap', 'object_type' ), 'wp.getTaxonomy' );
    17301730
    17311731        if ( ! $user = $this->login( $username, $password ) )
     
    17711771            $fields = $args[4];
    17721772        else
    1773             $fields = apply_filters( 'xmlrpc_default_taxonomy_fields', array( 'labels', 'capabilities', 'object_types' ), 'wp.getTaxonomies' );
     1773            $fields = apply_filters( 'xmlrpc_default_taxonomy_fields', array( 'labels', 'cap', 'object_type' ), 'wp.getTaxonomies' );
    17741774
    17751775        if ( ! $user = $this->login( $username, $password ) )
     
    30813081            $fields = $args[4];
    30823082        else
    3083             $fields = apply_filters( 'xmlrpc_default_posttype_fields', array( 'labels', 'capabilities', 'taxonomies' ), 'wp.getPostType' );
     3083            $fields = apply_filters( 'xmlrpc_default_posttype_fields', array( 'labels', 'cap', 'taxonomies' ), 'wp.getPostType' );
    30843084
    30853085        if ( !$user = $this->login( $username, $password ) )
     
    31273127            $fields = $args[4];
    31283128        else
    3129             $fields = apply_filters( 'xmlrpc_default_posttype_fields', array( 'labels', 'capabilities', 'taxonomies' ), 'wp.getPostTypes' );
     3129            $fields = apply_filters( 'xmlrpc_default_posttype_fields', array( 'labels', 'cap', 'taxonomies' ), 'wp.getPostTypes' );
    31303130
    31313131        if ( ! $user = $this->login( $username, $password ) )
Note: See TracChangeset for help on using the changeset viewer.