Skip to content

Portal

Hook Reference

HookDescription
fluent_affiliate/portal_menu_itemsFilters the navigation items shown in the affiliate portal sidebar.
fluent_affiliate/portal_page_urlFilters the URL of the affiliate portal page.
fluent_affiliate/default_share_urlFilters the default share URL used in affiliate tracking links when no specific page is configured.
fluent_affiliate/portal_notice_htmlFilters the HTML notice shown at the top of the affiliate portal.
fluent_affiliate/will_load_tracker_jsFilters whether the affiliate tracking JavaScript is enqueued on the front end.
fluent_affiliate/portal/pending_messageFilters the HTML shown to an affiliate whose account is pending approval.
fluent_affiliate/portal/inactive_messageFilters the HTML shown to an affiliate whose account is inactive.
fluent_affiliate/portal/additional_sitesFilters the list of additional sites shown in the affiliate portal share widget (Pro connected-sites feature).
fluent_affiliate/portal_localize_dataFilters all JavaScript data passed to the affiliate portal SPA.
fluent_affiliate/smartcode_fallbackFilters the fallback output when a smart code is unrecognised.
fluent_affiliate/smartcode_group_callback_{dataKey}Fires for an unrecognised smart code group, allowing third-party data keys.

fluent_affiliate/portal_menu_items

Filters the navigation items shown in the affiliate portal sidebar.

Parameters

ParameterTypeDescription
$itemsarrayPortal menu items.

Source: app/Helper/Helper.php

php
add_filter('fluent_affiliate/portal_menu_items', function($items) {
    $items[] = ['title' => 'My Custom Page', 'route' => 'custom-page', 'icon' => 'el-icon-document'];
    return $items;
});

fluent_affiliate/portal_page_url

Filters the URL of the affiliate portal page.

Parameters

ParameterTypeDescription
$urlstringThe portal page URL.

Source: app/Helper/Utility.php

php
add_filter('fluent_affiliate/portal_page_url', function($url) {
    return home_url('/affiliates/dashboard/');
});

fluent_affiliate/default_share_url

Filters the default share URL used in affiliate tracking links when no specific page is configured.

Parameters

ParameterTypeDescription
$urlstringThe current share URL (defaults to home_url('/')).
$affiliateAffiliateThe Affiliate model.

Source: app/Hooks/Handlers/BlockEditorHandler.php

php
add_filter('fluent_affiliate/default_share_url', function($url, $affiliate) {
    return home_url('/shop/');
}, 10, 2);

fluent_affiliate/portal_notice_html

Filters the HTML notice shown at the top of the affiliate portal.

Parameters

ParameterTypeDescription
$htmlstringNotice HTML, empty by default.

Source: app/Http/Controllers/Portal/PortalController.php

php
add_filter('fluent_affiliate/portal_notice_html', function($html) {
    return '<div class="notice notice-info">Special promotion this month!</div>';
});

fluent_affiliate/will_load_tracker_js

Filters whether the affiliate tracking JavaScript is enqueued on the front end.

Parameters

ParameterTypeDescription
$willLoadbooltrue to load (default), false to suppress.

Source: app/Modules/Integrations/FluentBooking/Bootstrap.php

php
// Disable tracker on specific pages
add_filter('fluent_affiliate/will_load_tracker_js', function($willLoad) {
    if (is_page('checkout')) {
        return false;
    }
    return $willLoad;
});

fluent_affiliate/portal/pending_message

Filters the HTML shown to an affiliate whose account is pending approval.

Parameters

ParameterTypeDescription
$htmlstringThe pending message HTML.
$affiliateAffiliateThe affiliate viewing the portal.

Source: app/Modules/Portal/CustomerPortal.php

php
add_filter('fluent_affiliate/portal/pending_message', function($html, $affiliate) {
    return '<p>Your application is under review. We will email you within 24 hours.</p>';
}, 10, 2);

fluent_affiliate/portal/inactive_message

Filters the HTML shown to an affiliate whose account is inactive.

Parameters

ParameterTypeDescription
$htmlstringThe inactive message HTML.
$affiliateAffiliateThe affiliate viewing the portal.

Source: app/Modules/Portal/CustomerPortal.php

php
add_filter('fluent_affiliate/portal/inactive_message', function($html, $affiliate) {
    return '<p>Your account has been deactivated. Please contact support.</p>';
}, 10, 2);

fluent_affiliate/portal/additional_sites

Filters the list of additional sites shown in the affiliate portal share widget (Pro connected-sites feature).

Parameters

ParameterTypeDescription
$sitesarrayArray of site definitions. Each entry: ['name', 'url', 'param'].

Source: app/Modules/Portal/CustomerPortal.php

php
add_filter('fluent_affiliate/portal/additional_sites', function($sites) {
    $sites[] = ['name' => 'My Store', 'url' => 'https://mystore.com/', 'param' => 'ref'];
    return $sites;
});

fluent_affiliate/portal_localize_data

Filters all JavaScript data passed to the affiliate portal SPA.

Parameters

ParameterTypeDescription
$portalDataarrayAssociative array of JS variables.

Source: app/Modules/Portal/CustomerPortal.php

php
add_filter('fluent_affiliate/portal_localize_data', function($portalData) {
    $portalData['custom_setting'] = get_option('my_plugin_portal_setting');
    return $portalData;
});

fluent_affiliate/smartcode_fallback

Filters the fallback output when a smart code is unrecognised.

Parameters

ParameterTypeDescription
$originalstringOriginal unmatched smart code string.
$dataarrayContext data passed to the parser.

Source: app/Services/Libs/SmartCodeParser.php

php
add_filter('fluent_affiliate/smartcode_fallback', function($original, $data) {
    return ''; // Remove unrecognised codes instead of leaving them visible.
}, 10, 2);

fluent_affiliate/smartcode_group_callback_{dataKey}

Fires for an unrecognised smart code group, allowing third-party data keys. The hook suffix is the group key from the template.

Parameters

ParameterTypeDescription
$originalstringOriginal matched string.
$valueKeystringThe specific sub-key requested.
$defaultValuemixedDefault value if unresolved.
$dataarrayContext data.

Source: app/Services/Libs/SmartCodeParser.php

php
add_filter('fluent_affiliate/smartcode_group_callback_order', function($original, $valueKey, $default, $data) {
    if ($valueKey === 'number') {
        return $data['order']['number'] ?? $default;
    }
    return $original;
}, 10, 4);

Released under the GPL-2.0 License.