From b5dc992f8495824c2f3795d05941aaaa6b8b8a93 Mon Sep 17 00:00:00 2001 From: Mario Santos Date: Fri, 6 Sep 2024 10:23:42 +0200 Subject: [PATCH] Add safety check --- lib/compat/wordpress-6.7/block-bindings.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/compat/wordpress-6.7/block-bindings.php b/lib/compat/wordpress-6.7/block-bindings.php index 9ff6083b1c4c86..1aaaf7bd3cb1b3 100644 --- a/lib/compat/wordpress-6.7/block-bindings.php +++ b/lib/compat/wordpress-6.7/block-bindings.php @@ -61,8 +61,12 @@ function gutenberg_add_can_update_block_bindings_editor_setting( $editor_setting * @return array Modified arguments array including `label`. */ function gutenberg_update_meta_args_with_label( $args ) { - // Default to empty string. - $schema = array( 'title' => isset( $args['label'] ) ? $args['label'] : '' ); + // Don't update schema when label isn't provided. + if ( ! isset( $args['label'] ) ) { + return $args; + } + + $schema = array( 'title' => $args['label'] ); if ( ! is_array( $args['show_in_rest'] ) ) { $args['show_in_rest'] = array( 'schema' => $schema,