-
Notifications
You must be signed in to change notification settings - Fork 0
/
gravitywp-gview-email-verification-autofill.php
59 lines (53 loc) · 1.4 KB
/
gravitywp-gview-email-verification-autofill.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
55
56
57
58
59
<?php
/**
* Plugin Name: GravityWP - Email Verification Autofill
* Plugin URI: http://gravitywp.com/
* Description: Autofill email verification field when loading the form on the front end (editing entry with Gravity View shortcode).
* Version: 1.0.0
* Author: GravityWP
* Author URI: http://gravitywp.com/
* License: GPLv2 or later
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/
/**
* Class GravityWP_Email_Verfication_Autofill
* @todo revision date merge tag
*/
class GravityWP_Email_Verfication_Autofill {
/**
* Instantiate the class
*
* @since 1.0.0
*/
public static function load() {
if ( ! did_action( 'gravitywp_email_verification_autofill_loaded' ) ) {
new self;
do_action( 'gravitywp_email_verification_autofill_loaded' );
}
}
/**
* GravityWP_Email_Verfication_Autofill constructor.
*
* @since 1.0.0
*/
private function __construct() {
$this->add_hooks();
}
/**
* Add hooks on the single entry screen
*
* @since 1.0.0
*/
private function add_hooks() {
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
}
/**
* Enqueue JS scripts
*
* @since 1.0.0
*/
public function enqueue_scripts() {
wp_enqueue_script( 'gravitywp_email_verification_autofill', plugins_url( '/js/scripts.js', __FILE__ ), array( 'jquery' ), '1.0.0', true );
}
}
add_action( 'gform_loaded', array( 'GravityWP_Email_Verfication_Autofill', 'load' ) );