Skip to content

Instantly share code, notes, and snippets.

@yawalkar
Last active June 22, 2018 07:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yawalkar/2780d37fadfe224fe55f95a7eb71c0af to your computer and use it in GitHub Desktop.
Save yawalkar/2780d37fadfe224fe55f95a7eb71c0af to your computer and use it in GitHub Desktop.
User Element Registration Messages Filter
// Update strings with custom branding strings.
add_filter( 'fusion_user_login_notices_array', 'update_registration_messages_text', 10, 3 );
/**
* Update strings with the new ones.
*
* @access public
* @since 1.0
* @param array $notice_array Array with default messages.
* @param string $action The current action performed by user.
* @param bool $success Whether the action is successfull or not.
* @return array $notice_array Updated messages.
*/
function update_registration_messages_text( $notice_array, $action, $success ) {
$notice_array = array(
'login' => array(
'error' => esc_html__( 'Login failed, please try again.', 'fusion-builder' ),
),
'register' => array(
'success' => esc_html__( 'Registration complete. Please check your email.', 'fusion-builder' ),
'empty_username' => esc_html__( 'Please enter a username.', 'fusion-builder' ),
'empty_email' => esc_html__( 'Please type your email address.', 'fusion-builder' ),
'username_exists' => esc_html__( 'This username is already registered. Please choose another one.', 'fusion-builder' ),
'email_exists' => esc_html__( 'This email is already registered, please choose another one.', 'fusion-builder' ),
'generic_error' => esc_html__( 'Something went wrong during registration. Please try again.', 'fusion-builder' ),
),
'lostpassword' => array(
'success' => esc_html__( 'Check your email for the confirmation link.', 'fusion-builder' ),
'empty_login' => esc_html__( 'Enter a username or email address.', 'fusion-builder' ),
'unregistered_user' => esc_html__( 'Invalid username.', 'fusion-builder' ),
'unregistered_mail' => esc_html__( 'There is no user registered with that email address.', 'fusion-builder' ),
'generic_error' => esc_html__( 'Invalid username or email.', 'fusion-builder' ),
),
);
return $notice_array;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment