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 @@ -427,12 +427,7 @@ public static function execute_update_settings( $input = array() ): array {
427427 $ current_value = self ::cast_value ( get_option ( $ option_name ), $ setting_type );
428428 $ sanitized_value = self ::cast_value ( $ sanitized_value , $ setting_type );
429429
430- if ( $ updated || $ current_value === $ sanitized_value ) {
431- if ( ! isset ( $ updated_settings [ $ group ] ) ) {
432- $ updated_settings [ $ group ] = array ();
433- }
434- $ updated_settings [ $ group ][ $ option_name ] = $ current_value ;
435- } else {
430+ if ( ! $ updated && $ current_value !== $ sanitized_value ) {
436431 return new WP_Error (
437432 'rest_setting_update_failed ' ,
438433 sprintf (
@@ -443,6 +438,12 @@ public static function execute_update_settings( $input = array() ): array {
443438 array ( 'status ' => 500 )
444439 );
445440 }
441+
442+ if ( ! isset ( $ updated_settings [ $ group ] ) ) {
443+ $ updated_settings [ $ group ] = array ();
444+ }
445+
446+ $ updated_settings [ $ group ][ $ option_name ] = $ current_value ;
446447 }
447448 }
448449
You can’t perform that action at this time.
0 commit comments