Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Code to allow to create and update a user in WordPress without an e-mail address. It simply removes the error message. This code was written to be used in a plugin written as a class
public function __construct () {
// other code...
add_action( 'user_profile_update_errors', array( $this, 'remove_empty_email_error' ));
}
function remove_empty_email_error( $arg ) {
if ( !empty( $arg->errors['empty_email'] ) ) unset( $arg->errors['empty_email'] );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment