WordPress.org

Make WordPress Core

Opened 19 months ago

Last modified 19 months ago

#22127 new defect (bug)

strange behaviour with shortcode with the_content filter

Reported by: thomask Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 3.4.2
Component: Shortcodes Keywords:
Focuses: Cc:

Description

let's say i have installed any lightbox/thickbox/... plugin (same behaviour with 'auto thickbox plus', 'lightview plus', 'jquery lightbox', 'fancybox plus', 'wp jquery lightbox' ...) and i have a shortcode, which uses the_content filter, e.g.

function test_shortcode( $atts, $content = null ) {
   return apply_filters('the_content', $content);
}
add_shortcode( 'test', 'test_shortcode' );

then if i use [test] shortcode anywhere in the post, the lightbox does not work. e.g.

[test]test[/test]

[caption ... /] // this is standard image

if the shortcode do not have the_content filter, or the shortcode is not use anywhere in the post, or i put the 'lightbox' etc. class to [a] directly than it works as a charm.

There may be a bug in the lightbox plugins, but it is strange, that it is in ALL lightbox plugins.

But even in that case for me it is very strange, that something what is INSIDE the shortcode affects OUTSIDE of the shortcode. That's why i think it is a bug of core.

Change History (1)

comment:1 SergeyBiryukov19 months ago

Possibly related: #19749

Note: See TracTickets for help on using tickets.