- Timestamp:
- 02/13/2024 09:55:38 AM (16 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/fields/class-wp-rest-meta-fields.php
r56075 r57611 142 142 public function update_value( $meta, $object_id ) { 143 143 $fields = $this->get_registered_fields(); 144 $error = new WP_Error(); 144 145 145 146 foreach ( $fields as $meta_key => $args ) { … … 164 165 165 166 if ( is_wp_error( rest_validate_value_from_schema( $current, $args['schema'] ) ) ) { 166 return new WP_Error(167 $error->add( 167 168 'rest_invalid_stored_value', 168 169 /* translators: %s: Custom field key. */ … … 170 171 array( 'status' => 500 ) 171 172 ); 173 continue; 172 174 } 173 175 } … … 175 177 $result = $this->delete_meta_value( $object_id, $meta_key, $name ); 176 178 if ( is_wp_error( $result ) ) { 177 return $result;179 $error->merge_from( $result ); 178 180 } 179 181 continue; … … 181 183 182 184 if ( ! $args['single'] && is_array( $value ) && count( array_filter( $value, 'is_null' ) ) ) { 183 return new WP_Error(185 $error->add( 184 186 'rest_invalid_stored_value', 185 187 /* translators: %s: Custom field key. */ … … 187 189 array( 'status' => 500 ) 188 190 ); 191 continue; 189 192 } 190 193 … … 192 195 if ( is_wp_error( $is_valid ) ) { 193 196 $is_valid->add_data( array( 'status' => 400 ) ); 194 return $is_valid; 197 $error->merge_from( $is_valid ); 198 continue; 195 199 } 196 200 … … 204 208 205 209 if ( is_wp_error( $result ) ) { 206 return $result; 207 } 210 $error->merge_from( $result ); 211 continue; 212 } 213 } 214 215 if ( $error->has_errors() ) { 216 return $error; 208 217 } 209 218
Note: See TracChangeset
for help on using the changeset viewer.