[wp-trac] [WordPress Trac] #22127: strange behaviour with shortcode with the_content filter

WordPress Trac wp-trac at lists.automattic.com
Mon Oct 8 11:04:01 UTC 2012


#22127: strange behaviour with shortcode with the_content filter
-----------------------------+--------------------------
 Reporter:  thomask          |       Type:  defect (bug)
   Status:  new              |   Priority:  normal
Milestone:  Awaiting Review  |  Component:  Shortcodes
  Version:  3.4.2            |   Severity:  normal
 Keywords:                   |
-----------------------------+--------------------------
 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.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/22127>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list