Created
July 5, 2016 20:26
-
-
Save FriendlyWP/8975567aafb3c1115e88db98c124c75f to your computer and use it in GitHub Desktop.
Shortcode to insert non-breaking spaces in WordPress content
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//[nbsp] shortcode | |
add_shortcode( 'nbsp', 'nbsp_shortcode' ); | |
function nbsp_shortcode( $atts, $content = null ) { | |
$a = shortcode_atts( array( | |
'num' => 1, | |
), $atts ); | |
$content = str_repeat(' ', $a['num']); | |
return $content; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment