I have a multisite config w/ members creating new sites. The code below allows me to insert a shortcode into CF7's Email Recipient field. The shortcode grabs the site admin's email address and uses it to send emails. When added to functions.php, this code works fine. I need this functionality on every new site created. So, I moved this code to a plugin, and it stops working. Anyone see why it's not working in a plugin?
//* Contact Form 7 Email Recipient Shortcode
function bloginfoSC( $atts ) {
extract(shortcode_atts(array( 'value' => '', ), $atts));
return get_bloginfo($value);
}
add_shortcode('bloginfo', 'bloginfoSC');
add_filter( 'wpcf7_form_elements', 'mycustom_wpcf7_form_elements' );
function mycustom_wpcf7_form_elements( $form ) {
$form = do_shortcode( $form );
return $form;
}
// Allow custom shortcodes in CF7 mailed message body
add_filter( 'wpcf7_mail_components', 'dacrosby_do_shortcodes_wpcf7_mail_recipient', 10, 2 );
function dacrosby_do_shortcodes_wpcf7_mail_recipient( $components, $number ) {
$components['recipient'] = do_shortcode( $components['recipient'] );
return $components;
};