[wp-trac] [WordPress Trac] #55510: The `wp_content_img_tag` filter can appear to run twice when used to wrap image tags

WordPress Trac noreply at wordpress.org
Tue Apr 12 00:37:58 UTC 2022


#55510: The `wp_content_img_tag` filter can appear to run twice when used to wrap
image tags
--------------------------------------+-----------------------
 Reporter:  peterwilsoncc             |       Owner:  flixos90
     Type:  defect (bug)              |      Status:  assigned
 Priority:  normal                    |   Milestone:  6.0
Component:  Media                     |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+-----------------------

Comment (by peterwilsoncc):

 Thanks @flixos90, I'll review the PR with a view to committing this over
 the next few hours.

 > While I definitely think we need to fix the duplicate logic execution
 here that causes the bug, calling `wp_filter_content_tags()` twice is a
 different topic. This is not something that should be done, WP core
 doesn't do it, and we also expect other `the_content` filters for example
 to not be run twice.

 Agreed.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/55510#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list