WPIntell

Source evidence

do_shortcode

blueimp lightbox · support · 2014-09-02T15:49:00+00:00

complaintsentiment
mediumseverity
0.8relevance
4replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

6 / 25 rows with source links

24.0% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

19 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
goncalvesjpedro unresolved
When I use the do_shortcode to echo an gallery shortcode the images don’t open with blueimp lightbox. https://wordpress.org/plugins/blueimp-lightbox/ The lightbox plugin adds content filters for the_content , the_excerpt and post_gallery : https://plugins.trac.wordpress.org/browser/blueimp-lightbox/trunk/lib/class-blueimp-lightbox.php#L60 The content filter for post_gallery is supposed to filter the Gallery shortcode output, so I’m not sure what is preventing the filter in your case: http://codex.wordpress.org/Plugin_API/Filter_Reference/post_gallery I’m not sure if this is the issue, but you might need to add link="file" to the Gallery shortcode. Actually, the post_gallery filter is intended for plugin authors who want to completely replace the gallery shortcode functionality. If you look at the code , you can see that the filter is at the beginning of the function, and that you’re actually filtering an empty string. I definitely think there should be a filter at the end of the shortcode to amend a WP gallery, and I’m a bit surprised one doesn’t exist already. I went ahead and submitted this ticket to try to get it added to core. Until that ticket takes effect (if it ever does), I don’t think there’s a way to add your awesome lightbox to a standard WP gallery if it’s added outside the main post content area (aside from copying the entirety of the gallery_shortcode function), unless you can get it to work without having to rely on inline attributes on those image elements. I was wrong. As Sergey points out in the Trac ticket, there are a couple different ways to get the lightbox working without changes to core. Not necessarily elegant, but it can be done.

Comments

4 shown
blueimp 2014-09-02T22:19:00+00:00

The lightbox plugin adds content filters for the_content , the_excerpt and post_gallery : https://plugins.trac.wordpress.org/browser/blueimp-lightbox/trunk/lib/class-blueimp-lightbox.php#L60 The content filter for post_gallery is supposed to filter the Gallery shortcode output, so I’m not sure what is preventing the filter in your case: http://codex.wordpress.org/Plugin_API/Filter_Reference/post_gallery

blueimp 2014-09-04T20:07:00+00:00

I’m not sure if this is the issue, but you might need to add link="file" to the Gallery shortcode.

David 2014-10-02T13:13:00+00:00

Actually, the post_gallery filter is intended for plugin authors who want to completely replace the gallery shortcode functionality. If you look at the code , you can see that the filter is at the beginning of the function, and that you’re actually filtering an empty string. I definitely think there should be a filter at the end of the shortcode to amend a WP gallery, and I’m a bit surprised one doesn’t exist already. I went ahead and submitted this ticket to try to get it added to core. Until that ticket takes effect (if it ever does), I don’t think there’s a way to add your awesome lightbox to a standard WP gallery if it’s added outside the main post content area (aside from copying the entirety of the gallery_shortcode function), unless you can get it to work without having to rely on inline attributes on those image elements.

David 2014-10-02T14:19:00+00:00

I was wrong. As Sergey points out in the Trac ticket, there are a couple different ways to get the lightbox working without changes to core. Not necessarily elegant, but it can be done.