Created
May 28, 2015 08:43
-
-
Save thierrypigot/b54118ecaeefb0018371 to your computer and use it in GitHub Desktop.
WordPress : Shortcode antispam email - add file in wp-content/mu-plugins folder
This file contains hidden or 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 | |
| /** | |
| * Anti Spam Email | |
| * [email][email protected][/email] | |
| **/ | |
| function tp_hide_email_shortcode( $atts , $content = null ) | |
| { | |
| if ( ! is_email( $content ) ) { | |
| return; | |
| } | |
| return '<a href="mailto:' . antispambot( $content ) . '">' . antispambot( $content ) . '</a>'; | |
| } | |
| add_shortcode( 'email', 'tp_hide_email_shortcode' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment