Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interactivity API: Fix interactivity api e2e tests. #59836

Merged
merged 3 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,20 @@ function wp_interactivity_process_directives_of_interactive_blocks( array $parse
};

/*
* Uses a priority of 20 to ensure that other filters can add additional
* directives before the processing starts.
*/
add_filter( 'render_block_' . $block_name, $process_interactive_blocks, 20, 2 );
* 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, 100, 2 );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
}

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 edit $parsed_block
* without crashing the SSR.
*/
add_filter( 'render_block_data', 'wp_interactivity_process_directives_of_interactive_blocks', 100 );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

core has 1 as the last argument here, although I think that's the default and maybe it should be omitted in core.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it should be omitted, pointless to add the default

}

if ( ! function_exists( 'wp_interactivity' ) ) {
Expand Down
3 changes: 2 additions & 1 deletion packages/e2e-tests/plugins/interactive-blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ function () {
// But remove the server directive processing.
remove_filter(
'render_block_data',
'wp_interactivity_process_directives_of_interactive_blocks'
'wp_interactivity_process_directives_of_interactive_blocks',
100
);
}
}
Expand Down
Loading