- Timestamp:
- 08/28/2019 03:07:03 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/fields/class-wp-rest-meta-fields.php
r45807 r45903 351 351 $old_value = get_metadata( $meta_type, $object_id, $meta_key ); 352 352 $subtype = get_object_subtype( $meta_type, $object_id ); 353 $args = $this->get_registered_fields()[ $meta_key ]; 353 354 354 355 if ( 1 === count( $old_value ) ) { 355 if ( (string) sanitize_meta( $meta_key, $value, $meta_type, $subtype ) === $old_value[0] ) { 356 $sanitized = sanitize_meta( $meta_key, $value, $meta_type, $subtype ); 357 358 if ( in_array( $args['type'], array( 'string', 'number', 'integer', 'boolean' ), true ) ) { 359 // The return value of get_metadata will always be a string for scalar types. 360 $sanitized = (string) $sanitized; 361 } 362 363 if ( $sanitized === $old_value[0] ) { 356 364 return true; 357 365 }
Note: See TracChangeset
for help on using the changeset viewer.