File tree Expand file tree Collapse file tree
src/wp-includes/abilities Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -432,12 +432,7 @@ public static function execute_update_settings( $input = array() ): array {
432432 $ current_value = self ::cast_value ( get_option ( $ option_name ), $ setting_type );
433433 $ sanitized_value = self ::cast_value ( $ sanitized_value , $ setting_type );
434434
435- if ( $ updated || $ current_value === $ sanitized_value ) {
436- if ( ! isset ( $ updated_settings [ $ group ] ) ) {
437- $ updated_settings [ $ group ] = array ();
438- }
439- $ updated_settings [ $ group ][ $ option_name ] = $ current_value ;
440- } else {
435+ if ( ! $ updated && $ current_value !== $ sanitized_value ) {
441436 return new WP_Error (
442437 'rest_setting_update_failed ' ,
443438 sprintf (
@@ -448,6 +443,12 @@ public static function execute_update_settings( $input = array() ): array {
448443 array ( 'status ' => 500 )
449444 );
450445 }
446+
447+ if ( ! isset ( $ updated_settings [ $ group ] ) ) {
448+ $ updated_settings [ $ group ] = array ();
449+ }
450+
451+ $ updated_settings [ $ group ][ $ option_name ] = $ current_value ;
451452 }
452453 }
453454
You can’t perform that action at this time.
0 commit comments