我正在使用contact-form-7 插件,我在其中创建的name
字段作为名称。
这个name
字段也接受文本和数字。但我的要求是name
字段不应该从数字开始,那么如何才能使名称字段只接受文本而不接受数字?
[text* your-name placeholder "Full Name"]
我在谷歌上搜索并访问了联系人表单7支持,但无法解决它。我正在使用contact-form-7 插件,我在其中创建的name
字段作为名称。
这个name
字段也接受文本和数字。但我的要求是name
字段不应该从数字开始,那么如何才能使名称字段只接受文本而不接受数字?
[text* your-name placeholder "Full Name"]
我在谷歌上搜索并访问了联系人表单7支持,但无法解决它。根据the documentation 您必须创建一个自定义过滤器来支持它-您可以这样做:
add_filter( \'wpcf7_validate_text*\', \'custom_text_validation_filter\', 20, 2 );
function custom_text_validation_filter( $result, $tag ) {
if ( \'your-name\' == $tag->name ) {
// matches any utf words with the first not starting with a number
$re = \'/^[^\\p{N}][\\p{L}]*/i\';
if (!preg_match($re, $_POST[\'your-name\'], $matches)) {
$result->invalidate($tag, "This is not a valid name!" );
}
}
return $result;
}
我有一个插件,它有自己的CSS,用于在使用相关短代码时生成的内容。我正在尝试创建一个主题来重新设置我网站前端的样式,但由于这个插件有自己的CSS,我如何在新主题中修改它?
我正在使用contact-form-7 插件,我在其中创建的name
字段作为名称。
这个name
字段也接受文本和数字。但我的要求是name
字段不应该从数字开始,那么如何才能使名称字段只接受文本而不接受数字?
[text* your-name placeholder "Full Name"]
我在谷歌上搜索并访问了联系人表单7支持,但无法解决它。根据the documentation 您必须创建一个自定义过滤器来支持它-您可以这样做:
add_filter( \'wpcf7_validate_text*\', \'custom_text_validation_filter\', 20, 2 );
function custom_text_validation_filter( $result, $tag ) {
if ( \'your-name\' == $tag->name ) {
// matches any utf words with the first not starting with a number
$re = \'/^[^\\p{N}][\\p{L}]*/i\';
if (!preg_match($re, $_POST[\'your-name\'], $matches)) {
$result->invalidate($tag, "This is not a valid name!" );
}
}
return $result;
}
我正在尝试在中创建按钮edit-comments 表,我想使用Ajax和一个插件来完成这项任务。这是插件/无电子邮件/无电子邮件下插件的代码。php:<?php /* Plugin Name: Approve Comment but don\'t send email Plugin URI: \"\" Description: Approve commnet or Trash Commnet but don\'t send the email.