WordPress电话号码限制为允许xxx xxx xxxx格式
我将占位符保留为xxx xxx xxxxWordPress电话号码限制为允许xxx xxx xxxx格式,wordpress,contact-form,phone-number,tel,Wordpress,Contact Form,Phone Number,Tel,我将占位符保留为xxx xxx xxxx <label> Phone Number </label> [number* shm-mrk-phone minlength:10 maxlength:140 placeholder "] 它不允许xxx xxx xxxx(这应该允许),它允许XXXXXXXXX这很简单。我用tel代替号码类型来添加手机号码 在Contact Form 7 plugin formatting.php模块中 我用更新了wpcf7\u is\u te
<label> Phone Number </label> [number* shm-mrk-phone minlength:10 maxlength:140 placeholder "]
它不允许xxx xxx xxxx(这应该允许),它允许XXXXXXXXX这很简单。我用
tel
代替号码类型来添加手机号码
在Contact Form 7 plugin formatting.php模块中
我用更新了wpcf7\u is\u tel
函数的代码
function wpcf7_is_tel( $tel ) {
$result = preg_match( '/^(?:\(\d{3}\)|\d{3}-)\d{3}-\d{4}$/', $tel );
return apply_filters( 'wpcf7_is_tel', $result, $tel );
}
很好
function wpcf7_is_tel( $tel ) {
$result = preg_match( '/^(?:\(\d{3}\)|\d{3}-)\d{3}-\d{4}$/', $tel );
return apply_filters( 'wpcf7_is_tel', $result, $tel );
}