Changeset 48302 for trunk/src/wp-includes/rest-api.php
- Timestamp:
- 07/04/2020 08:40:21 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api.php
r48300 r48302 1465 1465 } 1466 1466 1467 // The "format" keyword should only be applied to strings. However, for backward scompatibility,1467 // The "format" keyword should only be applied to strings. However, for backward compatibility, 1468 1468 // we allow the "format" keyword if the type keyword was not specified, or was set to an invalid value. 1469 if ( isset( $args['format'] ) && ( ! isset( $args['type'] ) || 'string' === $args['type'] || ! in_array( $args['type'], $allowed_types, true ) ) ) { 1469 if ( isset( $args['format'] ) 1470 && ( ! isset( $args['type'] ) || 'string' === $args['type'] || ! in_array( $args['type'], $allowed_types, true ) ) 1471 ) { 1470 1472 switch ( $args['format'] ) { 1471 1473 case 'hex-color': … … 1653 1655 1654 1656 // This behavior matches rest_validate_value_from_schema(). 1655 if ( isset( $args['format'] ) && ( ! isset( $args['type'] ) || 'string' === $args['type'] || ! in_array( $args['type'], $allowed_types, true ) ) ) { 1657 if ( isset( $args['format'] ) 1658 && ( ! isset( $args['type'] ) || 'string' === $args['type'] || ! in_array( $args['type'], $allowed_types, true ) ) 1659 ) { 1656 1660 switch ( $args['format'] ) { 1657 1661 case 'hex-color':
Note: See TracChangeset
for help on using the changeset viewer.