Make WordPress Core

Opened 3 years ago

Last modified 3 years ago

#53187 new defect (bug)

wp_filter_content_tags added too early

Reported by: maciejmackowiak's profile maciejmackowiak Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.5
Component: Media Keywords: needs-patch
Focuses: Cc:

Description (last modified by sabernhardt)

Currently wp_filter_content_tags filter is added to the_content filters with default priority, this means that if the iframe is outputted by shortcode it will not get the lazy loading attribute.
I think that it should be added after do_shortcode has run with priority of 12.

Change History (2)

#1 @sabernhardt
3 years ago

  • Component changed from General to Media
  • Description modified (diff)
  • Keywords needs-patch added
  • Summary changed from wp_filter_content_tags added to early to wp_filter_content_tags added too early
  • Version set to 5.5

The wp_filter_content_tags filter is added to four places in default-filters.php:

Though the_excerpt does not have the do_shortcode filter by default, it could be good to assign the priority of 12 there anyway (in addition to the other three).

(block-template.php has run_shortcode before wp_filter_content_tags)

Last edited 3 years ago by sabernhardt (previous) (diff)

#2 @sabernhardt
3 years ago

A directory search found one plugin using remove_filter (on both the_content and the_excerpt), which would need updating with a priority change.

Last edited 3 years ago by sabernhardt (previous) (diff)
Note: See TracTickets for help on using tickets.