-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathwp-user-signups.php
109 lines (95 loc) · 2.62 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
104
105
106
107
108
109
<?php
/**
* Plugin Name: WP Signups
* Description: Signup management for WordPress
* Plugin URI: https://wordpress.org/plugins/wp-user-signups/
* Author: Triple J Software, Inc.
* Author URI: https://jjj.software
* License: GPLv2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: wp-user-signups
* Domain Path: /wp-user-signups/assets/languages
* Requires at least: 5.2
* Requires PHP: 7.2
* Tested up to: 5.8
* Version: 5.0.2
*/
// 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/sponsor.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-user-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-user-signups/';
}
/**
* Return the asset version
*
* @since 1.0.0
*
* @return int
*/
function wp_signups_get_asset_version() {
return defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG
? time()
: 202105290001;
}