Shortcodes: Return different based on atts
I have the following shortcode for pullquotes:
//Pullquote shortcode
function pullQuotes($atts, $content = null) {
extract(shortcode_atts(array(
"author" => ''
), $atts));
return '<blockquote>'.$content.'<p class="quote-author">' . $author .
'</p> </blockquote>';
}
add_shortcode("pullquote", "pullQuotes");
Basically I dont want the paragraph containing the $author attribute to be
returned if there is no author set (ie: the default '' value).
Any ideas?
No comments:
Post a Comment