WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/31/2016 01:47:36 AM (4 years ago)
Author:
pento
Message:

REST API: Add support for arrays in schema validation and sanitization.

By allowing more fine-grained validation and sanitisation of endpoint args, we can ensure the correct data is being passed to endpoints.

This can easily be extended to support new data types, such as CSV fields or objects.

Props joehoyle, rachelbaker, pento.
Fixes #38531.

File:
1 edited

Legend:

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

    r39036 r39046  
    10071007                    'description' => __( 'Roles assigned to the resource.' ),
    10081008                    'type'        => 'array',
     1009                    'items'       => array(
     1010                        'type'    => 'string',
     1011                    ),
    10091012                    'context'     => array( 'edit' ),
    10101013                ),
Note: See TracChangeset for help on using the changeset viewer.