I'm working on a basic plugin that adds shortcodes for columns, buttons, panels, ect. Nothing new here. I haven't altered wpautop in anyway; I've tried removing it and delaying it - no change. What happens with all shortcodes used is, the first paragraph isn't wrapped within a p tag (the p tags are actually appearing directly after the first paragraph and empty), but all paragraphs after the first within the same shortcode ARE wrapped in p tags. I need to figure out WHY the first paragraph isn't being wrapped.
Function:
function vc_shortcode_panel($atts, $content = null) {
extract( shortcode_atts( array(
'type' => ''
), $atts) );
return '<div class="panel ' . $type . '">' . do_shortcode( trim($content) ) . '</div>';
}
add_shortcode('panel', 'vc_shortcode_panel');
Shortcode:
[panel type=""]paragraph 1
paragraph 2[/panel]
Output looks like this:
<div class="panel">
paragraph 1
<p></p>
<p>paragraph 2</p>
</div>
I know if I add a line break between the [panel] and the first paragraph, it will then wrap that first paragraph in a p tag. But shouldn't shortcodes be able to be formatted correctly without requiring that line break? What am I doing wrong and can anyone tell me why this is happening?