Skip to content

Instantly share code, notes, and snippets.

@lots0logs
Created March 2, 2016 21:00
Show Gist options
  • Save lots0logs/f8f8e1198a0ad5484b7d to your computer and use it in GitHub Desktop.
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.
<?php
function my_et_contact_page_headers( $headers, $contact_name, $contact_email ) {
/* ==================================================================
* >>>> Replace the "your-domain" below with your actual domain. <<<<
* ==================================================================
*/ $from = 'noreply@your-domain.com';
$headers[0] = "From: \"{$contact_name}\" <{$from}>";
return $headers;
}
add_filter( 'et_contact_page_headers', 'my_et_contact_page_headers' );
@djberriman
Copy link

djberriman commented Jun 12, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment