Skip to content

Instantly share code, notes, and snippets.

@bigdigital
Created October 5, 2017 12:34
Show Gist options
  • Save bigdigital/76fa242df72c73772526a91c7346ea0d to your computer and use it in GitHub Desktop.
Save bigdigital/76fa242df72c73772526a91c7346ea0d to your computer and use it in GitHub Desktop.
The7 change contact form header
add_filter( 'dt_core_send_mail-headers', 'my_dt_core_send_mail', 10);
function my_dt_core_send_mail($headers) {
$em = apply_filters( 'dt_core_send_mail-to', get_option( 'admin_email' ) );
if ( !empty( $fields['name'] ) ) {
$name = $fields['name'];
}
$headers[0] = 'From: ' . esc_attr( strip_tags( $name ) ) . ' <' . $em . '>';
return $headers;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment