wsf_action_user_signon_error

Description

The wsf_action_user_signon_error filter hook runs whenever the User Management add-on encounters an error when trying to login a user. This can be used to provide the user with a more meaningful message from third party plugins.

Usage

add_filter( 'wsf_action_user_signon_error', 'my_hook_function', 10, 5 );

Parameters

  1. $error_message String
    The error message.
  2. $error_id String
    The error ID returned by the wp_signon function.
  3. $form Form Object
    The form object.
  4. $submit Submit Object
    The submit object.
  5. $config Array
    The action configuration array.

Example

// Callback function for the wsf_action_user_signon_error filter hook
function my_hook_function( $error_message, $error_id, $form, $submit, $config ) {
    
    // Check the error ID
    switch( $error_id ) {

        // Example that detects Fortress rate limited error ID
        case 'snicco_fortress.rate_limited' :

            $error_message = __( 'You have tried to login too many times' );
            break;
    }

    // Return value
    return $error_message;
}

// Add a callback function for the wsf_action_user_signon_error filter hook
add_filter( 'wsf_action_user_signon_error', 'my_hook_function', 10, 5 );

 

Source File

This hook can be found in: <plugin root>/includes/classes/class-ws-form-action-user.php