PluginProbe
WebberZone Top 10 — Popular Posts / 4.5.2
WebberZone Top 10 — Popular Posts v4.5.2
4.5.2 4.5.1 4.5.0 4.4.3 4.4.2 4.4.1 4.4.0 4.3.4 4.3.3 4.3.2 4.3.1 4.3.0 trunk 1.0 1.0.1 1.1 1.2 1.3 1.4 1.4.1 1.5 1.5.1 1.5.2 1.5.3 1.6 All 118 releases
← All changes | includes/class-hook-loader.php +11 -1 4.3.1 → 4.5.2 View file →
@@ -54,9 +54,11 @@
54 54 */
55 55 private function register_init_hooks(): void {
56 56 Hook_Registry::add_action( 'init', array( $this, 'initiate_plugin' ) );
57 57 Hook_Registry::add_action( 'widgets_init', array( $this, 'register_widgets' ) );
58 - Hook_Registry::add_action( 'rest_api_init', array( $this, 'register_rest_routes' ) );
58 + if ( Feature_Manager::is_enabled( 'rest_api' ) ) {
59 + Hook_Registry::add_action( 'rest_api_init', array( $this, 'register_rest_routes' ) );
60 + }
59 61 Hook_Registry::add_action( 'parse_query', array( $this, 'parse_query' ) );
60 62 }
61 63
62 64 /**
@@ -83,8 +85,12 @@
83 85 *
84 86 * @since 3.3.0
85 87 */
86 88 public function register_widgets(): void {
89 + if ( ! Feature_Manager::is_enabled( 'legacy_widgets' ) ) {
90 + return;
91 + }
92 +
87 93 register_widget( '\WebberZone\Top_Ten\Frontend\Widgets\Posts_Widget' );
88 94 register_widget( '\WebberZone\Top_Ten\Frontend\Widgets\Count_Widget' );
89 95 }
90 96
@@ -93,8 +99,12 @@
93 99 *
94 100 * @since 3.0.0
95 101 */
96 102 public function register_rest_routes(): void {
103 + if ( ! Feature_Manager::is_enabled( 'rest_api' ) ) {
104 + return;
105 + }
106 +
97 107 $controller = new Frontend\REST_API();
98 108 $controller->register_routes();
99 109 }
100 110