[wp-trac] [WordPress Trac] #52055: Allow modifying gallery_shortcode attributes before filtering the default HTML output.

WordPress Trac noreply at wordpress.org
Fri Jan 29 15:16:42 UTC 2021


#52055: Allow modifying gallery_shortcode attributes before filtering the default
HTML output.
-------------------------------------+------------------------------
 Reporter:  webbistro                |       Owner:  (none)
     Type:  enhancement              |      Status:  new
 Priority:  normal                   |   Milestone:  Awaiting Review
Component:  Media                    |     Version:  2.5
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |     Focuses:
-------------------------------------+------------------------------
Changes (by Mista-Flo):

 * keywords:   => has-patch needs-testing


Comment:

 Hi Nadia, thanks for your ticket.

 Indeed the gallery shortcode is not easy to deal with.

 I guess TinyMCE editor is deprecated and the use of block editor is more
 encouraged, so it might not be a priority to enhance the shortcode.

 But if we want to do so, I would suggest moving `post_gallery` after
 shortcode_atts like you said, and also add an other hook to only filter
 shortcode attributes if we want to. That way, if you don't want to change
 the HTM output, but only the query, you can do so. And you can also let
 other plugins interact with the output with your updated query.

 Can you have some testing with this patch please?

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


More information about the wp-trac mailing list