forked from stuttter/wp-user-signups
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wp-user-signups.php
103 lines (89 loc) · 2.37 KB
/
wp-user-signups.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<?php
/**
* Plugin Name: WP Signups
* Plugin URI: https://wordpress.org/plugins/wp-user-signups/
* Author: John James Jacoby
* Author URI: https://profiles.wordpress.org/johnjamesjacoby/
* License: GPLv2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Description: Signup management for WordPress
* Version: 4.0.0
* Text Domain: wp-signups
* Domain Path: /wp-user-signups/assets/languages/
*/
// Exit if accessed directly
defined( 'ABSPATH' ) || exit;
// Bail if core already supports this
if ( class_exists( 'WP_Signup' ) ) {
return;
}
// Execute immediately
_wp_signups();
/**
* Include the required files
*
* @since 1.0.0
*/
function _wp_signups() {
// Get the plugin path
$plugin_path = wp_signups_get_plugin_path();
// Classes
require_once $plugin_path . 'includes/classes/class-wp-db-table.php';
require_once $plugin_path . 'includes/classes/class-wp-db-table-signups.php';
require_once $plugin_path . 'includes/classes/class-wp-db-table-signupmeta.php';
require_once $plugin_path . 'includes/classes/class-wp-signup.php';
require_once $plugin_path . 'includes/classes/class-wp-signup-query.php';
// Required Files
require_once $plugin_path . 'includes/functions/admin.php';
require_once $plugin_path . 'includes/functions/assets.php';
require_once $plugin_path . 'includes/functions/cache.php';
require_once $plugin_path . 'includes/functions/common.php';
require_once $plugin_path . 'includes/functions/capabilities.php';
require_once $plugin_path . 'includes/functions/metadata.php';
require_once $plugin_path . 'includes/functions/hooks.php';
// Tables
new WP_DB_Table_Signups();
new WP_DB_Table_Signupmeta();
// Ensure cache is shared
wp_cache_add_global_groups( array( 'signups', 'signupmeta' ) );
}
/**
* Return the plugin root file
*
* @since 1.0.0
*
* @return string
*/
function wp_signups_get_plugin_file() {
return __FILE__;
}
/**
* Return the plugin path
*
* @since 1.0.0
*
* @return string
*/
function wp_signups_get_plugin_path() {
return plugin_dir_path( __FILE__ ) . 'wp-signups/';
}
/**
* Return the plugin URL
*
* @since 1.0.0
*
* @return string
*/
function wp_signups_get_plugin_url() {
return plugin_dir_url( wp_signups_get_plugin_file() ) . 'wp-signups/';
}
/**
* Return the asset version
*
* @since 1.0.0
*
* @return int
*/
function wp_signups_get_asset_version() {
return 201704110001;
}