- Timestamp:
- 04/27/2021 06:34:52 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/fields/class-wp-rest-meta-fields.php
r50567 r50793 95 95 $value = array(); 96 96 97 foreach ( $all_values as $row ) { 98 $value[] = $this->prepare_value_for_response( $row, $request, $args ); 97 if ( is_array( $all_values ) ) { 98 foreach ( $all_values as $row ) { 99 $value[] = $this->prepare_value_for_response( $row, $request, $args ); 100 } 99 101 } 100 102 } … … 281 283 $current_values = get_metadata( $meta_type, $object_id, $meta_key, false ); 282 284 $subtype = get_object_subtype( $meta_type, $object_id ); 285 286 if ( ! is_array( $current_values ) ) { 287 $current_values = array(); 288 } 283 289 284 290 $to_remove = $current_values; … … 378 384 $subtype = get_object_subtype( $meta_type, $object_id ); 379 385 380 if ( 1 === count( $old_value ) && $this->is_meta_value_same_as_stored_value( $meta_key, $subtype, $old_value[0], $value ) ) { 386 if ( is_array( $old_value ) && 1 === count( $old_value ) 387 && $this->is_meta_value_same_as_stored_value( $meta_key, $subtype, $old_value[0], $value ) 388 ) { 381 389 return true; 382 390 }
Note: See TracChangeset
for help on using the changeset viewer.