-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathinstance.php
More file actions
43 lines (34 loc) · 771 Bytes
/
instance.php
File metadata and controls
43 lines (34 loc) · 771 Bytes
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
<?php
/**
* Instantiates the Cloudinary plugin
*
* @package Cloudinary
*/
namespace Cloudinary;
global $cloudinary_plugin;
require_once __DIR__ . '/php/class-plugin.php';
$cloudinary_plugin = new Plugin();
/**
* Cloudinary Plugin Instance
*
* @return Plugin
*/
function get_plugin_instance() {
global $cloudinary_plugin;
return $cloudinary_plugin;
}
/**
* Get an instance of the CLI Class.
*/
function cloudinary_cli_instance() {
if ( class_exists( '\WPCOM_VIP_CLI_Command' ) ) {
return new CLI_VIP();
}
return new CLI();
}
if ( defined( 'WP_CLI' ) && WP_CLI ) {
$plugin_instance = get_plugin_instance();
$cli = cloudinary_cli_instance();
$cli->setup_cloudinary( $plugin_instance );
\WP_CLI::add_command( 'cloudinary', $cli );
}