• Hey everyone,

    Trying to do a very simple shortcode with content:

    function test_shortcode( $atts, $content = null ) {
    	return '<div class="testshortcode">' . $content . '</div>';
    }
    add_shortcode( 'test', 'test_shortcode' );

    When I use this in a post like so:

    “[test]this is some text

    and some more on a new line[/test]”

    The output contains bleeding <p> tags:

    <div class="entry-content">
    		<div class="test_shortcode">this is some text</p>
    <p>and some more on a new line</div>
    	</div><!-- .entry-content -->

    Note the bleeding </p> and <p> tags. I am using the default twentyfifteen theme with no other plugins or modifications of any kind.

    I have Google’d for hours and found a tonne of differing opinions on wpautop, but I can’t seem to find a conclusive answer. Can anyone shed some light on this issue?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Shortcode content left with bleeding tags?’ is closed to new replies.