` with a condition on the * `actions` checklist), so `Actions::extend_manifest()` adds nothing for them. Nothing here translates * strings: register() runs during plugins_loaded, before `init`. */ final class Integrations { /** @var array|null */ private static ?array $providers = null; public function register(): void { add_action('zadex/forms/register_actions', [self::class, 'register_actions']); add_action('rest_api_init', static function (): void { (new ListsController())->routes(); }); add_action(Webhook::CRON_HOOK, static function ($job_id): void { (new Webhook())->retry(is_string($job_id) ? $job_id : ''); }); } /** @return array */ public static function providers(): array { if (self::$providers === null) { $list = [new Mailchimp(), new ActiveCampaign(), new GetResponse(), new ConvertKit(), new MailerLite(), new Drip()]; self::$providers = []; foreach ($list as $provider) { self::$providers[$provider->id()] = $provider; } } return self::$providers; } public static function provider(string $id): ?EmailProvider { return self::providers()[$id] ?? null; } public static function register_actions(Actions $actions): void { $webhook = new Webhook(); $actions->register(Webhook::ID, [$webhook, 'handle'], [], 'Webhook'); foreach (self::providers() as $id => $provider) { $actions->register($id, [$provider, 'handle'], [], $provider->label()); } $actions->register(Discord::ID, [Discord::class, 'handle'], [], 'Discord'); $actions->register(Slack::ID, [Slack::class, 'handle'], [], 'Slack'); } }