Description

Filter used to provide a message on User Registration Addon if the username already exists.

Parameters

$msg
(string) Message that displays if username already exists.

Source

wpforms-user-registration/class-user-registration.php

More Information

The wpforms_user_registration_username_exists is used to display a message if the username already exists.

Example

/**
 * Username already exists.
 *
 * @link    https://wpforms.com/developers/wpforms_user_registration_username_exists/
 *
 * @param   string   $msg  Message that displays if username already exists.
 *
 * @return  string
 */
function wpf_dev_user_registration_username_exists( $msg ) {
    $msg = 'A user with that username already exists. Need to <a href="';
    $msg .= esc_url( wp_lostpassword_url() );
    $msg .= '"> reset your password?</a>';
    return $msg;
}
add_filter( 'wpforms_user_registration_username_exists', 'wpf_dev_user_registration_username_exists' );


Snippet Reference: How to Change Validation Messages for User Registration Addon