Make WordPress Core

Changeset 39250


Ignore:
Timestamp:
11/15/2016 06:15:30 PM (10 years ago)
Author:
joehoyle
Message:

REST API: Clean up argument and property types.

There's a couple of places where we were missing type notes for arguments, which mainly affects documentation.

Props jnylen0.
Fixes #38792.

Location:
trunk/src/wp-includes/rest-api/endpoints
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php

    r39239 r39250  
    11591159                                                        'type'            => 'string',
    11601160                                                        'context'         => array( 'view', 'edit', 'embed' ),
     1161                                                        'readonly'        => true,
    11611162                                                ),
    11621163                                        ),
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-post-types-controller.php

    r39191 r39250  
    206206                                'capabilities'     => array(
    207207                                        'description'  => __( 'All capabilities used by the resource.' ),
    208                                         'type'         => 'array',
    209                                         'items'        => array(
    210                                                 'type' => 'string',
    211                                         ),
     208                                        'type'         => 'object',
    212209                                        'context'      => array( 'edit' ),
    213210                                        'readonly'     => true,
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php

    r39239 r39250  
    8787                                        'password' => array(
    8888                                                'description' => __( 'The password for the post if it is password protected.' ),
     89                                                'type'        => 'string',
    8990                                        ),
    9091                                ),
     
    20702071                        'description'       => __( 'Limit result set to posts with one or more specific slugs.' ),
    20712072                        'type'              => 'array',
     2073                        'items'             => array(
     2074                                'type'          => 'string',
     2075                        ),
    20722076                        'sanitize_callback' => 'wp_parse_slug_list',
    20732077                );
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-taxonomies-controller.php

    r39191 r39250  
    237237                                'capabilities'     => array(
    238238                                        'description'  => __( 'All capabilities used by the resource.' ),
    239                                         'type'         => 'array',
     239                                        'type'         => 'object',
    240240                                        'context'      => array( 'edit' ),
    241241                                        'readonly'     => true,
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php

    r39239 r39250  
    9090                                                'description' => __( 'Required to be true, as resource does not support trashing.' ),
    9191                                        ),
    92                                         'reassign' => array(),
     92                                        'reassign' => array(
     93                                                'type'        => 'integer',
     94                                                'description' => __( 'Reassign the deleted user\'s posts and links to this user ID.' ),
     95                                        ),
    9396                                ),
    9497                        ),
     
    101104                                'callback'            => array( $this, 'get_current_item' ),
    102105                                'args'                => array(
    103                                         'context'          => array(),
     106                                        'context' => $this->get_context_param( array( 'default' => 'view' ) ),
    104107                                ),
    105108                        ),
     
    120123                                                'description' => __( 'Required to be true, as resource does not support trashing.' ),
    121124                                        ),
    122                                         'reassign' => array(),
     125                                        'reassign' => array(
     126                                                'type'        => 'integer',
     127                                                'description' => __( 'Reassign the deleted user\'s posts and links to this user ID.' ),
     128                                        ),
    123129                                ),
    124130                        ),
Note: See TracChangeset for help on using the changeset viewer.