register_hooks(); } /** * Register WordPress hooks * * @return void */ private function register_hooks() { // Register cron hooks for title generation add_action( 'aisentic_process_title_generation', [ Title_Generator::class, 'processPending' ] ); // Schedule cron if not already scheduled if ( ! wp_next_scheduled( 'aisentic_process_title_generation' ) ) { wp_schedule_event( time(), 'hourly', 'aisentic_process_title_generation' ); } } /** * Get all API services * * This method returns all REST controllers that should be registered. * You can add filters here to allow other plugins to register their own endpoints. * * @return array */ public function get_services() { return apply_filters( 'aisentic_api_services', $this->services ); } }