[wp-trac] [WordPress Trac] #29832: Add filter to final output of gallery_shortcode
WordPress Trac
noreply at wordpress.org
Thu Oct 2 14:15:59 UTC 2014
#29832: Add filter to final output of gallery_shortcode
-------------------------+------------------------------
Reporter: dcrabill | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Gallery | Version: trunk
Severity: normal | Resolution:
Keywords: | Focuses: template
-------------------------+------------------------------
Comment (by dcrabill):
Thanks Sergey. I had noticed those related tickets but their patches
didn't look like they were doing the same thing as this.
Those solutions will get things working for me for now. The
`wp_get_attachment_link` filter does work and is certainly better than
nothing, though this then applies the lightbox to all attachments, not
just galleries.
That code to change the output is an interesting solution. I hadn't
thought of that and it is clever, though it seems kind of hacky. Do you
know why the decision was made to stick a filter at the beginning of the
shortcode without one at the end? I would have thought that the end would
be the first place a filter would go, but then again, I didn't write it.
Sorry for my ignorance about code design.
Perhaps, considering the number of related tickets, it's worth considering
whether there is value in having a filter for adjusting the final output
of the gallery. Isn't that the way many other elements of core work?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/29832#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list