我想在cf7中设置动态收件人-收件人来自acf字段。 我会尝试在较旧版本的联系表单7中使用此代码。
function set_cf7_form_recipient($components, $contact_form, $object) { if (($contact_form->id() == 190)) : $post_id = wpcf7_special_mail_tag('', '_post_id',''); $email_to_address = get_field( 'email_address', $post_id ); if ($email_to_address) : $components['recipient'] = $email_to_address; endif; endif; return $components; } add_filter('wpcf7_mail_components', 'set_cf7_form_recipient', 10, 3);
该代码在新版本的联系表格7中不起作用吗?还有更新的代码?