-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathgf-emailblacklist.php
54 lines (47 loc) · 1.41 KB
/
gf-emailblacklist.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
/**
* Plugin Name: Gravity Forms Email Blacklist
* Plugin URI: https://wordpress.org/plugins/gravity-forms-email-blacklist/
* Description: This plugin adds the ability to set a blacklist of domains on the email field in gravity forms.
* Version: 2.5.6
* Author: CrossPeak Software
* Author URI: https://www.crosspeaksoftware.com/
* Text Domain: gravity-forms-email-blacklist
* Domain Path: /languages
*
* @package GFEmailBlacklist
*/
defined( 'ABSPATH' ) || exit;
add_action( 'gform_loaded', array( 'GFEmailBlacklist_Bootstrap', 'load' ), 5 );
/**
* Gravity Forms Bootstrap class to load the Add-On library and new class.
*/
class GFEmailBlacklist_Bootstrap {
/**
* Load the Add-On class after checking for the frame work.
*/
public static function load() {
if ( ! method_exists( 'GFForms', 'include_addon_framework' ) ) {
return;
}
require_once 'includes/class-gfemailblacklist.php';
GFAddOn::register( 'GFEmailBlacklist' );
}
}
/**
* Init the class.
*
* @return object Return the instance of the Add-On class.
*/
function gf_email_blacklist_addon() {
return GFEmailBlacklist::get_instance();
}
/**
* Load plugin textdomain for localization.
*
* @return void
*/
function gf_email_blacklist_plugin_textdomain() {
load_plugin_textdomain( 'gravity-forms-email-blacklist', false, basename( dirname( __FILE__ ) ) . '/languages/' );
}
add_action( 'init', 'gf_email_blacklist_plugin_textdomain' );