Created
May 17, 2013 09:35
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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