Skip to content
This repository was archived by the owner on Feb 23, 2024. It is now read-only.

Commit 748a1e9

Browse files
committed
Enable directives and client transitions
1 parent 6b69132 commit 748a1e9

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

woocommerce-gutenberg-products-block.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,3 +317,17 @@ function wp_directives_register_scripts() {
317317
wp_enqueue_script( 'wp-directives-runtime' );
318318
}
319319
add_action( 'wp_enqueue_scripts', 'wp_directives_register_scripts' );
320+
321+
// Enqueue the WP directives runtime.
322+
add_filter( '__experimental_woocommerce_blocks_enqueue_directives_runtime', function () { return true; } );
323+
324+
// Insert the required meta tag for client-side transitions.
325+
function add_cst_meta_tag() {
326+
echo '<meta itemprop="wp-client-side-transitions" content="active">';
327+
add_filter(
328+
'client_side_transitions',
329+
true
330+
);
331+
}
332+
333+
add_action('wp_head', 'add_cst_meta_tag');

0 commit comments

Comments
 (0)