使用wpcf7_mail_sent
方法发送邮件后,我一直在尝试获取当前的联系表单ID。我的代码如下
function action_wpcf7_mail_sent( $contact_form ) {
// Run code after the email has been sent
$wpcf7_cur = WPCF7_ContactForm::get_current();
$wpcf7 = WPCF7_Submission::get_instance();
if($wpcf7_cur->id() == '29052'){
//echo 'this is test';
}
}
add_action( 'wpcf7_mail_sent', 'action_wpcf7_mail_sent');
我只想从帖子中获取图片网址,并在提交表单后将其替换为另一个网址。
但是当前此代码使表单等待提交的过程无休止。它没有提交,但是我正在接收邮件。