You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
get_the_block_template_html() in WordPress and gutenberg_get_the_template_html() in Gutenberg build the template HTML for the current page view and then wrap it in <div class="wp-site-blocks"> immediately before returning. This is a decision made in the original implementation, #17626.
What is your proposed solution?
It should be possible for a theme and the user to have as much control over the markup as possible. This wrapper may work as a default for many themes, but is not strictly necessary.
I would propose adding a filter here, maybe like so:
I'm currently into an issue which would also require the ability to filter the markup of templates before they are rendered.
I have a custom rich text format which stores some data as data-attributes. This rich text format should pull in dynamic data and for regular posts and pages we can accomplish this using the HTML_Tag_Processor and a filter on the_content filter. However this doesn't work for the templates.
(My case it kind of related to this issue here: #18490 )
What problem does this address?
get_the_block_template_html()
in WordPress andgutenberg_get_the_template_html()
in Gutenberg build the template HTML for the current page view and then wrap it in<div class="wp-site-blocks">
immediately before returning. This is a decision made in the original implementation, #17626.What is your proposed solution?
It should be possible for a theme and the user to have as much control over the markup as possible. This wrapper may work as a default for many themes, but is not strictly necessary.
I would propose adding a filter here, maybe like so:
It could also be more complex and filter both whether the content should be wrapped and then what the wrapping class is.
This would have an impact on how the automatic skip-link JS is generated, though that can easily be replaced by a theme via the
wp_footer
action.The text was updated successfully, but these errors were encountered: