Created
July 5, 2019 18:23
-
-
Save andrejIka/0b3254fb423b426da964f993aeb9162c to your computer and use it in GitHub Desktop.
Change from to wordpress email
This file contains hidden or 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
<?php | |
// first | |
add_filter( 'wp_mail_from', 'wpse_new_mail_from' ); | |
function wpse_new_mail_from( $old ) { | |
return 'your email address'; // Edit it with your email address | |
} | |
add_filter('wp_mail_from_name', 'wpse_new_mail_from_name'); | |
function wpse_new_mail_from_name( $old ) { | |
return 'your name or your website'; // Edit it with your/company name | |
} | |
// second | |
add_filter( 'wp_mail_from', 'new_mail_from' ); | |
add_filter( 'wp_mail_from_name', 'new_mail_from_name' ); | |
function new_mail_from( $old ) { | |
return get_option( 'admin_email' ); | |
} | |
function new_mail_from_name( $old ) { | |
return get_option( 'blogname' ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment