Skip to content

Miscellaneous

Hook Reference

HookDescription
fluent_affiliate/loadedFired on plugins_loaded once the FluentAffiliate application container is built.
fluent_affiliate/on_wp_initFired on WordPress init after FluentAffiliate has loaded.
fluent_affiliate/pro_loadedFired after the FluentAffiliate Pro application has booted against the free plugin.

fluent_affiliate/loaded

Fired on plugins_loaded once the FluentAffiliate application container is built. This is the canonical attach point for add-ons — the Pro plugin boots its own application from here.

Parameters

ParameterTypeDescription
$appApplicationThe FluentAffiliate application (service container) instance.

Source: boot/app.php

php
add_action('fluent_affiliate/loaded', function($app) {
    // Register your own routes, models or handlers against the container.
    $app->addAction('fluent_affiliate/affiliate_created', function($affiliate) {
        // ...
    });
});

fluent_affiliate/on_wp_init

Fired on WordPress init after FluentAffiliate has loaded. Use it for work that needs the full WordPress environment (post types, rewrite rules, translations) rather than just the plugin container.

Parameters

ParameterTypeDescription
$appApplicationThe FluentAffiliate application instance.

Source: boot/app.php

php
add_action('fluent_affiliate/on_wp_init', function($app) {
    // Safe to call WordPress APIs that are only ready on init.
});

fluent_affiliate/pro_loaded

Fired after the FluentAffiliate Pro application has booted against the free plugin. Use this instead of fluent_affiliate/loaded when your code depends on Pro services, models or routes.

Requires FluentAffiliate Pro.

Parameters

ParameterTypeDescription
$appApplicationThe FluentAffiliate application instance shared by both plugins.

Source: ../fluent-affiliate-pro/boot/app.php

php
add_action('fluent_affiliate/pro_loaded', function($app) {
    // Pro classes (Creative, AffiliateGroup, …) are available here.
});

FluentAffiliate developer documentation