| @@ -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 | /** |
| @@ -97,8 +99,12 @@ | ||
| 97 | 99 | * |
| 98 | 100 | * @since 3.0.0 |
| 99 | 101 | */ |
| 100 | 102 | public function register_rest_routes(): void { |
| 103 | + if ( ! Feature_Manager::is_enabled( 'rest_api' ) ) { | |
| 104 | + return; | |
| 105 | + } | |
| 106 | + | |
| 101 | 107 | $controller = new Frontend\REST_API(); |
| 102 | 108 | $controller->register_routes(); |
| 103 | 109 | } |
| 104 | 110 | |