From fc845c82663896d295fcae162eb73879cd0ac789 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Tue, 22 Oct 2024 10:59:42 -0400 Subject: [PATCH] Fix unset array key warning in block-bindings.php This has been throwing an error for several weeks on one of my sites Simplest fix is to just bail early if it's unset PHP Warning: Undefined array key "show_in_rest" in /var/www/wp-content/plugins/gutenberg/lib/compat/wordpress-6.7/block-bindings.php on line 70 --- lib/compat/wordpress-6.7/block-bindings.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/compat/wordpress-6.7/block-bindings.php b/lib/compat/wordpress-6.7/block-bindings.php index 70ba523ac966e..334396cfb00ee 100644 --- a/lib/compat/wordpress-6.7/block-bindings.php +++ b/lib/compat/wordpress-6.7/block-bindings.php @@ -57,7 +57,7 @@ function gutenberg_update_meta_args_with_label( $args ) { } $schema = array( 'title' => $args['label'] ); - if ( ! is_array( $args['show_in_rest'] ) ) { + if ( ! empty( $args['show_in_rest'] ) && ! is_array( $args['show_in_rest'] ) ) { $args['show_in_rest'] = array( 'schema' => $schema, );