menu_slug = 'cartflows'; $this->initialize_hooks(); } /** * Init Hooks. * * @since 1.0.0 * @return void */ public function initialize_hooks() { // REST API extensions init. add_action( 'rest_api_init', array( $this, 'register_routes' ) ); } /** * Register API routes. */ public function register_routes() { $controllers = array( 'CartflowsAdmin\AdminCore\Api\Flows', 'CartflowsAdmin\AdminCore\Api\FlowData', 'CartflowsAdmin\AdminCore\Api\StepData', 'CartflowsAdmin\AdminCore\Api\CommonSettings', 'CartflowsAdmin\AdminCore\Api\HomePage', 'CartflowsAdmin\AdminCore\Api\Product\ProductData', ); foreach ( $controllers as $controller ) { $controller::get_instance()->register_routes(); } } } ApiInit::get_instance();