[英]Echo Custom response message , contact form 7 before send email hook
我想在contactform7下方或上方顯示自定義消息,而不發送電子郵件。 我使用before_send_email函數感到厭倦,但是沒有任何效果。 以下是我使用的功能。
add_action("wpcf7_before_send_mail", "wpcf7_do_something_else");
function wpcf7_do_something_else($cf7) {
$wpcf->skip_mail = true;
// Here I tried to use jquery or wordpress filter function to display custom message. but nothing is displaying.
return $wpcf;
}
請幫忙
要在表單提交中返回自定義消息,可以使用過濾器wpcf7_ajax_json_echo
嘗試:
add_filter("wpcf7_ajax_json_echo", function ($response, $result) {
$response["message"] = "a custom message";
return $response;
});
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.