Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
aa490ab
Add interactivity schemas
cbravobernal Jan 23, 2024
53c0f34
Update all blocks with clientNavigation support
cbravobernal Jan 23, 2024
35f558e
Update non compatible with client side navigation blocks
cbravobernal Jan 23, 2024
d6ed376
Add clientNavigation conditional to Query block
cbravobernal Jan 23, 2024
f548120
Update changelog
cbravobernal Jan 23, 2024
6a7a5a1
Add interactivty enabled
cbravobernal Jan 24, 2024
2224a6f
Update with new schema
cbravobernal Jan 26, 2024
d3aecc7
Update with new schema
cbravobernal Jan 26, 2024
8d32c4b
Still not working, but updates on query
cbravobernal Jan 26, 2024
0ffdfd9
Hard reset of query PHP part, tests should pass
cbravobernal Jan 31, 2024
4279bfc
Update supports version and query code, tests still failing
cbravobernal Jan 31, 2024
c5bafa5
Remove comment template interactivity
cbravobernal Feb 1, 2024
7fd4df2
Simplify query
cbravobernal Feb 1, 2024
5f8f077
Simplify query
cbravobernal Feb 1, 2024
787767f
Remove not needed interactive false
cbravobernal Feb 1, 2024
e519909
Revert duplicated interactivity
cbravobernal Feb 2, 2024
0f01dda
Update supports
cbravobernal Feb 2, 2024
072c51f
Update schema
cbravobernal Feb 2, 2024
60efcbe
Update docs
cbravobernal Feb 2, 2024
dccc845
Fix query php render
cbravobernal Feb 2, 2024
e9fbe23
Improve comment
cbravobernal Feb 2, 2024
dfc7f6d
Add consistency to the render query
cbravobernal Feb 2, 2024
39d79ad
Avoid not needed serialization
cbravobernal Feb 2, 2024
4dede2f
Revert "Avoid not needed serialization"
cbravobernal Feb 2, 2024
36d9491
Improve `interactive` descriptions
luisherranz Feb 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Avoid not needed serialization
  • Loading branch information
cbravobernal committed Feb 2, 2024
commit 39d79adab71595cb478e5defccd308995187df6c
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@ function wp_interactivity_process_directives_of_interactive_blocks( $parsed_bloc
( isset( $block_type->supports['interactivity']['interactive'] ) && true === $block_type->supports['interactivity']['interactive'] ) )
) {
// Annotates the root interactive block for processing.
$root_interactive_block = array( $block_name, md5( serialize( $parsed_block ) ) );
$root_interactive_block = array( $block_name, $parsed_block );

/*
* Adds a filter to process the root interactive block once it has
* finished rendering.
*/
$process_interactive_blocks = static function ( $content, $parsed_block ) use ( &$root_interactive_block, &$process_interactive_blocks ) {
// Checks whether the current block is the root interactive block.
list($root_block_name, $root_block_md5) = $root_interactive_block;
if ( $root_block_name === $parsed_block['blockName'] && md5( serialize( $parsed_block ) ) === $root_block_md5 ) {
list( $root_block_name, $root_parsed_block ) = $root_interactive_block;
if ( $root_block_name === $parsed_block['blockName'] && $parsed_block === $root_parsed_block ) {
// The root interactive blocks has finished rendering, process it.
$content = wp_interactivity_process_directives( $content );
// Removes the filter and reset the root interactive block.
Expand Down