- Timestamp:
- 06/04/2020 04:41:47 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-controller.php
r47758 r47911 627 627 public function get_endpoint_args_for_item_schema( $method = WP_REST_Server::CREATABLE ) { 628 628 629 $schema = $this->get_item_schema(); 630 $schema_properties = ! empty( $schema['properties'] ) ? $schema['properties'] : array(); 631 $endpoint_args = array(); 629 $schema = $this->get_item_schema(); 630 $schema_properties = ! empty( $schema['properties'] ) ? $schema['properties'] : array(); 631 $endpoint_args = array(); 632 $valid_schema_properties = array( 633 'type', 634 'format', 635 'enum', 636 'items', 637 'properties', 638 'additionalProperties', 639 'minimum', 640 'maximum', 641 'exclusiveMinimum', 642 'exclusiveMaximum', 643 'minLength', 644 'maxLength', 645 'pattern', 646 ); 632 647 633 648 foreach ( $schema_properties as $field_id => $params ) { … … 655 670 } 656 671 657 foreach ( array( 'type', 'format', 'enum', 'items', 'properties', 'additionalProperties' )as $schema_prop ) {672 foreach ( $valid_schema_properties as $schema_prop ) { 658 673 if ( isset( $params[ $schema_prop ] ) ) { 659 674 $endpoint_args[ $field_id ][ $schema_prop ] = $params[ $schema_prop ];
Note: See TracChangeset
for help on using the changeset viewer.