Skip to content

Instantly share code, notes, and snippets.

@webzunft
Created May 17, 2013 09:35
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 webzunft/5598039 to your computer and use it in GitHub Desktop.
Save webzunft/5598039 to your computer and use it in GitHub Desktop.
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