Permalink
Browse files

support attributes on safe_email shortcode

  • Loading branch information...
1 parent b724b01 commit f6e582abaae6a9e93259285fadda570595a61f69 @willnorris committed May 18, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 functions.php
View
@@ -342,7 +342,13 @@ function pdx_modernizr_no_js($attributes) {
* Handle 'safe_email' shortcode which converts email address into spambot-safe link.
*/
function pdx_safe_email($atts, $content=null) {
- return '<a href="mailto:' . antispambot($content) . '">' . antispambot($content) . '</a>';
+ $attr = '';
+ foreach($atts as $k => $v) {
+ if ($v) {
+ $attr .= ' ' . $k . '="' . esc_attr($v) .'"';
+ }
+ }
+ return '<a' . $attr . ' href="mailto:' . antispambot($content) . '">' . antispambot($content) . '</a>';
}
add_shortcode('safe_email', 'pdx_safe_email');

0 comments on commit f6e582a

Please sign in to comment.