如何以联系表格7添加条件 如何写入条件在wordpress联系表格7中输入电子邮件ID或电话号码
function custom_validation_filter($result, $tag) {
$type = $tag['type'];
$email = $tag['email-603'];
$phone = $tag['tel-254'];
if($email == '' || $phone == '') {
$result['valid'] = false;
$result['reason'][$email] = 'Please enter email or phone number';
};
return $result;
};
add_filter('wpcf7_validate_text','custom_validation_filter', 10, 2);