Changeset 39222 for trunk/src/wp-includes/rest-api.php
- Timestamp:
- 11/14/2016 04:35:35 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api.php
r39158 r39222 998 998 if ( ! is_array( $value ) ) { 999 999 $value = preg_split( '/[\s,]+/', $value ); 1000 } 1001 if ( ! wp_is_numeric_array( $value ) ) { 1002 return new WP_Error( 'rest_invalid_param', sprintf( /* translators: 1: parameter, 2: type name */ __( '%1$s is not of type %2$s.' ), $param, 'array' ) ); 1000 1003 } 1001 1004 foreach ( $value as $index => $v ) { … … 1108 1111 $value[ $index ] = rest_sanitize_value_from_schema( $v, $args['items'] ); 1109 1112 } 1113 // Normalize to numeric array so nothing unexpected 1114 // is in the keys. 1115 $value = array_values( $value ); 1110 1116 return $value; 1111 1117 } … … 1141 1147 } 1142 1148 1149 if ( 'string' === $args['type'] ) { 1150 return strval( $value ); 1151 } 1152 1143 1153 return $value; 1144 1154 }
Note: See TracChangeset
for help on using the changeset viewer.