WordPress/wporg-parent-2021

Move content filtering off of pattern hooks

ryelle opened this issue · 3 comments

The render_block_core/pattern hook is used for a few things in the parent theme, but this hook is no longer run as of WordPress/gutenberg#60349. In fact, patterns are not "rendered" at all, instead the blocks are swapped out at the template level, before do_blocks runs.

So, how should the following be handled?

Rendering embeds — Can be removed, this was fixed in core.

Render shortcodes — Can maybe be removed? Shortcodes appear to work in block content, but not as attributes (see WordPress/wporg-developer#513).

Wrap the arrows ↗ in aria-hidden spans — We need an alternate solution for this. (see #94)

Flip inline styles for RTL support — We need an alternate solution for this (see WordPress/wporg-main-2022#126)

I've opened a PR to move shortcodes into block content for Developer here: WordPress/wporg-developer#517

As of GB 18.5, the pattern render hooks (for patterns included in templates) will run again, so we can unpin and update 👍🏻

A better fix would be WordPress/wordpress-develop#6533, which would create a single filter over all the page content, and we could add the arrow & RTL fixes on that. But until then, the GB fix will work.

I've unpinned Gutenberg, and everything is still running as expected.

I think I'm going to leave this open, on hold, and update the title so that we can track the the_block_template_html and switch to that if/when it's merged.