I have a fairly straight forward shortcode for making a quote breakout box which is called as:WordPress的汽提<a href> from shortcodes
[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.
加入 $ quote = apply_filters('the_content',$ quote) ; 到短代碼功能似乎沒有工作,這似乎很奇怪。它似乎是專門挑選標籤而沒有別的。 – artparks