Affiliates
Hook Reference
| Hook | Description |
|---|---|
fluent_affiliate/admin_app_rendering | Fired just before the admin SPA is rendered. |
fluent_affiliate/affiliate_updated | Fired after an affiliate record is updated by an admin. |
fluent_affiliate/affiliate_status_to_{affiliate} | See source. |
fluent_affiliate/wipe_current_data | Fired when an admin triggers a full data-wipe via the migration tools. |
fluent_affiliate/affiliate_created | Fired after a new affiliate record is created. |
fluent_affiliate/affiliate_status_to_active | See source. |
fluent_affiliate/admin_app_rendering
Fired just before the admin SPA is rendered. Useful for adding custom scripts or data.
Source: app/Hooks/Handlers/AdminMenuHandler.php
php
add_action('fluent_affiliate/admin_app_rendering', function() {
wp_enqueue_script('my-admin-extension', MY_PLUGIN_URL . 'admin-ext.js', ['jquery'], '1.0', true);
});fluent_affiliate/affiliate_updated
Fired after an affiliate record is updated by an admin.
Parameters
| Parameter | Type | Description |
|---|---|---|
$affiliate | Affiliate | The updated Affiliate model. |
$by | string | Who triggered the update — "by_admin". |
$data | array | Array of changed data. |
Source: app/Http/Controllers/AffiliateController.php
php
add_action('fluent_affiliate/affiliate_updated', function($affiliate, $by, $data) {
// Log the change or notify an external system.
}, 10, 3);fluent_affiliate/affiliate_status_to_{affiliate}
Dynamic hook — the suffix is determined at runtime. See source for exact usage.
Source: app/Http/Controllers/AffiliateController.php
fluent_affiliate/wipe_current_data
Fired when an admin triggers a full data-wipe via the migration tools.
Source: app/Http/Controllers/MigrationController.php
php
add_action('fluent_affiliate/wipe_current_data', function() {
// Remove plugin data that is not in FA tables.
delete_option('my_plugin_affiliate_cache');
});fluent_affiliate/affiliate_created
Fired after a new affiliate record is created.
Parameters
| Parameter | Type | Description |
|---|---|---|
$affiliate | Affiliate | The newly created Affiliate model instance. |
$user | User | The WordPress User model associated with the affiliate. |
Source: app/Models/User.php
php
add_action('fluent_affiliate/affiliate_created', function($affiliate, $user) {
// Send a welcome email, sync to CRM, etc.
my_plugin_send_affiliate_welcome($affiliate->payment_email);
}, 10, 2);fluent_affiliate/affiliate_status_to_active
Source: app/Models/User.php