Last active
March 5, 2020 18:06
-
-
Save lunaluna/08a9923bfa825e8f5ed74a834a444b45 to your computer and use it in GitHub Desktop.
【WordPress】管理者のメールアドレスを変更したときに飛ぶ確認通知を無効に
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
remove_action( 'add_option_new_admin_email', 'update_option_new_admin_email' ); | |
remove_action( 'update_option_new_admin_email', 'update_option_new_admin_email' ); | |
/** | |
* Disable the confirmation notices when an administrator | |
* changes their email address. | |
* | |
* @see http://codex.wordpress.com/Function_Reference/update_option_new_admin_email | |
*/ | |
function wpdocs_update_option_new_admin_email( $old_value, $value ) { | |
update_option( 'admin_email', $value ); | |
} | |
add_action( 'add_option_new_admin_email', 'wpdocs_update_option_new_admin_email', 10, 2 ); | |
add_action( 'update_option_new_admin_email', 'wpdocs_update_option_new_admin_email', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
update_option_new_admin_email() | Function | WordPress Developer Resources