initial commit
This commit is contained in:
commit
c7260db057
4 changed files with 52 additions and 0 deletions
22
lao-antispam.php
Normal file
22
lao-antispam.php
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Plugin Name: L’Agence Oueb antispam
|
||||||
|
* Plugin URI: https://lagenceoueb.tech
|
||||||
|
* Description: Shortcode to protect mail from spambots. To use this in your WordPress Content area all you have to do it wrap it in a short code.[email]john.doe@mysite.com[/email]
|
||||||
|
* Author: L’Agence Oueb
|
||||||
|
* Author URI: https://lagenceoueb.com
|
||||||
|
* Text Domain: lao-anti-spam
|
||||||
|
* Domain Path: /languages
|
||||||
|
* Version: 0.9.0
|
||||||
|
*
|
||||||
|
* @package Lao_Antispam
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
if (!defined('ABSPATH')) exit;
|
||||||
|
|
||||||
|
require_once ('src/class-Hide-Email-Shortcode.php');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
25
src/class-Hide-Email-Shortcode.php
Normal file
25
src/class-Hide-Email-Shortcode.php
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
class Hide_Email_Shortcode
|
||||||
|
{
|
||||||
|
|
||||||
|
function __construct() {
|
||||||
|
add_shortcode( 'email', array($this,'hide_email_shortcode' ));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Undocumented function
|
||||||
|
*
|
||||||
|
* @param string $atts
|
||||||
|
* @param string $content
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function hide_email_shortcode( $atts , $content = null ) {
|
||||||
|
if ( ! is_email( $content ) ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
return '<a href="' . esc_url('mailto:' . antispambot( $content ) ) . '">' . esc_html( antispambot( $content ) ) . '</a>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
new Hide_Email_Shortcode();
|
||||||
2
src/index.php
Normal file
2
src/index.php
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
<?php
|
||||||
|
//nothing to see here
|
||||||
3
uninstall.php
Normal file
3
uninstall.php
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
if (!defined('WP_UNINSTALL_PLUGIN')) exit;
|
||||||
Loading…
Add table
editor.link_modal.header
Reference in a new issue