get_endpoints(); foreach ( $endpoints as $endpoint ) { add_rewrite_endpoint( $endpoint, EP_ALL ); } } /** * Flush rewrite rules once per plugin version (after upgrade or fresh install). * * @return void */ public function maybe_flush_rules() { $stored = get_option( 'timetics_rewrite_version' ); if ( defined( 'TIMETICS_VERSION' ) && $stored !== TIMETICS_VERSION ) { flush_rewrite_rules( false ); update_option( 'timetics_rewrite_version', TIMETICS_VERSION, false ); } } /** * Get all endpoints * * @return array */ public function get_endpoints() { /** * All endpoints that have to be register */ return [ 'timetics-integration', ]; } };