PluginProbe
weForms – Easy Drag & Drop Contact Form Builder For WordPress / 1.1.0
weForms – Easy Drag & Drop Contact Form Builder For WordPress v1.1.0
1.6.7 1.6.8 1.6.9 1.6.12 1.6.13 1.6.14 1.6.15 1.6.16 1.6.17 1.6.18 1.6.19 1.6.2 1.6.20 1.6.21 1.6.22 1.6.23 1.6.24 1.6.25 1.6.26 1.6.27 1.6.28 1.6.3 1.6.4 1.6.5 1.6.6 All 74 releases
weforms / includes / admin / class-pro-upgrades.php

class-pro-upgrades.php in weForms – Easy Drag & Drop Contact Form Builder For WordPress 1.1.0, at includes/admin/class-pro-upgrades.php

125 lines 3.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * The Pro Integrations
5 */
6 class WeForms_Pro_Upgrades {
7
8 /**
9 * Initialize
10 */
11 function __construct() {
12
13 if ( class_exists( 'WeForms_Pro' ) ) {
14 return;
15 }
16
17 add_filter( 'weforms_integrations', array( $this, 'register_pro_integrations' ) );
18
19 // form fields
20 add_filter( 'weforms_field_get_js_settings', array( $this, 'add_conditional_field_prompt' ) );
21 add_filter( 'weforms_form_fields', array( $this, 'register_pro_fields' ) );
22 add_filter( 'weforms_field_groups_custom', array( $this, 'add_to_custom_fields' ) );
23 add_filter( 'weforms_field_groups_others', array( $this, 'add_to_others_fields' ) );
24 }
25
26 /**
27 * Register the pro integrations
28 *
29 * @param array $integrations
30 *
31 * @return array
32 */
33 public function register_pro_integrations( $integrations ) {
34 require_once WEFORMS_INCLUDES . '/admin/class-pro-upgrade-integrations.php';
35
36 $pro = array(
37 WeForms_Pro_Integration_MailChimp::class,
38 WeForms_Pro_Integration_CM::class,
39 WeForms_Pro_Integration_CC::class,
40 WeForms_Pro_Integration_MailPoet::class,
41 WeForms_Pro_Integration_AWeber::class,
42 WeForms_Pro_Integration_ConvertKit::class
43 );
44
45 return array_merge( $integrations, $pro );
46 }
47
48 /**
49 * Register pro fields
50 *
51 * @param array $fields
52 *
53 * @return array
54 */
55 public function register_pro_fields( $fields ) {
56 if ( ! class_exists( 'WeForms_Form_Field_Pro' ) ) {
57 require_once WEFORMS_INCLUDES . '/fields/class-fields-pro.php';
58 }
59
60 require_once WEFORMS_INCLUDES . '/admin/class-pro-upgrade-fields.php';
61
62 $fields['repeat_field'] = new WeForms_Form_Field_Repeat();
63 $fields['date_field'] = new WeForms_Form_Field_Date();
64 $fields['file_upload'] = new WeForms_Form_Field_File();
65 $fields['country_list_field'] = new WeForms_Form_Field_Country();
66 $fields['numeric_text_field'] = new WeForms_Form_Field_Numeric();
67 $fields['address_field'] = new WeForms_Form_Field_Address();
68 $fields['google_map'] = new WeForms_Form_Field_GMap();
69 $fields['shortcode'] = new WeForms_Form_Field_Shortcode();
70 $fields['action_hook'] = new WeForms_Form_Field_Hook();
71 $fields['toc'] = new WeForms_Form_Field_Toc();
72 $fields['ratings'] = new WeForms_Form_Field_Rating();
73 $fields['step_start'] = new WeForms_Form_Field_Step();
74
75 return $fields;
76 }
77
78 /**
79 * Register fields to custom field section
80 *
81 * @param array $fields
82 */
83 public function add_to_custom_fields( $fields ) {
84 $pro_fields = array(
85 'repeat_field', 'date_field', 'file_upload', 'country_list_field',
86 'numeric_text_field', 'address_field', 'google_map', 'step_start'
87 );
88
89 return array_merge( $fields, $pro_fields );
90 }
91
92 /**
93 * Register fields to others field section
94 *
95 * @param array $fields
96 */
97 public function add_to_others_fields( $fields ) {
98 $pro_fields = array(
99 'shortcode', 'action_hook', 'toc', 'ratings'
100 );
101
102 return array_merge( $fields, $pro_fields );
103 }
104
105 /**
106 * Add conditional logic prompt
107 *
108 * @param array $settings
109 */
110 public function add_conditional_field_prompt( $settings ) {
111
112 $settings['settings'][] = array(
113 'name' => 'wpuf_cond',
114 'title' => __( 'Conditional Logic', 'weforms' ),
115 'type' => 'option-pro-feature-alert',
116 'section' => 'advanced',
117 'priority' => 30,
118 'help_text' => '',
119 'is_pro_feature' => true
120 );
121
122 return $settings;
123 }
124 }
125