-
Notifications
You must be signed in to change notification settings - Fork 0
/
autoclose.php
147 lines (127 loc) · 3.71 KB
/
autoclose.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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<?php
/**
* Auto-Close Comments, Pingbacks and Trackbacks
*
* Automatically close Comments, Pingbacks and Trackbacks. Manage and delete revisions.
*
* @package AutoClose
* @author Ajay D'Souza
* @license GPL-2.0+
* @link https://webberzone.com/
* @copyright 2008-2022 Ajay D'Souza
*
* @wordpress-plugin
* Plugin Name: Auto-Close Comments, Pingbacks and Trackbacks
* Plugin URI: https://webberzone.com/plugins/autoclose/
* Description: Automatically close Comments, Pingbacks and Trackbacks. Manage and delete revisions.
* Version: 2.2.0
* Author: Ajay D'Souza
* Author URI: https://webberzone.com/
* Text Domain: autoclose
* License: GPL-2.0+
* License URI: https://www.gnu.org/licenses/gpl-2.0.txt
* Domain Path: /languages
* GitHub Plugin URI: https://github.com/ajaydsouza/autoclose/
*/
// If this file is called directly, then abort execution.
if ( ! defined( 'WPINC' ) ) {
die( "Aren't you supposed to come here via WP-Admin?" );
}
/**
* Holds the AutoClose plugin version
*
* @since 2.2.0
*
* @var string Plugin version
*/
if ( ! defined( 'ACC_PLUGIN_VERSION' ) ) {
define( 'ACC_PLUGIN_VERSION', '2.2.0' );
}
/**
* Holds the filesystem directory path (with trailing slash) for AutoClose
*
* @since 2.0.0
*
* @var string Plugin folder path
*/
if ( ! defined( 'ACC_PLUGIN_DIR' ) ) {
define( 'ACC_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
}
/**
* Holds the filesystem directory path (with trailing slash) for AutoClose
*
* @since 2.0.0
*
* @var string Plugin folder URL
*/
if ( ! defined( 'ACC_PLUGIN_URL' ) ) {
define( 'ACC_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
}
/**
* Holds the filesystem directory path (with trailing slash) for AutoClose
*
* @since 2.0.0
*
* @var string Plugin Root File
*/
if ( ! defined( 'ACC_PLUGIN_FILE' ) ) {
define( 'ACC_PLUGIN_FILE', __FILE__ );
}
/*
*---------------------------------------------------------------------------*
* AutoClose modules
*---------------------------------------------------------------------------*
*/
require_once ACC_PLUGIN_DIR . 'includes/admin/class-settings-api.php';
require_once ACC_PLUGIN_DIR . 'includes/admin/class-autoclose-settings.php';
require_once ACC_PLUGIN_DIR . 'includes/admin/options-api.php';
require_once ACC_PLUGIN_DIR . 'includes/activation.php';
require_once ACC_PLUGIN_DIR . 'includes/main.php';
require_once ACC_PLUGIN_DIR . 'includes/comments.php';
require_once ACC_PLUGIN_DIR . 'includes/revisions.php';
require_once ACC_PLUGIN_DIR . 'includes/cron.php';
require_once ACC_PLUGIN_DIR . 'includes/l10n.php';
require_once ACC_PLUGIN_DIR . 'includes/helpers.php';
/*
*---------------------------------------------------------------------------*
* Dashboard and Administrative Functionality
*---------------------------------------------------------------------------*
*/
if ( is_admin() || ( defined( 'WP_CLI' ) && WP_CLI ) ) {
require_once ACC_PLUGIN_DIR . 'includes/admin/tools-page.php';
}
/*
*---------------------------------------------------------------------------*
* Deprecated functions
*---------------------------------------------------------------------------*
*/
require_once ACC_PLUGIN_DIR . 'includes/deprecated.php';
/**
* Get Settings.
*
* Retrieves all plugin settings
*
* @since 2.0.0
* @return array AutoClose settings
*/
function acc_get_settings() {
$settings = get_option( 'acc_settings', acc_settings_defaults() );
/**
* Settings array
*
* Retrieves all plugin settings
*
* @since 2.0.0
* @param array $settings Settings array
*/
return apply_filters( 'acc_get_settings', $settings );
}
/**
* Global variable holding the current settings for AutoClose
*
* @since 2.0.0
*
* @var array
*/
global $acc_settings;
$acc_settings = acc_get_settings();