Subscriber.php
721 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
44
45
<?php
namespace WP_Rocket\Engine\Support;
use WP_Rocket\Event_Management\Subscriber_Interface;
class Subscriber implements Subscriber_Interface {
/**
* Rest instance
*
* @var Rest
*/
private $rest;
/**
* Instantiate the class
*
* @param Rest $rest Rest instance.
*/
public function __construct( Rest $rest ) {
$this->rest = $rest;
}
/**
* Events this subscriber listens to.
*
* @return array
*/
public static function get_subscribed_events() {
return [
'rest_api_init' => 'register_support_route',
];
}
/**
* Registers the rest support route
*
* @since 3.7.5
*
* @return void
*/
public function register_support_route() {
$this->rest->register_route();
}
}