PluginProbe ʕ •ᴥ•ʔ
WP Popular Posts / 6.4.2
WP Popular Posts v6.4.2
4.0.8 4.0.9 4.1.0 4.1.1 4.1.2 4.2.0 4.2.1 4.2.2 5.0.0 5.0.1 5.0.2 5.1.0 5.2.0 5.2.1 5.2.2 5.2.3 5.2.4 5.3.0 5.3.1 5.3.2 5.3.3 5.3.4 5.3.5 5.3.6 5.4.0 5.4.1 5.4.2 5.5.0 5.5.1 6.0.0 6.0.1 6.0.2 6.0.3 6.0.4 6.0.5 6.1.0 6.1.1 6.1.2 6.1.3 6.1.4 6.2.0 6.2.1 6.3.0 6.3.1 6.3.2 6.3.3 6.3.4 6.4.0 6.4.1 6.4.2 7.0.0 7.0.1 7.1.0 7.2.0 7.3.0 7.3.1 7.3.2 7.3.3 7.3.4 7.3.5 7.3.6 7.3.7 7.3.8 7.4.0 trunk 2.3.7 3.0.0 3.0.1 3.0.2 3.0.3 3.1.0 3.1.1 3.2.0 3.2.1 3.2.2 3.2.3 3.3.0 3.3.1 3.3.2 3.3.3 3.3.4 4.0.0 4.0.1 4.0.10 4.0.11 4.0.12 4.0.13 4.0.2 4.0.3 4.0.5 4.0.6
wordpress-popular-posts / src / Rest / Controller.php
wordpress-popular-posts / src / Rest Last commit date
Controller.php 2 years ago Endpoint.php 2 years ago PostsEndpoint.php 2 years ago TaxonomiesEndpoint.php 2 years ago ThemesEndpoint.php 2 years ago ThumbnailsEndpoint.php 2 years ago ViewLoggerEndpoint.php 2 years ago WidgetEndpoint.php 2 years ago
Controller.php
97 lines
1 <?php
2 namespace WordPressPopularPosts\Rest;
3
4 class Controller {
5
6 /**
7 * Posts Endpoint.
8 *
9 * @var \WordPressPopularPosts\Rest\PostsEndpoint
10 * @access private
11 */
12 private $posts_endpoint;
13
14 /**
15 * View Logger Endpoint.
16 *
17 * @var \WordPressPopularPosts\Rest\ViewLoggerEndpoint
18 * @access private
19 */
20 private $view_logger_endpoint;
21
22 /**
23 * View Logger Endpoint.
24 *
25 * @var \WordPressPopularPosts\Rest\WidgetEndpoint
26 * @access private
27 */
28 private $widget_endpoint;
29
30 /**
31 * Themes Endpoint.
32 *
33 * @var \WordPressPopularPosts\Rest\ThemesEndpoint
34 * @access private
35 */
36 private $themes_endpoint;
37
38 /**
39 * Themes Endpoint.
40 *
41 * @var \WordPressPopularPosts\Rest\ThumbnailsEndpoint
42 * @access private
43 */
44 private $thumbnails_endpoint;
45
46 /**
47 * Themes Endpoint.
48 *
49 * @var \WordPressPopularPosts\Rest\TaxonomiesEndpoint
50 * @access private
51 */
52 private $taxonomies_endpoint;
53
54 /**
55 * Initialize class.
56 *
57 * @param \WordPressPopularPosts\Rest\PostsEndpoint
58 * @param \WordPressPopularPosts\Rest\ViewLoggerEndpoint
59 * @param \WordPressPopularPosts\Rest\WidgetEndpoint
60 * @param \WordPressPopularPosts\Rest\ThemesEndpoint
61 * @param \WordPressPopularPosts\Rest\ThumbnailsEndpoint
62 * @param \WordPressPopularPosts\Rest\TaxonomiesEndpoint
63 */
64 public function __construct(PostsEndpoint $posts_endpoint, ViewLoggerEndpoint $view_logger_endpoint, WidgetEndpoint $widget_endpoint, ThemesEndpoint $themes_endpoint, ThumbnailsEndpoint $thumbnails_endpoint, TaxonomiesEndpoint $taxonomies_endpoint)
65 {
66 $this->posts_endpoint = $posts_endpoint;
67 $this->view_logger_endpoint = $view_logger_endpoint;
68 $this->widget_endpoint = $widget_endpoint;
69 $this->themes_endpoint = $themes_endpoint;
70 $this->thumbnails_endpoint = $thumbnails_endpoint;
71 $this->taxonomies_endpoint = $taxonomies_endpoint;
72 }
73
74 /**
75 * WordPress hooks.
76 *
77 * @since 5.0.0
78 */
79 public function hooks()
80 {
81 add_action('rest_api_init', [$this, 'register_routes']);
82 }
83
84 /**
85 * Registers REST endpoints.
86 */
87 public function register_routes()
88 {
89 $this->posts_endpoint->register();
90 $this->view_logger_endpoint->register();
91 $this->widget_endpoint->register();
92 $this->themes_endpoint->register();
93 $this->thumbnails_endpoint->register();
94 $this->taxonomies_endpoint->register();
95 }
96 }
97