- Timestamp:
- 11/30/2017 11:09:33 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-settings-controller.php
r42000 r42343 36 36 public function register_routes() { 37 37 38 register_rest_route( $this->namespace, '/' . $this->rest_base, array( 39 array( 40 'methods' => WP_REST_Server::READABLE, 41 'callback' => array( $this, 'get_item' ), 42 'args' => array(), 43 'permission_callback' => array( $this, 'get_item_permissions_check' ), 44 ), 45 array( 46 'methods' => WP_REST_Server::EDITABLE, 47 'callback' => array( $this, 'update_item' ), 48 'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::EDITABLE ), 49 'permission_callback' => array( $this, 'get_item_permissions_check' ), 50 ), 51 'schema' => array( $this, 'get_public_item_schema' ), 52 ) ); 38 register_rest_route( 39 $this->namespace, '/' . $this->rest_base, array( 40 array( 41 'methods' => WP_REST_Server::READABLE, 42 'callback' => array( $this, 'get_item' ), 43 'args' => array(), 44 'permission_callback' => array( $this, 'get_item_permissions_check' ), 45 ), 46 array( 47 'methods' => WP_REST_Server::EDITABLE, 48 'callback' => array( $this, 'update_item' ), 49 'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::EDITABLE ), 50 'permission_callback' => array( $this, 'get_item_permissions_check' ), 51 ), 52 'schema' => array( $this, 'get_public_item_schema' ), 53 ) 54 ); 53 55 54 56 } … … 140 142 $options = $this->get_registered_options(); 141 143 142 $params 144 $params = $request->get_params(); 143 145 144 146 foreach ( $options as $name => $args ) { … … 233 235 ); 234 236 235 $rest_args['schema'] = array_merge( $default_schema, $rest_args['schema'] );237 $rest_args['schema'] = array_merge( $default_schema, $rest_args['schema'] ); 236 238 $rest_args['option_name'] = $name; 237 239 … … 275 277 276 278 foreach ( $options as $option_name => $option ) { 277 $schema['properties'][ $option_name ] = $option['schema'];279 $schema['properties'][ $option_name ] = $option['schema']; 278 280 $schema['properties'][ $option_name ]['arg_options'] = array( 279 281 'sanitize_callback' => array( $this, 'sanitize_callback' ),
Note: See TracChangeset
for help on using the changeset viewer.