From bc2034f8dd0818df1fac114d4a0c99652f021316 Mon Sep 17 00:00:00 2001 From: Theo <328805+theodesp@users.noreply.github.com> Date: Thu, 6 Jun 2024 10:32:06 +0100 Subject: [PATCH] Bug: Fixes issue with blocks not showing in the block editor when running blockset command on WP >=v6.5 --- .changeset/wet-ladybugs-rush.md | 5 +++++ plugins/faustwp/includes/blocks/functions.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/wet-ladybugs-rush.md diff --git a/.changeset/wet-ladybugs-rush.md b/.changeset/wet-ladybugs-rush.md new file mode 100644 index 000000000..c2d1055a7 --- /dev/null +++ b/.changeset/wet-ladybugs-rush.md @@ -0,0 +1,5 @@ +--- +'@faustwp/wordpress-plugin': patch +--- + +Bug: Fixes issue with blocks not showing in the block editor when running blockset command on WP >=v6.5 diff --git a/plugins/faustwp/includes/blocks/functions.php b/plugins/faustwp/includes/blocks/functions.php index 3f1037d67..716e2ff71 100644 --- a/plugins/faustwp/includes/blocks/functions.php +++ b/plugins/faustwp/includes/blocks/functions.php @@ -187,7 +187,7 @@ function register_block_asset( $metadata, $field_name, $block_name, $dependencie } // Generate a handle and register the asset. - $handle = $block_name . '-' . strtolower( $field_name ); + $handle = generate_block_asset_handle( $metadata['name'], $field_name ); if ( strpos( strtolower( $field_name ), 'script' ) !== false ) { wp_register_script( $handle, $full_url, $dependencies, $version, true ); } elseif ( strpos( strtolower( $field_name ), 'style' ) !== false ) {