Created
March 19, 2016 07:25
-
-
Save al5dy/42f3965035d867183b57 to your computer and use it in GitHub Desktop.
Add custom [_admin_mail] shortcode to CF7
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
if ( ! function_exists( 'add_cf7_shortcode' ) ) { | |
add_filter('wpcf7_special_mail_tags', 'add_cf7_shortcode', 20, 3); | |
function add_cf7_shortcode($output, $name, $html) { | |
$name = preg_replace('/^wpcf7\./', '_', $name); | |
if ('_admin_mail' == $name) { | |
if ( function_exists('get_option_tree') ) { | |
$email = ot_get_option('email'); // get OT value | |
$output = $email; | |
} | |
} | |
return $output; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment