From c82480a847aabe8944858a34474ec49faf364c77 Mon Sep 17 00:00:00 2001 From: David Arenas Date: Tue, 14 Feb 2023 19:21:43 +0100 Subject: [PATCH] Fix wp_process_directives --- wp-directives.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/wp-directives.php b/wp-directives.php index 6cbbf513..c59d9cef 100644 --- a/wp-directives.php +++ b/wp-directives.php @@ -216,7 +216,7 @@ function wp_process_directives( $block_content ) { ); $attribute_directives = array( - // 'wp-context' => 'process_wp_context_attribute', // TODO + 'wp-context' => 'process_wp_context_attribute', 'wp-bind' => 'process_wp_bind', 'wp-class' => 'process_wp_class', 'wp-style' => 'process_wp_style', @@ -234,12 +234,13 @@ function wp_process_directives( $block_content ) { $attributes = $tags->get_attribute_names_with_prefix( 'wp-' ); foreach ( $attributes as $attribute ) { - if ( ! array_key_exists( $attribute, $attribute_directives ) ) { + list( $type ) = explode( ':', $attribute ); + if ( ! array_key_exists( $type, $attribute_directives ) ) { continue; } call_user_func( - $attribute_directives[ $attribute ], + $attribute_directives[ $type ], $tags, $context ); @@ -247,7 +248,7 @@ function wp_process_directives( $block_content ) { } } - return $block_content; + return $tags->get_updated_html(); } add_filter( 'render_block',