Created
March 3, 2016 23:15
-
-
Save kraftbj/d769d1e76d6fd56d0426 to your computer and use it in GitHub Desktop.
Force the default from e-mail address
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
add_filter( 'wp_mail_from', 'bk_force_default_email', 1 ); | |
function bk_force_default_email(){ | |
$sitename = strtolower( $_SERVER['SERVER_NAME'] ); | |
if ( substr( $sitename, 0, 4 ) == 'www.' ) { | |
$sitename = substr( $sitename, 4 ); | |
} | |
$email = 'wordpress@' . $sitename; | |
return $email; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment