forked from globalis-ms/multisite-clone-duplicator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
multisite-clone-duplicator.php
82 lines (67 loc) · 1.95 KB
/
multisite-clone-duplicator.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
<?php
/**
* Plugin Name: MultiSite Clone Duplicator
* Plugin URI: http://wordpress.org/plugins/multisite-clone-duplicator/
* Description: Clones an existing site into a new one in a multisite installation : copies all the posts, settings and files
* Author: Julien OGER, Pierre DARGHAM, David DAUGREILH, GLOBALIS media systems
* Author URI: https://github.com/globalis-ms/multisite-clone-duplicator
*
* Version: 1.5.3
* Requires at least: 4.0.0
* Tested up to: 5.0.0
*
* Network: true
*/
// Block direct requests
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
if ( ! class_exists( 'MUCD' ) ) {
// Load configuration
require_once realpath( dirname( __FILE__ ) ) . '/include/config.php';
// Plugin options
require_once MUCD_COMPLETE_PATH . '/include/option.php';
// Load textdomain
add_action(
'init',
function() {
load_plugin_textdomain( MUCD_DOMAIN, null, MUCD_PATH . '/language/' );
}
);
// Load language
require_once MUCD_COMPLETE_PATH . '/include/lang.php';
// Load Functions
require_once MUCD_COMPLETE_PATH . '/lib/functions.php';
if ( is_admin() ) {
require_once MUCD_COMPLETE_PATH . '/include/admin.php';
MUCD_Admin::hooks();
}
if ( defined( 'WP_CLI' ) && WP_CLI ) {
require_once MUCD_COMPLETE_PATH . '/lib/duplicate.php';
MUCD_Functions::set_locale_to_en_US();
require_once MUCD_COMPLETE_PATH . '/wp-cli/wp-cli-site-duplicate-subcommand.php';
}
/**
* Main class of the plugin
*/
class MUCD {
/**
* Plugin's version number
*/
const VERSION = '1.5.3';
/**
* Register hooks used by the plugin
*/
public static function hooks() {
register_activation_hook( __FILE__, array( __CLASS__, 'activate' ) );
add_action( 'admin_init', array( 'MUCD_Functions', 'check_if_multisite' ) );
}
/**
* What to do on plugin activation
*/
public static function activate() {
MUCD_Option::init_options();
}
}
MUCD::hooks();
}