From 858da6cbc580a0986258022b64e4eda7560eb32d Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Wed, 13 Mar 2024 10:48:11 +0000 Subject: [PATCH] Interactivity API: Increase hook priority for processing directives. Use a priority of 100 to ensure that other filters can add additional directives before the processing starts. This way, directives will be processed even if the `$parsed_block` variable is edited by a filter. Props cbravobernal, swissspidy, flixos90, joemcgill, gziolo. Fixes #60743. Built from https://develop.svn.wordpress.org/trunk@57826 git-svn-id: http://core.svn.wordpress.org/trunk@57327 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/interactivity-api/interactivity-api.php | 10 +++++++--- wp-includes/version.php | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/wp-includes/interactivity-api/interactivity-api.php b/wp-includes/interactivity-api/interactivity-api.php index cc2c812047..b8f3e508d0 100644 --- a/wp-includes/interactivity-api/interactivity-api.php +++ b/wp-includes/interactivity-api/interactivity-api.php @@ -57,16 +57,20 @@ function wp_interactivity_process_directives_of_interactive_blocks( array $parse }; /* - * Uses a priority of 20 to ensure that other filters can add additional + * Uses a priority of 100 to ensure that other filters can add additional * directives before the processing starts. */ - add_filter( 'render_block_' . $block_name, $process_interactive_blocks, 20, 2 ); + add_filter( 'render_block_' . $block_name, $process_interactive_blocks, 100, 2 ); } } return $parsed_block; } -add_filter( 'render_block_data', 'wp_interactivity_process_directives_of_interactive_blocks' ); +/* + * Uses a priority of 100 to ensure that other filters can add additional attributes to + * $parsed_block before the processing starts. + */ +add_filter( 'render_block_data', 'wp_interactivity_process_directives_of_interactive_blocks', 100, 1 ); /** * Retrieves the main WP_Interactivity_API instance. diff --git a/wp-includes/version.php b/wp-includes/version.php index 103b54c62b..da7a0527cb 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.6-alpha-57824'; +$wp_version = '6.6-alpha-57826'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.