-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathclassicpress-directory-integration.php
executable file
·66 lines (54 loc) · 2.29 KB
/
classicpress-directory-integration.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
<?php
/**
* -----------------------------------------------------------------------------
* Plugin Name: ClassicPress Directory Integration
* Description: Install and update plugins and themes from ClassicPress directory.
* Version: 1.1.0
* Author: ClassicPress Contributors
* Author URI: https://www.classicpress.net
* Plugin URI: https://www.classicpress.net
* Text Domain: classicpress-directory-integration
* Domain Path: /languages
* Requires PHP: 7.4
* Requires CP: 2.0
* -----------------------------------------------------------------------------
* This is free software released under the terms of the General Public License,
* version 2, or later. It is distributed WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Full
* text of the license is available at https://www.gnu.org/licenses/gpl-2.0.txt.
* -----------------------------------------------------------------------------
*/
// Declare the namespace.
namespace ClassicPress\Directory;
// Prevent direct access.
if (!defined('ABSPATH')) {
die();
}
const DB_VERSION = 1;
// Load non namespaced constants and functions
require_once 'includes/constants.php';
require_once 'includes/functions.php';
// Load Helpers trait.
require_once 'classes/Helpers.trait.php';
// Load Plugin Update functionality class.
require_once 'classes/PluginUpdate.class.php';
$plugin_update = new PluginUpdate();
// Load Plugin Install functionality class.
require_once 'classes/PluginInstall.class.php';
$plugin_install = new PluginInstall();
// Load Theme Update functionality class.
require_once 'classes/ThemeUpdate.class.php';
$theme_update = new ThemeUpdate();
// Load Theme Install functionality class.
require_once 'classes/ThemeInstall.class.php';
$theme_install = new ThemeInstall();
// Register text domain
function register_text_domain() {
load_plugin_textdomain('classicpress-directory-integration', false, dirname(plugin_basename(__FILE__)).'/languages');
}
add_action('plugins_loaded', '\ClassicPress\Directory\register_text_domain');
// Add commands to WP-CLI
require_once 'classes/WPCLI.class.php';
if (defined('WP_CLI') && WP_CLI) {
\WP_CLI::add_command('cpdi', '\ClassicPress\Directory\CPDICLI');
}