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

WordPress Trac noreply at wordpress.org
Tue Aug 1 18:24:58 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):

 Replying to [comment:5 flixos90]:
 > @joemcgill In your example, I think this wouldn't be a separate problem
 actually, since blocks (including dynamic blocks) are still parsed as part
 of `the_content` filter, so the shortcode in a block would have the same
 implications as a shortcode that is directly within the post content.

 I more detailed example would likely clarify the issue, but what I'm
 anticipating is that all blocks are being rendered prior to optimizations
 being applied to rendered markup, so the logic that tries to make
 assumptions about the optimizations based on the position in the markup
 could be wrong. For example, if a page included a large image block
 followed by a shortcode generated image (in my previous example), we would
 want to ensure that `fetchpriority="high"` was added to the image block
 and not the shortcode generated image.

 Currently, I suspect the shortcode generated image would actually be the
 one that receives the `fetchpriority` attribute.

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


More information about the wp-trac mailing list