Created
March 2, 2016 21:00
-
-
Save lots0logs/f8f8e1198a0ad5484b7d to your computer and use it in GitHub Desktop.
WordPress :: Divi Builder :: Contact Form Module :: Change the "From:" address to the same domain as website.
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 | |
function my_et_contact_page_headers( $headers, $contact_name, $contact_email ) { | |
/* ================================================================== | |
* >>>> Replace the "your-domain" below with your actual domain. <<<< | |
* ================================================================== | |
*/ $from = '[email protected]'; | |
$headers[0] = "From: \"{$contact_name}\" <{$from}>"; | |
return $headers; | |
} | |
add_filter( 'et_contact_page_headers', 'my_et_contact_page_headers' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I could only get this to work by changing
add_filter( 'et_contact_page_headers', 'my_et_contact_page_headers' );
to
add_filter( 'et_contact_page_headers', 'my_et_contact_page_headers' ,10,3);
as 3 arguments are expected. By default only 1 is passed. Wordpress has problem changed since this was originally written.
Great snippet though, solved my problem once I figured the argument issue.