In a multisite network, when you change the main email address in Settings / General, Wordpress sends an email that must be confirmed by the new email recipient.
I need to avoid or customize the message that is being sent but can't figure out how.
The function responsible for sending this email is not pluggable, as show bellow:
/**
* Sends an email when a site administrator email address is changed.
*
* @since 3.0.0
*
* @param string $old_value The old email address. Not currently used.
* @param string $value The new email address.
*/
function update_option_new_admin_email( $old_value, $value ) {
if ( $value == get_option( 'admin_email' ) || !is_email( $value ) )
return;
$hash = md5( $value. time() .mt_rand() );
$new_admin_email = array(
'hash' => $hash,
'newemail' => $value
);
update_option( 'adminhash', $new_admin_email );
$email_text = __( 'Dear user,
You recently requested to have the administration email address on
your site changed.
If this is correct, please click on the following link to change it:
###ADMIN_URL###
You can safely ignore and delete this email if you do not want to
take this action.
This email has been sent to ###EMAIL###
Regards,
All at ###SITENAME###
###SITEURL###' );
This function continues and have a few filters to change some vars, but no way to customise the message itself.
Do you know any way to avoid this notification from being necessary in multisite, or at least to be able to override the message it sends?
$priority
and$accepted_args
parameters, which are required if instance ofdo_action()
passes more than two parameters. – David Gard Mar 6 '15 at 11:00