uo_unverified_users_notice
Filters the text for the unverified user account notice, allowing customization of the default message.
add_filter( 'uo_unverified_users_notice', $callback, 10, 1 );
Description
Filters the message displayed to unverified users. Developers can use this hook to customize the notice shown after a user attempts to log in without verification, allowing for different wording or additional HTML.
Usage
add_filter( 'uo_unverified_users_notice', 'your_function_name', 10, 1 );
Return Value
The filtered value.
Examples
add_filter( 'uo_unverified_users_notice', 'my_custom_unverified_user_notice', 10, 1 );
/**
* Customizes the unverified user notice message.
*
* This function allows developers to change the default message displayed
* when a user attempts to log in with an unverified account.
*
* @param string $message The default unverified user notice message.
* @return string The modified unverified user notice message.
*/
function my_custom_unverified_user_notice( $message ) {
// Example: Append a link to a registration page for unverified users.
$registration_url = home_url( '/register/' ); // Replace with your actual registration page URL
$custom_message = sprintf(
'%s Please <a href="%s">register</a> again or contact support.',
$message,
esc_url( $registration_url )
);
return $custom_message;
}
Placement
This code should be placed in the functions.php file of your active theme, a custom plugin, or using a code snippets plugin.
Source Code
src/classes/frontend-login-plus.php:1602
public function user_login_message( $message ) {
// Show the error message if it seems to be a disabled user
if ( isset( $_GET['unverified'] ) && 1 === $_GET['unverified'] ) {
$message = '<div id="login_error">' . apply_filters( 'uo_unverified_users_notice', esc_html__( "We haven't verified this account.", 'uncanny-learndash-toolkit' ) ) . '</div>';
}
return $message;
}