Skip to content

Commit

Permalink
Adds additional check to make sure the show_in_rest parameter is pres…
Browse files Browse the repository at this point in the history
…ent before it is manipulated
  • Loading branch information
thijsoo committed Apr 18, 2024
1 parent 80c783f commit 4abcce1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/compat/wordpress-6.6/option.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ function gutenberg_update_initial_settings( $args, $defaults, $option_group, $op
$args['label'] = $settings_label_map[ $option_name ];
}

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

Check failure on line 30 in lib/compat/wordpress-6.6/option.php

View workflow job for this annotation

GitHub Actions / PHP coding standards

Expected exactly one space between closing parenthesis and opening control structure; " " found.

Check failure on line 30 in lib/compat/wordpress-6.6/option.php

View workflow job for this annotation

GitHub Actions / PHP coding standards

Expected 1 spaces before closing parenthesis; 0 found

Check failure on line 30 in lib/compat/wordpress-6.6/option.php

View workflow job for this annotation

GitHub Actions / PHP coding standards

Expected 1 space after closing parenthesis; found 2
//return $args;
}

$schema = array( 'title' => $args['label'] );
Expand Down

0 comments on commit 4abcce1

Please sign in to comment.