WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/04/2017 08:26:44 AM (23 months ago)
Author:
joehoyle
Message:

REST API: Support for objects in schema validation and sanitization.

When registering routes developers can now define their complex objects in the schema and benefit from the automatic validation and sanitization in the REST API. This also paves the way for support for complex object registration via register_meta and register_setting.

See #38583.
Props TimothyBlynJacobs5.

File:
1 edited

Legend:

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

    r41588 r41727  
    18471847                        'arg_options' => array(
    18481848                            'sanitize_callback' => null, // Note: sanitization implemented in self::prepare_item_for_database()
     1849                            'validate_callback' => null, // Note: validation implemented in self::prepare_item_for_database()
    18491850                        ),
    18501851                        'properties'  => array(
     
    18711872                        'arg_options' => array(
    18721873                            'sanitize_callback' => null, // Note: sanitization implemented in self::prepare_item_for_database()
     1874                            'validate_callback' => null, // Note: validation implemented in self::prepare_item_for_database()
    18731875                        ),
    18741876                        'properties'  => array(
     
    19091911                        'arg_options' => array(
    19101912                            'sanitize_callback' => null, // Note: sanitization implemented in self::prepare_item_for_database()
     1913                            'validate_callback' => null, // Note: validation implemented in self::prepare_item_for_database()
    19111914                        ),
    19121915                        'properties'  => array(
Note: See TracChangeset for help on using the changeset viewer.