[wp-trac] [WordPress Trac] #55996: the get_the_block_template_html call all the same functions as the the_conent filter so they are run twice
WordPress Trac
noreply at wordpress.org
Tue Jul 26 15:40:22 UTC 2022
#55996: the get_the_block_template_html call all the same functions as the
the_conent filter so they are run twice
------------------------------------------+------------------------------
Reporter: pbearne | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Formatting | Version:
Severity: normal | Resolution:
Keywords: needs-patch needs-unit-tests | Focuses: performance
------------------------------------------+------------------------------
Comment (by ocean90):
I'm trying to debug why the lazy loading attribute isn't omitted for the
first image (feature from #53675) in a block theme using template parts
and als noticed the direct call to `wp_filter_content_tags()` in
`get_the_block_template_html()` but also
`render_block_core_template_part()`.
It seems like `false` gets passed to `wp_get_loading_attr_default()` in
these cases which is actually an undocumented value but happens when the
function is not used as part of a filter thus `current_filter()` returns
false.
Removing both `wp_filter_content_tags()` calls still adds the loading
attribute so there's indeed something that still runs the `the_content`
filter on the output.
cc: @flixos90 for awareness
--
Ticket URL: <https://core.trac.wordpress.org/ticket/55996#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list