Last active
July 6, 2016 15:39
-
-
Save cfxd/670b81e6265a320d7935 to your computer and use it in GitHub Desktop.
WordPress Contact Form 7 filter: set your contact form's "To:" field to "%admin%" to automatically use the site admin email dynamically. See http://cfxdesign.com/contact-form-7-dynamic-email-field
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
<?php | |
function wpcf7_dynamic_email_field($args) { | |
if(!empty($args['recipient'])) { | |
$args['recipient'] = str_replace('%admin%', get_option('admin_email'), $args['recipient']); | |
return $args; | |
} | |
return false; | |
} | |
add_filter('wpcf7_mail_components', 'wpcf7_dynamic_email_field'); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment