[wp-trac] [WordPress Trac] #29832: Add filter to final output of gallery_shortcode

WordPress Trac noreply at wordpress.org
Thu Oct 2 12:50:36 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       |   Keywords:
  Focuses:  template     |
-------------------------+-----------------------------
 This is similar to [#26623] but a lot simpler.

 The attached patch adds a "gallery_content" filter to the end of the
 gallery shortcode.

 It would be nice if the gallery shortcode had an available filter at the
 end, before the shortcode output was returned. This would be similar to
 the "the_content" filter, but just for a gallery.

 I am currently trying to use a [https://wordpress.org/plugins/blueimp-
 lightbox/ lightbox plugin] on a gallery, but it needs to insert an extra
 attribute onto the image links. It currently utilizes the "the_content"
 filter and works well on galleries added to the main content of a post.

 However, I am trying run the gallery shortcode outside the main content,
 so the plugin doesn't work. As far as I can tell, the plugin author
 doesn't have a way to get his lightbox to work on galleries added outside
 the main content or excerpt.

 I can understand why the "post_gallery" filter is called so soon, for devs
 who want to completely replace the functionality of this shortcode. I
 don't want to replace it, nor do I want the lightbox plugin to replace
 it... I want to use the standard Wordpress gallery, but with that
 particular lightbox functionality added to it. This patch would allow
 that.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/29832>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list