diff --git a/src/api/classes/integration-manager-controller/index.md b/src/api/classes/integration-manager-controller/index.md index 6fe4fc6..7428578 100644 --- a/src/api/classes/integration-manager-controller/index.md +++ b/src/api/classes/integration-manager-controller/index.md @@ -53,6 +53,18 @@ public function __construct(Application $application) } ``` +### Bootstrapping your integration +Instantiate your integration class on the `fluentform/loaded` action. It fires on every request once Fluent Forms is loaded and passes the Application instance your constructor needs. + +```php +/* + * Finally initialize the integration + */ +add_action('fluentform/loaded', function ($app) { + new MyAwesomeIntegration($app); +}); +``` + ### `addActiveNotificationType($types)` **Source:** `fluentform/app/Http/Controllers/IntegrationManagerController.php` (line 137) @@ -305,6 +317,8 @@ public function pushIntegration($integrations, $formId) ### `registerAdminHooks()` +Registers the integration on the **Integrations** screen (`fluentform/global_addons`) and, once enabled, its settings, feed and notification hooks. Call it from your constructor and instantiate the class on `fluentform/loaded` — see [Bootstrapping your integration](/api/classes/integration-manager-controller/#bootstrapping-your-integration). + **Source:** `fluentform/app/Http/Controllers/IntegrationManagerController.php` (line 54) --- diff --git a/src/hooks/filters/integration.md b/src/hooks/filters/integration.md index 8b311b5..afc28a0 100644 --- a/src/hooks/filters/integration.md +++ b/src/hooks/filters/integration.md @@ -302,7 +302,9 @@ add_filter('fluentform/global_addons', function ($addons) use ($isEnabled) { `apply_filters('fluentform/global_addons', $addons);` -This filter is located in FluentForm\app\Modules\AddOnModules -> showFluentAddOns() +This filter is located in FluentForm\App\Modules\AddOnModule -> getRegisteredAddOns() + +If you extend `IntegrationManagerController`, `registerAdminHooks()` adds this filter for you — see [Bootstrapping your integration](/api/classes/integration-manager-controller/#bootstrapping-your-integration).