initial commit

This commit is contained in:
Jean michel SILONE 2024-03-06 18:06:47 +01:00
commit c7260db057
4 changed files with 52 additions and 0 deletions

22
lao-antispam.php Normal file
View file

@ -0,0 +1,22 @@
<?php
/**
* Plugin Name: LAgence 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: LAgence 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');

View 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
View file

@ -0,0 +1,2 @@
<?php
//nothing to see here

3
uninstall.php Normal file
View file

@ -0,0 +1,3 @@
<?php
if (!defined('WP_UNINSTALL_PLUGIN')) exit;