Created
April 20, 2010 01:00
-
-
Save felipelavinz/371875 to your computer and use it in GitHub Desktop.
A simple plugin to use WordPress' antispambot() function in posts and pages
This file contains 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
<?php | |
/* | |
Plugin Name: Antispambot Shortcode | |
Plugin URI: http://yukei.net/proyectos/nospam-sc | |
Description: A simple plugin to use WordPress' antispambot() function in posts and pages | |
Version: 1.0 | |
Author: Felipe Lavin Z. | |
Author URI: http://www.yukei.net | |
*/ | |
function antispambot_sc($atts, $content = ''){ | |
extract(shortcode_atts(array( | |
'email' => '', | |
'link' => '' | |
), $atts)); | |
if ( empty($link) ) { | |
$out = '<a href="mailto:'. antispambot($email) .'">'. antispambot($email) .'</a>'; | |
} else { | |
$out = '<a href="mailto:'. antispambot($email) .'">'. $link .'</a>'; | |
} | |
return $out; | |
} | |
add_shortcode('antispambot', 'antispambot_sc'); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment