Wordpress

Allow using duplicated email on WordPress and Buddypress signup

If you want users to register with the same email account, you can use this filter:


function sumun_remove_registration_errors ($errors, $sanitized_user_login, $user_email) {

	if( isset($errors->errors['email_exists'])) {
		$errors->remove('email_exists');
	}
	return $errors;
}
add_filter( 'registration_errors', 'sumun_remove_registration_errors', 10, 3);

Note that “remove” function is available since WordPress 4.1.0. If you are using a prior version you should use:

		unset( $errors->errors['email_exists'] );
		unset( $errors->error_data['email_exists'] );

instead.

But we were working on a Buddypress site and this solution does not work in BP signup form, so we had to search another solution. Here it is:


function sumun_remove_bp_email_exists_error($result) {
	$result['errors']->remove('user_email');
}
add_filter('bp_core_validate_user_signup','sumun_remove_bp_email_exists_error');

Use it at your own risk, because it generates an inconsistence in password reset. I made a workaround installing Allow multiple accounts plugin, which appends some text to emails sent to users with usernames associated to this email account.

Cheers

Say Hello

Fray Luis Amigó 6, Oficina D
50006 Zaragoza

976 49 54 20

Si estás en ese momento en el que tienes una visión para tu empresa, eres lo suficientemente valiente como para querer llevarla a cabo, y no sabes cómo, ¡seguimos hablando!






    Basic information about the treatment of your data:

    • Responsible: Sumun Comunicación Global S.L.U. (Sumun)
    • Purpose: queries resolution (contact form) / application management (“work with us” form)
    • Legitimation: privacy policy consent by checking the box to the effect.
    • Recipient: Sumun. The data will not be transferred to third parties.
    • Your rights: access, rectify and delete data, portability of data, limitation or opposition to data treatment, transparency. lopd@sumun.net
    • Expiration: until the user announces that he wants to delete them, or failing that until Sumun considers that they are no longer useful.

    Horario de atención
    Lunes a vienes
    de 8:30h a 16:30h