Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathinstance.php
More file actions
Latest commit
43 lines (34 loc) · 771 Bytes
/
Copy pathinstance.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
*/
namespaceCloudinary;
global$cloudinary_plugin;
require_once__DIR__ . '/php/class-plugin.php';
$cloudinary_plugin = newPlugin();
/**
* Cloudinary Plugin Instance
*
* @return Plugin
*/
functionget_plugin_instance() {
global$cloudinary_plugin;
return$cloudinary_plugin;
}
/**
* Get an instance of the CLI Class.
*/
functioncloudinary_cli_instance() {
if ( class_exists( '\WPCOM_VIP_CLI_Command' ) ) {
returnnewCLI_VIP();
}
returnnewCLI();
}
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 );
}