[wordpress插件] Bin Opt-In启用本箱

wordpress 插件 文章 2020-03-05 07:20 622 0 全屏看文

AI助手支持GPT4.0

评分
0
描述

Provides features and functions to create an opt-in or double-opt in with contact form 7 (cf7) and other form plugins.

提供了使用联系表格7(cf7)和其他表格插件来创建选择加入或双重选择加入的功能。

Save contacts

保存联系人

To store your contacts, please install the additional plugin called bin contact.

要存储您的联系人,请安装名为bin contact的附加插件。

This plugin assists you installing all the necessary dependencies.

此插件可帮助您安装所有必需的依赖项。

Opt-In Function

启用功能

BinOptIn::optIn($postdata, [    

 BinOptIn :: optIn($ postdata,[    

'opt_in_admin_message' => false,    

'opt_in_admin_message'=>否,    

'double_opt_in' => false,    

'double_opt_in'=>否,    

'admin_unlock' => false,    

'admin_unlock'=>否,    

'unlock_message' => false

'unlock_message'=>否

]);

]);

    • opt_in_admin_message

      opt_in_admin_message

      (bool) Notify the site owner of any new contact, regardless of whether or not he has confirmed his e-mail address.

      (布尔)通知任何新联系人的网站所有者,无论他是否已确认其电子邮件地址。

      Default false.

      默认为false。

    • double_opt_in

      double_opt_in

      (bool) The contact must confirm the e-mail address by clicking on a confirmation link.

      (布尔)联系人必须通过单击确认链接来确认电子邮件地址。

      Default false.

      默认为false。

    • admin_unlock

      admin_unlock

      (bool) The site owner has to confirm every new contact by clicking on a confirmation link.

      (布尔)网站所有者必须通过单击确认链接来确认每个新联系人。

      This is useful if you want to show a list of contacts (like a committee or a list of supporters).

      如果要显示联系人列表(例如委员会或支持者列表),此功能很有用。

      Default false.

      默认为false。

    • unlock_message

      解锁消息

      (bool) This option allows you to specify whether the contact should receive a notification once the site owner has confirmed the committee subscription.

      (布尔)此选项使您可以指定网站所有者确认委员会订阅后,联系人是否应收到通知。

      Default false.

      默认为false。

    Accepted postdata

    接受的数据

      • salutation

        称呼

        (int) Default empty.

        (int)默认为空。

          • 0 (Mister)
          • 0(先生)

          • 1 (Miss)
          • 1(小姐)

          • 2 (Other)
          • 2(其他)

        • polite_form

          polite_form

          (int) Default empty.

          (int)默认为空。

            • 0 (Personally)
            • 0(个人)

            • 1 (Formally)
            • 1(正式)

          • language_of_correspondence

            通信语言

            (int) Check this functions to see a list of all available languages: BinContact::formLanguage() and BinContact::formLanguageValue()

            (int)检查此功能以查看所有可用语言的列表:BinContact :: formLanguage()和BinContact :: formLanguageValue()

          • name_suffix

            名称后缀

            (string) Default empty.

            (字符串)默认为空。

          • first_name

            名字

            (string) Default empty.

            (字符串)默认为空。

          • last_name

            姓氏

            (string) Default empty.

            (字符串)默认为空。

          • designation

            名称

            (string) Default empty.

            (字符串)默认为空。

          • mobile

            移动

            (string) Default empty.

            (字符串)默认为空。

          • phone_private

            phone_private

            (string) Default empty.

            (字符串)默认为空。

          • phone_work

            电话工作

            (string) Default empty.

            (字符串)默认为空。

          • street_and_number

            街道号

            (string) Default empty.

            (字符串)默认为空。

          • zip

            zip

            (string) Default empty.

            (字符串)默认为空。

          • city

            城市

            (string) Default empty.

            (字符串)默认为空。

          • country

            国家/地区

            (string) Default empty.

            (字符串)默认为空。

          • website

            网站

            (string) Default empty.

            (字符串)默认为空。

          • facebook

            facebook

            (string) Default empty.

            (字符串)默认为空。

          • twitter

            推特

            (string) Default empty.

            (字符串)默认为空。

          • instagram

            instagram

            (string) Default empty.

            (字符串)默认为空。

          • flickr

            flickr

            (string) Default empty.

            (字符串)默认为空。

          • linkedin

            linkedin

            (string) Default empty.

            (字符串)默认为空。

          • xing

            xing

            (string) Default empty.

            (字符串)默认为空。

          • youtube

            youtube

            (string) Default empty.

            (字符串)默认为空。

          • socialmedia_other1

            socialmedia_other1

            (string) Default empty.

            (字符串)默认为空。

          • socialmedia_other2

            socialmedia_other2

            (string) Default empty.

            (字符串)默认为空。

          • socialmedia_other3

            socialmedia_other3

            (string) Default empty.

            (字符串)默认为空。

          • terms_and_conditions_accepted

            已接受条款和条件

            (string) Default empty.

            (字符串)默认为空。

              • empty (Not filled)
              • 空(未填充)

              • no (No)
              • 否(否)

              • yes (Yes)
              • 是(是)

            • privacy_policy_accepted

              privacy_policy_accepted

              (string) Default empty.

              (字符串)默认为空。

                • empty (Not filled)
                • 空(未填充)

                • no (No)
                • 否(否)

                • yes (Yes)
                • 是(是)

              Integrate with Contact Form 7

              与联系表格7集成

              Bin Opt-In works best with contact form seven.

              Bin Opt-In最适用于联系表七。

              To integrate it into your contact forms, you need to add custom code like this to your theme functions.php.

              要将其集成到您的联系表单中,您需要向主题函数.php中添加这样的自定义代码。

              add_action('wpcf7_before_send_mail', 'bin_opt_in_contact');

               add_action('wpcf7_before_send_mail','bin_opt_in_contact');

              function bin_opt_in_contact($cf7)

              函数bin_opt_in_contact($ cf7)

              {    

              {    

              // Get current form id    

              //获取当前表单ID    

              $formId = $cf7->id;    

              $ formId = $ cf7-> id;    

              // Array of form ids    

              //表单ID的数组    

              $forms = [159, 454];    

              $ forms = [159,454];    

              // Only apply to certain forms    

              //仅适用于某些表格    

              if(in_array($formId, $forms))    

              if(in_array($ formId,$ forms))    

              {        

              {        

              // Dont do anything if class is missing        

              //如果缺少课程,请不要做任何事情        

              if(class_exists('BinOptIn'))        

              如果(class_exists('BinOptIn'))        

              {            

              {            

              // At least, the email must be present            

              //至少必须存在该电子邮件            

              if(is_email($_POST['email']))            

              if(is_email($ _ POST ['email']))            

              {                

              {                

              // map salutation                

              //地图称呼                

              $salutationMap = [                    

              $ salutationMap = [                    

              'Frau' => 0,                    

              'Frau'=> 0,                    

              'Madame' => 0,                    

              '女士'=> 0,                    

              'Mrs' => 0,                    

              '太太'=> 0,                    

              'Herr' => 1,                    

              'Herr'=> 1,                    

              'Monsieur' => 1,                    

              '先生'=> 1,                    

              'Mr' => 1,                    

              '先生'=> 1,                    

              '*' => 2                

              '*'=> 2                

              ];                

              ];                

              // assign form data with corresponding meta fields                

              //为表单数据分配相应的元字段                

              $postdata = [];                

              $ postdata = [];                

              $postdata['email'] = sanitize_email($_POST['email']);                

              $ postdata ['email'] = sanitize_email($ _ POST ['email']);                

              $postdata['first_name'] = sanitize_text_field($_POST['first_name']);                

              $ postdata ['first_name'] = sanitize_text_field($ _ POST ['first_name']);                

              $postdata['last_name'] = sanitize_text_field($_POST['last_name']);                

              $ postdata ['last_name'] = sanitize_text_field($ _ POST ['last_name']);                

              $postdata['salutation'] = $salutationMap[$_POST['salutation']];                

              $ postdata ['salutation'] = $ salutationMap [$ _ POST ['salutation']];                

              $postdata['terms_and_conditions_accepted'] = isset($_POST['terms_and_conditions_accepted']) ?

              $ postdata ['terms_and_conditions_accepted'] = isset($ _ POST ['terms_and_conditions_accepted'])吗?

              'yes' : '';                

              '是':'';                

              // save contact                

              //保存联系人                

              BinOptIn::optIn($postdata, [                    

              BinOptIn :: optIn($ postdata,[                    

              'opt_in_admin_message' => false,                    

              'opt_in_admin_message'=>否,                    

              'double_opt_in' => false,                    

              'double_opt_in'=>否,                    

              'admin_unlock' => false,                    

              'admin_unlock'=>否,                    

              'unlock_message' => false                

              'unlock_message'=>否                

              ]);            

              ]);            

              }        

              }        

              }    

              }    

              }

              }

              }

              }

              Integrate with Contact Form 7 Multi-Step Pro

              与Contact Form 7 Multi-Step Pro集成

              Save form data at every step by using the filter wpcf7_validate.

              使用过滤器 wpcf7_validate 在每一步保存表单数据。

              add_filter('wpcf7_validate', 'save_contact_step', 10, 2);

              add_filter('wpcf7_validate','save_contact_step',10,2);

              function save_contact_step($result, $tags)

              函数save_contact_step($ result,$ tags)

              {    

              {    

              // Get current form id    

              //获取当前表单ID    

              $formId = $_POST['_wpcf7'];    

              $ formId = $ _POST ['_ wpcf7'];    

              // Array of form ids    

              //表单ID的数组    

              $forms = [159, 454];    

              $ forms = [159,454];    

              // Only apply to certain forms    

              //仅适用于某些表格    

              if(in_array($formId, $forms))    

              if(in_array($ formId,$ forms))    

              {        

              {        

              // Dont do anything if class is missing        

              //如果缺少课程,请不要做任何事情        

              if(class_exists('BinOptIn'))        

              如果(class_exists('BinOptIn'))        

              {            

              {            

              // save contact info here            

              //在此处保存联系信息            

              // BinOptIn::optIn()        

              // BinOptIn :: optIn()        

              }    

              }    

              }    

              }    

              return $result;

              返回$ result;

              }

              }

安装步骤

    1. Download, unzip and upload to your WordPress plugins directory
    2. 下载,解压缩并上传到您的WordPress插件目录

    3. Activate the plugin within you WordPress Administration Backend
    4. 在您的WordPress管理后端中激活插件

下载地址
https://downloads.wordpress.org/plugin/bin-opt-in.1.0.1.zip
-EOF-

AI助手支持GPT4.0


国内超级便宜服务器

摸鱼人热门新闻聚合

钻级赞助商 我要加入

开发者在线工具

第三方支付技术请加QQ群

相关文章
[wordpress插件] Business Era Extension业务时代扩展
[wordpress插件] Cryptocurrency Widgets Pack加密货币小工具包
[wordpress插件] Freewheel Viewer飞轮查看器
[wordpress插件] Animated AL List动画AL清单
[wordpress插件] Debug Elementor调试Elementor
随便看看
怎么添加小程序支付功能? 4516
教育科技公司申请微信支付被拒绝? 4799
微信公众号免300认证教程 5892
小程序已经上线,作为管理员无法在小程序数据助手查看数据? 5299
小程序广告组件通过审核,但是小程序内没有显示广告? 5067
企业微信通讯录账号被管理员误/恶意删除,怎么办? 9568
问题? 9048
如何快速搭建抽奖助手小程序(无需代码知识) 6177
许涛 大哥在吗, 要解冻小程序的时候提示信息主体不一致, 能帮忙看下吗? 7472
小程序搜一搜全称搜索不显示 麻烦解决一下!谢谢 6793