Skip to content

Auth

Hook Reference

HookDescription
fluent_affiliate/auth/custom_field_valuesCollects and validates values for custom registration fields during affiliate signup and portal profile updates.
fluent_affiliate/auth/pre_registration_errorsRuns before an affiliate registration is accepted, after field sanitization.
fluent_affiliate/auth/after_login_redirect_urlFilters the URL the affiliate is redirected to after logging in.
fluent_affiliate/auth/after_signup_redirect_urlFilters the URL the affiliate is redirected to after signing up.
fluent_affiliate/terms_policy_urlFilters the Terms & Privacy Policy URL shown on the affiliate sign-up form.
fluent_affiliate/auth/signup_fieldsFilters the form fields shown on the affiliate registration form.
fluent_affiliate/auth/lost_password_urlFilters the lost password URL linked on the affiliate login form.
fluent_affiliate/auth/signup_verification_email_bodyFilters the body of the email verification message sent during sign-up.
fluent_affiliate/reserved_usernamesFilters the list of usernames that affiliates are not allowed to register.
fluent_affiliate/auth/auto_approve_affiliatesFilters whether new affiliates are automatically approved on registration.
fluent_affiliate/captcha_providersRegisters the captcha providers available on the registration form PRO.
fluent_affiliate/recaptcha_remoteipFilters the remoteip value sent to Google when verifying a reCAPTCHA response PRO.
fluent_affiliate/recaptcha_v3_ref_scoreFilters the reCAPTCHA v3 score threshold a registration must meet to be accepted PRO.

fluent_affiliate/auth/custom_field_values

Collects and validates values for custom registration fields during affiliate signup and portal profile updates. Merge into the accumulated array and return it, or return a WP_Error to abort with a validation message. Pro's custom registration fields feature hooks here.

Parameters

ParameterTypeDescription
$valuesarrayAccumulated custom field values — merge into this, do not replace it.
$fieldsarrayRegistration form field definitions.
$submittedarraySubmitted values restricted to the known field keys.

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

php
add_filter('fluent_affiliate/auth/custom_field_values', function($values, $fields, $submitted) {
    if (empty($submitted['company'])) {
        return new \WP_Error('validation_failed', 'Company is required.');
    }
    $values['company'] = sanitize_text_field($submitted['company']);
    return $values;
}, 10, 3);

fluent_affiliate/auth/pre_registration_errors

Runs before an affiliate registration is accepted, after field sanitization. Return a non-empty array to reject the request with HTTP 422. Pro's captcha verification hooks here.

Parameters

ParameterTypeDescription
$errorsarrayError payload — return [] to allow, or ['message' => string, 'errors' => array] to block.
$dataarraySanitized registration data.
$requestRequestThe current request object.

Source: app/Modules/Auth/AuthHandler.php

php
add_filter('fluent_affiliate/auth/pre_registration_errors', function($errors, $data, $request) {
    if (str_ends_with($data['email'], '@example.test')) {
        $errors['message'] = 'This email domain is not allowed.';
    }
    return $errors;
}, 10, 3);

fluent_affiliate/auth/after_login_redirect_url

Filters the URL the affiliate is redirected to after logging in.

Parameters

ParameterTypeDescription
$urlstringRedirect URL.
$userWP_UserThe logged-in user.

Source: app/Modules/Auth/AuthHandler.php

php
add_filter('fluent_affiliate/auth/after_login_redirect_url', function($url, $user) {
    return home_url('/affiliates/');
}, 10, 2);

fluent_affiliate/auth/after_signup_redirect_url

Filters the URL the affiliate is redirected to after signing up.

Parameters

ParameterTypeDescription
$urlstringRedirect URL.
$userWP_UserThe newly created user.
$requestarrayThe submitted sign-up form data.

Source: app/Modules/Auth/AuthHandler.php

php
add_filter('fluent_affiliate/auth/after_signup_redirect_url', function($url, $user, $request) {
    return home_url('/affiliates/welcome/');
}, 10, 3);

fluent_affiliate/terms_policy_url

Filters the Terms & Privacy Policy URL shown on the affiliate sign-up form.

Parameters

ParameterTypeDescription
$urlstringPolicy URL (defaults to get_privacy_policy_url()).

Source: app/Modules/Auth/AuthHelper.php

php
add_filter('fluent_affiliate/terms_policy_url', function($url) {
    return home_url('/affiliate-terms/');
});

fluent_affiliate/auth/signup_fields

Filters the form fields shown on the affiliate registration form.

Parameters

ParameterTypeDescription
$fieldsarrayForm field definitions.
$userWP_UserCurrent user (if logged in).

Source: app/Modules/Auth/AuthHelper.php

php
add_filter('fluent_affiliate/auth/signup_fields', function($fields, $user) {
    $fields['company'] = [
        'label'    => 'Company Name',
        'type'     => 'text',
        'required' => false,
    ];
    return $fields;
}, 10, 2);

fluent_affiliate/auth/lost_password_url

Filters the lost password URL linked on the affiliate login form.

Parameters

ParameterTypeDescription
$urlstringLost password URL.

Source: app/Modules/Auth/AuthHelper.php

php
add_filter('fluent_affiliate/auth/lost_password_url', function($url) {
    return wp_lostpassword_url(home_url('/affiliate-login/'));
});

fluent_affiliate/auth/signup_verification_email_body

Filters the body of the email verification message sent during sign-up.

Parameters

ParameterTypeDescription
$messagestringEmail body HTML.
$verificationCodestringThe verification code.
$formDataarraySubmitted form data.

Source: app/Modules/Auth/AuthHelper.php

php
add_filter('fluent_affiliate/auth/signup_verification_email_body', function($message, $code, $formData) {
    return $message . '<p>Your code expires in 30 minutes.</p>';
}, 10, 3);

fluent_affiliate/reserved_usernames

Filters the list of usernames that affiliates are not allowed to register.

Parameters

ParameterTypeDescription
$reservedarrayArray of reserved username strings.

Source: app/Modules/Auth/AuthHelper.php

php
add_filter('fluent_affiliate/reserved_usernames', function($reserved) {
    $reserved[] = 'admin';
    $reserved[] = 'affiliate';
    return $reserved;
});

fluent_affiliate/auth/auto_approve_affiliates

Filters whether new affiliates are automatically approved on registration.

Parameters

ParameterTypeDescription
$autoApprovebooltrue to auto-approve. Default false.

Source: app/Modules/Auth/AuthHelper.php

php
add_filter('fluent_affiliate/auth/auto_approve_affiliates', '__return_true');

fluent_affiliate/captcha_providers

Registers the captcha providers available on the registration form PRO. Add an instance of a class extending FluentAffiliatePro\App\Services\Captcha\AbstractCaptchaProvider to offer an alternative to the bundled Google reCAPTCHA provider. Entries that are not AbstractCaptchaProvider instances are ignored, and each provider is keyed by its getKey().

Requires FluentAffiliate Pro.

Parameters

ParameterTypeDescription
$providersarrayProvider instances keyed by provider key — defaults to ['recaptcha' => new RecaptchaProvider()].

Source: ../fluent-affiliate-pro/app/Services/Captcha/CaptchaManager.php

php
add_filter('fluent_affiliate/captcha_providers', function($providers) {
    $providers['turnstile'] = new My_Turnstile_Provider(); // extends AbstractCaptchaProvider
    return $providers;
});

fluent_affiliate/recaptcha_remoteip

Filters the remoteip value sent to Google when verifying a reCAPTCHA response PRO. Return an empty string to omit the parameter entirely (data minimization) — Google treats it as optional.

Requires FluentAffiliate Pro.

Parameters

ParameterTypeDescription
$ipstringDetected visitor IP (Cloudflare / X-Forwarded-For / REMOTE_ADDR).
$settingsarrayThe active provider settings.

Source: ../fluent-affiliate-pro/app/Services/Captcha/RecaptchaProvider.php

php
// Don't send visitor IPs to Google
add_filter('fluent_affiliate/recaptcha_remoteip', '__return_empty_string');

fluent_affiliate/recaptcha_v3_ref_score

Filters the reCAPTCHA v3 score threshold a registration must meet to be accepted PRO. Scores below the threshold are rejected. Defaults to the provider's v3_score_threshold setting (0.5).

Requires FluentAffiliate Pro.

Parameters

ParameterTypeDescription
$thresholdfloatMinimum acceptable score, 0.0–1.0.

Source: ../fluent-affiliate-pro/app/Services/Captcha/RecaptchaProvider.php

php
add_filter('fluent_affiliate/recaptcha_v3_ref_score', function($threshold) {
    return 0.7; // stricter
});

FluentAffiliate developer documentation