- Timestamp:
- 01/17/2021 12:49:39 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/fields/class-wp-rest-meta-fields.php
r49927 r49966 146 146 } 147 147 148 $value = $meta[ $name ]; 149 148 150 /* 149 151 * A null value means reset the field, which is essentially deleting it 150 152 * from the database and then relying on the default value. 153 * 154 * Non-single meta can also be removed by passing an empty array. 151 155 */ 152 if ( is_null( $ meta[ $name] ) ) {156 if ( is_null( $value ) || ( array() === $value && ! $args['single'] ) ) { 153 157 $args = $this->get_registered_fields()[ $meta_key ]; 154 158 … … 172 176 continue; 173 177 } 174 175 $value = $meta[ $name ];176 178 177 179 if ( ! $args['single'] && is_array( $value ) && count( array_filter( $value, 'is_null' ) ) ) {
Note: See TracChangeset
for help on using the changeset viewer.