forked from BoldGrid/w3-total-cache
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathExtension_ImageService_Plugin.php
95 lines (84 loc) · 1.44 KB
/
Extension_ImageService_Plugin.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
83
84
85
86
87
88
89
90
91
92
93
94
95
<?php
/**
* File: Extension_ImageService_Plugin.php
*
* @since 2.2.0
*
* @package W3TC
*
* phpcs:disable WordPress.WP.CronInterval
*/
namespace W3TC;
if ( ! defined( 'W3TC' ) ) {
die();
}
/**
* Extension_ImageService_Plugin
*
* @since 2.2.0
*/
class Extension_ImageService_Plugin {
/**
* Image Service API object.
*
* @since 2.2.0
*
* @static
*
* @var Extension_ImageService_Api
*/
public static $api;
/**
* Add hooks.
*
* @since 2.2.0
* @static
*/
public static function wp_loaded() {
add_action(
'w3tc_extension_load_admin',
array(
'\W3TC\Extension_ImageService_Plugin_Admin',
'w3tc_extension_load_admin',
)
);
// Cron event handling.
require_once __DIR__ . '/Extension_ImageService_Cron.php';
add_action(
'w3tc_imageservice_cron',
array(
'\W3TC\Extension_ImageService_Cron',
'run',
)
);
add_filter(
'cron_schedules',
array(
'\W3TC\Extension_ImageService_Cron',
'add_schedule',
)
);
Extension_ImageService_Cron::add_cron();
}
/**
* Get the Image Service API object.
*
* @since 2.2.0
*
* @return Extension_ImageService_Api
*/
public static function get_api() {
if ( is_null( self::$api ) ) {
require_once __DIR__ . '/Extension_ImageService_Api.php';
self::$api = new Extension_ImageService_Api();
}
return self::$api;
}
}
w3tc_add_action(
'wp_loaded',
array(
'\W3TC\Extension_ImageService_Plugin',
'wp_loaded',
)
);