[wp-trac] [WordPress Trac] #24846: Usage of a shortcode disables wpautop filter

WordPress Trac noreply at wordpress.org
Fri Aug 9 09:59:38 UTC 2013


#24846: Usage of a shortcode disables wpautop filter
--------------------------+----------------------
 Reporter:  Looimaster    |       Owner:
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  General       |     Version:  3.6
 Severity:  normal        |  Resolution:  invalid
 Keywords:                |
--------------------------+----------------------

Comment (by Looimaster):

 Here's the shortcode:

 {{{
 function symple_highlight_shortcode( $atts, $content = null ) {
         extract( shortcode_atts( array(
                 'color' => 'yellow',
                 'class' => '',
           ),
           $atts ) );
           return '<span class="symple-highlight symple-highlight-'. $color
 .' '. $class .'">' . do_shortcode( $content ) . '</span>';

 }
 add_shortcode('symple_highlight', 'symple_highlight_shortcode');
 }}}

 This creates a paragraph:

 {{{
 Some text. Some text. Some text. Some text. Some text. Some text. Some
 text.
 }}}

 This creates a paragraph:


 {{{
 Some text. Some text. Some text. [symple_highlight color="gray"]Some
 text[/symple_highlight]. Some text. Some text. Some text.
 }}}


 This doesn't create a paragraph:

 {{{
 [symple_highlight color="gray"]Some text[/symple_highlight]. Some text.
 Some text. Some text. Some text. Some text. Some text.
 }}}


 Please note that paragraph is actually created, but after the text:

 [[Image(http://gyazo.com/4c43312ad0ad083be4cc7ffe55df14c5.png)]]

--
Ticket URL: <http://core.trac.wordpress.org/ticket/24846#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list