
该插件可用于使用国家/地区的国旗以国际格式轻松输入电话号码。包括自动设置国家/地区(使用客户端 IP)和电话号码验证的选项。
要开始插件工作 – 您需要激活它并在“电话”字段上启用“友好的国际电话字段”。这真的很简单。
另请在此处检查该插件的 WP WooCommerce 版本: 链接
特征:
- 新增功能!能够防止在没有正确电话号码的情况下提交表单
- 通过管理面板舒适地使用性
- 适用于任何 WordPress 主题
- 跨浏览器兼容性
- 无需编码
可用过滤器:
- gfip_prevent_wrong_phone_submit – 防止在没有正确电话号码的情况下提交表格
- gfip_success_message – 自定义“电话正确”前端消息
- gfip_fail_message – 自定义“电话不正确”前端消息
- gfi_show_only_countries – 接受要在列表中显示的国家/地区代码数组
- gfi_initial_country – 初始国家/地区代码,如果未设置,它将从 IP 地址获取用户国家/地区
- gfi_preferred_countries – 一系列首选国家
可用过滤器示例:
add_filter('gfip_prevent_wrong_phone_submit', function ($enabled) {
$enabled = true;
return $enabled;
}, 10, 1);
add_filter( 'gfip_success_message', function ($message) {
$message = 'Correct!';
return $message;
}, 10, 1 );
add_filter( 'gfip_fail_message', function ($message) {
$message = 'Incorrect :(';
return $message;
}, 10, 1 );
add_filter('gfi_show_only_countries', function(){
return ['ua', 'us', 'gb'];
});
add_filter('gfi_initial_country', function(){
return 'ua';
});
add_filter('gfi_preferred_countries', function(){
return ['ua', 'gb'];
});
v 1.2.3 - 22/02/2025 - Compatibility fixes (+ Orbital theme support) v 1.2.2 - 09/07/2021 - Changed the way of phone validation (from now phone number will be validated on keyup event instead of the blur event) v 1.2.1 - 24/09/2020 - Localization implemented - Ability to prevent form submission without correct phone number[s] v 1.2 - 22/03/2020 - Filters added v 1.1.1 - 02/11/2019 - Bug fix v 1.1 - 12/08/2019 - Multiple forms instances on a single page support added v 1.0 - 07/07/2019 - First stable release
原文链接:https://www.hrdweb.com/51748.html,转载请注明出处~~~


评论0