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

Pattern resolver: run filters #61711

Closed
wants to merge 2 commits into from
Closed

Conversation

ellatrix
Copy link
Member

What?

Render the pattern block through the render_block API, which will call the necessary filters.

Why?

Fixes #61454.

How?

Testing Instructions

Testing Instructions for Keyboard

Screenshots or screencast

@ellatrix ellatrix added [Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced Backported to WP Core Pull request that has been successfully merged into WP Core labels May 16, 2024
@ellatrix ellatrix requested a review from ryelle May 16, 2024 09:50
@ellatrix ellatrix requested a review from spacedmonkey as a code owner May 16, 2024 09:50
@ellatrix ellatrix added Needs PHP backport Needs PHP backport to Core [Type] Bug An existing feature does not function as intended and removed Backported to WP Core Pull request that has been successfully merged into WP Core labels May 16, 2024
Copy link

This pull request has changed or added PHP files. Please confirm whether these changes need to be synced to WordPress Core, and therefore featured in the next release of WordPress.

If so, it is recommended to create a new Trac ticket and submit a pull request to the WordPress Core Github repository soon after this pull request is merged.

If you're unsure, you can always ask for help in the #core-editor channel in WordPress Slack.

Thank you! ❤️

View changed files
❔ lib/compat/wordpress-6.6/resolve-patterns.php

Copy link

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: ellatrix <[email protected]>
Co-authored-by: joemcgill <[email protected]>
Co-authored-by: westonruter <[email protected]>
Co-authored-by: justintadlock <[email protected]>
Co-authored-by: ryelle <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@ellatrix
Copy link
Member Author

Ok, this will break because we now rely on the pattern block's server side render function, which is really a front-end render function, because it in turn calls do_blocks and strips paragraphs from its comment delimiters.

@ellatrix
Copy link
Member Author

We also can't really run the render_block filters because we're not rendering blocks, we're just fetching them and resolving them, and they might be displayed in the editor (in which case these front-end filters shouldn't be running).

@ellatrix ellatrix closed this May 17, 2024
@ellatrix ellatrix deleted the fix/resolve-patterns-filter branch May 17, 2024 05:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced Needs PHP backport Needs PHP backport to Core [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pattern render hooks no longer run
1 participant