title: p tag formatting in shortcode's content wordpress
body: <p>I know this must have been asked a hundred times but I've been trying out a number of solutions I could find but none seem to work.</p>
  
  <p>I have a <code>shortcode</code> that wraps content:</p>
  
  <pre><code>[important_note]Lorem ipsum dolor sit amet, consectetur adipiscing elit.
  
  Nam vel velit at ex congue aliquet.[/important_note]
  </code></pre>
  
  <p>I'm using the following shortcode function in <code>functions.php</code>:</p>
  
  <pre><code>function important_note( $atts, $content = null ) {
      return '&lt;div class="imp-note"&gt;'.$content.'&lt;/div&gt;';
  }
  add_shortcode("important_note", "important_note");
  </code></pre>
  
  <p>This is the resulting html code:</p>
  
  <pre><code>&lt;div class="imp-note"&gt;
      Lorem ipsum dolor sit amet, consectetur adipiscing elit.
      &lt;p&gt;&lt;/p&gt;
      &lt;p&gt;Nam vel velit at ex congue aliquet.&lt;/p&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>The main issue is the empty <code>&lt;p&gt;</code> which I've been trying to solve using these solutions mentioned here: <a href="https://stackoverflow.com/questions/13510131/remove-empty-p-tags-from-wordpress-shortcodes-via-a-php-functon">remove empty &lt;p&gt; tags from wordpress shortcodes via a php functon</a> and on <a href="https://gist.github.com/maxxscho/2058547" rel="nofollow noreferrer">Github</a> however this seems to solve <code>&lt;p&gt;</code> wrapping the <code>shortcode</code> not the content of the <code>shortcode</code>.</p>
  
  <p>Having the first line without any <code>&lt;p&gt;</code> wrapping is a bit odd as well which makes me thinking that I should add code to the shortcode function?</p>
  
  <p>Thanks in advance for any help.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Ok so this bit of code looks like it does the trick:</p>
  
  <pre><code>remove_filter( 'the_content', 'wpautop' );
  add_filter( 'the_content', 'wpautop' , 99);
  add_filter( 'the_content', 'shortcode_unautop',100 );
  </code></pre>
  
  <p>As seen here: <a href="https://stackoverflow.com/a/21460343/1275525">https://stackoverflow.com/a/21460343/1275525</a> and here: <a href="http://www.paulund.co.uk/remove-line-breaks-in-shortcodes" rel="nofollow noreferrer">http://www.paulund.co.uk/remove-line-breaks-in-shortcodes</a> (<strong>Removing wpautop() To Content Only In Shortcodes</strong>)</p>
  
  <p><strong>AND</strong> the content in the shortcode must be like this not as I've shown above:</p>
  
  <pre><code>[important_note]
  Lorem ipsum dolor sit amet, consectetur adipiscing elit.
  Nam vel velit at ex congue aliquet.
  [/important_note]
  </code></pre>
  
  <p>Content is separate from the shortcode tags. That shortcode outputts the following html:</p>
  
  <pre><code>&lt;div class="imp-note"&gt;
      &lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit.&lt;/p&gt;
      &lt;p&gt;Nam vel velit at ex congue aliquet.&lt;/p&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Will confirm if it works on all shortcodes...</p>