forked from cloudinary/cloudinary_wordpress
-
Notifications
You must be signed in to change notification settings - Fork 0
/
instance.php
45 lines (35 loc) · 846 Bytes
/
instance.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
<?php
/**
* Instantiates the Cloudinary plugin
*
* @package Cloudinary
*/
namespace Cloudinary;
global $cloudinary_plugin;
define( 'CLDN_ASSET_DEBUG', ! defined( 'DEBUG_SCRIPTS' ) ? '.min' : '' );
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 );
}