Skip to content

Instantly share code, notes, and snippets.

@szbl
Created August 21, 2014 18:56
Show Gist options
  • Save szbl/09e069e75e2e5ed9a8c6 to your computer and use it in GitHub Desktop.
Save szbl/09e069e75e2e5ed9a8c6 to your computer and use it in GitHub Desktop.
<?php
add_shortcode( 'format_test', 'test_shortcode' );
function test_shortcode( $atts )
{
// ignore $atts
return "<div class='test'>This\ntext\n\nshould all appear\n\n\n\non one line if shortcode output is untouched.</div>";
}
@szbl
Copy link
Author

szbl commented Aug 21, 2014

The output should always be:

<div class="test">This
text

should all appear



on one line if shortcode output is untouched.</div>

With the disable formatting un-checked, you start to get:

<div class="test">This<br>
text<p></p>
<p>should all appear</p>
<p>on one line if shortcode output is untouched.</p></div>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment