[wp-trac] [WordPress Trac] #58853: Fix shortcode output not receiving image (and other) optimizations

WordPress Trac noreply at wordpress.org
Mon Jul 24 18:23:07 UTC 2023


#58853: Fix shortcode output not receiving image (and other) optimizations
-------------------------------------------------+-------------------------
 Reporter:  flixos90                             |       Owner:  flixos90
     Type:  defect (bug)                         |      Status:  assigned
 Priority:  normal                               |   Milestone:  6.4
Component:  Media                                |     Version:  5.5
 Severity:  normal                               |  Resolution:
 Keywords:  2nd-opinion needs-patch needs-unit-  |     Focuses:
  tests                                          |  performance
-------------------------------------------------+-------------------------

Comment (by joemcgill):

 One other use case that we need to add a test case for is when
 `do_shortcode()` is called manually to render a shortcode early in the
 rendering process, and not via the filter callback.

 For example, if some custom code like a dynamic block's render callback is
 written like this (simplified):


 {{{#!php
 <?php
 function render_custom_block() {
     return do_shortcode( '[shortcode-slug]' );
 }
 }}}

 The shortcode will be processed and (assuming it results in image markup)
 will have optimizations applied prior to the `wp_filter_content_tags()`
 callback on `the_content`. This currently throws off the counts used to
 determine when optimizations should be applied.

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


More information about the wp-trac mailing list