Skip to content

Commit

Permalink
Fix PHP notice triggered by 'gutenberg_update_initial_settings'
Browse files Browse the repository at this point in the history
  • Loading branch information
Mamaduka committed Apr 18, 2024
1 parent 80c783f commit 0833a59
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/compat/wordpress-6.6/option.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ function gutenberg_update_initial_settings( $args, $defaults, $option_group, $op
$args['label'] = $settings_label_map[ $option_name ];
}

// Don't update schema when a setting isn't exposed via REST API.
if ( ! isset( $args['show_in_rest'] ) ) {
return $args;
}

// Don't update schema when label isn't provided.
if ( ! isset( $args['label'] ) ) {
return $args;
Expand Down

0 comments on commit 0833a59

Please sign in to comment.