I have a fairly straight forward shortcode for making a quote breakout box which is called as:
[jasminesays quote="blah de blah"]
Dead easy. However when I try and put a link inside it wordpress won’t return the quote at all. All other HTML that I’ve tried seems fine, it only seems to fall over with something like:
[jasminesays quote="blah <a href="#">de</a> blah"]
Something like
[jasminesays quote="blah <p>de</p> blah"]
works fine.
The code to process the shortcode is:
function mm_jasmineSays( $atts ) {
extract( shortcode_atts( array(
"quote" => '',
), $atts ) );
return '<link href="'.get_bloginfo( 'template_directory' ).'/css/shortcodes.css" rel="stylesheet" type="text/css" />
<div class="jasmine-says">
<h2>Jasmine says...</h2>
<div class="jasmine-says-quote">
<p><img src="'.get_bloginfo( 'template_directory' ).'/imgs/shortcodes/quote-1.jpg" /></p>
<p class="quote">'.$quote.'</p>
<p><img src="'.get_bloginfo( 'template_directory' ).'/imgs/shortcodes/quote-2.jpg" /></p>
</div>
</div>';
}
add_shortcode('jasminesays', 'mm_jasmineSays');
but I don’t think this is the problem, I’m guessing wordpress is filtering certain things out somewhere and I need to disable this. Anyone have any ideas?
Thanks for any help.
From WordPress Codex
Not sure if this will help, but have you tried changing the outer quotes to single quotes?
or removing the inner quotes?
why not adding the url option to the shortcode?
Something like adding:
And then adding
Maybe it could work..
or using the $output instead return like: