Skip to content

Auth

Hook Reference

HookDescription
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/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');

Released under the GPL-2.0 License.