WP User Frontend – Membership, Profile, Registration & Post Submission Plugin for WordPress - Version 3.1.0

Version Description

Download this release

Release Info

Developer rabbii
Plugin Icon 128x128 WP User Frontend – Membership, Profile, Registration & Post Submission Plugin for WordPress
Version 3.1.0
Comparing to
See all releases

Code changes from version 3.0.1 to 3.1.0

Files changed (129) hide show
  1. admin/class-admin-settings.php +6 -0
  2. admin/form-builder/class-wpuf-admin-form-builder.php +2 -66
  3. admin/form-builder/class-wpuf-form-builder-field-settings.php +1 -982
  4. admin/form.php +28 -405
  5. admin/html/form-settings-post-edit.php +12 -0
  6. admin/html/whats-new.php +36 -0
  7. admin/installer.php +0 -0
  8. admin/posting.php +166 -50
  9. admin/premium.php +1 -1
  10. admin/promotion.php +139 -0
  11. admin/template-post.php +0 -0
  12. admin/template.php +0 -0
  13. admin/tools.php +0 -0
  14. assets/css/admin.css +0 -0
  15. assets/css/admin/gutenblock-editor.css +0 -0
  16. assets/css/admin/gutenblock.css +94 -9
  17. assets/css/chosen/chosen-sprite.png +0 -0
  18. assets/css/chosen/chosen-sprite@2x.png +0 -0
  19. assets/css/chosen/chosen.css +0 -0
  20. assets/css/frontend-forms.css +2 -0
  21. assets/css/images/ui-bg_diagonals-small_75_cccccc_40x40.png +0 -0
  22. assets/css/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  23. assets/css/images/ui-bg_flat_0_ffffff_40x100.png +0 -0
  24. assets/css/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  25. assets/css/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  26. assets/css/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  27. assets/css/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  28. assets/css/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  29. assets/css/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  30. assets/css/images/ui-icons_222222_256x240.png +0 -0
  31. assets/css/images/ui-icons_2e83ff_256x240.png +0 -0
  32. assets/css/images/ui-icons_454545_256x240.png +0 -0
  33. assets/css/images/ui-icons_888888_256x240.png +0 -0
  34. assets/css/images/ui-icons_cd0a0a_256x240.png +0 -0
  35. assets/css/jquery-ui-1.9.1.custom.css +0 -0
  36. assets/css/jquery.smallipop.css +0 -0
  37. assets/css/wpuf.css +0 -0
  38. assets/images/add.png +0 -0
  39. assets/images/arrow-move.png +0 -0
  40. assets/images/arrows.png +0 -0
  41. assets/images/cross.png +0 -0
  42. assets/images/del.png +0 -0
  43. assets/images/delete.png +0 -0
  44. assets/images/edit.png +0 -0
  45. assets/images/help.png +0 -0
  46. assets/images/no-image.png +0 -0
  47. assets/images/paypal.png +0 -0
  48. assets/images/remove.png +0 -0
  49. assets/images/tick.png +0 -0
  50. assets/images/wpspin_light.gif +0 -0
  51. assets/js/admin/blockFrameSetup.js +15 -0
  52. assets/js/admin/gutenblock.js +159 -40
  53. assets/js/chosen.jquery.js +0 -0
  54. assets/js/conditional.js +0 -0
  55. assets/js/frontend-form.js +0 -0
  56. assets/js/frontend-form.min.js +0 -0
  57. assets/js/jquery-ui-timepicker-addon.js +0 -0
  58. assets/js/jquery.smallipop-0.4.0.min.js +0 -0
  59. assets/js/jquery.validate.min.js +0 -0
  60. assets/js/subscriptions.js +0 -0
  61. assets/js/upload.js +0 -0
  62. assets/js/upload.min.js +0 -0
  63. assets/js/wpuf-admin.js +28 -1
  64. assets/less/frontend-forms.less +2 -0
  65. assets/vendor/vue/vue.js +0 -0
  66. assets/vendor/vue/vue.min.js +0 -0
  67. assets/vendor/vuex/vuex.js +0 -0
  68. assets/vendor/vuex/vuex.min.js +0 -0
  69. class/admin-asset-loader.php +1 -3
  70. class/frontend-dashboard.php +0 -6
  71. class/frontend-form-post.php +55 -14
  72. class/payment.php +0 -0
  73. class/post-form-template.php +14 -0
  74. class/post-form-templates/post.php +106 -99
  75. class/render-form.php +0 -0
  76. class/subscription.php +0 -0
  77. class/upload.php +0 -0
  78. includes/class-field-manager.php +359 -0
  79. includes/class-form.php +387 -150
  80. includes/class-frontend-form-post.php +933 -0
  81. includes/class-frontend-render-form.php +751 -0
  82. includes/class-gutenblock.php +65 -45
  83. includes/class-pro-upgrades.php +109 -0
  84. includes/class-user.php +18 -0
  85. includes/fields/class-abstract-fields.php +880 -0
  86. includes/fields/class-field-checkbox.php +145 -0
  87. includes/fields/class-field-dropdown.php +124 -0
  88. includes/fields/class-field-email.php +123 -0
  89. includes/fields/class-field-featured-image.php +144 -0
  90. includes/fields/class-field-hidden.php +83 -0
  91. includes/fields/class-field-html.php +85 -0
  92. includes/fields/class-field-image.php +166 -0
  93. includes/fields/class-field-multidropdown.php +127 -0
  94. includes/fields/class-field-numeric.php +34 -0
  95. includes/fields/class-field-post-content.php +179 -0
  96. includes/fields/class-field-post-excerpt.php +163 -0
  97. includes/fields/class-field-post-tags.php +113 -0
  98. includes/fields/class-field-post-taxonomy.php +345 -0
  99. includes/fields/class-field-post-title.php +133 -0
  100. includes/fields/class-field-pro.php +46 -0
  101. includes/fields/class-field-radio.php +138 -0
  102. includes/fields/class-field-recaptcha.php +223 -0
  103. includes/fields/class-field-sectionbreak.php +95 -0
  104. includes/fields/class-field-text.php +158 -0
  105. includes/fields/class-field-textarea.php +153 -0
  106. includes/fields/class-field-url.php +119 -0
  107. includes/fields/class-pro-upgrade-fields.php +209 -0
  108. includes/fields/field-trait.php +42 -0
  109. includes/free/admin/form-builder/class-wpuf-form-builder-field-settings-free.php +0 -267
  110. includes/free/admin/form-builder/class-wpuf-form-builder-free.php +1 -64
  111. includes/free/class-login.php +9 -9
  112. includes/free/class-registration.php +33 -0
  113. includes/free/edit-profile.php +23 -2
  114. includes/free/post-form-templates/woocommerce.php +2 -1
  115. languages/readme.txt +0 -0
  116. languages/wp-user-frontend.pot +1216 -1012
  117. lib/class.settings-api.php +0 -0
  118. lib/gateway/bank.php +0 -0
  119. lib/recaptchalib.php +0 -0
  120. readme.txt +41 -2
  121. templates/dashboard.php +0 -0
  122. templates/dashboard/dashboard.php +15 -13
  123. templates/logged-in.php +0 -0
  124. templates/login-form.php +0 -0
  125. templates/lost-pass-form.php +0 -0
  126. templates/reset-pass-form.php +0 -0
  127. templates/subscriptions/pack-details.php +1 -2
  128. wpuf-functions.php +36 -10
  129. wpuf.php +181 -4
admin/class-admin-settings.php CHANGED
@@ -401,6 +401,12 @@ class WPUF_Admin_Settings {
401
 
402
  wp_enqueue_style( 'wpuf-admin', WPUF_ASSET_URI . '/css/admin.css', false, WPUF_VERSION );
403
  wp_enqueue_script( 'wpuf-admin-script', WPUF_ASSET_URI . '/js/wpuf-admin.js', array( 'jquery' ), false, WPUF_VERSION );
 
 
 
 
 
 
404
  }
405
 
406
  }
401
 
402
  wp_enqueue_style( 'wpuf-admin', WPUF_ASSET_URI . '/css/admin.css', false, WPUF_VERSION );
403
  wp_enqueue_script( 'wpuf-admin-script', WPUF_ASSET_URI . '/js/wpuf-admin.js', array( 'jquery' ), false, WPUF_VERSION );
404
+
405
+ wp_localize_script( 'wpuf-admin-script', 'wpuf_admin_script', array(
406
+ 'ajaxurl' => admin_url( 'admin-ajax.php' ),
407
+ 'nonce' => wp_create_nonce( 'wpuf_nonce' ),
408
+ 'cleared_schedule_lock' => __( 'Schedule lock has been cleared', 'wp-user-frontend' ),
409
+ ) );
410
  }
411
 
412
  }
admin/form-builder/class-wpuf-admin-form-builder.php CHANGED
@@ -139,8 +139,8 @@ class WPUF_Admin_Form_Builder {
139
  'i18n' => $this->i18n(),
140
  'post' => $post,
141
  'form_fields' => wpuf_get_form_fields( $post->ID ),
142
- 'panel_sections' => $this->get_panel_sections(),
143
- 'field_settings' => WPUF_Form_Builder_Field_Settings::get_field_settings(),
144
  'notifications' => wpuf_get_form_notifications( $post->ID ),
145
  'pro_link' => WPUF_Pro_Prompt::get_pro_url(),
146
  'site_url' => site_url('/'),
@@ -248,70 +248,6 @@ class WPUF_Admin_Form_Builder {
248
  include WPUF_ROOT . '/admin/form-builder/views/form-builder.php';
249
  }
250
 
251
- /**
252
- * Add Fields panel sections
253
- *
254
- * @since 2.5
255
- *
256
- * @return array
257
- */
258
- private function get_panel_sections() {
259
- $before_custom_fields = apply_filters( 'wpuf-form-builder-fields-section-before', array() );
260
-
261
- $sections = array_merge( $before_custom_fields, $this->get_custom_fields() );
262
- $sections = array_merge( $sections, $this->get_others_fields() );
263
-
264
- $after_custom_fields = apply_filters( 'wpuf-form-builder-fields-section-after', array() );
265
-
266
- $sections = array_merge( $sections, $after_custom_fields );
267
-
268
- return $sections;
269
- }
270
-
271
- /**
272
- * Custom field section
273
- *
274
- * @since 2.5
275
- *
276
- * @return array
277
- */
278
- private function get_custom_fields() {
279
- $fields = apply_filters( 'wpuf-form-builder-fields-custom-fields', array(
280
- 'text_field', 'textarea_field', 'dropdown_field', 'multiple_select',
281
- 'radio_field', 'checkbox_field', 'website_url', 'email_address',
282
- 'custom_hidden_field', 'image_upload'
283
- ) );
284
-
285
- return array(
286
- array(
287
- 'title' => __( 'Custom Fields', 'wp-user-frontend' ),
288
- 'id' => 'custom-fields',
289
- 'fields' => $fields
290
- )
291
- );
292
- }
293
-
294
- /**
295
- * Others field section
296
- *
297
- * @since 2.5
298
- *
299
- * @return array
300
- */
301
- private function get_others_fields() {
302
- $fields = apply_filters( 'wpuf-form-builder-fields-others-fields', array(
303
- 'section_break', 'custom_html', 'recaptcha'
304
- ) );
305
-
306
- return array(
307
- array(
308
- 'title' => __( 'Others', 'wp-user-frontend' ),
309
- 'id' => 'others',
310
- 'fields' => $fields
311
- )
312
- );
313
- }
314
-
315
  /**
316
  * i18n translatable strings
317
  *
139
  'i18n' => $this->i18n(),
140
  'post' => $post,
141
  'form_fields' => wpuf_get_form_fields( $post->ID ),
142
+ 'panel_sections' => wpuf()->fields->get_field_groups(),
143
+ 'field_settings' => wpuf()->fields->get_js_settings(),
144
  'notifications' => wpuf_get_form_notifications( $post->ID ),
145
  'pro_link' => WPUF_Pro_Prompt::get_pro_url(),
146
  'site_url' => site_url('/'),
248
  include WPUF_ROOT . '/admin/form-builder/views/form-builder.php';
249
  }
250
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
251
  /**
252
  * i18n translatable strings
253
  *
admin/form-builder/class-wpuf-form-builder-field-settings.php CHANGED
@@ -12,989 +12,8 @@ class WPUF_Form_Builder_Field_Settings {
12
  * @return array
13
  */
14
  public static function get_field_settings() {
15
- return apply_filters( 'wpuf-form-builder-field-settings', array(
16
- 'text_field' => self::text_field(),
17
- 'textarea_field' => self::textarea_field(),
18
- 'dropdown_field' => self::dropdown_field(),
19
- 'multiple_select' => self::multiple_select(),
20
- 'radio_field' => self::radio_field(),
21
- 'checkbox_field' => self::checkbox_field(),
22
- 'website_url' => self::website_url(),
23
- 'email_address' => self::email_address(),
24
- 'custom_hidden_field' => self::custom_hidden_field(),
25
- 'image_upload' => self::image_upload(),
26
- 'section_break' => self::section_break(),
27
- 'custom_html' => self::custom_html(),
28
- 'recaptcha' => self::recaptcha(),
29
- ) );
30
- }
31
-
32
- /**
33
- * Common properties for all kinds of fields
34
- *
35
- * @since 2.5
36
- *
37
- * @param boolean $is_meta
38
- *
39
- * @return array
40
- */
41
- public static function get_common_properties( $is_meta = true ) {
42
- $common_properties = array(
43
- array(
44
- 'name' => 'label',
45
- 'title' => __( 'Field Label', 'wp-user-frontend' ),
46
- 'type' => 'text',
47
- 'section' => 'basic',
48
- 'priority' => 10,
49
- 'help_text' => __( 'Enter a title of this field', 'wp-user-frontend' ),
50
- ),
51
-
52
- array(
53
- 'name' => 'help',
54
- 'title' => __( 'Help text', 'wp-user-frontend' ),
55
- 'type' => 'text',
56
- 'section' => 'basic',
57
- 'priority' => 20,
58
- 'help_text' => __( 'Give the user some information about this field', 'wp-user-frontend' ),
59
- ),
60
-
61
- array(
62
- 'name' => 'required',
63
- 'title' => __( 'Required', 'wp-user-frontend' ),
64
- 'type' => 'radio',
65
- 'options' => array(
66
- 'yes' => __( 'Yes', 'wp-user-frontend' ),
67
- 'no' => __( 'No', 'wp-user-frontend' ),
68
- ),
69
- 'section' => 'basic',
70
- 'priority' => 21,
71
- 'default' => 'no',
72
- 'inline' => true,
73
- 'help_text' => __( 'Check this option to mark the field required. A form will not submit unless all required fields are provided.', 'wp-user-frontend' ),
74
- ),
75
-
76
- array(
77
- 'name' => 'width',
78
- 'title' => __( 'Field Size', 'wp-user-frontend' ),
79
- 'type' => 'radio',
80
- 'options' => array(
81
- 'small' => __( 'Small', 'wp-user-frontend' ),
82
- 'medium' => __( 'Medium', 'wp-user-frontend' ),
83
- 'large' => __( 'Large', 'wp-user-frontend' ),
84
- ),
85
- 'section' => 'advanced',
86
- 'priority' => 23,
87
- 'default' => 'large',
88
- 'inline' => true,
89
- ),
90
-
91
- array(
92
- 'name' => 'css',
93
- 'title' => __( 'CSS Class Name', 'wp-user-frontend' ),
94
- 'type' => 'text',
95
- 'section' => 'advanced',
96
- 'priority' => 22,
97
- 'help_text' => __( 'Provide a container class name for this field. Available classes: wpuf-col-half, wpuf-col-half-last, wpuf-col-one-third, wpuf-col-one-third-last', 'wp-user-frontend' ),
98
- )
99
- );
100
-
101
- if ( is_wpuf_post_form_builder() ) {
102
- $common_properties = array_merge($common_properties, array(
103
- array(
104
- 'name' => 'wpuf_visibility',
105
- 'title' => __( 'Visibility', 'wp-user-frontend' ),
106
- 'type' => 'visibility',
107
- 'section' => 'advanced',
108
- 'options' => array(
109
- 'everyone' => __( 'Everyone', 'wp-user-frontend' ),
110
- 'hidden' => __( 'Hidden', 'wp-user-frontend' ),
111
- 'logged_in' => __( 'Logged in users only', 'wp-user-frontend' ),
112
- 'subscribed_users' => __( 'Subscription users only', 'wp-user-frontend' ),
113
- ),
114
- 'priority' => 30,
115
- 'inline' => true,
116
- 'help_text' => __( 'Select option', 'wp-user-frontend' ),
117
- )
118
- ));
119
- }
120
-
121
- if ( $is_meta ) {
122
- $common_properties = array_merge($common_properties, array(
123
- array(
124
- 'name' => 'name',
125
- 'title' => __( 'Meta Key', 'wp-user-frontend' ),
126
- 'type' => 'text-meta',
127
- 'section' => 'basic',
128
- 'priority' => 11,
129
- 'help_text' => __( 'Name of the meta key this field will save to', 'wp-user-frontend' ),
130
- )
131
- ));
132
-
133
- if ( is_wpuf_post_form_builder() ) {
134
- $common_properties = array_merge($common_properties, array(
135
- array(
136
- 'name' => 'show_in_post',
137
- 'title' => __( 'Show Data in Post', 'wp-user-frontend' ),
138
- 'type' => 'radio',
139
- 'options' => array(
140
- 'yes' => __( 'Yes', 'wp-user-frontend' ),
141
- 'no' => __( 'No', 'wp-user-frontend' ),
142
- ),
143
- 'section' => 'advanced',
144
- 'priority' => 24,
145
- 'default' => 'yes',
146
- 'inline' => true,
147
- 'help_text' => __( 'Select Yes if you want to show the field data in single post.', 'wp-user-frontend' ),
148
- ),
149
- array(
150
- 'name' => 'hide_field_label',
151
- 'title' => __( 'Hide Field Label in Post', 'wp-user-frontend' ),
152
- 'type' => 'radio',
153
- 'options' => array(
154
- 'yes' => __( 'Yes', 'wp-user-frontend' ),
155
- 'no' => __( 'No', 'wp-user-frontend' ),
156
- ),
157
- 'section' => 'advanced',
158
- 'priority' => 24,
159
- 'default' => 'no',
160
- 'inline' => true,
161
- 'help_text' => __( 'Select Yes if you want to hide the field label in single post.', 'wp-user-frontend' ),
162
- )
163
- ));
164
- }
165
- }
166
-
167
- return apply_filters( 'wpuf-form-builder-fields-common-properties', $common_properties );
168
- }
169
-
170
- /**
171
- * Common properties of a text input field
172
- *
173
- * @since 2.5
174
- *
175
- * @return array
176
- */
177
- public static function get_common_text_properties( $word_restriction = false ) {
178
- $properties = array(
179
- array(
180
- 'name' => 'placeholder',
181
- 'title' => __( 'Placeholder text', 'wp-user-frontend' ),
182
- 'type' => 'text',
183
- 'section' => 'advanced',
184
- 'priority' => 10,
185
- 'help_text' => __( 'Text for HTML5 placeholder attribute', 'wp-user-frontend' ),
186
- ),
187
-
188
- array(
189
- 'name' => 'default',
190
- 'title' => __( 'Default value', 'wp-user-frontend' ),
191
- 'type' => 'text',
192
- 'section' => 'advanced',
193
- 'priority' => 11,
194
- 'help_text' => __( 'The default value this field will have', 'wp-user-frontend' ),
195
- ),
196
-
197
- array(
198
- 'name' => 'size',
199
- 'title' => __( 'Size', 'wp-user-frontend' ),
200
- 'type' => 'text',
201
- 'variation' => 'number',
202
- 'section' => 'advanced',
203
- 'priority' => 20,
204
- 'help_text' => __( 'Size of this input field', 'wp-user-frontend' ),
205
- )
206
- );
207
-
208
- if ( $word_restriction ) {
209
- $properties[] = array(
210
- 'name' => 'word_restriction',
211
- 'title' => __( 'Word Restriction', 'wp-user-frontend' ),
212
- 'type' => 'text',
213
- 'section' => 'advanced',
214
- 'priority' => 15,
215
- 'help_text' => __( 'Numebr of words the author to be restricted in', 'wp-user-frontend' ),
216
- );
217
- }
218
-
219
- return apply_filters( 'wpuf-form-builder-common-text-fields-properties', $properties );
220
- }
221
-
222
- /**
223
- * Common properties of a textarea field
224
- *
225
- * @since 2.5
226
- *
227
- * @return array
228
- */
229
- public static function get_common_textarea_properties() {
230
- return array(
231
- array(
232
- 'name' => 'rows',
233
- 'title' => __( 'Rows', 'wp-user-frontend' ),
234
- 'type' => 'text',
235
- 'section' => 'advanced',
236
- 'priority' => 10,
237
- 'help_text' => __( 'Number of rows in textarea', 'wp-user-frontend' ),
238
- ),
239
-
240
- array(
241
- 'name' => 'cols',
242
- 'title' => __( 'Columns', 'wp-user-frontend' ),
243
- 'type' => 'text',
244
- 'section' => 'advanced',
245
- 'priority' => 11,
246
- 'help_text' => __( 'Number of columns in textarea', 'wp-user-frontend' ),
247
- ),
248
-
249
- array(
250
- 'name' => 'placeholder',
251
- 'title' => __( 'Placeholder text', 'wp-user-frontend' ),
252
- 'type' => 'text',
253
- 'section' => 'advanced',
254
- 'priority' => 12,
255
- 'help_text' => __( 'Text for HTML5 placeholder attribute', 'wp-user-frontend' ),
256
- 'dependencies' => array(
257
- 'rich' => 'no'
258
- )
259
- ),
260
-
261
- array(
262
- 'name' => 'default',
263
- 'title' => __( 'Default value', 'wp-user-frontend' ),
264
- 'type' => 'text',
265
- 'section' => 'advanced',
266
- 'priority' => 13,
267
- 'help_text' => __( 'The default value this field will have', 'wp-user-frontend' ),
268
- ),
269
-
270
- array(
271
- 'name' => 'rich',
272
- 'title' => __( 'Textarea', 'wp-user-frontend' ),
273
- 'type' => 'radio',
274
- 'options' => array(
275
- 'no' => __( 'Normal', 'wp-user-frontend' ),
276
- 'yes' => __( 'Rich textarea', 'wp-user-frontend' ),
277
- 'teeny' => __( 'Teeny Rich textarea', 'wp-user-frontend' ),
278
- ),
279
- 'section' => 'advanced',
280
- 'priority' => 14,
281
- 'default' => 'no',
282
- ),
283
-
284
- array(
285
- 'name' => 'word_restriction',
286
- 'title' => __( 'Word Restriction', 'wp-user-frontend' ),
287
- 'type' => 'text',
288
- 'section' => 'advanced',
289
- 'priority' => 15,
290
- 'help_text' => __( 'Numebr of words the author to be restricted in', 'wp-user-frontend' ),
291
- ),
292
- );
293
- }
294
-
295
- /**
296
- * wpuf_visibility property for all fields
297
- *
298
- * @since 2.6
299
- *
300
- * @return array
301
- */
302
- public static function get_wpuf_visibility_prop( $default = 'everyone' ) {
303
- return array(
304
- 'selected' => $default,
305
- 'choices' => array()
306
- );
307
- }
308
-
309
- /**
310
- * wpuf_cond property for all fields
311
- *
312
- * @since 2.5
313
- *
314
- * @return array
315
- */
316
- public static function get_wpuf_cond_prop() {
317
- return array(
318
- 'condition_status' => 'no',
319
- 'cond_field' => array(),
320
- 'cond_operator' => array( '=' ),
321
- 'cond_option' => array( __( '- select -', 'wp-user-frontend' ) ),
322
- 'cond_logic' => 'all'
323
- );
324
- }
325
-
326
- /**
327
- * Text field settings
328
- *
329
- * @since 2.5
330
- *
331
- * @return array
332
- */
333
- public static function text_field() {
334
- $settings = self::get_common_properties();
335
- $settings = array_merge( $settings, self::get_common_text_properties( true ) );
336
-
337
- return array(
338
- 'template' => 'text_field',
339
- 'title' => __( 'Text', 'wp-user-frontend' ),
340
- 'icon' => 'text-width',
341
- 'settings' => $settings,
342
- 'field_props' => array(
343
- 'input_type' => 'text',
344
- 'template' => 'text_field',
345
- 'required' => 'no',
346
- 'label' => __( 'Text', 'wp-user-frontend' ),
347
- 'name' => '',
348
- 'is_meta' => 'yes',
349
- 'help' => '',
350
- 'width' => '',
351
- 'css' => '',
352
- 'placeholder' => '',
353
- 'default' => '',
354
- 'size' => 40,
355
- 'word_restriction' => '',
356
- 'id' => 0,
357
- 'is_new' => true,
358
- 'show_in_post' => 'yes',
359
- 'hide_field_label' => 'no',
360
- 'wpuf_visibility' => self::get_wpuf_visibility_prop(),
361
- 'wpuf_cond' => self::get_wpuf_cond_prop()
362
- )
363
- );
364
- }
365
-
366
- /**
367
- * Textarea field settings
368
- *
369
- * @since 2.5
370
- *
371
- * @return array
372
- */
373
- public static function textarea_field() {
374
- $settings = self::get_common_properties();
375
- $settings = array_merge( $settings, self::get_common_textarea_properties() );
376
-
377
- return array(
378
- 'template' => 'textarea_field',
379
- 'title' => __( 'Textarea', 'wp-user-frontend' ),
380
- 'icon' => 'paragraph',
381
- 'settings' => $settings,
382
- 'field_props' => array(
383
- 'input_type' => 'textarea',
384
- 'template' => 'textarea_field',
385
- 'required' => 'no',
386
- 'label' => __( 'Textarea', 'wp-user-frontend' ),
387
- 'name' => '',
388
- 'is_meta' => 'yes',
389
- 'help' => '',
390
- 'width' => '',
391
- 'css' => '',
392
- 'rows' => 5,
393
- 'cols' => 25,
394
- 'placeholder' => '',
395
- 'default' => '',
396
- 'rich' => 'no',
397
- 'word_restriction' => '',
398
- 'id' => 0,
399
- 'is_new' => true,
400
- 'show_in_post' => 'yes',
401
- 'hide_field_label' => 'no',
402
- 'wpuf_visibility' => self::get_wpuf_visibility_prop(),
403
- 'wpuf_cond' => self::get_wpuf_cond_prop()
404
- )
405
- );
406
- }
407
-
408
- /**
409
- * Option data for option based fields
410
- *
411
- * @since 2.5
412
- *
413
- * @param boolean $is_multiple
414
- *
415
- * @return array
416
- */
417
- public static function get_option_data_setting( $is_multiple = false ) {
418
- return array(
419
- 'name' => 'options',
420
- 'title' => __( 'Options', 'wp-user-frontend' ),
421
- 'type' => 'option-data',
422
- 'is_multiple' => $is_multiple,
423
- 'section' => 'basic',
424
- 'priority' => 12,
425
- 'help_text' => __( 'Add options for the form field', 'wp-user-frontend' ),
426
- );
427
- }
428
-
429
- /**
430
- * Dropdown/Select field settings
431
- *
432
- * @since 2.5
433
- *
434
- * @return array
435
- */
436
- public static function dropdown_field() {
437
- $settings = self::get_common_properties();
438
-
439
- $dropdown_settings = array(
440
- self::get_option_data_setting(),
441
-
442
- array(
443
- 'name' => 'first',
444
- 'title' => __( 'Select Text', 'wp-user-frontend' ),
445
- 'type' => 'text',
446
- 'section' => 'basic',
447
- 'priority' => 13,
448
- 'help_text' => __( "First element of the select dropdown. Leave this empty if you don't want to show this field", 'wp-user-frontend' ),
449
- ),
450
- );
451
-
452
- $settings = array_merge( $settings, $dropdown_settings );
453
-
454
- return array(
455
- 'template' => 'dropdown_field',
456
- 'title' => __( 'Dropdown', 'wp-user-frontend' ),
457
- 'icon' => 'caret-square-o-down',
458
- 'settings' => $settings,
459
- 'field_props' => array(
460
- 'input_type' => 'select',
461
- 'template' => 'dropdown_field',
462
- 'required' => 'no',
463
- 'label' => __( 'Dropdown', 'wp-user-frontend' ),
464
- 'name' => '',
465
- 'is_meta' => 'yes',
466
- 'help' => '',
467
- 'width' => '',
468
- 'css' => '',
469
- 'selected' => '',
470
- 'options' => array( 'Option' => __( 'Option', 'wp-user-frontend' ) ),
471
- 'first' => __( '- select -', 'wp-user-frontend' ),
472
- 'id' => 0,
473
- 'is_new' => true,
474
- 'show_in_post' => 'yes',
475
- 'hide_field_label' => 'no',
476
- 'wpuf_visibility' => self::get_wpuf_visibility_prop(),
477
- 'wpuf_cond' => self::get_wpuf_cond_prop()
478
- )
479
- );
480
- }
481
-
482
- /**
483
- * Multiselect field settings
484
- *
485
- * @since 2.5
486
- *
487
- * @return array
488
- */
489
- public static function multiple_select() {
490
- $settings = self::get_common_properties();
491
-
492
- $dropdown_settings = array(
493
- self::get_option_data_setting( true )
494
- );
495
-
496
- $settings = array_merge( $settings, $dropdown_settings );
497
-
498
- return array(
499
- 'template' => 'multiple_select',
500
- 'title' => __( 'Multi Select', 'wp-user-frontend' ),
501
- 'icon' => 'list-ul',
502
- 'settings' => $settings,
503
- 'field_props' => array(
504
- 'input_type' => 'multiselect',
505
- 'template' => 'multiple_select',
506
- 'required' => 'no',
507
- 'label' => __( 'Multi Select', 'wp-user-frontend' ),
508
- 'name' => '',
509
- 'is_meta' => 'yes',
510
- 'help' => '',
511
- 'width' => '',
512
- 'css' => '',
513
- 'selected' => array(),
514
- 'options' => array( 'Option' => __( 'Option', 'wp-user-frontend' ) ),
515
- 'first' => __( '- select -', 'wp-user-frontend' ),
516
- 'id' => 0,
517
- 'is_new' => true,
518
- 'show_in_post' => 'yes',
519
- 'hide_field_label' => 'no',
520
- 'wpuf_visibility' => self::get_wpuf_visibility_prop(),
521
- 'wpuf_cond' => self::get_wpuf_cond_prop()
522
- )
523
- );
524
- }
525
-
526
- /**
527
- * Radio field settings
528
- *
529
- * @since 2.5
530
- *
531
- * @return array
532
- */
533
- public static function radio_field() {
534
- $settings = self::get_common_properties();
535
-
536
- $dropdown_settings = array(
537
- self::get_option_data_setting(),
538
-
539
- array(
540
- 'name' => 'inline',
541
- 'title' => __( 'Show in inline list', 'wp-user-frontend' ),
542
- 'type' => 'radio',
543
- 'options' => array(
544
- 'yes' => __( 'Yes', 'wp-user-frontend' ),
545
- 'no' => __( 'No', 'wp-user-frontend' ),
546
- ),
547
- 'default' => 'no',
548
- 'inline' => true,
549
- 'section' => 'advanced',
550
- 'priority' => 23,
551
- 'help_text' => __( 'Show this option in an inline list', 'wp-user-frontend' ),
552
- )
553
- );
554
-
555
- $settings = array_merge( $settings, $dropdown_settings );
556
-
557
- return array(
558
- 'template' => 'radio_field',
559
- 'title' => __( 'Radio', 'wp-user-frontend' ),
560
- 'icon' => 'dot-circle-o',
561
- 'settings' => $settings,
562
- 'field_props' => array(
563
- 'input_type' => 'radio',
564
- 'template' => 'radio_field',
565
- 'required' => 'no',
566
- 'label' => __( 'Radio Field', 'wp-user-frontend' ),
567
- 'name' => '',
568
- 'is_meta' => 'yes',
569
- 'help' => '',
570
- 'width' => '',
571
- 'css' => '',
572
- 'selected' => '',
573
- 'inline' => 'no',
574
- 'options' => array( 'Option' => __( 'Option', 'wp-user-frontend' ) ),
575
- 'id' => 0,
576
- 'is_new' => true,
577
- 'show_in_post' => 'yes',
578
- 'hide_field_label' => 'no',
579
- 'wpuf_visibility' => self::get_wpuf_visibility_prop(),
580
- 'wpuf_cond' => self::get_wpuf_cond_prop()
581
- )
582
- );
583
- }
584
-
585
- /**
586
- * Checkbox field settings
587
- *
588
- * @since 2.5
589
- *
590
- * @return array
591
- */
592
- public static function checkbox_field() {
593
- $settings = self::get_common_properties();
594
-
595
- $dropdown_settings = array(
596
- self::get_option_data_setting( true ),
597
-
598
- array(
599
- 'name' => 'inline',
600
- 'title' => __( 'Show in inline list', 'wp-user-frontend' ),
601
- 'type' => 'radio',
602
- 'options' => array(
603
- 'yes' => __( 'Yes', 'wp-user-frontend' ),
604
- 'no' => __( 'No', 'wp-user-frontend' ),
605
- ),
606
- 'default' => 'no',
607
- 'inline' => true,
608
- 'section' => 'advanced',
609
- 'priority' => 23,
610
- 'help_text' => __( 'Show this option in an inline list', 'wp-user-frontend' ),
611
- )
612
- );
613
-
614
- $settings = array_merge( $settings, $dropdown_settings );
615
-
616
- return array(
617
- 'template' => 'checkbox_field',
618
- 'title' => __( 'Checkbox', 'wp-user-frontend' ),
619
- 'icon' => 'check-square-o',
620
- 'settings' => $settings,
621
- 'field_props' => array(
622
- 'input_type' => 'checkbox',
623
- 'template' => 'checkbox_field',
624
- 'required' => 'no',
625
- 'label' => __( 'Checkbox Field', 'wp-user-frontend' ),
626
- 'name' => '',
627
- 'is_meta' => 'yes',
628
- 'help' => '',
629
- 'width' => '',
630
- 'css' => '',
631
- 'selected' => array(),
632
- 'inline' => 'no',
633
- 'options' => array( 'Option' => __( 'Option', 'wp-user-frontend' ) ),
634
- 'id' => 0,
635
- 'is_new' => true,
636
- 'show_in_post' => 'yes',
637
- 'hide_field_label' => 'no',
638
- 'wpuf_visibility' => self::get_wpuf_visibility_prop(),
639
- 'wpuf_cond' => self::get_wpuf_cond_prop()
640
- )
641
- );
642
- }
643
-
644
- /**
645
- * Website URL field settings
646
- *
647
- * @since 2.5
648
- *
649
- * @return array
650
- */
651
- public static function website_url() {
652
- $settings = self::get_common_properties();
653
- $settings = array_merge( $settings, self::get_common_text_properties() );
654
- $settings[] = array(
655
- 'name' => 'open_window',
656
- 'title' => __( 'Open in : ', 'wp-user-frontend' ),
657
- 'type' => 'radio',
658
- 'options' => array(
659
- 'same' => __( 'Same Window', 'wp-user-frontend' ),
660
- 'new' => __( 'New Window', 'wp-user-frontend' ),
661
- ),
662
- 'section' => 'basic',
663
- 'default' => 'same',
664
- 'inline' => true,
665
- 'priority' => 32,
666
- 'help_text' => __( 'Choose whether the link will open in new tab or same window', 'wp-user-frontend' ),
667
- );
668
-
669
- return array(
670
- 'template' => 'website_url',
671
- 'title' => __( 'URL', 'wp-user-frontend' ),
672
- 'icon' => 'link',
673
- 'settings' => $settings,
674
- 'field_props' => array(
675
- 'input_type' => 'url',
676
- 'template' => 'website_url',
677
- 'required' => 'no',
678
- 'label' => __( 'URL', 'wp-user-frontend' ),
679
- 'name' => '',
680
- 'is_meta' => 'yes',
681
- 'help' => '',
682
- 'width' => 'large',
683
- 'css' => '',
684
- 'placeholder' => '',
685
- 'default' => '',
686
- 'open_window' => 'same',
687
- 'size' => 40,
688
- 'id' => 0,
689
- 'is_new' => true,
690
- 'show_in_post' => 'yes',
691
- 'hide_field_label' => 'no',
692
- 'wpuf_visibility' => self::get_wpuf_visibility_prop(),
693
- 'wpuf_cond' => self::get_wpuf_cond_prop()
694
- )
695
- );
696
- }
697
-
698
- /**
699
- * Email field settings
700
- *
701
- * @since 2.5
702
- *
703
- * @return array
704
- */
705
- public static function email_address() {
706
- $settings = self::get_common_properties();
707
- $settings = array_merge( $settings, self::get_common_text_properties() );
708
 
709
- return array(
710
- 'template' => 'email_address',
711
- 'title' => __( 'Email Address', 'wp-user-frontend' ),
712
- 'icon' => 'envelope-o',
713
- 'settings' => $settings,
714
- 'field_props' => array(
715
- 'input_type' => 'email',
716
- 'template' => 'email_address',
717
- 'required' => 'no',
718
- 'label' => __( 'Email', 'wp-user-frontend' ),
719
- 'name' => '',
720
- 'is_meta' => 'yes',
721
- 'help' => '',
722
- 'width' => 'large',
723
- 'css' => '',
724
- 'placeholder' => '',
725
- 'default' => '',
726
- 'size' => 40,
727
- 'id' => 0,
728
- 'is_new' => true,
729
- 'show_in_post' => 'yes',
730
- 'hide_field_label' => 'no',
731
- 'wpuf_visibility' => self::get_wpuf_visibility_prop(),
732
- 'wpuf_cond' => self::get_wpuf_cond_prop()
733
- )
734
- );
735
  }
736
 
737
- /**
738
- * Hidden field settings
739
- *
740
- * @since 2.5
741
- *
742
- * @return array
743
- */
744
- public static function custom_hidden_field() {
745
- $settings = array(
746
- array(
747
- 'name' => 'name',
748
- 'title' => __( 'Meta Key', 'wp-user-frontend' ),
749
- 'type' => 'text',
750
- 'section' => 'basic',
751
- 'priority' => 10,
752
- 'help_text' => __( 'Name of the meta key this field will save to', 'wp-user-frontend' ),
753
- ),
754
-
755
- array(
756
- 'name' => 'meta_value',
757
- 'title' => __( 'Meta Value', 'wp-user-frontend' ),
758
- 'type' => 'text',
759
- 'section' => 'basic',
760
- 'priority' => 11,
761
- 'help_text' => __( 'Enter the meta value', 'wp-user-frontend' ),
762
- ),
763
- );
764
-
765
- return array(
766
- 'template' => 'custom_hidden_field',
767
- 'title' => __( 'Hidden Field', 'wp-user-frontend' ),
768
- 'icon' => 'eye-slash',
769
- 'settings' => $settings,
770
- 'field_props' => array(
771
- 'input_type' => 'hidden',
772
- 'template' => 'custom_hidden_field',
773
- 'label' => '',
774
- 'name' => '',
775
- 'meta_value' => '',
776
- 'is_meta' => 'yes',
777
- 'id' => 0,
778
- 'is_new' => true,
779
- 'show_in_post' => 'yes',
780
- 'hide_field_label' => 'no',
781
- 'wpuf_visibility' => self::get_wpuf_visibility_prop(),
782
- 'wpuf_cond' => null
783
- )
784
- );
785
- }
786
-
787
- /**
788
- * Image field settings
789
- *
790
- * @since 2.5
791
- *
792
- * @return array
793
- */
794
- public static function image_upload() {
795
- $settings = self::get_common_properties();
796
-
797
- $settings = array_merge( $settings, array(
798
- array(
799
- 'name' => 'button_label',
800
- 'title' => __( 'Button Label', 'wp-user-frontend' ),
801
- 'type' => 'text',
802
- 'default' => __( 'Select Image', 'wp-user-frontend' ),
803
- 'section' => 'basic',
804
- 'priority' => 30,
805
- 'help_text' => __( 'Enter a label for the Select button', 'wp-user-frontend' ),
806
- ),
807
- array(
808
- 'name' => 'max_size',
809
- 'title' => __( 'Max. file size', 'wp-user-frontend' ),
810
- 'type' => 'text',
811
- 'section' => 'advanced',
812
- 'priority' => 20,
813
- 'help_text' => __( 'Enter maximum upload size limit in KB', 'wp-user-frontend' ),
814
- ),
815
- array(
816
- 'name' => 'count',
817
- 'title' => __( 'Max. files', 'wp-user-frontend' ),
818
- 'type' => 'text',
819
- 'section' => 'advanced',
820
- 'priority' => 21,
821
- 'help_text' => __( 'Number of images can be uploaded', 'wp-user-frontend' ),
822
- ),
823
- ) );
824
-
825
- return array(
826
- 'template' => 'image_upload',
827
- 'title' => __( 'Image Upload', 'wp-user-frontend' ),
828
- 'icon' => 'file-image-o',
829
- 'settings' => $settings,
830
- 'field_props' => array(
831
- 'input_type' => 'image_upload',
832
- 'template' => 'image_upload',
833
- 'required' => 'no',
834
- 'label' => __( 'Image Upload', 'wp-user-frontend' ),
835
- 'name' => '',
836
- 'button_label' => __( 'Select Image', 'wp-user-frontend' ),
837
- 'is_meta' => 'yes',
838
- 'help' => '',
839
- 'width' => '',
840
- 'css' => '',
841
- 'max_size' => '1024',
842
- 'count' => '1',
843
- 'id' => 0,
844
- 'is_new' => true,
845
- 'show_in_post' => 'yes',
846
- 'hide_field_label' => 'no',
847
- 'wpuf_visibility' => self::get_wpuf_visibility_prop(),
848
- 'wpuf_cond' => self::get_wpuf_cond_prop()
849
- )
850
- );
851
- }
852
-
853
- /**
854
- * Section break field settings
855
- *
856
- * @since 2.5
857
- *
858
- * @return array
859
- */
860
- public static function section_break() {
861
- $settings = array(
862
- array(
863
- 'name' => 'label',
864
- 'title' => __( 'Title', 'wp-user-frontend' ),
865
- 'type' => 'text',
866
- 'section' => 'basic',
867
- 'priority' => 10,
868
- 'help_text' => __( 'Title of the section', 'wp-user-frontend' ),
869
- ),
870
-
871
- array(
872
- 'name' => 'description',
873
- 'title' => __( 'Description', 'wp-user-frontend' ),
874
- 'type' => 'textarea',
875
- 'section' => 'basic',
876
- 'priority' => 11,
877
- 'help_text' => __( 'Some details text about the section', 'wp-user-frontend' ),
878
- ),
879
- );
880
-
881
- return array(
882
- 'template' => 'section_break',
883
- 'title' => __( 'Section Break', 'wp-user-frontend' ),
884
- 'icon' => 'columns',
885
- 'is_full_width' => true,
886
- 'settings' => $settings,
887
- 'field_props' => array(
888
- 'input_type' => 'section_break',
889
- 'template' => 'section_break',
890
- 'label' => __( 'Section Break', 'wp-user-frontend' ),
891
- 'description' => __( 'Some description about this section', 'wp-user-frontend' ),
892
- 'id' => 0,
893
- 'is_new' => true,
894
- 'show_in_post' => 'yes',
895
- 'hide_field_label' => 'no',
896
- 'wpuf_visibility' => self::get_wpuf_visibility_prop(),
897
- 'wpuf_cond' => self::get_wpuf_cond_prop()
898
- )
899
- );
900
- }
901
-
902
- /**
903
- * HTML field settings
904
- *
905
- * @since 2.5
906
- *
907
- * @return array
908
- */
909
- public static function custom_html() {
910
- $settings = array(
911
- array(
912
- 'name' => 'html',
913
- 'title' => __( 'HTML Codes', 'wp-user-frontend' ),
914
- 'type' => 'textarea',
915
- 'section' => 'basic',
916
- 'priority' => 11,
917
- 'help_text' => __( 'Paste your HTML codes, WordPress shortcodes will also work here', 'wp-user-frontend' ),
918
- ),
919
- );
920
-
921
- return array(
922
- 'template' => 'custom_html',
923
- 'title' => __( 'Custom HTML', 'wp-user-frontend' ),
924
- 'icon' => 'code',
925
- 'is_full_width' => true,
926
- 'settings' => $settings,
927
- 'field_props' => array(
928
- 'input_type' => 'html',
929
- 'template' => 'custom_html',
930
- 'label' => __( 'Custom HTML', 'wp-user-frontend' ),
931
- 'html' => sprintf( '<p>%s</p>', __( 'Some description about this section', 'wp-user-frontend' ) ),
932
- 'id' => 0,
933
- 'is_new' => true,
934
- 'wpuf_visibility' => self::get_wpuf_visibility_prop(),
935
- 'wpuf_cond' => self::get_wpuf_cond_prop()
936
- )
937
- );
938
- }
939
-
940
- /**
941
- * Recaptcha
942
- *
943
- * @since 2.5
944
- *
945
- * @return array
946
- */
947
- public static function recaptcha() {
948
- $settings = array(
949
- array(
950
- 'name' => 'label',
951
- 'title' => __( 'Title', 'wp-user-frontend' ),
952
- 'type' => 'text',
953
- 'section' => 'basic',
954
- 'priority' => 10,
955
- 'help_text' => __( 'Title of the section', 'wp-user-frontend' ),
956
- ),
957
-
958
- array(
959
- 'name' => 'recaptcha_type',
960
- 'title' => 'reCaptcha type',
961
- 'type' => 'radio',
962
- 'options' => array(
963
- 'enable_no_captcha' => __( 'Enable noCaptcha', 'wp-user-frontend' ),
964
- 'invisible_recaptcha' => __( 'Enable Invisible reCaptcha', 'wp-user-frontend' ),
965
- ),
966
- 'default' => 'enable_no_captcha',
967
- 'section' => 'basic',
968
- 'priority' => 11,
969
- 'help_text' => __( 'Select reCaptcha type', 'wp-user-frontend' ),
970
- )
971
- );
972
-
973
- return array(
974
- 'template' => 'recaptcha',
975
- 'title' => __( 'reCaptcha', 'wp-user-frontend' ),
976
- 'icon' => 'qrcode',
977
- 'validator' => array(
978
- 'callback' => 'has_recaptcha_api_keys',
979
- 'button_class' => 'button-faded',
980
- 'msg_title' => __( 'Site key and Secret key', 'wp-user-frontend' ),
981
- 'msg' => sprintf(
982
- __( 'You need to set Site key and Secret key in <a href="%s" target="_blank">Settings</a> in order to use "Recaptcha" field. <a href="%s" target="_blank">Click here to get the these key</a>.', 'wp-user-frontend' ),
983
- admin_url( 'admin.php?page=wpuf-settings' ),
984
- 'https://www.google.com/recaptcha/'
985
- ),
986
- ),
987
- 'settings' => $settings,
988
- 'field_props' => array(
989
- 'input_type' => 'recaptcha',
990
- 'template' => 'recaptcha',
991
- 'label' => '',
992
- 'recaptcha_type' => 'enable_no_captcha',
993
- 'id' => 0,
994
- 'is_new' => true,
995
- 'wpuf_visibility' => self::get_wpuf_visibility_prop(),
996
- 'wpuf_cond' => self::get_wpuf_cond_prop(),
997
- )
998
- );
999
- }
1000
  }
12
  * @return array
13
  */
14
  public static function get_field_settings() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
 
16
+ return array();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  }
18
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  }
admin/form.php CHANGED
@@ -153,7 +153,7 @@ class WPUF_Admin_Form {
153
  add_action( 'wpuf-form-builder-tab-contents-post', array( $this, 'add_primary_tab_contents' ) );
154
  add_action( 'wpuf-form-builder-settings-tabs-post', array( $this, 'add_settings_tabs' ) );
155
  add_action( 'wpuf-form-builder-settings-tab-contents-post', array( $this, 'add_settings_tab_contents' ) );
156
- add_filter( 'wpuf-form-builder-fields-section-before', array( $this, 'add_post_field_section' ) );
157
  add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
158
  add_action( 'wpuf-form-builder-js-deps', array( $this, 'js_dependencies' ) );
159
  add_filter( 'wpuf-form-builder-js-root-mixins', array( $this, 'js_root_mixins' ) );
@@ -161,7 +161,7 @@ class WPUF_Admin_Form {
161
  add_filter( 'wpuf-form-builder-js-field-options-mixins', array( $this, 'js_field_options_mixins' ) );
162
  add_action( 'wpuf-form-builder-template-builder-stage-submit-area', array( $this, 'add_form_submit_area' ) );
163
  add_action( 'wpuf-form-builder-localize-script', array( $this, 'add_to_localize_script' ) );
164
- add_filter( 'wpuf-form-builder-field-settings', array( $this, 'add_field_settings' ) );
165
  add_filter( 'wpuf-form-builder-i18n', array( $this, 'i18n' ) );
166
 
167
  do_action( 'wpuf-form-builder-init-type-wpuf_forms' );
@@ -504,424 +504,47 @@ class WPUF_Admin_Form {
504
  * @return array
505
  */
506
  public function add_field_settings( $field_settings ) {
507
- $field_settings = array_merge( $field_settings, array(
508
- 'post_title' => self::post_title(),
509
- 'post_content' => self::post_content(),
510
- 'post_excerpt' => self::post_excerpt(),
511
- 'featured_image' => self::featured_image()
512
- ) );
513
-
514
- $taxonomy_templates = array();
515
-
516
- foreach ( $this->wp_post_types as $post_type => $taxonomies ) {
517
-
518
- if ( ! empty( $taxonomies ) ) {
519
 
520
- foreach ( $taxonomies as $tax_name => $taxonomy ) {
521
- if ( 'post_tag' === $tax_name ) {
522
- $taxonomy_templates['post_tag'] = self::post_tags();
523
- } else {
524
- $taxonomy_templates[ $tax_name ] = self::taxonomy_template( $tax_name, $taxonomy );
525
- }
526
- }
527
 
528
- }
 
 
 
 
 
529
 
530
- }
 
 
 
531
 
532
- $field_settings = array_merge( $field_settings, $taxonomy_templates );
533
 
534
- return $field_settings;
535
- }
536
-
537
- /**
538
- * Post Title field settings
539
- *
540
- * @since 2.5
541
- *
542
- * @return array
543
- */
544
- public static function post_title() {
545
- $settings = WPUF_Form_Builder_Field_Settings::get_common_properties( false );
546
- $settings = array_merge( $settings, WPUF_Form_Builder_Field_Settings::get_common_text_properties( true ) );
547
 
548
- return array(
549
- 'template' => 'post_title',
550
- 'title' => __( 'Post Title', 'wp-user-frontend' ),
551
- 'icon' => 'header',
552
- 'settings' => $settings,
553
- 'field_props' => array(
554
- 'input_type' => 'text',
555
- 'template' => 'post_title',
556
- 'required' => 'no',
557
- 'label' => __( 'Post Title', 'wp-user-frontend' ),
558
- 'name' => 'post_title',
559
- 'is_meta' => 'no',
560
- 'help' => '',
561
- 'width' => 'large',
562
- 'css' => '',
563
- 'placeholder' => '',
564
- 'default' => '',
565
- 'size' => 40,
566
- 'word_restriction' => '',
567
- 'id' => 0,
568
- 'is_new' => true,
569
- 'wpuf_visibility' => WPUF_Form_Builder_Field_Settings::get_wpuf_visibility_prop(),
570
- 'wpuf_cond' => WPUF_Form_Builder_Field_Settings::get_wpuf_cond_prop()
571
- )
572
- );
573
- }
574
 
575
- /**
576
- * Post Content field settings
577
- *
578
- * @since 2.5
579
- *
580
- * @return array
581
- */
582
- public static function post_content() {
583
- $settings = WPUF_Form_Builder_Field_Settings::get_common_properties( false );
584
- $settings = array_merge( $settings, WPUF_Form_Builder_Field_Settings::get_common_textarea_properties() );
585
 
586
- $settings = array_merge( $settings, array(
587
- array(
588
- 'name' => 'insert_image',
589
- 'title' => __( 'Enable Image Insertion', 'wp-user-frontend' ),
590
- 'type' => 'checkbox',
591
- 'options' => array( 'yes' => __( 'Enable image upload in post area', 'wp-user-frontend' ) ),
592
- 'is_single_opt' => true,
593
- 'section' => 'advanced',
594
- 'priority' => 14,
595
- ),
596
- ) );
597
 
598
- return array(
599
- 'template' => 'post_content',
600
- 'title' => __( 'Post Body', 'wp-user-frontend' ),
601
- 'icon' => 'file-text',
602
- 'settings' => $settings,
603
- 'field_props' => array(
604
- 'input_type' => 'textarea',
605
- 'template' => 'post_content',
606
- 'required' => 'no',
607
- 'label' => __( 'Post Body', 'wp-user-frontend' ),
608
- 'name' => 'post_content',
609
- 'is_meta' => 'no',
610
- 'help' => '',
611
- 'width' => '',
612
- 'css' => '',
613
- 'rows' => 5,
614
- 'cols' => 25,
615
- 'placeholder' => '',
616
- 'default' => '',
617
- 'rich' => 'yes',
618
- 'word_restriction' => '',
619
- 'id' => 0,
620
- 'is_new' => true,
621
- 'wpuf_visibility' => WPUF_Form_Builder_Field_Settings::get_wpuf_visibility_prop(),
622
- 'wpuf_cond' => WPUF_Form_Builder_Field_Settings::get_wpuf_cond_prop()
623
- )
624
- );
625
- }
626
 
627
- /**
628
- * Post Excerpt field settings
629
- *
630
- * @since 2.5
631
- *
632
- * @return array
633
- */
634
- public static function post_excerpt() {
635
- $settings = WPUF_Form_Builder_Field_Settings::get_common_properties( false );
636
- $settings = array_merge( $settings, WPUF_Form_Builder_Field_Settings::get_common_textarea_properties() );
637
 
638
- $index = array_search( 'rich', array_column( $settings, 'name' ) );
639
- if ( ! empty( $index ) ) {
640
- unset( $settings[ $index ] );
641
  }
642
 
643
-
644
- return array(
645
- 'template' => 'post_excerpt',
646
- 'title' => __( 'Excerpt', 'wp-user-frontend' ),
647
- 'icon' => 'compress',
648
- 'settings' => $settings,
649
- 'field_props' => array(
650
- 'input_type' => 'textarea',
651
- 'template' => 'post_excerpt',
652
- 'required' => 'no',
653
- 'label' => __( 'Excerpt', 'wp-user-frontend' ),
654
- 'name' => 'post_excerpt',
655
- 'is_meta' => 'no',
656
- 'help' => '',
657
- 'width' => '',
658
- 'css' => '',
659
- 'rows' => 5,
660
- 'cols' => 25,
661
- 'placeholder' => '',
662
- 'default' => '',
663
- 'rich' => 'no',
664
- 'word_restriction' => '',
665
- 'id' => 0,
666
- 'is_new' => true,
667
- 'wpuf_visibility' => WPUF_Form_Builder_Field_Settings::get_wpuf_visibility_prop(),
668
- 'wpuf_cond' => WPUF_Form_Builder_Field_Settings::get_wpuf_cond_prop()
669
- )
670
- );
671
- }
672
-
673
- /**
674
- * Featured Image
675
- *
676
- * @since 2.5
677
- *
678
- * @return array
679
- */
680
- public static function featured_image() {
681
- $settings = WPUF_Form_Builder_Field_Settings::get_common_properties( false );
682
-
683
- $settings = array_merge( $settings, array(
684
- array(
685
- 'name' => 'button_label',
686
- 'title' => __( 'Button Label', 'wp-user-frontend' ),
687
- 'type' => 'text',
688
- 'default' => __( 'Select Image', 'wp-user-frontend' ),
689
- 'section' => 'basic',
690
- 'priority' => 30,
691
- 'help_text' => __( 'Enter a label for the Select button', 'wp-user-frontend' ),
692
- ),
693
- array(
694
- 'name' => 'max_size',
695
- 'title' => __( 'Max. file size', 'wp-user-frontend' ),
696
- 'type' => 'text',
697
- 'section' => 'advanced',
698
- 'priority' => 20,
699
- 'help_text' => __( 'Enter maximum upload size limit in KB', 'wp-user-frontend' ),
700
- )
701
- ) );
702
-
703
- return array(
704
- 'template' => 'featured_image',
705
- 'title' => __( 'Featured Image', 'wp-user-frontend' ),
706
- 'icon' => 'picture-o',
707
- 'settings' => $settings,
708
- 'field_props' => array(
709
- 'input_type' => 'image_upload',
710
- 'template' => 'featured_image',
711
- 'required' => 'no',
712
- 'label' => __( 'Featured Image', 'wp-user-frontend' ),
713
- 'name' => 'featured_image',
714
- 'button_label' => __( 'Select Image', 'wp-user-frontend' ),
715
- 'is_meta' => 'no',
716
- 'help' => '',
717
- 'css' => '',
718
- 'max_size' => '1024',
719
- 'count' => '1',
720
- 'id' => 0,
721
- 'is_new' => true,
722
- 'wpuf_visibility' => WPUF_Form_Builder_Field_Settings::get_wpuf_visibility_prop(),
723
- 'wpuf_cond' => WPUF_Form_Builder_Field_Settings::get_wpuf_cond_prop()
724
- )
725
- );
726
- }
727
-
728
- /**
729
- * Post Tag
730
- *
731
- * @since 2.5
732
- *
733
- * @return array
734
- */
735
- public static function post_tags() {
736
- $settings = WPUF_Form_Builder_Field_Settings::get_common_properties( false );
737
- $settings = array_merge( $settings, WPUF_Form_Builder_Field_Settings::get_common_text_properties() );
738
-
739
- return array(
740
- 'template' => 'post_tags',
741
- 'title' => __( 'Tags', 'wp-user-frontend' ),
742
- 'settings' => $settings,
743
- 'field_props' => array(
744
- 'input_type' => 'text',
745
- 'template' => 'post_tags',
746
- 'required' => 'no',
747
- 'label' => __( 'Tags', 'wp-user-frontend' ),
748
- 'name' => 'tags',
749
- 'is_meta' => 'no',
750
- 'help' => '',
751
- 'width' => 'large',
752
- 'css' => '',
753
- 'placeholder' => '',
754
- 'default' => '',
755
- 'size' => 40,
756
- 'id' => 0,
757
- 'is_new' => true,
758
- 'wpuf_visibility' => WPUF_Form_Builder_Field_Settings::get_wpuf_visibility_prop(),
759
- 'wpuf_cond' => WPUF_Form_Builder_Field_Settings::get_wpuf_cond_prop()
760
- )
761
- );
762
  }
763
 
764
- /**
765
- * Common settings for taxonomy fields
766
- *
767
- * @since 2.5
768
- *
769
- * @return array
770
- */
771
- public static function taxonomy_template( $tax_name, $taxonomy ) {
772
- $settings = WPUF_Form_Builder_Field_Settings::get_common_properties( false );
773
-
774
- $settings = array_merge( $settings, array(
775
- array(
776
- 'name' => 'type',
777
- 'title' => __( 'Type', 'wp-user-frontend' ),
778
- 'type' => 'select',
779
- 'options' => array(
780
- 'select' => __( 'Select', 'wp-user-frontend' ),
781
- 'multiselect' => __( 'Multi Select', 'wp-user-frontend' ),
782
- 'checkbox' => __( 'Checkbox', 'wp-user-frontend' ),
783
- 'text' => __( 'Text Input', 'wp-user-frontend' ),
784
- 'ajax' => __( 'Ajax', 'wp-user-frontend' ),
785
- ),
786
- 'section' => 'advanced',
787
- 'priority' => 23,
788
- 'default' => 'select',
789
- ),
790
-
791
- array(
792
- 'name' => 'first',
793
- 'title' => __( 'Select Text', 'wp-user-frontend' ),
794
- 'type' => 'text',
795
- 'section' => 'basic',
796
- 'priority' => 13,
797
- 'help_text' => __( "First element of the select dropdown. Leave this empty if you don't want to show this field", 'wp-user-frontend' ),
798
- ),
799
-
800
- array(
801
- 'name' => 'show_inline',
802
- 'title' => __( 'Show in inline list', 'wp-user-frontend' ),
803
- 'type' => 'radio',
804
- 'options' => array(
805
- 'yes' => __( 'Yes', 'wp-user-frontend' ),
806
- 'no' => __( 'No', 'wp-user-frontend' ),
807
- ),
808
- 'default' => 'no',
809
- 'inline' => true,
810
- 'section' => 'advanced',
811
- 'priority' => 23,
812
- 'help_text' => __( 'Show this option in an inline list', 'wp-user-frontend' ),
813
- ),
814
-
815
- array(
816
- 'name' => 'orderby',
817
- 'title' => __( 'Order By', 'wp-user-frontend' ),
818
- 'type' => 'select',
819
- 'options' => array(
820
- 'name' => __( 'Name', 'wp-user-frontend' ),
821
- 'term_id' => __( 'Term ID', 'wp-user-frontend' ), // NOTE: before 2.5 the key was 'id' not 'term_id'
822
- 'slug' => __( 'Slug', 'wp-user-frontend' ),
823
- 'count' => __( 'Count', 'wp-user-frontend' ),
824
- 'term_group' => __( 'Term Group', 'wp-user-frontend' ),
825
- ),
826
- 'section' => 'advanced',
827
- 'priority' => 24,
828
- 'default' => 'name',
829
- ),
830
-
831
- array(
832
- 'name' => 'order',
833
- 'title' => __( 'Order', 'wp-user-frontend' ),
834
- 'type' => 'radio',
835
- 'inline' => true,
836
- 'options' => array(
837
- 'ASC' => __( 'ASC', 'wp-user-frontend' ),
838
- 'DESC' => __( 'DESC', 'wp-user-frontend' ),
839
- ),
840
- 'section' => 'advanced',
841
- 'priority' => 25,
842
- 'default' => 'ASC',
843
- ),
844
-
845
- array(
846
- 'name' => 'exclude_type',
847
- 'title' => __( 'Selection Type', 'wp-user-frontend' ),
848
- 'type' => 'select',
849
- 'options' => array(
850
- 'exclude' => __( 'Exclude', 'wp-user-frontend' ),
851
- 'include' => __( 'Include', 'wp-user-frontend' ),
852
- 'child_of' => __( 'Child of', 'wp-user-frontend' ),
853
- ),
854
- 'section' => 'advanced',
855
- 'priority' => 26,
856
- 'default' => '',
857
- ),
858
-
859
- array(
860
- 'name' => 'exclude',
861
- 'title' => __( 'Selection Terms', 'wp-user-frontend' ),
862
- 'type' => 'multiselect',
863
- 'section' => 'advanced',
864
- 'priority' => 27,
865
- 'help_text' => __( 'Enter the term IDs as comma separated (without space) to exclude/include in the form.', 'wp-user-frontend' ),
866
- 'options' => wpuf_get_terms( $tax_name ),
867
- ),
868
-
869
- array(
870
- 'name' => 'woo_attr',
871
- 'type' => 'checkbox',
872
- 'is_single_opt' => true,
873
- 'options' => array(
874
- 'yes' => __( 'This taxonomy is a WooCommerce attribute', 'wp-user-frontend' )
875
- ),
876
- 'section' => 'advanced',
877
- 'priority' => 28,
878
- ),
879
-
880
- array(
881
- 'name' => 'woo_attr_vis',
882
- 'type' => 'checkbox',
883
- 'is_single_opt' => true,
884
- 'options' => array(
885
- 'yes' => __( 'Visible on product page', 'wp-user-frontend' )
886
- ),
887
- 'section' => 'advanced',
888
- 'priority' => 29,
889
- 'dependencies' => array(
890
- 'woo_attr' => 'yes'
891
- )
892
- ),
893
- ) );
894
-
895
- return array(
896
- 'template' => 'taxonomy',
897
- 'title' => $taxonomy['title'],
898
- 'settings' => $settings,
899
- 'field_props' => array(
900
- 'input_type' => 'taxonomy',
901
- 'template' => 'taxonomy',
902
- 'required' => 'no',
903
- 'label' => $taxonomy['title'],
904
- 'name' => $tax_name,
905
- 'is_meta' => 'no',
906
- 'help' => '',
907
- 'width' => 'small',
908
- 'css' => '',
909
- 'type' => 'select',
910
- 'first' => __( '- select -', 'wp-user-frontend' ),
911
- 'show_inline' => 'inline',
912
- 'orderby' => 'name',
913
- 'order' => 'ASC',
914
- 'exclude_type' => '',
915
- 'exclude' => array(),
916
- 'woo_attr' => '',
917
- 'woo_attr_vis' => '',
918
- 'id' => 0,
919
- 'is_new' => true,
920
- 'wpuf_visibility' => WPUF_Form_Builder_Field_Settings::get_wpuf_visibility_prop(),
921
- 'wpuf_cond' => WPUF_Form_Builder_Field_Settings::get_wpuf_cond_prop()
922
- )
923
- );
924
- }
925
 
926
  /**
927
  * i18n strings specially for Post Forms
153
  add_action( 'wpuf-form-builder-tab-contents-post', array( $this, 'add_primary_tab_contents' ) );
154
  add_action( 'wpuf-form-builder-settings-tabs-post', array( $this, 'add_settings_tabs' ) );
155
  add_action( 'wpuf-form-builder-settings-tab-contents-post', array( $this, 'add_settings_tab_contents' ) );
156
+ add_filter( 'wpuf-form-fields-section-before', array( $this, 'add_post_field_section' ) );
157
  add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
158
  add_action( 'wpuf-form-builder-js-deps', array( $this, 'js_dependencies' ) );
159
  add_filter( 'wpuf-form-builder-js-root-mixins', array( $this, 'js_root_mixins' ) );
161
  add_filter( 'wpuf-form-builder-js-field-options-mixins', array( $this, 'js_field_options_mixins' ) );
162
  add_action( 'wpuf-form-builder-template-builder-stage-submit-area', array( $this, 'add_form_submit_area' ) );
163
  add_action( 'wpuf-form-builder-localize-script', array( $this, 'add_to_localize_script' ) );
164
+ add_filter( 'wpuf-form-fields', array( $this, 'add_field_settings' ) );
165
  add_filter( 'wpuf-form-builder-i18n', array( $this, 'i18n' ) );
166
 
167
  do_action( 'wpuf-form-builder-init-type-wpuf_forms' );
504
  * @return array
505
  */
506
  public function add_field_settings( $field_settings ) {
 
 
 
 
 
 
 
 
 
 
 
 
507
 
508
+ if ( class_exists( 'WPUF_Field_Contract' ) ) {
 
 
 
 
 
 
509
 
510
+ require_once WPUF_ROOT . '/includes/fields/class-field-post-title.php';
511
+ require_once WPUF_ROOT . '/includes/fields/class-field-post-content.php';
512
+ require_once WPUF_ROOT . '/includes/fields/class-field-post-tags.php';
513
+ require_once WPUF_ROOT . '/includes/fields/class-field-post-excerpt.php';
514
+ require_once WPUF_ROOT . '/includes/fields/class-field-post-taxonomy.php';
515
+ require_once WPUF_ROOT . '/includes/fields/class-field-featured-image.php';
516
 
517
+ $field_settings['post_title'] = new WPUF_Form_Field_Post_Title();
518
+ $field_settings['post_content'] = new WPUF_Form_Field_Post_Content();
519
+ $field_settings['post_excerpt'] = new WPUF_Form_Field_Post_Excerpt();
520
+ $field_settings['featured_image'] = new WPUF_Form_Field_Featured_Image();
521
 
522
+ $taxonomy_templates = array();
523
 
524
+ foreach ( $this->wp_post_types as $post_type => $taxonomies ) {
 
 
 
 
 
 
 
 
 
 
 
 
525
 
526
+ if ( ! empty( $taxonomies ) ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
527
 
528
+ foreach ( $taxonomies as $tax_name => $taxonomy ) {
529
+ if ( 'post_tag' === $tax_name ) {
530
+ $taxonomy_templates['post_tag'] = new WPUF_Form_Field_Post_Tags();
531
+ } else {
532
+ $taxonomy_templates[ $tax_name ] = new WPUF_Form_Field_Post_Taxonomy($tax_name, $taxonomy);
533
+ // $taxonomy_templates[ 'taxonomy' ] = new WPUF_Form_Field_Post_Taxonomy($tax_name, $taxonomy);
534
+ }
535
+ }
 
 
536
 
537
+ }
 
 
 
 
 
 
 
 
 
 
538
 
539
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
540
 
541
+ $field_settings = array_merge( $field_settings, $taxonomy_templates );
 
 
 
 
 
 
 
 
 
542
 
 
 
 
543
  }
544
 
545
+ return $field_settings;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
546
  }
547
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
548
 
549
  /**
550
  * i18n strings specially for Post Forms
admin/html/form-settings-post-edit.php CHANGED
@@ -6,6 +6,7 @@ $page_id = isset( $form_settings['edit_page_id'] ) ? $form_settings
6
  $url = isset( $form_settings['edit_url'] ) ? $form_settings['edit_url'] : '';
7
  $update_text = isset( $form_settings['update_text'] ) ? $form_settings['update_text'] : __( 'Update', 'wp-user-frontend' );
8
  $subscription = isset( $form_settings['subscription'] ) ? $form_settings['subscription'] : null;
 
9
  ?>
10
  <table class="form-table">
11
 
@@ -93,4 +94,15 @@ $subscription = isset( $form_settings['subscription'] ) ? $form_settings
93
  <input type="text" name="wpuf_settings[update_text]" value="<?php echo esc_attr( $update_text ); ?>">
94
  </td>
95
  </tr>
 
 
 
 
 
 
 
 
 
 
 
96
  </table>
6
  $url = isset( $form_settings['edit_url'] ) ? $form_settings['edit_url'] : '';
7
  $update_text = isset( $form_settings['update_text'] ) ? $form_settings['update_text'] : __( 'Update', 'wp-user-frontend' );
8
  $subscription = isset( $form_settings['subscription'] ) ? $form_settings['subscription'] : null;
9
+ $lock_edit_post = isset( $form_settings['lock_edit_post'] ) ? $form_settings['lock_edit_post'] : '';
10
  ?>
11
  <table class="form-table">
12
 
94
  <input type="text" name="wpuf_settings[update_text]" value="<?php echo esc_attr( $update_text ); ?>">
95
  </td>
96
  </tr>
97
+
98
+ <tr class="lock-edit-post">
99
+ <th><?php _e( 'Lock User From Editing After', 'wp-user-frontend' ); ?></th>
100
+ <td>
101
+ <input type="number" name="wpuf_settings[lock_edit_post]" id="lock_edit_post" value="<?php echo $lock_edit_post; ?>">
102
+ <span><?php _e( 'hours', 'wp-user-frontend' ); ?></span>
103
+ <p class="description">
104
+ <?php _e( 'After how many hours user will be locked from editing the submitted post.', 'wp-user-frontend' ) ?>
105
+ </p>
106
+ </td>
107
+ </tr>
108
  </table>
admin/html/whats-new.php CHANGED
@@ -1,5 +1,41 @@
1
  <?php
2
  $changelog = array(
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  array(
4
  'version' => 'Version 2.9.4',
5
  'released' => '2018-11-20',
1
  <?php
2
  $changelog = array(
3
+ array(
4
+ 'version' => 'Version 3.1.0',
5
+ 'released' => '2019-01-31',
6
+ 'changes' => array(
7
+ array(
8
+ 'title' => __( 'Unable to send new user registration email', 'wp-user-frontend' ),
9
+ 'type' => 'Fix',
10
+ 'description' => __( 'WP User Frontend default registration form `[wpuf-registration]` was unable to send the new user registration email.', 'wp-user-frontend' )
11
+ ),
12
+ array(
13
+ 'title' => __( 'WPUF forms block compatibility issue with the latest WP version', 'wp-user-frontend' ),
14
+ 'type' => 'Fix',
15
+ 'description' => __( 'With the latest version of WordPress the gutenberg block of WP User Frontend were not working. In this version, you will get it fixed.', 'wp-user-frontend' )
16
+ ),
17
+ array(
18
+ 'title' => __( 'Page not update where `[wpuf_dashboard]` shortcode exist', 'wp-user-frontend' ),
19
+ 'type' => 'Fix',
20
+ 'description' => __( 'While using Gutenberg, the page were not being updated with WPUF shortcode [wpuf dashboard]', 'wp-user-frontend' )
21
+ ),
22
+ array(
23
+ 'title' => __( 'Retain default when determining whether to display the admin bar', 'wp-user-frontend' ),
24
+ 'type' => 'Fix',
25
+ 'description' => __( "From the User Frontend Settings, set that Administrator, Editor, Vendor can see the admin bar. Now, the super admin want, one specific user ( who has the user role from the above ) can't see the admin bar and disabled it from the Toolbar form that specific user profile. And this configuration ( Toolbar ) from the specific user profile were unable to impact on the frontend.", 'wp-user-frontend' )
26
+ ),
27
+ array(
28
+ 'title' => __( 'Fatal error when use PHP lower version (5.4 or lower)', 'wp-user-frontend' ),
29
+ 'type' => 'Fix',
30
+ 'description' => __( "It was unable to install WP User Frontend with PHP 5.4 or lower version. Here is the error details: <br><br><strong>Fatal error: Can't use method return value in write context in /wp-user-frontend/class/frontend-form-post.php on line 194</strong>", 'wp-user-frontend' )
31
+ ),
32
+ array(
33
+ 'title' => __( 'Product form was unable to show the single gallery image', 'wp-user-frontend' ),
34
+ 'type' => 'Fix',
35
+ 'description' => __( "When user upload single image for product gallery using WPUF WooCommerce product form, that image were not showing on the frontend.", 'wp-user-frontend' )
36
+ ),
37
+ )
38
+ ),
39
  array(
40
  'version' => 'Version 2.9.4',
41
  'released' => '2018-11-20',
admin/installer.php CHANGED
File without changes
admin/posting.php CHANGED
@@ -8,7 +8,7 @@
8
  *
9
  * @package WP User Frontend
10
  */
11
- class WPUF_Admin_Posting extends WPUF_Render_Form {
12
 
13
  private static $_instance;
14
 
@@ -16,11 +16,12 @@ class WPUF_Admin_Posting extends WPUF_Render_Form {
16
  // meta boxes
17
  add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes') );
18
  add_action( 'add_meta_boxes', array( $this, 'add_meta_box_form_select') );
19
-
20
  add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_script') );
21
-
22
  add_action( 'save_post', array( $this, 'save_meta'), 1, 2 ); // save the custom fields
23
  add_action( 'save_post', array( $this, 'form_selection_metabox_save' ), 1, 2 ); // save edit form id
 
 
24
  }
25
 
26
  public static function init() {
@@ -101,7 +102,6 @@ class WPUF_Admin_Posting extends WPUF_Render_Form {
101
  }
102
  }
103
 
104
-
105
  /**
106
  * Form selection meta box in post types
107
  *
@@ -127,7 +127,7 @@ class WPUF_Admin_Posting extends WPUF_Render_Form {
127
  <?php } ?>
128
  </select>
129
  <div>
130
- <p><a href="https://wedevs.com/docs/wp-user-frontend-pro/tutorials/purpose-of-the-wpuf-form-metabox/" target="_blank"><?php _e( 'Purpose of this metabox', 'wp-user-frontend' ); ?></a></p>
131
  </div>
132
  <?php
133
  }
@@ -158,6 +158,89 @@ class WPUF_Admin_Posting extends WPUF_Render_Form {
158
  update_post_meta( $post->ID, '_wpuf_form_id', $_POST['wpuf_form_select'] );
159
  }
160
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
161
  /**
162
  * Meta box to show WPUF Custom Fields
163
  *
@@ -232,8 +315,24 @@ class WPUF_Admin_Posting extends WPUF_Render_Form {
232
 
233
  <table class="form-table wpuf-cf-table">
234
  <tbody>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
235
  <?php
236
- $this->render_items( $custom_fields, $post->ID, 'post', $form_id, $form_settings );
 
237
  ?>
238
  </tbody>
239
  </table>
@@ -241,49 +340,6 @@ class WPUF_Admin_Posting extends WPUF_Render_Form {
241
  $this->scripts_styles();
242
  }
243
 
244
- /**
245
- * Prints form input label
246
- *
247
- * @param string $attr
248
- */
249
- function label( $attr, $post_id = 0 ) {
250
- ?>
251
- <?php echo $attr['label'] . $this->required_mark( $attr ); ?>
252
- <?php
253
- }
254
-
255
- /**
256
- * generate table header of frontend form field
257
- *
258
- * @since 2.5
259
- *
260
- * @param array $form_field
261
- * @param int $post_id
262
- *
263
- * @return void
264
- */
265
- function render_item_before( $form_field, $post_id = 0 ) {
266
- echo '<tr>';
267
- echo '<th><strong>';
268
- $this->label( $form_field );
269
- echo '</strong></th>';
270
- echo '<td>';
271
- }
272
-
273
- /**
274
- * generate table bottom of frontend form field
275
- *
276
- * @since 2.5
277
- *
278
- * @param array $form_field
279
- *
280
- * @return void
281
- */
282
- function render_item_after( $form_field ) {
283
- echo '</td>';
284
- echo '</tr>';
285
- }
286
-
287
  function scripts_styles() {
288
  ?>
289
  <script type="text/javascript">
@@ -427,7 +483,67 @@ class WPUF_Admin_Posting extends WPUF_Render_Form {
427
 
428
  list( $post_vars, $tax_vars, $meta_vars ) = self::get_input_fields( $_POST['wpuf_cf_form_id'] );
429
 
430
- WPUF_Frontend_Form_Post::update_post_meta( $meta_vars, $post_id );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
431
  }
432
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
433
  }
8
  *
9
  * @package WP User Frontend
10
  */
11
+ class WPUF_Admin_Posting {
12
 
13
  private static $_instance;
14
 
16
  // meta boxes
17
  add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes') );
18
  add_action( 'add_meta_boxes', array( $this, 'add_meta_box_form_select') );
19
+ add_action( 'add_meta_boxes', array( $this, 'add_meta_box_post_lock') );
20
  add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_script') );
 
21
  add_action( 'save_post', array( $this, 'save_meta'), 1, 2 ); // save the custom fields
22
  add_action( 'save_post', array( $this, 'form_selection_metabox_save' ), 1, 2 ); // save edit form id
23
+ add_action( 'save_post', array( $this, 'post_lock_metabox_save' ), 1, 2 ); // save post lock option
24
+ add_action( 'wp_ajax_wpuf_clear_schedule_lock', array($this, 'clear_schedule_lock') );
25
  }
26
 
27
  public static function init() {
102
  }
103
  }
104
 
 
105
  /**
106
  * Form selection meta box in post types
107
  *
127
  <?php } ?>
128
  </select>
129
  <div>
130
+ <p><a href="https://wedevs.com/docs/wp-user-frontend-pro/tutorials/purpose-of-the-wpuf-form-metabox/" target="_blank"><?php _e( 'Learn more', 'wp-user-frontend' ); ?></a></p>
131
  </div>
132
  <?php
133
  }
158
  update_post_meta( $post->ID, '_wpuf_form_id', $_POST['wpuf_form_select'] );
159
  }
160
 
161
+ /**
162
+ * Meta box for post lock
163
+ *
164
+ * Registers a meta box in public post types to select the desired WPUF
165
+ * form select box to assign a form id.
166
+ *
167
+ * @since 3.0.2
168
+ *
169
+ * @return void
170
+ */
171
+ function add_meta_box_post_lock() {
172
+ $post_types = get_post_types( array('public' => true) );
173
+
174
+ foreach ($post_types as $post_type) {
175
+ add_meta_box( 'wpuf-post-lock', __('WPUF Lock User', 'wp-user-frontend'), array($this, 'post_lock_metabox'), $post_type, 'side', 'high' );
176
+ }
177
+ }
178
+
179
+ /**
180
+ * Post lock meta box in post types
181
+ *
182
+ * Registered via $this->add_meta_box_post_lock()
183
+ *
184
+ * @since 3.0.2
185
+ *
186
+ * @global object $post
187
+ */
188
+ function post_lock_metabox() {
189
+ global $post;
190
+
191
+ $msg = '';
192
+ $edit_post_lock = get_post_meta( $post->ID, '_wpuf_lock_editing_post', true );
193
+ $edit_post_lock_time = get_post_meta( $post->ID, '_wpuf_lock_user_editing_post_time', true );
194
+
195
+ if( !empty( $edit_post_lock_time ) && $edit_post_lock_time > time() ) {
196
+ $time = date( 'Y-m-d H:i:s', $edit_post_lock_time );
197
+ $local_time = get_date_from_gmt( $time, get_option('date_format') . ' ' . get_option('time_format') );
198
+ $msg = sprintf( __( 'Frontend edit access for this post will be automatically locked after %s, <a id="wpuf_clear_schedule_lock" data="%s" href="#">Clear Schedule Lock</a> Or,', 'wp-user-frontend' ), $local_time, $post->ID );
199
+ }
200
+
201
+ ?>
202
+
203
+ <input type="hidden" name="wpuf_lock_editing_post_nonce" value="<?php echo wp_create_nonce( plugin_basename( __FILE__ ) ); ?>" />
204
+
205
+ <p><?php echo $msg; ?></p>
206
+
207
+ <label>
208
+ <input type="hidden" name="wpuf_lock_post" value="no">
209
+ <input type="checkbox" name="wpuf_lock_post" value="yes" <?php checked($edit_post_lock, 'yes'); ?>>
210
+ <?php _e( 'Lock Post', 'wp-user-frontend' ); ?>
211
+ </label>
212
+ <p style="margin-top: 10px"><?php _e( 'Lock user from editing this post from the frontend dashboard', 'wp-user-frontend' ); ?></p>
213
+ <?php
214
+ }
215
+
216
+ /**
217
+ * Save the lock post option
218
+ *
219
+ * @since 3.0.2
220
+ *
221
+ * @param int $post_id
222
+ * @param object $post
223
+ * @return int|void
224
+ */
225
+ function post_lock_metabox_save( $post_id, $post ) {
226
+ $edit_post_lock_time = isset( $_POST['_wpuf_lock_user_editing_post_time'] ) ? $_POST['_wpuf_lock_user_editing_post_time'] : '';
227
+
228
+ if ( !isset($_POST['wpuf_lock_post'])) {
229
+ return $post->ID;
230
+ }
231
+
232
+ if ( !wp_verify_nonce( $_POST['wpuf_lock_editing_post_nonce'], plugin_basename( __FILE__ ) ) ) {
233
+ return $post->ID;
234
+ }
235
+
236
+ // Is the user allowed to edit the post or page?
237
+ if ( !current_user_can( 'edit_post', $post->ID ) ) {
238
+ return $post->ID;
239
+ }
240
+
241
+ update_post_meta( $post->ID, '_wpuf_lock_editing_post', $_POST['wpuf_lock_post'] );
242
+ }
243
+
244
  /**
245
  * Meta box to show WPUF Custom Fields
246
  *
315
 
316
  <table class="form-table wpuf-cf-table">
317
  <tbody>
318
+
319
+ <script type="text/javascript">
320
+ if ( typeof wpuf_conditional_items === 'undefined' ) {
321
+ wpuf_conditional_items = [];
322
+ }
323
+
324
+ if ( typeof wpuf_plupload_items === 'undefined' ) {
325
+ wpuf_plupload_items = [];
326
+ }
327
+
328
+ if ( typeof wpuf_map_items === 'undefined' ) {
329
+ wpuf_map_items = [];
330
+ }
331
+ </script>
332
+
333
  <?php
334
+ $atts = array();
335
+ wpuf()->fields->render_fields( $custom_fields, $form_id, $atts, $type = 'post', $post->ID );
336
  ?>
337
  </tbody>
338
  </table>
340
  $this->scripts_styles();
341
  }
342
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
343
  function scripts_styles() {
344
  ?>
345
  <script type="text/javascript">
483
 
484
  list( $post_vars, $tax_vars, $meta_vars ) = self::get_input_fields( $_POST['wpuf_cf_form_id'] );
485
 
486
+ // WPUF_Frontend_Form_Post::update_post_meta( $meta_vars, $post_id );
487
+ WPUF_Frontend_Form::update_post_meta( $meta_vars, $post_id );
488
+ }
489
+
490
+ /**
491
+ * Clear Schedule lock
492
+ *
493
+ * @since 3.0.2
494
+ */
495
+ public function clear_schedule_lock() {
496
+ check_ajax_referer( 'wpuf_nonce', 'nonce' );
497
+
498
+ $post_id = isset( $_POST['post_id'] ) ? $_POST['post_id'] : '';
499
+ if ( !empty( $post_id ) ) {
500
+ $edit_post_lock_time = get_post_meta( $post_id, '_wpuf_lock_user_editing_post_time', true );
501
+
502
+ if ( !empty( $edit_post_lock_time ) ) {
503
+ update_post_meta( $post_id, '_wpuf_lock_user_editing_post_time', '' );
504
+ }
505
+ }
506
+ exit;
507
  }
508
 
509
+ /**
510
+ * Get input meta fields separated as post vars, taxonomy and meta vars
511
+ *
512
+ * @param int $form_id form id
513
+ * @return array
514
+ */
515
+ public static function get_input_fields( $form_id ) {
516
+ $form_vars = wpuf_get_form_fields( $form_id );
517
+
518
+ $ignore_lists = array('section_break', 'html');
519
+ $post_vars = $meta_vars = $taxonomy_vars = array();
520
+
521
+ foreach ($form_vars as $key => $value) {
522
+
523
+ // ignore section break and HTML input type
524
+ if ( in_array( $value['input_type'], $ignore_lists ) ) {
525
+ continue;
526
+ }
527
+
528
+ //separate the post and custom fields
529
+ if ( isset( $value['is_meta'] ) && $value['is_meta'] == 'yes' ) {
530
+ $meta_vars[] = $value;
531
+ continue;
532
+ }
533
+
534
+ if ( $value['input_type'] == 'taxonomy' ) {
535
+
536
+ // don't add "category"
537
+ if ( $value['name'] == 'category' ) {
538
+ continue;
539
+ }
540
+
541
+ $taxonomy_vars[] = $value;
542
+ } else {
543
+ $post_vars[] = $value;
544
+ }
545
+ }
546
+
547
+ return array($post_vars, $taxonomy_vars, $meta_vars);
548
+ }
549
  }
admin/premium.php CHANGED
@@ -228,7 +228,7 @@
228
  </div>
229
 
230
  <div class="text-right">
231
- <a class="button button-primary" href="<?php echo WPUF_Pro_Prompt::get_pro_url(); ?>" target="_blank"><?php _e( 'Upgrade Now', 'wp-user-frontend' ); ?></a>
232
  </div>
233
  </div>
234
 
228
  </div>
229
 
230
  <div class="text-right">
231
+
232
  </div>
233
  </div>
234
 
admin/promotion.php CHANGED
@@ -7,7 +7,9 @@ class WPUF_Admin_Promotion {
7
 
8
  public function __construct() {
9
  add_action( 'admin_notices', array( $this, 'promotional_offer' ) );
 
10
  add_action( 'wp_ajax_wpuf-dismiss-promotional-offer-notice', array( $this, 'dismiss_promotional_offer' ) );
 
11
  }
12
 
13
  /**
@@ -182,6 +184,130 @@ class WPUF_Admin_Promotion {
182
  <?php
183
  }
184
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
185
 
186
  /**
187
  * Dismiss promotion notice
@@ -196,4 +322,17 @@ class WPUF_Admin_Promotion {
196
  update_option( $offer_key, 'hide' );
197
  }
198
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
199
  }
7
 
8
  public function __construct() {
9
  add_action( 'admin_notices', array( $this, 'promotional_offer' ) );
10
+ add_action( 'admin_notices' , array( $this, 'wpuf_review_notice_message' ) );
11
  add_action( 'wp_ajax_wpuf-dismiss-promotional-offer-notice', array( $this, 'dismiss_promotional_offer' ) );
12
+ add_action( 'wp_ajax_wpuf-dismiss-review-notice', array( $this, 'dismiss_review_notice' ) );
13
  }
14
 
15
  /**
184
  <?php
185
  }
186
 
187
+ /**
188
+ *
189
+ * @since 3.1.0
190
+ *
191
+ * @return void
192
+ **/
193
+ public function wpuf_review_notice_message() {
194
+ // Show only to Admins
195
+ if ( ! current_user_can( 'manage_options' ) ) {
196
+ return;
197
+ }
198
+
199
+ $dismiss_notice = get_option( 'wpuf_review_notice_dismiss', 'no' );
200
+ $activation_time = get_option( 'wpuf_installed' );
201
+
202
+ // check if it has already been dismissed
203
+ // and don't show notice in 15 days of installation, 1296000 = 15 Days in seconds
204
+ if ( 'yes' == $dismiss_notice ) {
205
+ return;
206
+ }
207
+
208
+ if ( time() - $activation_time < 1296000 ) {
209
+ return;
210
+ }
211
+
212
+ ?>
213
+ <div id="wpuf-review-notice" class="wpuf-review-notice">
214
+ <div class="wpuf-review-thumbnail">
215
+ <img src="<?php echo WPUF_ASSET_URI . '/images/icon-128x128.png' ?>" alt="">
216
+ </div>
217
+ <div class="wpuf-review-text">
218
+ <h3><?php _e( 'Enjoying <strong>WP User Frontend</strong>?', 'wp-user-frontend' ) ?></h3>
219
+ <p><?php _e( 'Hope that you had a neat and snappy experience with the tool. Would you please show us a little love by rating us in the <a href="https://wordpress.org/support/plugin/wp-user-frontend/reviews/#new-post" target="_blank"><strong>WordPress.org</strong></a>?', 'wp-user-frontend' ) ?></p>
220
+
221
+ <ul class="wpuf-review-ul">
222
+ <li><a href="https://wordpress.org/support/plugin/wp-user-frontend/reviews/#new-post" target="_blank"><span class="dashicons dashicons-external"></span><?php _e( 'Sure! I\'d love to!', 'wp-user-frontend' ) ?></a></li>
223
+ <li><a href="#" class="notice-dismiss"><span class="dashicons dashicons-smiley"></span><?php _e( 'I\'ve already left a review', 'wp-user-frontend' ) ?></a></li>
224
+ <li><a href="#" class="notice-dismiss"><span class="dashicons dashicons-dismiss"></span><?php _e( 'Never show again', 'wp-user-frontend' ) ?></a></li>
225
+ </ul>
226
+ </div>
227
+ </div>
228
+ <style type="text/css">
229
+ #wpuf-review-notice .notice-dismiss{
230
+ padding: 0 0 0 26px;
231
+ }
232
+
233
+ #wpuf-review-notice .notice-dismiss:before{
234
+ display: none;
235
+ }
236
+
237
+ #wpuf-review-notice.wpuf-review-notice {
238
+ padding: 15px 15px 15px 0;
239
+ background-color: #fff;
240
+ border-radius: 3px;
241
+ margin: 20px 20px 0 0;
242
+ border-left: 4px solid transparent;
243
+ }
244
+
245
+ #wpuf-review-notice .wpuf-review-thumbnail {
246
+ width: 114px;
247
+ float: left;
248
+ line-height: 80px;
249
+ text-align: center;
250
+ border-right: 4px solid transparent;
251
+ }
252
+
253
+ #wpuf-review-notice .wpuf-review-thumbnail img {
254
+ width: 60px;
255
+ vertical-align: middle;
256
+ }
257
+
258
+ #wpuf-review-notice .wpuf-review-text {
259
+ overflow: hidden;
260
+ }
261
+
262
+ #wpuf-review-notice .wpuf-review-text h3 {
263
+ font-size: 24px;
264
+ margin: 0 0 5px;
265
+ font-weight: 400;
266
+ line-height: 1.3;
267
+ }
268
+
269
+ #wpuf-review-notice .wpuf-review-text p {
270
+ font-size: 13px;
271
+ margin: 0 0 5px;
272
+ }
273
+
274
+ #wpuf-review-notice .wpuf-review-ul {
275
+ margin: 0;
276
+ padding: 0;
277
+ }
278
+
279
+ #wpuf-review-notice .wpuf-review-ul li {
280
+ display: inline-block;
281
+ margin-right: 15px;
282
+ }
283
+
284
+ #wpuf-review-notice .wpuf-review-ul li a {
285
+ display: inline-block;
286
+ color: #82C776;
287
+ text-decoration: none;
288
+ padding-left: 26px;
289
+ position: relative;
290
+ }
291
+
292
+ #wpuf-review-notice .wpuf-review-ul li a span {
293
+ position: absolute;
294
+ left: 0;
295
+ top: -2px;
296
+ }
297
+ </style>
298
+ <script type='text/javascript'>
299
+ jQuery('body').on('click', '#wpuf-review-notice .notice-dismiss', function(e) {
300
+ e.preventDefault();
301
+ jQuery("#wpuf-review-notice").hide();
302
+
303
+ wp.ajax.post('wpuf-dismiss-review-notice', {
304
+ dismissed: true
305
+ });
306
+ });
307
+ </script>
308
+ <?php
309
+
310
+ }
311
 
312
  /**
313
  * Dismiss promotion notice
322
  update_option( $offer_key, 'hide' );
323
  }
324
  }
325
+
326
+ /**
327
+ * Dismiss review notice
328
+ *
329
+ * @since 3.1.0
330
+ *
331
+ * @return void
332
+ **/
333
+ public function dismiss_review_notice() {
334
+ if ( ! empty( $_POST['dismissed'] ) ) {
335
+ update_option( 'wpuf_review_notice_dismiss', 'yes' );
336
+ }
337
+ }
338
  }
admin/template-post.php CHANGED
File without changes
admin/template.php CHANGED
File without changes
admin/tools.php CHANGED
File without changes
assets/css/admin.css CHANGED
File without changes
assets/css/admin/gutenblock-editor.css ADDED
File without changes
assets/css/admin/gutenblock.css CHANGED
@@ -1,17 +1,102 @@
1
- .wpuf-form-container {
 
 
 
 
 
 
 
 
 
 
 
 
2
  position: relative;
3
  }
4
- .wpuf-form-overlay {
5
  position: absolute;
6
  top: 0; right: 0; bottom: 0; left: 0;
7
  }
8
- .wpuf-title{
9
- display: inline;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  position: absolute;
11
- margin: 0px;
12
- padding: 5px;
13
- top: 20px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  }
15
- .wpuf-icon{
16
- width: 60px;
 
 
17
  }
1
+ .wpuf-block-logo{
2
+ max-width: 50px !important;
3
+ max-height: 50px;
4
+ float: left;
5
+ margin-right: 15px;
6
+ margin-bottom: 10px;
7
+ }
8
+
9
+ #wpuf-filter-input-main{
10
+ clear: both;
11
+ }
12
+
13
+ .wpuf-iframe-container {
14
  position: relative;
15
  }
16
+ .wpuf-iframe-overlay {
17
  position: absolute;
18
  top: 0; right: 0; bottom: 0; left: 0;
19
  }
20
+ .wpuf-block-form-selector {
21
+ background-color: lightgrey;
22
+ border-bottom: 1px solid;
23
+ margin-bottom: 5px;
24
+ padding: 4px;
25
+ }
26
+
27
+ .wpuf-filter-input {
28
+ border: 1px solid #ddd;
29
+ border-radius: 5px;
30
+ box-shadow: inset 0 1px 2px rgba(0,0,0,.07);
31
+ padding: 0;
32
+ width: 100%;
33
+ margin-top: 10px;
34
+ margin-bottom: 10px;
35
+ position: relative;
36
+ }
37
+
38
+ .wpuf-filter-input .blocks-select-control__input {
39
+ margin: 0 0 0 0;
40
+ }
41
+
42
+ .wpuf-filter-input-el {
43
+ border: none !important;
44
+ box-shadow: none !important;
45
+ width: 95%;
46
+ position: relative;
47
+ display: inline-block;
48
+ }
49
+
50
+ .wpuf-filter-input-icon {
51
+ display: inline-block;
52
+ content: '&#9662;';
53
+ color: #999;
54
+ font-size: 14px;
55
+ right: .77em;
56
  position: absolute;
57
+ top: .2em;
58
+ }
59
+
60
+ #wpuf-formFilter-main {
61
+ border-top: none;
62
+ border-left: none;
63
+ border-bottom: none;
64
+ }
65
+
66
+ #wpuf-formFilter-sidebar {
67
+ border-top: none;
68
+ border-left: none;
69
+ border-bottom: none;
70
+ width: 95%;
71
+ }
72
+
73
+ #wpuf-filter-input-icon-sidebar {
74
+ font-size: 1.4em;
75
+ top: .35em;
76
+ right: .45em;
77
+ }
78
+
79
+ .wpuf-filter-input-el.blocks-select-control__input > .components-base-control__field {
80
+ margin-bottom: 0;
81
+ }
82
+
83
+ .wpuf-filter-option-container {
84
+ display: none;
85
+ position: absolute;
86
+ background-color: #edeff0;
87
+ z-index: 10000;
88
+ padding: 4px;
89
+ width: 100%;
90
+ border-radius: 5px;
91
+ max-height: 200px;
92
+ overflow: scroll;
93
+ box-shadow: 0 2px 4px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12)!important;
94
+ }
95
+ .wpuf-filter-option {
96
+ list-style: none;
97
  }
98
+
99
+ .wpuf-filter-option:hover {
100
+ background-color: #0073aa;
101
+ color: white;
102
  }
assets/css/chosen/chosen-sprite.png CHANGED
File without changes
assets/css/chosen/chosen-sprite@2x.png CHANGED
File without changes
assets/css/chosen/chosen.css CHANGED
File without changes
assets/css/frontend-forms.css CHANGED
@@ -162,6 +162,8 @@
162
  .wpuf-form-add.wpuf-style ul.wpuf-form .wpuf-submit input[type=submit] {
163
  font-size: 16px;
164
  padding: 5px 15px;
 
 
165
  border: 1px solid #ccc;
166
  -webkit-border-radius: 3px;
167
  -moz-border-radius: 3px;
162
  .wpuf-form-add.wpuf-style ul.wpuf-form .wpuf-submit input[type=submit] {
163
  font-size: 16px;
164
  padding: 5px 15px;
165
+ line-height: inherit;
166
+ height: inherit;
167
  border: 1px solid #ccc;
168
  -webkit-border-radius: 3px;
169
  -moz-border-radius: 3px;
assets/css/images/ui-bg_diagonals-small_75_cccccc_40x40.png CHANGED
File without changes
assets/css/images/ui-bg_flat_0_aaaaaa_40x100.png CHANGED
File without changes
assets/css/images/ui-bg_flat_0_ffffff_40x100.png CHANGED
File without changes
assets/css/images/ui-bg_flat_75_ffffff_40x100.png CHANGED
File without changes
assets/css/images/ui-bg_glass_55_fbf9ee_1x400.png CHANGED
File without changes
assets/css/images/ui-bg_glass_65_ffffff_1x400.png CHANGED
File without changes
assets/css/images/ui-bg_glass_75_dadada_1x400.png CHANGED
File without changes
assets/css/images/ui-bg_glass_75_e6e6e6_1x400.png CHANGED
File without changes
assets/css/images/ui-bg_glass_95_fef1ec_1x400.png CHANGED
File without changes
assets/css/images/ui-icons_222222_256x240.png CHANGED
File without changes
assets/css/images/ui-icons_2e83ff_256x240.png CHANGED
File without changes
assets/css/images/ui-icons_454545_256x240.png CHANGED
File without changes
assets/css/images/ui-icons_888888_256x240.png CHANGED
File without changes
assets/css/images/ui-icons_cd0a0a_256x240.png CHANGED
File without changes
assets/css/jquery-ui-1.9.1.custom.css CHANGED
File without changes
assets/css/jquery.smallipop.css CHANGED
File without changes
assets/css/wpuf.css CHANGED
File without changes
assets/images/add.png CHANGED
File without changes
assets/images/arrow-move.png CHANGED
File without changes
assets/images/arrows.png CHANGED
File without changes
assets/images/cross.png CHANGED
File without changes
assets/images/del.png CHANGED
File without changes
assets/images/delete.png CHANGED
File without changes
assets/images/edit.png CHANGED
File without changes
assets/images/help.png CHANGED
File without changes
assets/images/no-image.png CHANGED
File without changes
assets/images/paypal.png CHANGED
File without changes
assets/images/remove.png CHANGED
File without changes
assets/images/tick.png CHANGED
File without changes
assets/images/wpspin_light.gif CHANGED
File without changes
assets/js/admin/blockFrameSetup.js ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // moved to separate file so we could enqueue it and make sure jquery was loaded
2
+ (function() {
3
+ jQuery( document ).ready( function() {
4
+ var frameEl = window.frameElement;
5
+
6
+ // get the form element
7
+ var $form = jQuery('.wpuf-form-add');
8
+ // get the height of the form
9
+ var height = $form.find( '.wpuf-form' ).outerHeight(true);
10
+
11
+ if (frameEl) {
12
+ frameEl.height = height + 200;
13
+ }
14
+ });
15
+ })();
assets/js/admin/gutenblock.js CHANGED
@@ -1,18 +1,17 @@
1
  /**
2
- * weform Form Block
3
  *
4
- * A block for embedding a weform Form form using Gutenberg
5
  */
6
- ( function( blocks, i18n, element, components ) {
7
 
8
  var el = element.createElement, // function to create elements
9
- SelectControl = components.SelectControl, // select control
10
- InspectorControls = blocks.InspectorControls, // sidebar controls
11
- Sandbox = components.Sandbox; // needed to register the block
12
 
13
  // register our block
14
  blocks.registerBlockType( 'wpuf/form', {
15
- title: 'WPUF ' + i18n.__( 'Form' ),
16
  icon: 'feedback',
17
  category: 'common',
18
 
@@ -20,82 +19,202 @@
20
  formID: {
21
  type: 'integer',
22
  default: 0
 
 
 
 
23
  }
24
  },
25
 
26
- //implement the edit function
27
  edit: function( props ) {
28
 
29
- var focus = props.focus;
30
  var formID = props.attributes.formID;
 
 
 
31
  var children = [];
32
 
33
- if ( ! formID )
34
- formID = ''; // Default.
 
 
 
35
 
36
- function onFormChange( newFormID ) {
37
- // updates the form id on the props
38
- props.setAttributes( { formID: newFormID } );
 
 
 
 
 
 
 
39
  }
40
 
41
- // Set up the form dropdown in the side bar 'block' settings
42
- var inspectorControls = el( InspectorControls, {},
43
- el( SelectControl,
44
- {
45
- label: i18n.__( 'Selected Form' ),
46
- value: formID,
47
- options: wpufblock.forms,
48
- onChange: onFormChange
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
  )
51
  );
52
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
  /**
54
  * Create the div container, add an overlay so the user can interact
55
  * with the form in Gutenberg, then render the iframe with form
56
  */
57
- if ( '' === formID ) {
58
- children.push(
59
- el( 'div', { style : {width: '100%' } },
60
- el( 'img',{ src: wpufblock.block_logo, className : 'wpuf-icon' }),
61
- el( 'h3', { className : 'wpuf-title' }, 'WP User Frontend' ),
62
- el( SelectControl, { value: formID, options: wpufblock.forms, onChange: onFormChange })
63
  ) );
64
  } else {
65
  children.push(
66
- el( 'div', { className: 'wpuf-form-container' },
67
- el( 'div', { className: 'wpuf-form-overlay'} ),
68
- el( 'iframe', { src: wpufblock.siteUrl + '?wpuf_preview&wpuf_iframe&form_id=' + formID, height: '0', width: '500', scrolling: 'no' })
69
  )
70
  )
71
  }
72
-
73
  return [
74
- children,
75
- !! focus && inspectorControls
76
  ];
77
  },
78
 
79
- //implement the handle function
80
  save: function( props ) {
81
-
82
  var formID = props.attributes.formID;
83
- if ( ! formID )
84
- return '';
85
  /**
86
  * we're essentially just adding a short code, here is where
87
  * it's save in the editor
88
  *
89
- * return content wrapped in DIV as raw HTML is unsupported
 
90
  */
91
  var returnHTML = '[wpuf_form id=' + parseInt( formID ) + ']';
92
  return el( 'div', null, returnHTML );
93
  }
94
  } );
95
 
 
96
  } )(
97
  window.wp.blocks,
98
  window.wp.i18n,
 
99
  window.wp.element,
100
  window.wp.components
101
- );
1
  /**
2
+ * WPUF Block
3
  *
4
+ * A block for embedding a wpuf form into a post/page.
5
  */
6
+ ( function( blocks, i18n, editor, element, components ) {
7
 
8
  var el = element.createElement, // function to create elements
9
+ TextControl = components.TextControl,// text input control
10
+ InspectorControls = editor.InspectorControls; // sidebar controls
 
11
 
12
  // register our block
13
  blocks.registerBlockType( 'wpuf/form', {
14
+ title: 'WPUF Forms',
15
  icon: 'feedback',
16
  category: 'common',
17
 
19
  formID: {
20
  type: 'integer',
21
  default: 0
22
+ },
23
+ formName: {
24
+ type: 'string',
25
+ default: ''
26
  }
27
  },
28
 
 
29
  edit: function( props ) {
30
 
 
31
  var formID = props.attributes.formID;
32
+
33
+ var formName = props.attributes.formName;
34
+
35
  var children = [];
36
 
37
+ if( ! formID ) formID = ''; // Default.
38
+ if( ! formName ) formName = ''; // Default
39
+
40
+ // this function is required, but we don't need it to do anything
41
+ function wpufOnValueChange( formName ) { }
42
 
43
+ // show the dropdown when we click on the input
44
+ function wpufFocusClick( event ) {
45
+ var elID = event.target.getAttribute( 'id' );
46
+ var idArray = elID.split( '-' );
47
+ var wpufOptions = document.getElementById( 'wpuf-filter-container-' + idArray[ idArray.length -1 ] );
48
+ // get the related input element
49
+ var wpufInput = document.getElementById( 'wpuf-formFilter-' + idArray[ idArray.length -1 ] );
50
+ // set focus to the element so the onBlur function runs properly
51
+ wpufInput.focus();
52
+ wpufOptions.style.display = 'block';
53
  }
54
 
55
+ // function for select the form on filter drop down item click
56
+ function selectForm( event ) {
57
+ //set the attributes from the selected for item
58
+ props.setAttributes( {
59
+ formID: parseInt( event.target.getAttribute( 'data-formid' ) ),
60
+ formName: event.target.innerText
61
+ } );
62
+ /**
63
+ * Get the main div of the filter to tell if this is being
64
+ * selected from the sidebar or block so we can hide the dropdown
65
+ */
66
+ var elID = event.target.parentNode.parentNode;
67
+ var idArray = elID.getAttribute( 'id' ).split( '-' );
68
+ var wpufOptions = document.getElementById( 'wpuf-filter-container-' + idArray[ idArray.length -1 ] );
69
+ var inputEl = document.getElementById( 'wpuf-formFilter-sidebar' );
70
+
71
+ if( inputEl ) {
72
+ inputEl.value = '';
73
+ }
74
+ wpufOptions.style.display = 'none';
75
+ }
76
+
77
+ function wpufHideOptions( event ) {
78
+ /**
79
+ * Get the main div of the filter to tell if this is being
80
+ * selected from the sidebar or block so we can hide the dropdown
81
+ */
82
+ var elID = event.target.getAttribute( 'id' );
83
+ var idArray = elID.split( '-' );
84
+ var wpufOptions = document.getElementById( 'wpuf-filter-container-' + idArray[ idArray.length -1 ] );
85
+ wpufOptions.style.display = 'none';
86
+ }
87
+
88
+ function wpufInputKeyUp( event ) {
89
+ var val = event.target.value;
90
+ /**
91
+ * Get the main div of the filter to tell if this is being
92
+ * selected from the sidebar or block so we can SHOW the dropdown
93
+ */
94
+ var filterInputContainer = event.target.parentNode.parentNode.parentNode;
95
+ filterInputContainer.querySelector( '.wpuf-filter-option-container' ).style.display = 'block';
96
+ filterInputContainer.style.display = 'block';
97
+
98
+ // Let's filter the forms here
99
+ _.each( wpufBlock.forms, function( form, index ) {
100
+ var liEl = filterInputContainer.querySelector( "[data-formid='" + form.value + "']" );
101
+ if ( 0 <= form.label.toLowerCase().indexOf( val.toLowerCase() ) ) {
102
+ // shows options that DO contain the text entered
103
+ liEl.style.display = 'block';
104
+ } else {
105
+ // hides options the do not contain the text entered
106
+ liEl.style.display = 'none';
107
  }
108
+ });
109
+ }
110
+
111
+ // Set up the form items from the localized php variables
112
+ var formItems = [];
113
+ _.each( wpufBlock.forms, function( form, index ) {
114
+ formItems.push( el( 'li', { className: 'wpuf-filter-option',
115
+ 'data-formid': form.value, onMouseDown: selectForm},
116
+ form.label + " ( ID: " + form.value + " )" ))
117
+ });
118
+
119
+ // Set up form filter for the block
120
+ var inputFilterMain = el( 'div', { id: 'wpuf-filter-input-main',
121
+ className: 'wpuf-filter-input' },
122
+ el( TextControl, { id: 'wpuf-formFilter-main',
123
+ placeHolder: 'Select a Form',
124
+ className: 'wpuf-filter-input-el blocks-select-control__input',
125
+ onChange: wpufOnValueChange,
126
+ onClick: wpufFocusClick,
127
+ onKeyUp: wpufInputKeyUp,
128
+ onBlur: wpufHideOptions
129
+ } ),
130
+ el( 'span', { id: 'wpuf-filter-input-icon-main',
131
+ className: 'wpuf-filter-input-icon',
132
+ onClick: wpufFocusClick,
133
+ dangerouslySetInnerHTML: { __html: '&#9662;' } } ),
134
+ el( 'div', { id: 'wpuf-filter-container-main',
135
+ className: 'wpuf-filter-option-container' },
136
+ el( 'ul', null, formItems )
137
+ )
138
+ );
139
+ // Create filter input for the sidebar blocks settings
140
+ var inputFilterSidebar = el( 'div', { id: 'wpuf-filter-input-sidebar',
141
+ className: 'wpuf-filter-input' },
142
+ el( TextControl, { id: 'wpuf-formFilter-sidebar',
143
+ placeHolder: 'Select a Form',
144
+ className: 'wpuf-filter-input-el blocks-select-control__input',
145
+ onChange: wpufOnValueChange,
146
+ onClick: wpufFocusClick,
147
+ onKeyUp: wpufInputKeyUp,
148
+ onBlur: wpufHideOptions
149
+ } ),
150
+ el( 'span', { id: 'wpuf-filter-input-icon-sidebar',
151
+ className: 'wpuf-filter-input-icon',
152
+ onClick: wpufFocusClick,
153
+ dangerouslySetInnerHTML: { __html: '&#9662;' } } ),
154
+ el( 'div', { id: 'wpuf-filter-container-sidebar',
155
+ className: 'wpuf-filter-option-container' },
156
+ el( 'ul', null, formItems )
157
  )
158
  );
159
 
160
+ // Set up the form filter dropdown in the side bar 'block' settings
161
+ var inspectorControls = el( InspectorControls, {},
162
+ el( 'span', null, 'Current selected form:' ),
163
+ el( 'br', null ),
164
+ el( 'span', null, formName ),
165
+ el( 'br', null ),
166
+ el ('hr', null ),
167
+ el ( 'label', { for: 'wpuf-formFilter-sidebar' }, 'Type to' +
168
+ ' filter' +
169
+ ' forms' ),
170
+ inputFilterSidebar
171
+ );
172
+
173
  /**
174
  * Create the div container, add an overlay so the user can interact
175
  * with the form in Gutenberg, then render the iframe with form
176
  */
177
+ if( '' === formID ) {
178
+ children.push( el( 'div', {style : {width: '100%'}},
179
+ el( 'img', { className: 'wpuf-block-logo', src: wpufBlock.block_logo}),
180
+ el ( 'div', null, 'WPUF Forms'),
181
+ inputFilterMain
 
182
  ) );
183
  } else {
184
  children.push(
185
+ el( 'div', { className: 'wpuf-iframe-container' },
186
+ el( 'div', { className: 'wpuf-iframe-overlay' } ),
187
+ el( 'iframe', { src: wpufBlock.siteUrl + '?wpuf_preview=1&wpuf_iframe&form_id=' + formID, height: '0', width: '500', scrolling: 'no' })
188
  )
189
  )
190
  }
191
+ children.push(inspectorControls);
192
  return [
193
+ children
 
194
  ];
195
  },
196
 
 
197
  save: function( props ) {
 
198
  var formID = props.attributes.formID;
199
+
200
+ if( ! formID ) return '';
201
  /**
202
  * we're essentially just adding a short code, here is where
203
  * it's save in the editor
204
  *
205
+ * return content wrapped in DIV b/c raw HTML is unsupported
206
+ * going forward
207
  */
208
  var returnHTML = '[wpuf_form id=' + parseInt( formID ) + ']';
209
  return el( 'div', null, returnHTML );
210
  }
211
  } );
212
 
213
+
214
  } )(
215
  window.wp.blocks,
216
  window.wp.i18n,
217
+ window.wp.editor,
218
  window.wp.element,
219
  window.wp.components
220
+ );
assets/js/chosen.jquery.js CHANGED
File without changes
assets/js/conditional.js CHANGED
File without changes
assets/js/frontend-form.js CHANGED
File without changes
assets/js/frontend-form.min.js CHANGED
File without changes
assets/js/jquery-ui-timepicker-addon.js CHANGED
File without changes
assets/js/jquery.smallipop-0.4.0.min.js CHANGED
File without changes
assets/js/jquery.validate.min.js CHANGED
File without changes
assets/js/subscriptions.js CHANGED
File without changes
assets/js/upload.js CHANGED
File without changes
assets/js/upload.min.js CHANGED
File without changes
assets/js/wpuf-admin.js CHANGED
@@ -26,6 +26,33 @@ jQuery(function($) {
26
  $(this.children[0]).attr("checked", "checked");
27
  $(".wpuf-form-layouts li").removeClass('active');
28
  $(this).toggleClass('active');
29
- })
 
 
 
 
 
30
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  });
26
  $(this.children[0]).attr("checked", "checked");
27
  $(".wpuf-form-layouts li").removeClass('active');
28
  $(this).toggleClass('active');
29
+ });
30
+
31
+ // Clear schedule lock
32
+ $('#wpuf_clear_schedule_lock').on('click', function(e) {
33
+ e.preventDefault();
34
+ var post_id = $(this).attr('data');
35
 
36
+ $.ajax({
37
+ url: wpuf_admin_script.ajaxurl,
38
+ type: 'POST',
39
+ data: {
40
+ 'action' : 'wpuf_clear_schedule_lock',
41
+ 'nonce' : wpuf_admin_script.nonce,
42
+ 'post_id' : post_id
43
+ },
44
+ success:function(data) {
45
+ swal({
46
+ type: 'success',
47
+ title: wpuf_admin_script.cleared_schedule_lock,
48
+ showConfirmButton: false,
49
+ timer: 1500
50
+ });
51
+ },
52
+ error: function(errorThrown){
53
+ console.log(errorThrown);
54
+ }
55
+ });
56
+ $(this).closest("p").hide();
57
+ });
58
  });
assets/less/frontend-forms.less CHANGED
@@ -191,6 +191,8 @@
191
  input[type=submit] {
192
  font-size: 16px;
193
  padding: 5px 15px;
 
 
194
  border: 1px solid #ccc;
195
  .border-radius(3px);
196
  .core-button();
191
  input[type=submit] {
192
  font-size: 16px;
193
  padding: 5px 15px;
194
+ line-height: inherit;
195
+ height: inherit;
196
  border: 1px solid #ccc;
197
  .border-radius(3px);
198
  .core-button();
assets/vendor/vue/vue.js CHANGED
File without changes
assets/vendor/vue/vue.min.js CHANGED
File without changes
assets/vendor/vuex/vuex.js CHANGED
File without changes
assets/vendor/vuex/vuex.min.js CHANGED
File without changes
class/admin-asset-loader.php CHANGED
@@ -47,11 +47,9 @@ class WPUF_Admin_Assets {
47
  require_once WPUF_ROOT . '/includes/free/prompt.php';
48
 
49
  $wpuf_form_builder = apply_filters( 'wpuf-form-builder-localize-script', array(
50
- // 'i18n' => $this->i18n(),
51
  'post' => $post,
52
  'form_fields' => wpuf_get_form_fields( $post->ID ),
53
- // 'panel_sections' => $this->get_panel_sections(),
54
- 'field_settings' => WPUF_Form_Builder_Field_Settings::get_field_settings(),
55
  'notifications' => wpuf_get_form_notifications( $post->ID ),
56
  'pro_link' => WPUF_Pro_Prompt::get_pro_url(),
57
  'site_url' => site_url('/'),
47
  require_once WPUF_ROOT . '/includes/free/prompt.php';
48
 
49
  $wpuf_form_builder = apply_filters( 'wpuf-form-builder-localize-script', array(
 
50
  'post' => $post,
51
  'form_fields' => wpuf_get_form_fields( $post->ID ),
52
+ 'field_settings' => wpuf()->fields->get_js_settings(),
 
53
  'notifications' => wpuf_get_form_notifications( $post->ID ),
54
  'pro_link' => WPUF_Pro_Prompt::get_pro_url(),
55
  'site_url' => site_url('/'),
class/frontend-dashboard.php CHANGED
@@ -21,12 +21,6 @@ class WPUF_Frontend_Dashboard {
21
  * @since 0.1
22
  */
23
  function shortcode( $atts ) {
24
- // wpuf()->plugin_scripts();
25
- ?>
26
- <style>
27
- <?php //echo $custom_css = wpuf_get_option( 'custom_css', 'wpuf_general' ); ?>
28
- </style>
29
- <?php
30
  $attributes = shortcode_atts( array( 'form_id'=>'off', 'post_type' => 'post', 'category' =>'off', 'featured_image' => 'default', 'meta' => 'off', 'excerpt' =>'off', 'payment_column' => 'on' ), $atts ) ;
31
  ob_start();
32
 
21
  * @since 0.1
22
  */
23
  function shortcode( $atts ) {
 
 
 
 
 
 
24
  $attributes = shortcode_atts( array( 'form_id'=>'off', 'post_type' => 'post', 'category' =>'off', 'featured_image' => 'default', 'meta' => 'off', 'excerpt' =>'off', 'payment_column' => 'on' ), $atts ) ;
25
  ob_start();
26
 
class/frontend-form-post.php CHANGED
@@ -9,23 +9,23 @@ class WPUF_Frontend_Form_Post extends WPUF_Render_Form {
9
 
10
  function __construct() {
11
 
12
- add_shortcode( 'wpuf_form', array( $this, 'add_post_shortcode' ) );
13
- add_shortcode( 'wpuf_edit', array( $this, 'edit_post_shortcode' ) );
14
 
15
- // ajax requests
16
- add_action( 'wp_ajax_wpuf_submit_post', array( $this, 'submit_post' ) );
17
- add_action( 'wp_ajax_nopriv_wpuf_submit_post', array( $this, 'submit_post' ) );
18
- add_action( 'wp_ajax_make_media_embed_code', array( $this, 'make_media_embed_code' ) );
19
- add_action( 'wp_ajax_nopriv_make_media_embed_code', array( $this, 'make_media_embed_code' ) );
20
 
21
- // draft
22
- add_action( 'wp_ajax_wpuf_draft_post', array( $this, 'draft_post' ) );
23
 
24
- // guest post hook
25
- add_action( 'init', array( $this, 'publish_guest_post' ) );
26
 
27
- // form preview
28
- add_action( 'wp_ajax_wpuf_form_preview', array( $this, 'preview_form' ) );
29
  }
30
 
31
  public static function init() {
@@ -179,6 +179,24 @@ class WPUF_Frontend_Form_Post extends WPUF_Render_Form {
179
  return '<div class="wpuf-info">' . __( 'Invalid post', 'wp-user-frontend' ) . '</div>';
180
  }
181
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
182
  //is editing enabled?
183
  if ( wpuf_get_option( 'enable_post_edit', 'wpuf_dashboard', 'yes' ) != 'yes' ) {
184
  return '<div class="wpuf-info">' . __( 'Post Editing is disabled', 'wp-user-frontend' ) . '</div>';
@@ -410,7 +428,19 @@ class WPUF_Frontend_Form_Post extends WPUF_Render_Form {
410
  if ( isset( $_POST['wpuf_is_publish_time'] ) ) {
411
 
412
  if ( isset( $_POST[$_POST['wpuf_is_publish_time']] ) && !empty( $_POST[$_POST['wpuf_is_publish_time']] ) ) {
413
- $postarr['post_date'] = date( 'Y-m-d H:i:s', strtotime( str_replace( array( ':', '/' ), '-', $_POST[$_POST['wpuf_is_publish_time']] ) ) );
 
 
 
 
 
 
 
 
 
 
 
 
414
  }
415
  }
416
 
@@ -491,6 +521,17 @@ class WPUF_Frontend_Form_Post extends WPUF_Render_Form {
491
 
492
  $post_id = wp_insert_post( $postarr );
493
 
 
 
 
 
 
 
 
 
 
 
 
494
  if ( $post_id ) {
495
 
496
  self::update_post_meta( $meta_vars, $post_id );
9
 
10
  function __construct() {
11
 
12
+ // add_shortcode( 'wpuf_form', array( $this, 'add_post_shortcode' ) );
13
+ // add_shortcode( 'wpuf_edit', array( $this, 'edit_post_shortcode' ) );
14
 
15
+ // // ajax requests
16
+ // add_action( 'wp_ajax_wpuf_submit_post', array( $this, 'submit_post' ) );
17
+ // add_action( 'wp_ajax_nopriv_wpuf_submit_post', array( $this, 'submit_post' ) );
18
+ // add_action( 'wp_ajax_make_media_embed_code', array( $this, 'make_media_embed_code' ) );
19
+ // add_action( 'wp_ajax_nopriv_make_media_embed_code', array( $this, 'make_media_embed_code' ) );
20
 
21
+ // // draft
22
+ // add_action( 'wp_ajax_wpuf_draft_post', array( $this, 'draft_post' ) );
23
 
24
+ // // guest post hook
25
+ // add_action( 'init', array( $this, 'publish_guest_post' ) );
26
 
27
+ // // form preview
28
+ // add_action( 'wp_ajax_wpuf_form_preview', array( $this, 'preview_form' ) );
29
  }
30
 
31
  public static function init() {
179
  return '<div class="wpuf-info">' . __( 'Invalid post', 'wp-user-frontend' ) . '</div>';
180
  }
181
 
182
+ $edit_post_lock = get_post_meta( $post_id, '_wpuf_lock_editing_post', true );
183
+ $edit_post_lock_time = get_post_meta( $post_id, '_wpuf_lock_user_editing_post_time', true );
184
+
185
+ if ( $edit_post_lock == 'yes' ) {
186
+ return '<div class="wpuf-info">' . apply_filters( 'wpuf_edit_post_lock_user_notice', __( 'Your edit access for this post has been locked by an administrator.', 'wp-user-frontend' ) ) . '</div>';
187
+ }
188
+
189
+ if ( !empty( $edit_post_lock_time ) && $edit_post_lock_time < time() ) {
190
+ return '<div class="wpuf-info">' . apply_filters( 'wpuf_edit_post_lock_expire_notice', __( 'Your allocated time for editing this post has been expired.', 'wp-user-frontend' ) ) . '</div>';
191
+ }
192
+
193
+ if ( wpuf_get_user()->edit_post_locked() ) {
194
+ if ( wpuf_get_user()->edit_post_lock_reason() ) {
195
+ return '<div class="wpuf-info">' . wpuf_get_user()->edit_post_lock_reason() . '</div>';
196
+ }
197
+ return '<div class="wpuf-info">' . apply_filters( 'wpuf_user_edit_post_lock_notice', __( 'Your post edit access has been locked by an administrator.', 'wp-user-frontend' ) ) . '</div>';
198
+ }
199
+
200
  //is editing enabled?
201
  if ( wpuf_get_option( 'enable_post_edit', 'wpuf_dashboard', 'yes' ) != 'yes' ) {
202
  return '<div class="wpuf-info">' . __( 'Post Editing is disabled', 'wp-user-frontend' ) . '</div>';
428
  if ( isset( $_POST['wpuf_is_publish_time'] ) ) {
429
 
430
  if ( isset( $_POST[$_POST['wpuf_is_publish_time']] ) && !empty( $_POST[$_POST['wpuf_is_publish_time']] ) ) {
431
+ $date_time = explode(" ", $_POST[$_POST['wpuf_is_publish_time']] );
432
+
433
+ if ( !empty ( $date_time[0] ) ) {
434
+ $timestamp = strtotime( str_replace( array( '/' ), '-', $date_time[0] ) );
435
+ }
436
+
437
+ if ( !empty ( $date_time[1] ) ) {
438
+ $time = explode(':', $date_time[1] );
439
+ $seconds = ( $time[0] * 60 * 60 ) + ($time[1] * 60);
440
+ $timestamp = $timestamp + $seconds;
441
+ }
442
+
443
+ $postarr['post_date'] = date( 'Y-m-d H:i:s', $timestamp );
444
  }
445
  }
446
 
521
 
522
  $post_id = wp_insert_post( $postarr );
523
 
524
+ // add _wpuf_lock_editing_post_time meta to
525
+ // lock user from editing the published post after a certain time
526
+ if ( !$is_update ) {
527
+ $lock_edit_post = isset( $form_settings['lock_edit_post'] ) ? floatval( $form_settings['lock_edit_post'] ) : 0;
528
+
529
+ if ( $post_id && $lock_edit_post > 0 ) {
530
+ $lock_edit_post_time = time() + ( $lock_edit_post * 60 * 60 );
531
+ update_post_meta( $post_id, '_wpuf_lock_user_editing_post_time', $lock_edit_post_time );
532
+ }
533
+ }
534
+
535
  if ( $post_id ) {
536
 
537
  self::update_post_meta( $meta_vars, $post_id );
class/payment.php CHANGED
File without changes
class/post-form-template.php CHANGED
@@ -152,4 +152,18 @@ abstract class WPUF_Post_Form_Template {
152
  * @return void
153
  */
154
  public function after_update( $post_id, $form_id, $form_settings ) {}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
155
  }
152
  * @return void
153
  */
154
  public function after_update( $post_id, $form_id, $form_settings ) {}
155
+
156
+ /**
157
+ * wpuf_visibility property for all fields
158
+ *
159
+ * @since 2.6
160
+ *
161
+ * @return array
162
+ */
163
+ public function get_default_visibility_prop( $default = 'everyone' ) {
164
+ return array(
165
+ 'selected' => $default,
166
+ 'choices' => array()
167
+ );
168
+ }
169
  }
class/post-form-templates/post.php CHANGED
@@ -14,37 +14,40 @@ class WPUF_Post_Form_Template_Post extends WPUF_Post_Form_Template {
14
  $this->image = WPUF_ASSET_URI . '/images/templates/post.png';
15
  $this->form_fields = array(
16
  array(
17
- 'input_type' => 'text',
18
- 'template' => 'post_title',
19
- 'required' => 'yes',
20
- 'label' => __( 'Post Title', 'wp-user-frontend' ),
21
- 'name' => 'post_title',
22
- 'is_meta' => 'no',
23
- 'help' => '',
24
- 'css' => '',
25
- 'placeholder' => __( 'Please enter your post name', 'wp-user-frontend' ),
26
- 'default' => '',
27
- 'size' => '40',
28
- 'wpuf_cond' => $this->conditionals
 
29
  ),
30
  array(
31
- 'input_type' => 'taxonomy',
32
- 'template' => 'taxonomy',
33
- 'required' => 'yes',
34
- 'label' => __( 'Category', 'wp-user-frontend' ),
35
- 'name' => 'category',
36
- 'is_meta' => 'no',
37
- 'help' => __( 'Select a category for your post', 'wp-user-frontend' ) ,
38
- 'css' => '',
39
- 'type' => 'select',
40
- 'orderby' => 'name',
41
- 'order' => 'ASC',
42
- 'exclude_type' => 'exclude',
43
- 'exclude' => '',
44
- 'woo_attr' => 'no',
45
- 'woo_attr_vis' => 'no',
46
- 'options' => array(),
47
- 'wpuf_cond' => $this->conditionals
 
 
48
  ),
49
  array(
50
  'input_type' => 'textarea',
@@ -62,96 +65,100 @@ class WPUF_Post_Form_Template_Post extends WPUF_Post_Form_Template {
62
  'rich' => 'yes',
63
  'insert_image' => 'yes',
64
  'word_restriction' => '',
65
- 'wpuf_cond' => $this->conditionals
 
66
  ),
67
  array(
68
- 'input_type' => 'image_upload',
69
- 'template' => 'featured_image',
70
- 'count' => '1',
71
- 'required' => 'yes',
72
- 'label' => __( 'Featured Image', 'wp-user-frontend' ),
73
- 'button_label' => __( 'Featured Image', 'wp-user-frontend' ),
74
- 'name' => 'featured_image',
75
- 'is_meta' => 'no',
76
- 'help' => __( 'Upload the main image of your post', 'wp-user-frontend' ),
77
- 'css' => '',
78
- 'max_size' => '1024',
79
- 'wpuf_cond' => $this->conditionals
 
80
  ),
81
  array(
82
- 'input_type' => 'textarea',
83
- 'template' => 'post_excerpt',
84
- 'required' => 'no',
85
- 'label' => __( 'Excerpt', 'wp-user-frontend' ),
86
- 'name' => 'post_excerpt',
87
- 'is_meta' => 'no',
88
- 'help' => __( 'Provide a short description of this post (optional)', 'wp-user-frontend' ),
89
- 'css' => '',
90
- 'rows' => '5',
91
- 'cols' => '25',
92
- 'placeholder' => '',
93
- 'default' => '',
94
- 'rich' => 'no',
95
- 'wpuf_cond' => $this->conditionals
 
96
  ),
97
  array(
98
- 'input_type' => 'text',
99
- 'template' => 'post_tags',
100
- 'required' => 'no',
101
- 'label' => __( 'Tags', 'wp-user-frontend' ),
102
- 'name' => 'tags',
103
- 'is_meta' => 'no',
104
- 'help' => __( 'Separate tags with commas.', 'wp-user-frontend' ),
105
- 'css' => '',
106
- 'placeholder' => '',
107
- 'default' => '',
108
- 'size' => '40',
109
- 'wpuf_cond' => $this->conditionals
 
110
  ),
111
  );
112
 
113
  $this->form_settings = array (
114
- 'post_type' => 'post',
115
- 'post_status' => 'publish',
116
- 'default_cat' => '-1',
117
- 'guest_post' => 'false',
118
- 'message_restrict' => __( 'This page is restricted. Please Log in / Register to view this page.', 'wp-user-frontend' ),
119
- 'redirect_to' => 'post',
120
- 'comment_status' => 'open',
121
- 'submit_text' => __( 'Create Post', 'wp-user-frontend' ),
122
- 'edit_post_status' => 'publish',
123
- 'edit_redirect_to' => 'same',
124
- 'update_message' => __( 'Post has been updated successfully. <a target="_blank" href="%link%">View post</a>', 'wp-user-frontend' ),
125
- 'edit_url' => '',
126
- 'update_text' => __( 'Update Post', 'wp-user-frontend' ),
127
- 'form_template' => __CLASS__,
128
- 'notification' => array(
129
  'new' => 'on',
130
  'new_to' => get_option( 'admin_email' ),
131
  'new_subject' => 'New post has been created',
132
  'new_body' => 'Hi,
133
- A new post has been created in your site %sitename% (%siteurl%).
134
 
135
- Here is the details:
136
- Post Title: %post_title%
137
- Description: %post_content%
138
- Short Description: %post_excerpt%
139
- Author: %author%
140
- Post URL: %permalink%
141
- Edit URL: %editlink%',
142
  'edit' => 'off',
143
  'edit_to' => get_option( 'admin_email' ),
144
  'edit_subject' => 'Post has been edited',
145
  'edit_body' => 'Hi,
146
- The post "%post_title%" has been updated.
147
 
148
- Here is the details:
149
- Post Title: %post_title%
150
- Description: %post_content%
151
- Short Description: %post_excerpt%
152
- Author: %author%
153
- Post URL: %permalink%
154
- Edit URL: %editlink%',
155
  ),
156
  );
157
  }
14
  $this->image = WPUF_ASSET_URI . '/images/templates/post.png';
15
  $this->form_fields = array(
16
  array(
17
+ 'input_type' => 'text',
18
+ 'template' => 'post_title',
19
+ 'required' => 'yes',
20
+ 'label' => __( 'Post Title', 'wp-user-frontend' ),
21
+ 'name' => 'post_title',
22
+ 'is_meta' => 'no',
23
+ 'help' => '',
24
+ 'css' => '',
25
+ 'placeholder' => __( 'Please enter your post name', 'wp-user-frontend' ),
26
+ 'default' => '',
27
+ 'size' => '40',
28
+ 'wpuf_cond' => $this->conditionals,
29
+ 'wpuf_visibility' => $this->get_default_visibility_prop()
30
  ),
31
  array(
32
+ 'input_type' => 'taxonomy',
33
+ 'template' => 'taxonomy',
34
+ 'required' => 'yes',
35
+ 'label' => __( 'Category', 'wp-user-frontend' ),
36
+ 'name' => 'category',
37
+ 'is_meta' => 'no',
38
+ 'help' => __( 'Select a category for your post', 'wp-user-frontend' ) ,
39
+ 'first' => __( '- select -', 'wp-user-frontend' ),
40
+ 'css' => '',
41
+ 'type' => 'select',
42
+ 'orderby' => 'name',
43
+ 'order' => 'ASC',
44
+ 'exclude_type' => 'exclude',
45
+ 'exclude' => array(),
46
+ 'woo_attr' => 'no',
47
+ 'woo_attr_vis' => 'no',
48
+ 'options' => array(),
49
+ 'wpuf_cond' => $this->conditionals,
50
+ 'wpuf_visibility' => $this->get_default_visibility_prop()
51
  ),
52
  array(
53
  'input_type' => 'textarea',
65
  'rich' => 'yes',
66
  'insert_image' => 'yes',
67
  'word_restriction' => '',
68
+ 'wpuf_cond' => $this->conditionals,
69
+ 'wpuf_visibility' => $this->get_default_visibility_prop()
70
  ),
71
  array(
72
+ 'input_type' => 'image_upload',
73
+ 'template' => 'featured_image',
74
+ 'count' => '1',
75
+ 'required' => 'yes',
76
+ 'label' => __( 'Featured Image', 'wp-user-frontend' ),
77
+ 'button_label' => __( 'Featured Image', 'wp-user-frontend' ),
78
+ 'name' => 'featured_image',
79
+ 'is_meta' => 'no',
80
+ 'help' => __( 'Upload the main image of your post', 'wp-user-frontend' ),
81
+ 'css' => '',
82
+ 'max_size' => '1024',
83
+ 'wpuf_cond' => $this->conditionals,
84
+ 'wpuf_visibility' => $this->get_default_visibility_prop()
85
  ),
86
  array(
87
+ 'input_type' => 'textarea',
88
+ 'template' => 'post_excerpt',
89
+ 'required' => 'no',
90
+ 'label' => __( 'Excerpt', 'wp-user-frontend' ),
91
+ 'name' => 'post_excerpt',
92
+ 'is_meta' => 'no',
93
+ 'help' => __( 'Provide a short description of this post (optional)', 'wp-user-frontend' ),
94
+ 'css' => '',
95
+ 'rows' => '5',
96
+ 'cols' => '25',
97
+ 'placeholder' => '',
98
+ 'default' => '',
99
+ 'rich' => 'no',
100
+ 'wpuf_cond' => $this->conditionals,
101
+ 'wpuf_visibility' => $this->get_default_visibility_prop()
102
  ),
103
  array(
104
+ 'input_type' => 'text',
105
+ 'template' => 'post_tags',
106
+ 'required' => 'no',
107
+ 'label' => __( 'Tags', 'wp-user-frontend' ),
108
+ 'name' => 'tags',
109
+ 'is_meta' => 'no',
110
+ 'help' => __( 'Separate tags with commas.', 'wp-user-frontend' ),
111
+ 'css' => '',
112
+ 'placeholder' => '',
113
+ 'default' => '',
114
+ 'size' => '40',
115
+ 'wpuf_cond' => $this->conditionals,
116
+ 'wpuf_visibility' => $this->get_default_visibility_prop()
117
  ),
118
  );
119
 
120
  $this->form_settings = array (
121
+ 'post_type' => 'post',
122
+ 'post_status' => 'publish',
123
+ 'default_cat' => '-1',
124
+ 'guest_post' => 'false',
125
+ 'message_restrict' => __( 'This page is restricted. Please Log in / Register to view this page.', 'wp-user-frontend' ),
126
+ 'redirect_to' => 'post',
127
+ 'comment_status' => 'open',
128
+ 'submit_text' => __( 'Create Post', 'wp-user-frontend' ),
129
+ 'edit_post_status' => 'publish',
130
+ 'edit_redirect_to' => 'same',
131
+ 'update_message' => __( 'Post has been updated successfully. <a target="_blank" href="%link%">View post</a>', 'wp-user-frontend' ),
132
+ 'edit_url' => '',
133
+ 'update_text' => __( 'Update Post', 'wp-user-frontend' ),
134
+ 'form_template' => __CLASS__,
135
+ 'notification' => array(
136
  'new' => 'on',
137
  'new_to' => get_option( 'admin_email' ),
138
  'new_subject' => 'New post has been created',
139
  'new_body' => 'Hi,
140
+ A new post has been created in your site %sitename% (%siteurl%).
141
 
142
+ Here is the details:
143
+ Post Title: %post_title%
144
+ Description: %post_content%
145
+ Short Description: %post_excerpt%
146
+ Author: %author%
147
+ Post URL: %permalink%
148
+ Edit URL: %editlink%',
149
  'edit' => 'off',
150
  'edit_to' => get_option( 'admin_email' ),
151
  'edit_subject' => 'Post has been edited',
152
  'edit_body' => 'Hi,
153
+ The post "%post_title%" has been updated.
154
 
155
+ Here is the details:
156
+ Post Title: %post_title%
157
+ Description: %post_content%
158
+ Short Description: %post_excerpt%
159
+ Author: %author%
160
+ Post URL: %permalink%
161
+ Edit URL: %editlink%',
162
  ),
163
  );
164
  }
class/render-form.php CHANGED
File without changes
class/subscription.php CHANGED
File without changes
class/upload.php CHANGED
File without changes
includes/class-field-manager.php ADDED
@@ -0,0 +1,359 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Form field manager class
5
+ *
6
+ * @since 1.1.0
7
+ */
8
+ class WPUF_Field_Manager {
9
+
10
+
11
+ /**
12
+ * The fields
13
+ *
14
+ * @var array
15
+ *
16
+ */
17
+ private $fields = array();
18
+
19
+ /**
20
+ * WP post types
21
+ *
22
+ * @var string
23
+ */
24
+ private $wp_post_types = array();
25
+
26
+
27
+
28
+ function __construct() {
29
+
30
+ }
31
+
32
+ /**
33
+ * Get all the registered fields
34
+ *
35
+ * @return array
36
+ */
37
+ public function get_fields() {
38
+
39
+ if ( ! empty( $this->fields ) ) {
40
+ return $this->fields;
41
+ }
42
+
43
+ $this->register_field_types();
44
+
45
+ return $this->fields;
46
+ }
47
+
48
+
49
+
50
+ /**
51
+ * Add Post Field Type
52
+ *
53
+ * @since 2.5
54
+ *
55
+ * @return void
56
+ */
57
+
58
+ public function add_field_settings( $field_settings ) {
59
+
60
+ if ( class_exists( 'WPUF_Field_Contract' ) ) {
61
+
62
+ require_once WPUF_ROOT . '/includes/fields/class-field-post-title.php';
63
+ require_once WPUF_ROOT . '/includes/fields/class-field-post-content.php';
64
+ require_once WPUF_ROOT . '/includes/fields/class-field-post-tags.php';
65
+ require_once WPUF_ROOT . '/includes/fields/class-field-post-excerpt.php';
66
+ require_once WPUF_ROOT . '/includes/fields/class-field-post-taxonomy.php';
67
+ require_once WPUF_ROOT . '/includes/fields/class-field-featured-image.php';
68
+
69
+ $field_settings['post_title'] = new WPUF_Form_Field_Post_Title();
70
+ $field_settings['post_content'] = new WPUF_Form_Field_Post_Content();
71
+ $field_settings['post_excerpt'] = new WPUF_Form_Field_Post_Excerpt();
72
+ $field_settings['featured_image'] = new WPUF_Form_Field_Featured_Image();
73
+
74
+
75
+ $taxonomy_templates = array();
76
+
77
+ foreach ( $this->wp_post_types as $post_type => $taxonomies ) {
78
+
79
+ if ( ! empty( $taxonomies ) ) {
80
+
81
+ foreach ( $taxonomies as $tax_name => $taxonomy ) {
82
+ if ( 'post_tag' === $tax_name ) {
83
+ // $taxonomy_templates['post_tag'] = self::post_tags();
84
+ $taxonomy_templates['post_tags'] = new WPUF_Form_Field_Post_Tags();
85
+
86
+ } else {
87
+ // $taxonomy_templates[ $tax_name ] = self::taxonomy_template( $tax_name, $taxonomy );
88
+ // $taxonomy_templates[ 'taxonomy' ] = new WPUF_Form_Field_Post_Taxonomy($tax_name, $taxonomy);
89
+ $taxonomy_templates[ $tax_name ] = new WPUF_Form_Field_Post_Taxonomy($tax_name, $taxonomy);
90
+ }
91
+ }
92
+
93
+ }
94
+
95
+ }
96
+
97
+ $field_settings = array_merge( $field_settings, $taxonomy_templates );
98
+
99
+ }
100
+
101
+ return $field_settings;
102
+ }
103
+
104
+
105
+ /**
106
+ * Register the field types
107
+ *
108
+ * @return void
109
+ */
110
+ private function register_field_types() {
111
+
112
+ require_once dirname( __FILE__ ) . '/fields/class-abstract-fields.php';
113
+ require_once dirname( __FILE__ ) . '/fields/class-field-text.php';
114
+ require_once dirname( __FILE__ ) . '/fields/class-field-email.php';
115
+ require_once dirname( __FILE__ ) . '/fields/class-field-textarea.php';
116
+ require_once dirname( __FILE__ ) . '/fields/class-field-checkbox.php';
117
+ require_once dirname( __FILE__ ) . '/fields/class-field-radio.php';
118
+ require_once dirname( __FILE__ ) . '/fields/class-field-dropdown.php';
119
+ require_once dirname( __FILE__ ) . '/fields/class-field-multidropdown.php';
120
+ require_once dirname( __FILE__ ) . '/fields/class-field-url.php';
121
+ require_once dirname( __FILE__ ) . '/fields/class-field-sectionbreak.php';
122
+ require_once dirname( __FILE__ ) . '/fields/class-field-html.php';
123
+ require_once dirname( __FILE__ ) . '/fields/class-field-hidden.php';
124
+ require_once dirname( __FILE__ ) . '/fields/class-field-image.php';
125
+ require_once dirname( __FILE__ ) . '/fields/class-field-recaptcha.php';
126
+
127
+
128
+ $fields = array(
129
+ 'text_field' => new WPUF_Form_Field_Text(),
130
+ 'email_address' => new WPUF_Form_Field_Email(),
131
+ 'textarea_field' => new WPUF_Form_Field_Textarea(),
132
+ 'radio_field' => new WPUF_Form_Field_Radio(),
133
+ 'checkbox_field' => new WPUF_Form_Field_Checkbox(),
134
+ 'dropdown_field' => new WPUF_Form_Field_Dropdown(),
135
+ 'multiple_select' => new WPUF_Form_Field_MultiDropdown(),
136
+ 'website_url' => new WPUF_Form_Field_URL(),
137
+ 'section_break' => new WPUF_Form_Field_SectionBreak(),
138
+ 'custom_html' => new WPUF_Form_Field_HTML(),
139
+ 'custom_hidden_field' => new WPUF_Form_Field_Hidden(),
140
+ 'image_upload' => new WPUF_Form_Field_Image(),
141
+ 'recaptcha' => new WPUF_Form_Field_reCaptcha(),
142
+ );
143
+
144
+ $this->fields = apply_filters( 'wpuf-form-fields', $fields );
145
+ }
146
+
147
+
148
+ /**
149
+ * Get field groups
150
+ *
151
+ * @return array
152
+ */
153
+ public function get_field_groups() {
154
+
155
+ $before_custom_fields = apply_filters( 'wpuf-form-fields-section-before', array() );
156
+ $groups = array_merge( $before_custom_fields, $this->get_custom_fields() );
157
+ $groups = array_merge( $groups, $this->get_others_fields() );
158
+ $after_custom_fields = apply_filters( 'wpuf-form-fields-section-after', array() );
159
+ $groups = array_merge( $groups, $after_custom_fields );
160
+
161
+ return $groups;
162
+ }
163
+
164
+
165
+ /**
166
+ * Custom field section
167
+ *
168
+ * @since 2.5
169
+ *
170
+ * @return array
171
+ */
172
+ private function get_custom_fields() {
173
+
174
+ // $fields = apply_filters( 'wpuf-form-builder-fields-custom-fields', array(
175
+ $fields = apply_filters( 'wpuf-form-fields-custom-fields', array(
176
+ 'text_field', 'textarea_field', 'dropdown_field', 'multiple_select',
177
+ 'radio_field', 'checkbox_field', 'website_url', 'email_address',
178
+ 'custom_hidden_field', 'image_upload'
179
+ ) );
180
+
181
+ return array(
182
+ array(
183
+ 'title' => __( 'Custom Fields', 'wp-user-frontend' ),
184
+ 'id' => 'custom-fields',
185
+ 'fields' => $fields
186
+ )
187
+ );
188
+ }
189
+
190
+ /**
191
+ * Others field section
192
+ *
193
+ * @since 2.5
194
+ *
195
+ * @return array
196
+ */
197
+ private function get_others_fields() {
198
+
199
+ $fields = apply_filters( 'wpuf-form-fields-others-fields', array(
200
+ 'section_break', 'custom_html', 'recaptcha'
201
+ ) );
202
+
203
+ return array(
204
+ array(
205
+ 'title' => __( 'Others', 'wp-user-frontend' ),
206
+ 'id' => 'others',
207
+ 'fields' => $fields
208
+ )
209
+ );
210
+ }
211
+
212
+
213
+ /**
214
+ * Get fields JS setting for the form builder
215
+ *
216
+ * @return array
217
+ */
218
+ public function get_js_settings() {
219
+
220
+ $fields = $this->get_fields();
221
+
222
+ $js_array = array();
223
+
224
+ if ( $fields ) {
225
+ foreach ( $fields as $type => $object ) {
226
+ if ( is_object( $object ) ) {
227
+
228
+ $js_array[ $type ] = $object->get_js_settings();
229
+ }
230
+ }
231
+ }
232
+
233
+ return $js_array;
234
+ }
235
+
236
+ /**
237
+ * Render the form fields
238
+ *
239
+ * @param array $fields
240
+ * @param integer $form_id
241
+ * @param array $atts
242
+ * @param string $type
243
+ * @param int $post_id
244
+ *
245
+ * @return void
246
+ */
247
+ public function render_fields( $fields, $form_id, $atts = array(), $type = 'post' , $post_id = null ) {
248
+
249
+ if ( ! $fields ) {
250
+ return;
251
+ }
252
+
253
+ $fields = apply_filters( 'wpuf_render_fields', $fields, $form_id );
254
+
255
+ foreach ( $fields as $field ) {
256
+
257
+ if ( ! $field_object = $this->field_exists( $field['template'] ) ) {
258
+
259
+ if ( defined( 'WP_DEBUG' && WP_DEBUG ) ) {
260
+ echo '<h4 style="color: red;"><em>' . $field['template'] . '</em> field not found.</h4>';
261
+ }
262
+
263
+ continue;
264
+ }
265
+
266
+ if( $this->check_field_visibility( $field ) ) {
267
+
268
+ if ( is_object( $field_object ) ) {
269
+ $field_object->render( $field, $form_id,$type , $post_id );
270
+ $field_object->conditional_logic( $field, $form_id );
271
+ }
272
+ }
273
+
274
+ }
275
+ }
276
+
277
+ /**
278
+ * Check field Visibility
279
+ *
280
+ * @param array $form_field
281
+ *
282
+ * @return boolean
283
+ **/
284
+ public function check_field_visibility( &$form_field ) {
285
+
286
+ $show_field = true;
287
+
288
+ // check field visibility options
289
+ if ( array_key_exists( 'wpuf_visibility', $form_field ) ) {
290
+
291
+ $visibility_selected = $form_field['wpuf_visibility']['selected'];
292
+ $visibility_choices = $form_field['wpuf_visibility']['choices'];
293
+ $show_field = false;
294
+
295
+ if ( $visibility_selected == 'everyone' ) {
296
+ $show_field = true;
297
+ }
298
+
299
+ if ( $visibility_selected == 'hidden' ) {
300
+ $form_field['css'] .= 'wpuf_hidden_field';
301
+ $show_field = true;
302
+ }
303
+
304
+ if ( $visibility_selected == 'logged_in' && is_user_logged_in() ) {
305
+
306
+ if ( empty( $visibility_choices ) ) {
307
+ $show_field = true;
308
+ } else {
309
+ foreach ( $visibility_choices as $key => $choice ) {
310
+ if ( current_user_can( $choice ) ) {
311
+ $show_field = true;
312
+ break;
313
+ }
314
+ continue;
315
+ }
316
+ }
317
+ }
318
+
319
+ if ( $visibility_selected == 'subscribed_users' && is_user_logged_in() ) {
320
+
321
+ $user_pack = WPUF_Subscription::init()->get_user_pack(get_current_user_id());
322
+
323
+ if ( empty( $visibility_choices ) && !empty( $user_pack ) ) {
324
+ $show_field = true;
325
+ } elseif ( !empty( $user_pack ) && !empty( $visibility_choices ) ) {
326
+
327
+ foreach ( $visibility_choices as $pack => $id ) {
328
+ if ( $user_pack['pack_id'] == $id ) {
329
+ $show_field = true;
330
+ break;
331
+ }
332
+ continue;
333
+ }
334
+
335
+ }
336
+
337
+ }
338
+
339
+ }
340
+
341
+ return $show_field;
342
+ }
343
+
344
+
345
+ /**
346
+ * Check if a field exists
347
+ *
348
+ * @param string $field_type
349
+ *
350
+ * @return boolean
351
+ */
352
+ public function field_exists( $field_type ) {
353
+ if ( array_key_exists( $field_type, $this->get_fields() ) ) {
354
+ return $this->fields[ $field_type ];
355
+ }
356
+
357
+ return false;
358
+ }
359
+ }
includes/class-form.php CHANGED
@@ -1,150 +1,387 @@
1
- <?php
2
-
3
- class WPUF_Form {
4
-
5
- /**
6
- * The form ID
7
- *
8
- * @var integer
9
- */
10
- public $id;
11
-
12
- public function __construct( $form ) {
13
-
14
- if ( is_numeric( $form ) ) {
15
-
16
- $this->id = $form;
17
- $this->data = get_post( $form );
18
-
19
- } elseif ( is_a( $form, 'WP_Post' )) {
20
-
21
- $this->id = $form->ID;
22
- $this->data = $form;
23
- }
24
- }
25
-
26
- /**
27
- * Returns form title
28
- *
29
- * @return string
30
- */
31
- public function get_title() {
32
- return $this->data->post_title;
33
- }
34
-
35
- /**
36
- * Get the form settings
37
- *
38
- * @return array
39
- */
40
- public function get_settings() {
41
- $form_settings = wpuf_get_form_settings( $this->id );
42
- return $form_settings;
43
-
44
- }
45
-
46
- /**
47
- * Get guest post settings
48
- *
49
- * @return boolean
50
- */
51
- public function guest_post() {
52
- $settings = $this->get_settings();
53
- if ( isset( $settings['guest_post'] ) && $settings['guest_post'] == 'true' ) {
54
- return true;
55
- }
56
-
57
- return false;
58
- }
59
-
60
- /**
61
- * Check if payment is enabled
62
- *
63
- * @return boolean
64
- */
65
- public function is_charging_enabled() {
66
- $settings = $this->get_settings();
67
-
68
- if ( isset( $settings['payment_options'] ) && $settings['payment_options'] == 'true' ) {
69
- return true;
70
- }
71
-
72
- return false;
73
- }
74
-
75
- /**
76
- * Check if pay per post is enabled
77
- *
78
- * @return boolean
79
- */
80
- public function is_enabled_pay_per_post() {
81
- $settings = $this->get_settings();
82
-
83
- if ( isset( $settings['enable_pay_per_post'] ) && $settings['enable_pay_per_post'] == 'true' ) {
84
- return true;
85
- }
86
-
87
- return false;
88
- }
89
-
90
- /**
91
- * Check if subscription pack is forced
92
- *
93
- * @return boolean
94
- */
95
- public function is_enabled_force_pack() {
96
- $settings = $this->get_settings();
97
-
98
- if ( isset( $settings['force_pack_purchase'] ) && $settings['force_pack_purchase'] == 'true' ) {
99
- return true;
100
- }
101
-
102
- return false;
103
- }
104
-
105
- /**
106
- * Get pay per cost amount
107
- *
108
- * @return integer
109
- */
110
- public function get_pay_per_post_cost() {
111
- $settings = $this->get_settings();
112
-
113
- if ( isset( $settings['pay_per_post_cost'] ) && $settings['pay_per_post_cost'] > 0 ) {
114
- return $settings['pay_per_post_cost'];
115
- }
116
-
117
- return 0;
118
- }
119
-
120
- /**
121
- * Check if fallback cost after subscription pack expiration is enabled
122
- *
123
- * @return boolean
124
- */
125
- public function is_enabled_fallback_cost() {
126
- $settings = $this->get_settings();
127
-
128
- if ( isset( $settings['fallback_ppp_enable'] ) && $settings['fallback_ppp_enable'] == 'true' ) {
129
- return true;
130
- }
131
-
132
- return false;
133
- }
134
-
135
- /**
136
- * Get the fallback cost amount
137
- *
138
- * @return integer
139
- */
140
- public function get_subs_fallback_cost() {
141
- $settings = $this->get_settings();
142
-
143
- if ( isset( $settings['fallback_ppp_cost'] ) && $settings['fallback_ppp_cost'] > 0 ) {
144
- return $settings['fallback_ppp_cost'];
145
- }
146
-
147
- return 0;
148
- }
149
-
150
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class WPUF_Form {
4
+
5
+ /**
6
+ * The form ID
7
+ *
8
+ * @var integer
9
+ */
10
+ public $id;
11
+
12
+ /**
13
+ * Form fields
14
+ *
15
+ * @var array
16
+ */
17
+
18
+ public $form_fields = array();
19
+
20
+
21
+ public function __construct( $form ) {
22
+
23
+ if ( is_numeric( $form ) ) {
24
+
25
+ $this->id = $form;
26
+ $this->data = get_post( $form );
27
+
28
+ } elseif ( is_a( $form, 'WP_Post' )) {
29
+
30
+ $this->id = $form->ID;
31
+ $this->data = $form;
32
+ }
33
+ }
34
+
35
+ /**
36
+ * Returns form title
37
+ *
38
+ * @return string
39
+ */
40
+ public function get_title() {
41
+ return $this->data->post_title;
42
+ }
43
+
44
+ /**
45
+ * Get the form settings
46
+ *
47
+ * @return array
48
+ */
49
+ public function get_settings() {
50
+ $form_settings = wpuf_get_form_settings( $this->id );
51
+ return $form_settings;
52
+
53
+ }
54
+
55
+ /**
56
+ * Get guest post settings
57
+ *
58
+ * @return boolean
59
+ */
60
+ public function guest_post() {
61
+ $settings = $this->get_settings();
62
+ if ( isset( $settings['guest_post'] ) && $settings['guest_post'] == 'true' ) {
63
+ return true;
64
+ }
65
+
66
+ return false;
67
+ }
68
+
69
+ /**
70
+ * Check if payment is enabled
71
+ *
72
+ * @return boolean
73
+ */
74
+ public function is_charging_enabled() {
75
+ $settings = $this->get_settings();
76
+
77
+ if ( isset( $settings['payment_options'] ) && $settings['payment_options'] == 'true' ) {
78
+ return true;
79
+ }
80
+
81
+ return false;
82
+ }
83
+
84
+ /**
85
+ * Check if pay per post is enabled
86
+ *
87
+ * @return boolean
88
+ */
89
+ public function is_enabled_pay_per_post() {
90
+ $settings = $this->get_settings();
91
+
92
+ if ( isset( $settings['enable_pay_per_post'] ) && $settings['enable_pay_per_post'] == 'true' ) {
93
+ return true;
94
+ }
95
+
96
+ return false;
97
+ }
98
+
99
+ /**
100
+ * Check if subscription pack is forced
101
+ *
102
+ * @return boolean
103
+ */
104
+ public function is_enabled_force_pack() {
105
+ $settings = $this->get_settings();
106
+
107
+ if ( isset( $settings['force_pack_purchase'] ) && $settings['force_pack_purchase'] == 'true' ) {
108
+ return true;
109
+ }
110
+
111
+ return false;
112
+ }
113
+
114
+ /**
115
+ * Get pay per cost amount
116
+ *
117
+ * @return integer
118
+ */
119
+ public function get_pay_per_post_cost() {
120
+ $settings = $this->get_settings();
121
+
122
+ if ( isset( $settings['pay_per_post_cost'] ) && $settings['pay_per_post_cost'] > 0 ) {
123
+ return $settings['pay_per_post_cost'];
124
+ }
125
+
126
+ return 0;
127
+ }
128
+
129
+ /**
130
+ * Check if fallback cost after subscription pack expiration is enabled
131
+ *
132
+ * @return boolean
133
+ */
134
+ public function is_enabled_fallback_cost() {
135
+ $settings = $this->get_settings();
136
+
137
+ if ( isset( $settings['fallback_ppp_enable'] ) && $settings['fallback_ppp_enable'] == 'true' ) {
138
+ return true;
139
+ }
140
+
141
+ return false;
142
+ }
143
+
144
+ /**
145
+ * Get the fallback cost amount
146
+ *
147
+ * @return integer
148
+ */
149
+ public function get_subs_fallback_cost() {
150
+ $settings = $this->get_settings();
151
+
152
+ if ( isset( $settings['fallback_ppp_cost'] ) && $settings['fallback_ppp_cost'] > 0 ) {
153
+ return $settings['fallback_ppp_cost'];
154
+ }
155
+
156
+ return 0;
157
+ }
158
+
159
+ /**
160
+ * Check if the form submission is open
161
+ *
162
+ * @param object $form
163
+ * @param array $form_settings
164
+ * @param array $atts
165
+ * @param string $type
166
+ * @param int $post_id
167
+ *
168
+ * @return array
169
+ */
170
+ public function is_submission_open( $form, $form_settings ) {
171
+
172
+ $info = '';
173
+
174
+ $user_can_post = 'yes';
175
+
176
+ $current_user = wpuf_get_user();
177
+
178
+ $guest_post_enabled = $this->guest_post();
179
+
180
+
181
+ if(isset( $this->form_settings['message_restrict'] ) && !$guest_post_enabled && ! is_user_logged_in() ) {
182
+ $user_can_post = 'no';
183
+ $info = $this->form_settings['message_restrict'];
184
+ }
185
+
186
+ if ( $this->is_charging_enabled() ) {
187
+
188
+ $pay_per_post = $this->is_enabled_pay_per_post();
189
+
190
+ $pay_per_post_cost = (float) $this->get_pay_per_post_cost();
191
+
192
+ $force_pack = $this->is_enabled_force_pack();
193
+
194
+ $fallback_enabled = $this->is_enabled_fallback_cost();
195
+
196
+ $fallback_cost = $this->get_subs_fallback_cost();
197
+
198
+ $has_post_count = $current_user->subscription()->has_post_count( $form_settings['post_type'] );
199
+
200
+ // guest post payment checking
201
+ if ( ! is_user_logged_in() && isset( $form_settings['guest_post'] ) && $form_settings['guest_post'] == 'true' ) {
202
+
203
+ //if ( $form->is_charging_enabled() ) {
204
+
205
+ if ( $force_pack ) {
206
+ $user_can_post = 'no';
207
+ $info = 'You need to buy a pack to post in this form.';
208
+ } elseif ( $pay_per_post && !$force_pack ) {
209
+ $user_can_post = 'yes';
210
+ // $info = sprintf( __( 'There is a <strong>%s</strong> charge to add a new post.', 'wpuf' ), wpuf_format_price( $pay_per_post_cost ));
211
+ // echo '<div class="wpuf-info">' . apply_filters( 'wpuf_ppp_notice', $info, $id, $form_settings ) . '</div>';
212
+ } else {
213
+ $user_can_post = 'no';
214
+ $info = sprintf( __( 'Payment type not selected for this form. Please contact admin.', 'wp-user-frontend' ));
215
+ }
216
+
217
+ // } else {
218
+ // $user_can_post = 'yes';
219
+ // }
220
+
221
+ } else {
222
+ // regular payment checking
223
+ if ( $force_pack && is_user_logged_in() ) {
224
+ $current_pack = $current_user->subscription()->current_pack();
225
+
226
+ if ( ! is_wp_error( $current_pack ) ) {
227
+ // user has valid post count
228
+ if ( $has_post_count ) {
229
+ $user_can_post = 'yes';
230
+ } else {
231
+ if ( $fallback_enabled && !$has_post_count ) {
232
+ $user_can_post = 'yes';
233
+ } else {
234
+ $user_can_post = 'no';
235
+ $info = 'Post Limit Exceeded for your purchased subscription pack.';
236
+ }
237
+ }
238
+ } else {
239
+ $user_can_post = 'no';
240
+ $info = $current_pack->get_error_message();
241
+ }
242
+ } elseif ( $pay_per_post && is_user_logged_in() && !$current_user->subscription()->has_post_count( $form_settings['post_type'] ) ) {
243
+
244
+ $user_can_post = 'yes';
245
+ // $info = sprintf( __( 'There is a <strong>%s</strong> charge to add a new post.', 'wpuf' ), wpuf_format_price( $pay_per_post_cost ));
246
+ // echo '<div class="wpuf-info">' . apply_filters( 'wpuf_ppp_notice', $info, $id, $form_settings ) . '</div>';
247
+
248
+ } elseif ( !$pay_per_post && !$current_user->subscription()->has_post_count( $form_settings['post_type'] ) ) {
249
+
250
+ $user_can_post = 'no';
251
+ $info = sprintf( __( 'Payment type not selected for this form. Please contact admin.', 'wp-user-frontend' ));
252
+
253
+ } else {
254
+ $user_can_post = 'no';
255
+ if ( !is_user_logged_in() ) {
256
+ $info = $form_settings['message_restrict'];
257
+ } else {
258
+ $info = sprintf( __( 'Payment type not selected for this form. Please contact admin.', 'wp-user-frontend' ));
259
+ }
260
+
261
+ }
262
+ }
263
+ } else {
264
+ if ( isset( $form_settings['guest_post'] ) && $form_settings['guest_post'] == 'true' && ! is_user_logged_in() ) {
265
+ $user_can_post = 'yes';
266
+ }
267
+ }
268
+
269
+ return array($user_can_post,$info);
270
+ }
271
+
272
+
273
+ /**
274
+ * prepare_entries
275
+ *
276
+ * @return array
277
+ */
278
+ public function prepare_entries() {
279
+
280
+ $fields = wpuf()->fields->get_fields();
281
+
282
+ $form_fields = $this->get_fields();
283
+
284
+ $entry_fields = array();
285
+
286
+ $ignore_list = apply_filters('wpuf_entry_ignore_list', array('recaptcha'));
287
+
288
+ foreach ($form_fields as $field) {
289
+
290
+ if ( in_array( $field['template'], $ignore_list ) ) {
291
+ continue;
292
+ }
293
+
294
+ if ( ! array_key_exists( $field['template'], $fields ) ) {
295
+ continue;
296
+ }
297
+
298
+ $field_class = $fields[ $field['template'] ];
299
+
300
+ $entry_fields[ $field['name'] ] = $field_class->prepare_entry( $field );
301
+ }
302
+
303
+ return apply_filters( 'wpuf_prepare_entries', $entry_fields );
304
+ }
305
+
306
+ /**
307
+ * Get all form fields of this form
308
+ *
309
+ * @return array
310
+ */
311
+
312
+ public function get_fields() {
313
+
314
+ // return if already fetched
315
+ if ( $this->form_fields ) {
316
+ return $this->form_fields;
317
+ }
318
+
319
+ $fields = get_children(array(
320
+ 'post_parent' => $this->id,
321
+ 'post_status' => 'publish',
322
+ 'post_type' => 'wpuf_input',
323
+ 'numberposts' => '-1',
324
+ 'orderby' => 'menu_order',
325
+ 'order' => 'ASC',
326
+ ));
327
+
328
+ $form_fields = array();
329
+
330
+ foreach ( $fields as $key => $content ) {
331
+
332
+ $field = maybe_unserialize( $content->post_content );
333
+
334
+ if ( empty( $field['template'] ) ) {
335
+ continue;
336
+ }
337
+
338
+
339
+ $field['id'] = $content->ID;
340
+
341
+ // Add inline property for radio and checkbox fields
342
+ $inline_supported_fields = apply_filters( 'wpuf_inline_supported_fields_list', array( 'radio_field', 'checkbox_field' ) );
343
+ if ( in_array( $field['template'] , $inline_supported_fields ) ) {
344
+ if ( ! isset( $field['inline'] ) ) {
345
+ $field['inline'] = 'no';
346
+ }
347
+ }
348
+
349
+ // Add 'selected' property
350
+ $option_based_fields = apply_filters( 'wpuf_option_based_fields_list', array( 'dropdown_field', 'multiple_select', 'radio_field', 'checkbox_field' ) );
351
+ if ( in_array( $field['template'] , $option_based_fields ) ) {
352
+ if ( ! isset( $field['selected'] ) ) {
353
+
354
+ if ( 'dropdown_field' === $field['template'] || 'radio_field' === $field['template'] ) {
355
+ $field['selected'] = '';
356
+ } else {
357
+ $field['selected'] = array();
358
+ }
359
+
360
+ }
361
+ }
362
+
363
+ // Add 'multiple' key for template:repeat
364
+ if ( 'repeat_field' === $field['template'] && ! isset( $field['multiple'] ) ) {
365
+ $field['multiple'] = '';
366
+ }
367
+
368
+ if ( 'recaptcha' === $field['template'] ) {
369
+ $field['name'] = 'recaptcha';
370
+ $field['enable_no_captcha'] = isset( $field['enable_no_captcha'] ) ? $field['enable_no_captcha'] : '';
371
+ $field['recaptcha_theme'] = isset( $field['recaptcha_theme'] ) ? $field['recaptcha_theme'] : 'light';
372
+ }
373
+
374
+ // $form_fields[] = apply_filters( 'wpuf-get-form-field', $field );
375
+
376
+ $form_fields[] = apply_filters( 'wpuf-get-form-fields', $field );
377
+
378
+ }
379
+
380
+ // $this->form_fields = apply_filters( 'wpuf-get-form-fields', $form_fields );
381
+
382
+ // return $this->form_fields;
383
+
384
+ return $form_fields;
385
+ }
386
+
387
+ }
includes/class-frontend-form-post.php ADDED
@@ -0,0 +1,933 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class WPUF_Frontend_Form extends WPUF_Frontend_Render_Form{
4
+
5
+
6
+
7
+ private static $_instance;
8
+ private $post_expiration_date = 'wpuf-post_expiration_date';
9
+ private $expired_post_status = 'wpuf-expired_post_status';
10
+ private $post_expiration_message = 'wpuf-post_expiration_message';
11
+
12
+ public function __construct() {
13
+ add_shortcode( 'wpuf_form', array( $this, 'add_post_shortcode'));
14
+ add_shortcode( 'wpuf_edit', array( $this, 'edit_post_shortcode' ) );
15
+ // ajax requests
16
+ add_action( 'wp_ajax_wpuf_form_preview', array( $this, 'preview_form' ) );
17
+ add_action( 'wp_ajax_wpuf_submit_post', array( $this, 'submit_post' ) );
18
+ add_action( 'wp_ajax_nopriv_wpuf_submit_post', array( $this, 'submit_post' ) );
19
+ add_action( 'wp_ajax_make_media_embed_code', array( $this, 'make_media_embed_code' ) );
20
+ add_action( 'wp_ajax_nopriv_make_media_embed_code', array( $this, 'make_media_embed_code' ) );
21
+ // draft
22
+ add_action( 'wp_ajax_wpuf_draft_post', array( $this, 'draft_post' ) );
23
+ // form preview
24
+ add_action( 'wp_ajax_wpuf_form_preview', array( $this, 'preview_form' ) );
25
+ $this->set_wp_post_types();
26
+ }
27
+
28
+ /**
29
+ * Edit post shortcode handler
30
+ *
31
+ * @param array $atts
32
+ * @return
33
+ **/
34
+ function edit_post_shortcode( $atts ) {
35
+ add_filter( 'wpuf-form-fields', array( $this, 'add_field_settings'));
36
+ extract( shortcode_atts( array( 'id' => 0 ), $atts ) );
37
+ ob_start();
38
+ global $userdata;
39
+ ob_start();
40
+ if ( !is_user_logged_in() ) {
41
+ echo '<div class="wpuf-message">' . __( 'You are not logged in', 'wp-user-frontend' ) . '</div>';
42
+ wp_login_form();
43
+ return;
44
+ }
45
+ $post_id = isset( $_GET['pid'] ) ? intval( $_GET['pid'] ) : 0;
46
+ if ( !$post_id ) {
47
+ return '<div class="wpuf-info">' . __( 'Invalid post', 'wp-user-frontend' ) . '</div>';
48
+ }
49
+
50
+ $edit_post_lock = get_post_meta( $post_id, '_wpuf_lock_editing_post', true );
51
+ $edit_post_lock_time = get_post_meta( $post_id, '_wpuf_lock_user_editing_post_time', true );
52
+
53
+ if ( $edit_post_lock == 'yes' ) {
54
+ return '<div class="wpuf-info">' . apply_filters( 'wpuf_edit_post_lock_user_notice', __( 'Your edit access for this post has been locked by an administrator.', 'wp-user-frontend' ) ) . '</div>';
55
+ }
56
+
57
+ if ( !empty( $edit_post_lock_time ) && $edit_post_lock_time < time() ) {
58
+ return '<div class="wpuf-info">' . apply_filters( 'wpuf_edit_post_lock_expire_notice', __( 'Your allocated time for editing this post has been expired.', 'wp-user-frontend' ) ) . '</div>';
59
+ }
60
+
61
+ if ( wpuf_get_user()->edit_post_locked() ) {
62
+ if ( wpuf_get_user()->edit_post_lock_reason() ) {
63
+ return '<div class="wpuf-info">' . wpuf_get_user()->edit_post_lock_reason() . '</div>';
64
+ }
65
+ return '<div class="wpuf-info">' . apply_filters( 'wpuf_user_edit_post_lock_notice', __( 'Your post edit access has been locked by an administrator.', 'wp-user-frontend' ) ) . '</div>';
66
+ }
67
+
68
+ //is editing enabled?
69
+ if ( wpuf_get_option( 'enable_post_edit', 'wpuf_dashboard', 'yes' ) != 'yes' ) {
70
+ return '<div class="wpuf-info">' . __( 'Post Editing is disabled', 'wp-user-frontend' ) . '</div>';
71
+ }
72
+
73
+ $curpost = get_post( $post_id );
74
+
75
+ if ( !$curpost ) {
76
+ return '<div class="wpuf-info">' . __( 'Invalid post', 'wp-user-frontend' );
77
+ }
78
+
79
+ // has permission?
80
+ if ( !current_user_can( 'delete_others_posts' ) && ( $userdata->ID != $curpost->post_author ) ) {
81
+ return '<div class="wpuf-info">' . __( 'You are not allowed to edit', 'wp-user-frontend' ) . '</div>';
82
+ }
83
+
84
+ $form_id = get_post_meta( $post_id, self::$config_id, true );
85
+
86
+ // fallback to default form
87
+ if ( !$form_id ) {
88
+ $form_id = wpuf_get_option( 'default_post_form', 'wpuf_frontend_posting' );
89
+ }
90
+
91
+ if ( !$form_id ) {
92
+ return '<div class="wpuf-info">' . __( "I don't know how to edit this post, I don't have the form ID", 'wp-user-frontend' ) . '</div>';
93
+ }
94
+
95
+ $form = new WPUF_Form( $form_id );
96
+
97
+ $this->form_fields = $form->get_fields();
98
+ // $form_settings = wpuf_get_form_settings( $form_id );
99
+ $this->form_settings = $form->get_settings();
100
+
101
+ $disable_pending_edit = wpuf_get_option( 'disable_pending_edit', 'wpuf_dashboard', 'on' );
102
+
103
+ if ( $curpost->post_status == 'pending' && $disable_pending_edit == 'on' ) {
104
+ return '<div class="wpuf-info">' . __( 'You can\'t edit a post while in pending mode.', 'wp-user-frontend' );
105
+ }
106
+
107
+ if ( isset( $_GET['msg'] ) && $_GET['msg'] == 'post_updated' ) {
108
+ echo '<div class="wpuf-success">';
109
+ echo str_replace( '%link%', get_permalink( $post_id ), $this->form_settings['update_message'] );
110
+ echo '</div>';
111
+ }
112
+
113
+ $this->render_form( $form_id,$post_id,$atts,$form);
114
+
115
+ $content = ob_get_contents();
116
+
117
+ ob_end_clean();
118
+
119
+ return $content;
120
+ }
121
+
122
+
123
+
124
+ public static function init() {
125
+ if ( !self::$_instance ) {
126
+ self::$_instance = new self;
127
+ }
128
+ return self::$_instance;
129
+ }
130
+
131
+
132
+ /**
133
+ * this will embed media to the editor
134
+ */
135
+ function make_media_embed_code() {
136
+ if ( $embed_code = wp_oembed_get( $_POST['content'] ) ) {
137
+ echo $embed_code;
138
+ } else {
139
+ echo '';
140
+ }
141
+ exit;
142
+ }
143
+
144
+ /**
145
+ * Draft Post
146
+ */
147
+ public function draft_post() {
148
+
149
+ check_ajax_referer( 'wpuf_form_add' );
150
+ add_filter( 'wpuf-form-fields', array( $this, 'add_field_settings'));
151
+ @header( 'Content-Type: application/json; charset=' . get_option( 'blog_charset' ) );
152
+
153
+ $form_id = isset( $_POST['form_id'] ) ? intval( $_POST['form_id'] ) : 0;
154
+ $form = new WPUF_Form( $form_id );
155
+ $this->form_settings = $form->get_settings();
156
+ $this->form_fields = $form->get_fields();
157
+ $pay_per_post = $form->is_enabled_pay_per_post();
158
+
159
+ list( $post_vars, $taxonomy_vars, $meta_vars ) =$this->get_input_fields($this->form_fields);
160
+
161
+ $entry_fields = $form->prepare_entries();
162
+ $post_content = isset( $_POST[ 'post_content' ] ) ? $_POST[ 'post_content' ] : '';
163
+
164
+ $postarr = array(
165
+ 'post_type' => $this->form_settings['post_type'],
166
+ 'post_status' => wpuf_get_draft_post_status( $this->form_settings ),
167
+ 'post_author' => get_current_user_id(),
168
+ 'post_title' => isset( $_POST['post_title'] ) ? trim( $_POST['post_title'] ) : '',
169
+ 'post_content' => $post_content,
170
+ 'post_excerpt' => isset( $_POST['post_excerpt'] ) ? trim( $_POST['post_excerpt'] ) : '',
171
+ );
172
+
173
+ if ( isset( $_POST['category'] ) && ( $_POST['category'] !='' && $_POST['category'] !='0' && $_POST['category'][0] !='-1' ) ) {
174
+ $category = $_POST['category'];
175
+ $postarr['post_category'] = is_array( $category ) ? $category : array( $category );
176
+ }
177
+
178
+ // set default post category if it's not been set yet and if post type supports
179
+ if ( !isset( $postarr['post_category'] ) && isset( $this->form_settings['default_cat'] ) && is_object_in_taxonomy( $this->form_settings['post_type'], 'category' ) ) {
180
+ if ( is_array( $this->form_settings['default_cat'] ) ) {
181
+ $postarr['post_category'] = $this->form_settings['default_cat'];
182
+ } else {
183
+ $postarr['post_category'] = array( $this->form_settings['default_cat'] );
184
+ }
185
+ }
186
+
187
+ if ( isset( $_POST['tags'] ) ) {
188
+ $postarr['tags_input'] = explode( ',', $_POST['tags'] );
189
+ }
190
+
191
+ // if post_id is passed, we update the post
192
+ if ( isset( $_POST['post_id'] ) ) {
193
+ $is_update = true;
194
+ $postarr['ID'] = $_POST['post_id'];
195
+ $postarr['comment_status'] = 'open';
196
+ }
197
+
198
+ $post_id = wp_insert_post( $postarr );
199
+
200
+ // add post revision when post edit from the frontend
201
+ wpuf_frontend_post_revision( $post_id, $this->form_settings );
202
+
203
+ if ( $post_id ) {
204
+
205
+ self::update_post_meta( $meta_vars, $post_id );
206
+
207
+ // set the post form_id for later usage
208
+ update_post_meta( $post_id, self::$config_id, $form_id );
209
+
210
+ // save post formats if have any
211
+ if ( isset( $this->form_settings['post_format'] ) && $this->form_settings['post_format'] != '0' ) {
212
+ if ( post_type_supports( $this->form_settings['post_type'], 'post-formats' ) ) {
213
+ set_post_format( $post_id, $this->form_settings['post_format'] );
214
+ }
215
+ }
216
+
217
+ // if pay per post is enabled then update payment status as pending
218
+ if ( $pay_per_post ) {
219
+ update_post_meta ( $post_id, '_wpuf_payment_status', 'pending' );
220
+ }
221
+
222
+ if(!empty($taxonomy_vars)) {
223
+ $this->set_custom_taxonomy($post_id,$taxonomy_vars);
224
+ }
225
+ }
226
+
227
+ //used to add code to run when the post is going to draft
228
+ do_action( 'wpuf_draft_post_after_insert', $post_id, $form_id, $this->form_settings, $this->form_fields );
229
+
230
+ wpuf_clear_buffer();
231
+
232
+ echo json_encode( array(
233
+ 'post_id' => $post_id,
234
+ 'action' => $_POST['action'],
235
+ 'date' => current_time( 'mysql' ),
236
+ 'post_author' => get_current_user_id(),
237
+ 'comment_status' => get_option( 'default_comment_status' ),
238
+ 'url' => add_query_arg( 'preview', 'true', get_permalink( $post_id ) )
239
+ ) );
240
+
241
+ exit;
242
+ }
243
+
244
+
245
+ /**
246
+ * New/Edit post submit handler
247
+ *
248
+ * @return void
249
+ */
250
+ function submit_post() {
251
+
252
+ check_ajax_referer( 'wpuf_form_add' );
253
+ add_filter( 'wpuf-form-fields', array( $this, 'add_field_settings'));
254
+ @header( 'Content-Type: application/json; charset=' . get_option( 'blog_charset' ) );
255
+
256
+ $form_id = isset( $_POST['form_id'] ) ? intval( $_POST['form_id'] ) : 0;
257
+ $form = new WPUF_Form( $form_id );
258
+ $this->form_settings = $form->get_settings();
259
+ $this->form_fields = $form->get_fields();
260
+ $guest_mode = isset( $this->form_settings['guest_post'] ) ? $this->form_settings['guest_post'] : '';
261
+ $guest_verify = isset( $this->form_settings['guest_email_verify'] ) ? $this->form_settings['guest_email_verify'] : 'false' ;
262
+ $attachments_to_delete = isset( $_POST['delete_attachments'] ) ? $_POST['delete_attachments'] : array();
263
+ foreach ( $attachments_to_delete as $attach_id ) {
264
+ wp_delete_attachment( $attach_id, true );
265
+ }
266
+ list( $post_vars, $taxonomy_vars, $meta_vars ) =$this->get_input_fields($this->form_fields);
267
+ if ( !isset( $_POST['post_id'] ) ) {
268
+ $has_limit = ( isset( $this->form_settings['limit_entries'] ) && $this->form_settings['limit_entries'] == 'true' ) ? true : false;
269
+ if ( $has_limit ) {
270
+ $limit = (int) !empty( $this->form_settings['limit_number'] ) ? $this->form_settings['limit_number'] : 0;
271
+ $form_entries = wpuf_form_posts_count( $form_id );
272
+ if ( $limit && $limit <= $form_entries ) {
273
+ $this->send_error( $this->form_settings['limit_message'] );
274
+ }
275
+ }
276
+ $this->on_edit_no_check_recaptcha( $post_vars );
277
+ }
278
+
279
+ $is_update = false;
280
+ $post_author = null;
281
+ $default_post_author = wpuf_get_option( 'default_post_owner', 'wpuf_frontend_posting', 1 );
282
+ $post_author = $this->wpuf_get_post_user();
283
+ $postarr = array(
284
+ 'post_type' => $this->form_settings['post_type'],
285
+ 'post_status' => isset( $this->form_settings['post_status'] ) ? $this->form_settings['post_status'] : 'publish',
286
+ 'post_author' => $post_author,
287
+ 'post_title' => isset( $_POST['post_title'] ) ? trim( $_POST['post_title'] ) : '',
288
+ 'post_content' => isset( $_POST['post_content'] ) ? trim( $_POST['post_content'] ) : '',
289
+ 'post_excerpt' => isset( $_POST['post_excerpt'] ) ? trim( $_POST['post_excerpt'] ) : '',
290
+ );
291
+ // $charging_enabled = wpuf_get_option( 'charge_posting', 'wpuf_payment' );
292
+ $charging_enabled = '';
293
+ $form = new WPUF_Form( $form_id );
294
+ $payment_options = $form->is_charging_enabled();
295
+ $ppp_cost_enabled = $form->is_enabled_pay_per_post();
296
+ $current_user = wpuf_get_user();
297
+ if ( !$payment_options ) {
298
+ $charging_enabled = 'no';
299
+ } else {
300
+ $charging_enabled = 'yes';
301
+ }
302
+ if ( $guest_mode == 'true' && $guest_verify == 'true' && !is_user_logged_in() && $charging_enabled == 'yes' ) {
303
+ $postarr['post_status'] = wpuf_get_draft_post_status( $this->form_settings );
304
+ } elseif ( $guest_mode == 'true' && $guest_verify == 'true' && !is_user_logged_in() ) {
305
+ $postarr['post_status'] = 'draft';
306
+ }
307
+ //if date is set and assigned as publish date
308
+ if ( isset( $_POST['wpuf_is_publish_time'] ) ) {
309
+ if ( isset( $_POST[$_POST['wpuf_is_publish_time']] ) && !empty( $_POST[$_POST['wpuf_is_publish_time']] ) ) {
310
+ // $postarr['post_date'] = date( 'Y-m-d H:i:s', strtotime( str_replace( array( ':', '/' ), '-', $_POST[$_POST['wpuf_is_publish_time']] ) ) );
311
+ $date_time = explode(" ", $_POST[$_POST['wpuf_is_publish_time']] );
312
+ if ( !empty ( $date_time[0] ) ) {
313
+ $timestamp = strtotime( str_replace( array( '/' ), '-', $date_time[0] ) );
314
+ }
315
+ if ( !empty ( $date_time[1] ) ) {
316
+ $time = explode(':', $date_time[1] );
317
+ $seconds = ( $time[0] * 60 * 60 ) + ($time[1] * 60);
318
+ $timestamp = $timestamp + $seconds;
319
+ }
320
+ $postarr['post_date'] = date( 'Y-m-d H:i:s', $timestamp );
321
+ }
322
+ }
323
+
324
+ if ( isset( $_POST['category'] ) && ( $_POST['category'] !='' && $_POST['category'] !='0' && $_POST['category'][0] !='-1' ) ) {
325
+ $category = $_POST['category'];
326
+ if ( !is_array( $category ) && is_string( $category ) ) {
327
+ $category_strings = explode( ',', $category );
328
+ $cat_ids = array();
329
+ foreach ( $category_strings as $key => $each_cat_string ) {
330
+ $cat_ids[] = get_cat_ID( trim( $each_cat_string ) );
331
+ $postarr['post_category'] = $cat_ids;
332
+ }
333
+ } else {
334
+ $postarr['post_category'] =$category;
335
+ }
336
+ }
337
+
338
+ if ( isset( $_POST['tags'] ) ) {
339
+ $postarr['tags_input'] = explode( ',', $_POST['tags'] );
340
+ }
341
+
342
+ // if post_id is passed, we update the post
343
+ if ( isset( $_POST['post_id'] ) ) {
344
+ $is_update = true;
345
+ $postarr['ID'] = $_POST['post_id'];
346
+ $postarr['post_date'] = $_POST['post_date'];
347
+ $postarr['comment_status'] = $_POST['comment_status'];
348
+ $postarr['post_author'] = $_POST['post_author'];
349
+ $postarr['post_parent'] = get_post_field( 'post_parent', $_POST['post_id'] );
350
+ if ( $this->form_settings['edit_post_status'] == '_nochange' ) {
351
+ $postarr['post_status'] = get_post_field( 'post_status', $_POST['post_id'] );
352
+ } else {
353
+ $postarr['post_status'] = $this->form_settings['edit_post_status'];
354
+ }
355
+ } else {
356
+ if ( isset( $this->form_settings['comment_status'] ) ) {
357
+ $postarr['comment_status'] = $this->form_settings['comment_status'];
358
+ }
359
+ }
360
+ // check the form status, it might be already a draft
361
+ // in that case, it already has the post_id field
362
+ // so, WPUF's add post action/filters won't work for new posts
363
+ if ( isset( $_POST['wpuf_form_status'] ) && $_POST['wpuf_form_status'] == 'new' ) {
364
+ $is_update = false;
365
+ }
366
+
367
+ // set default post category if it's not been set yet and if post type supports
368
+ if ( !isset( $postarr['post_category'] ) && isset( $this->form_settings['default_cat'] ) && is_object_in_taxonomy( $this->form_settings['post_type'], 'category' ) ) {
369
+ if ( is_array( $this->form_settings['default_cat'] ) ) {
370
+ $postarr['post_category'] = $this->form_settings['default_cat'];
371
+ } else {
372
+ $postarr['post_category'] = array( $this->form_settings['default_cat'] );
373
+ }
374
+ }
375
+
376
+ // validation filter
377
+ if ( $is_update ) {
378
+ $error = apply_filters( 'wpuf_update_post_validate', '' );
379
+ } else {
380
+ $error = apply_filters( 'wpuf_add_post_validate', '' );
381
+ }
382
+ if ( !empty( $error ) ) {
383
+ $this->send_error( $error );
384
+ }
385
+ // ############ It's Time to Save the World ###############
386
+ if ( $is_update ) {
387
+ $postarr = apply_filters( 'wpuf_update_post_args', $postarr, $form_id, $this->form_settings, $this->form_fields );
388
+ } else {
389
+ $postarr = apply_filters( 'wpuf_add_post_args', $postarr, $form_id, $this->form_settings, $this->form_fields );
390
+ }
391
+
392
+ $post_id = wp_insert_post( $postarr, $wp_error = false );
393
+
394
+ // add post revision when post edit from the frontend
395
+ wpuf_frontend_post_revision( $post_id, $this->form_settings );
396
+
397
+ // add _wpuf_lock_editing_post_time meta to
398
+ // lock user from editing the published post after a certain time
399
+ if ( !$is_update ) {
400
+ $lock_edit_post = isset( $this->form_settings['lock_edit_post'] ) ? floatval( $this->form_settings['lock_edit_post'] ) : 0;
401
+
402
+ if ( $post_id && $lock_edit_post > 0 ) {
403
+ $lock_edit_post_time = time() + ( $lock_edit_post * 60 * 60 );
404
+ update_post_meta( $post_id, '_wpuf_lock_user_editing_post_time', $lock_edit_post_time );
405
+ }
406
+ }
407
+
408
+ if ( $post_id ) {
409
+
410
+ self::update_post_meta( $meta_vars, $post_id );
411
+ // set the post form_id for later usage
412
+ update_post_meta( $post_id, self::$config_id, $form_id );
413
+ // if user has a subscription pack
414
+ $this->wpuf_user_subscription_pack($this->form_settings);
415
+ // set the post form_id for later usage
416
+ update_post_meta( $post_id, self::$config_id, $form_id );
417
+
418
+ // save post formats if have any
419
+ if ( isset( $this->form_settings['post_format'] ) && $this->form_settings['post_format'] != '0' ) {
420
+ if ( post_type_supports( $this->form_settings['post_type'], 'post-formats' ) ) {
421
+ set_post_format( $post_id, $this->form_settings['post_format'] );
422
+ }
423
+ }
424
+
425
+ // find our if any images in post content and associate them
426
+ if ( !empty( $postarr['post_content'] ) ) {
427
+ $dom = new DOMDocument();
428
+ @$dom->loadHTML( $postarr['post_content'] );
429
+ $images = $dom->getElementsByTagName( 'img' );
430
+
431
+ if ( $images->length ) {
432
+ foreach ( $images as $img ) {
433
+ $url = $img->getAttribute( 'src' );
434
+ $url = str_replace( array( '"', "'", "\\" ), '', $url );
435
+ $attachment_id = wpuf_get_attachment_id_from_url( $url );
436
+
437
+ if ( $attachment_id ) {
438
+ wpuf_associate_attachment( $attachment_id, $post_id );
439
+ }
440
+ }
441
+ }
442
+ }
443
+ if(!empty($taxonomy_vars)) {
444
+ $this->set_custom_taxonomy($post_id,$taxonomy_vars);
445
+ }
446
+ $response = $this->send_mail_for_guest($charging_enabled,$post_id,$form_id,$is_update,$post_author,$meta_vars);
447
+ wpuf_clear_buffer();
448
+ wp_send_json( $response );
449
+
450
+ }
451
+ $this->send_error( __( 'Something went wrong', 'wp-user-frontend' ) );
452
+ }
453
+
454
+
455
+ public function wpuf_get_post_user() {
456
+
457
+ if ( !is_user_logged_in() ) {
458
+
459
+ if ( isset( $this->form_settings['guest_post'] ) && $this->form_settings['guest_post'] == 'true' && $this->form_settings['guest_details'] == 'true' ) {
460
+
461
+ $guest_name = trim( $_POST['guest_name'] );
462
+
463
+ $guest_email = trim( $_POST['guest_email'] );
464
+
465
+ // is valid email?
466
+ if ( !is_email( $guest_email ) ) {
467
+ $this->send_error( __( 'Invalid email address.', 'wp-user-frontend' ) );
468
+ }
469
+
470
+ // check if the user email already exists
471
+ $user = get_user_by( 'email', $guest_email );
472
+
473
+ if ( $user ) {
474
+ // $post_author = $user->ID;
475
+ wp_send_json( array(
476
+ 'success' => false,
477
+ 'error' => __( "You already have an account in our site. Please login to continue.\n\nClicking 'OK' will redirect you to the login page and you will lose the form data.\nClick 'Cancel' to stay at this page.", 'wp-user-frontend' ),
478
+ 'type' => 'login',
479
+ 'redirect_to' => wp_login_url( get_permalink( $_POST['page_id'] ) )
480
+ ) );
481
+
482
+ } else {
483
+
484
+ // user not found, lets register him
485
+ // username from email address
486
+ $username = $this->guess_username( $guest_email );
487
+
488
+ $user_pass = wp_generate_password( 12, false );
489
+
490
+ $errors = new WP_Error();
491
+
492
+ do_action( 'register_post', $username, $guest_email, $errors );
493
+
494
+ $user_id = wp_create_user( $username, $user_pass, $guest_email );
495
+
496
+ // if its a success and no errors found
497
+
498
+ if ( $user_id && !is_wp_error( $user_id ) ) {
499
+
500
+ update_user_option( $user_id, 'default_password_nag', true, true ); //Set up the Password change nag.
501
+
502
+ if ( class_exists( 'Theme_My_Login_Custom_Email' ) ) {
503
+ do_action( 'tml_new_user_registered', $user_id, $user_pass );
504
+ } else {
505
+ wp_send_new_user_notifications( $user_id );
506
+ }
507
+
508
+ // update display name to full name
509
+ wp_update_user( array( 'ID' => $user_id, 'display_name' => $guest_name ) );
510
+
511
+ $post_author = $user_id;
512
+
513
+ } else {
514
+ //something went wrong creating the user, set post author to the default author
515
+ $post_author = $default_post_author;
516
+ }
517
+
518
+ }
519
+
520
+ // guest post is enabled and details are off
521
+ } elseif ( isset( $this->form_settings['guest_post'] ) && $this->form_settings['guest_post'] == 'true' && $this->form_settings['guest_details'] == 'false' ) {
522
+ $post_author = $default_post_author;
523
+ } elseif ( isset( $this->form_settings['guest_post'] ) && $this->form_settings['guest_post'] != 'true' ) {
524
+ $this->send_error( $this->form_settings['message_restrict'] );
525
+ }
526
+
527
+ // the user must be logged in already
528
+ } elseif ( isset( $this->form_settings['role_base'] ) && $this->form_settings['role_base'] == 'true' ) {
529
+
530
+ $current_user = wp_get_current_user();
531
+
532
+ if ( !in_array( $current_user->roles[0], $this->form_settings['roles'] ) ) {
533
+ $this->send_error( __( 'You do not have sufficient permissions to access this form.', 'wp-user-frontend' ) );
534
+ }
535
+
536
+ } else {
537
+ $post_author = get_current_user_id();
538
+ }
539
+
540
+
541
+ return $post_author;
542
+ }
543
+
544
+ /**w
545
+ * Add post shortcode handler
546
+ *
547
+ * @param array $atts
548
+ * @return string
549
+ */
550
+
551
+ function add_post_shortcode( $atts ) {
552
+ add_filter( 'wpuf-form-fields', array( $this, 'add_field_settings'));
553
+ extract( shortcode_atts( array( 'id' => 0 ), $atts ) );
554
+ ob_start();
555
+ $form = new WPUF_Form( $id );
556
+ $this->form_fields = $form->get_fields();
557
+ $this->form_settings = $form->get_settings();
558
+ list($user_can_post,$info) = $form->is_submission_open($form ,$this->form_settings);
559
+ $info = apply_filters( 'wpuf_addpost_notice', $info, $id, $this->form_settings );
560
+ $user_can_post = apply_filters( 'wpuf_can_post', $user_can_post, $id, $this->form_settings );
561
+ if ( $user_can_post == 'yes' ) {
562
+ $this->render_form( $id,null,$atts,$form);
563
+ } else {
564
+ echo '<div class="wpuf-info">' . $info . '</div>';
565
+ }
566
+ $content = ob_get_contents();
567
+ ob_end_clean();
568
+ return $content;
569
+ }
570
+
571
+ public static function update_post_meta( $meta_vars, $post_id ) {
572
+
573
+ // prepare the meta vars
574
+ list( $meta_key_value, $multi_repeated, $files ) = self::prepare_meta_fields( $meta_vars );
575
+
576
+ // set featured image if there's any
577
+ if ( isset( $_POST['wpuf_files']['featured_image'] ) ) {
578
+ $attachment_id = $_POST['wpuf_files']['featured_image'][0];
579
+
580
+ wpuf_associate_attachment( $attachment_id, $post_id );
581
+ set_post_thumbnail( $post_id, $attachment_id );
582
+
583
+ $file_data = isset( $_POST['wpuf_files_data'][$attachment_id] ) ? $_POST['wpuf_files_data'][$attachment_id] : false;
584
+ if ( $file_data ) {
585
+ $args = array(
586
+ 'ID' => $attachment_id,
587
+ 'post_title' => $file_data['title'],
588
+ 'post_content' => $file_data['desc'],
589
+ 'post_excerpt' => $file_data['caption'],
590
+ );
591
+ wpuf_update_post( $args );
592
+
593
+ update_post_meta( $attachment_id, '_wp_attachment_image_alt', $file_data['title'] );
594
+ }
595
+ }
596
+
597
+ // save all custom fields
598
+ foreach ( $meta_key_value as $meta_key => $meta_value ) {
599
+ update_post_meta( $post_id, $meta_key, $meta_value );
600
+ }
601
+
602
+ // save any multicolumn repeatable fields
603
+ foreach ( $multi_repeated as $repeat_key => $repeat_value ) {
604
+ // first, delete any previous repeatable fields
605
+ delete_post_meta( $post_id, $repeat_key );
606
+
607
+ // now add them
608
+ foreach ( $repeat_value as $repeat_field ) {
609
+ add_post_meta( $post_id, $repeat_key, $repeat_field );
610
+ }
611
+ }
612
+
613
+ // save any files attached
614
+ foreach ( $files as $file_input ) {
615
+ // delete any previous value
616
+ delete_post_meta( $post_id, $file_input['name'] );
617
+
618
+ if ( count( $file_input['value'] ) > 1 ) {
619
+ $image_ids = maybe_serialize( $file_input['value'] );
620
+ } else {
621
+ $image_ids = $file_input['value'][0];
622
+ }
623
+
624
+ add_post_meta( $post_id, $file_input['name'], $image_ids );
625
+
626
+ //to track how many files are being uploaded
627
+ $file_numbers = 0;
628
+
629
+ foreach ( $file_input['value'] as $attachment_id ) {
630
+
631
+ //if file numbers are greated than allowed number, prevent it from being uploaded
632
+ if ( $file_numbers >= $file_input['count'] ) {
633
+ wp_delete_attachment( $attachment_id );
634
+ continue;
635
+ }
636
+
637
+ wpuf_associate_attachment( $attachment_id, $post_id );
638
+ //add_post_meta( $post_id, $file_input['name'], $attachment_id );
639
+
640
+ // file title, caption, desc update
641
+ $file_data = isset( $_POST['wpuf_files_data'][$attachment_id] ) ? $_POST['wpuf_files_data'][$attachment_id] : false;
642
+ if ( $file_data ) {
643
+ $args = array(
644
+ 'ID' => $attachment_id,
645
+ 'post_title' => $file_data['title'],
646
+ 'post_content' => $file_data['desc'],
647
+ 'post_excerpt' => $file_data['caption'],
648
+ );
649
+ wpuf_update_post( $args );
650
+
651
+ update_post_meta( $attachment_id, '_wp_attachment_image_alt', $file_data['title'] );
652
+ }
653
+ $file_numbers++;
654
+ }
655
+ }
656
+ }
657
+
658
+ function prepare_mail_body( $content, $user_id, $post_id ) {
659
+ $user = get_user_by( 'id', $user_id );
660
+ $post = get_post( $post_id );
661
+
662
+ $post_field_search = array( '%post_title%', '%post_content%', '%post_excerpt%', '%tags%', '%category%',
663
+ '%author%', '%author_email%', '%author_bio%', '%sitename%', '%siteurl%', '%permalink%', '%editlink%' );
664
+
665
+ $post_field_replace = array(
666
+ $post->post_title,
667
+ $post->post_content,
668
+ $post->post_excerpt,
669
+ get_the_term_list( $post_id, 'post_tag', '', ', ' ),
670
+ get_the_term_list( $post_id, 'category', '', ', ' ),
671
+ $user->display_name,
672
+ $user->user_email,
673
+ ($user->description) ? $user->description : 'not available',
674
+ get_bloginfo( 'name' ),
675
+ home_url(),
676
+ get_permalink( $post_id ),
677
+ admin_url( 'post.php?action=edit&post=' . $post_id )
678
+ );
679
+
680
+ $content = str_replace( $post_field_search, $post_field_replace, $content );
681
+
682
+ // custom fields
683
+ preg_match_all( '/%custom_([\w-]*)\b%/', $content, $matches );
684
+ list( $search, $replace ) = $matches;
685
+
686
+ if ( $replace ) {
687
+ foreach ( $replace as $index => $meta_key ) {
688
+ $value = get_post_meta( $post_id, $meta_key, false );
689
+ $new_value = implode( '; ', $value );
690
+
691
+ $original_value = '';
692
+ $meta_val = '';
693
+ if ( count( $value ) > 1 ) {
694
+ $isFirst = true;
695
+ foreach ($value as $val) {
696
+ if ( $isFirst ) {
697
+ if ( get_post_mime_type( (int) $val ) ) {
698
+ $meta_val = wp_get_attachment_url( $val );
699
+ } else {
700
+ $meta_val = $val;
701
+ }
702
+ $isFirst = false;
703
+ } else {
704
+ if ( get_post_mime_type( (int) $val ) ) {
705
+ $meta_val = $meta_val . ', ' . wp_get_attachment_url( $val );
706
+ } else {
707
+ $meta_val = $meta_val . ', ' . $val;
708
+ }
709
+ }
710
+ if ( get_post_mime_type( (int) $val ) ) {
711
+ $meta_val = $meta_val . ',' . wp_get_attachment_url( $val );
712
+ } else {
713
+ $meta_val = $meta_val . ',' . $val;
714
+ }
715
+ }
716
+ $original_value = $original_value . $meta_val ;
717
+ } else {
718
+ if ( get_post_mime_type( (int) $new_value ) ) {
719
+ $original_value = wp_get_attachment_url( $new_value );
720
+ } else {
721
+ $original_value = $new_value;
722
+ }
723
+ }
724
+
725
+ $content = str_replace( $search[$index], $original_value, $content );
726
+ }
727
+ }
728
+
729
+ return $content;
730
+ }
731
+
732
+ function woo_attribute( $taxonomy ) {
733
+ return array(
734
+ 'name' => $taxonomy['name'],
735
+ 'value' => $_POST[$taxonomy['name']],
736
+ 'is_visible' => $taxonomy['woo_attr_vis'] == 'yes' ? 1 : 0,
737
+ 'is_variation' => 0,
738
+ 'is_taxonomy' => 1
739
+ );
740
+ }
741
+
742
+ /**
743
+ * Hook to publish verified guest post with payment
744
+ *
745
+ * @since 2.5.8
746
+ */
747
+
748
+ function publish_guest_post () {
749
+
750
+ if ( isset($_GET['post_msg']) && $_GET['post_msg'] == 'verified' ) {
751
+
752
+ $response = array();
753
+ $post_id = wpuf_decryption( $_GET['p_id'] );
754
+ $form_id = wpuf_decryption( $_GET['f_id'] );
755
+ $form_settings = wpuf_get_form_settings( $form_id );
756
+ $post_author_id = get_post_field( 'post_author', $post_id );
757
+ $payment_status = new WPUF_Subscription();
758
+ $form = new WPUF_Form( $form_id );
759
+ $pay_per_post = $form->is_enabled_pay_per_post();
760
+ $force_pack = $form->is_enabled_force_pack();
761
+
762
+ if ( $form->is_charging_enabled() && $pay_per_post ) {
763
+ if ( ($payment_status->get_payment_status( $post_id ) ) == 'pending') {
764
+
765
+ $response['show_message'] = true;
766
+ $response['redirect_to'] = add_query_arg( array(
767
+ 'action' => 'wpuf_pay',
768
+ 'type' => 'post',
769
+ 'post_id' => $post_id
770
+ ), get_permalink( wpuf_get_option( 'payment_page', 'wpuf_payment' ) ) );
771
+
772
+ wp_redirect( $response['redirect_to'] );
773
+ wpuf_clear_buffer();
774
+ wpuf_send_json( $response );
775
+ }
776
+ } else {
777
+ $p_status = get_post_status( $post_id );
778
+ if ( $p_status ) {
779
+ wp_update_post(array(
780
+ 'ID' => $post_id,
781
+ 'post_status' => isset( $form_settings['post_status'] ) ? $form_settings['post_status'] : 'publish'
782
+ ));
783
+ echo "<div class='wpuf-success' style='text-align:center'>" . __( 'Email successfully verified. Please Login.', 'wp-user-frontend' ) ."</div>";
784
+ }
785
+
786
+ }
787
+ }
788
+ }
789
+
790
+ function wpuf_user_subscription_pack($form_settings) {
791
+
792
+ // if user has a subscription pack
793
+ $user_wpuf_subscription_pack = get_user_meta( get_current_user_id(), '_wpuf_subscription_pack', true );
794
+
795
+ if ( !empty( $user_wpuf_subscription_pack ) && isset( $user_wpuf_subscription_pack['_enable_post_expiration'] )
796
+ && isset( $user_wpuf_subscription_pack['expire'] ) && strtotime( $user_wpuf_subscription_pack['expire'] ) >= time() ) {
797
+
798
+ $expire_date = date( 'Y-m-d', strtotime( "+" . $user_wpuf_subscription_pack['_post_expiration_time'] ) );
799
+ update_post_meta( $post_id, $this->post_expiration_date, $expire_date );
800
+ // save post status after expiration
801
+ $expired_post_status = $user_wpuf_subscription_pack['_expired_post_status'];
802
+ update_post_meta( $post_id, $this->expired_post_status, $expired_post_status );
803
+ // if mail active
804
+ if ( isset( $user_wpuf_subscription_pack['_enable_mail_after_expired'] ) && $user_wpuf_subscription_pack['_enable_mail_after_expired'] == 'on' ) {
805
+ $wpuf_user = wpuf_get_user();
806
+ $user_subscription = new WPUF_User_Subscription( $wpuf_user );
807
+ $post_expiration_message = $user_subscription->get_subscription_exp_msg( $user_wpuf_subscription_pack['pack_id'] );
808
+ update_post_meta( $post_id, $this->post_expiration_message, $post_expiration_message );
809
+ }
810
+ } elseif ( !empty( $user_wpuf_subscription_pack ) && isset( $user_wpuf_subscription_pack['expire'] ) && strtotime( $user_wpuf_subscription_pack['expire'] ) <= time() ) {
811
+
812
+ if ( isset( $form_settings['expiration_settings']['enable_post_expiration'] ) ) {
813
+
814
+ $expire_date = date( 'Y-m-d', strtotime( "+" . $form_settings['expiration_settings']['expiration_time_value'] . ' ' . $form_settings['expiration_settings']['expiration_time_type'] . "" ) );
815
+
816
+ update_post_meta( $post_id, $this->post_expiration_date, $expire_date );
817
+ // save post status after expiration
818
+ $expired_post_status = $form_settings['expiration_settings']['expired_post_status'];
819
+ update_post_meta( $post_id, $this->expired_post_status, $expired_post_status );
820
+ // if mail active
821
+ if ( isset( $form_settings['expiration_settings']['enable_mail_after_expired'] ) && $form_settings['expiration_settings']['enable_mail_after_expired'] == 'on' ) {
822
+ $post_expiration_message = $form_settings['expiration_settings']['post_expiration_message'];
823
+ update_post_meta( $post_id, $this->post_expiration_message, $post_expiration_message );
824
+ }
825
+ }
826
+ } elseif ( empty( $user_wpuf_subscription_pack ) || $user_wpuf_subscription_pack == 'Cancel' || $user_wpuf_subscription_pack == 'cancel' ) {
827
+ if ( isset( $form_settings['expiration_settings']['enable_post_expiration'] ) ) {
828
+ $expire_date = date( 'Y-m-d', strtotime( "+" . $form_settings['expiration_settings']['expiration_time_value'] . ' ' . $form_settings['expiration_settings']['expiration_time_type'] . "" ) );
829
+ update_post_meta( $post_id, $this->post_expiration_date, $expire_date );
830
+ // save post status after expiration
831
+ $expired_post_status = $form_settings['expiration_settings']['expired_post_status'];
832
+ update_post_meta( $post_id, $this->expired_post_status, $expired_post_status );
833
+ // if mail active
834
+ if ( isset( $form_settings['expiration_settings']['enable_mail_after_expired'] ) && $form_settings['expiration_settings']['enable_mail_after_expired'] == 'on' ) {
835
+ $post_expiration_message = $form_settings['expiration_settings']['post_expiration_message'];
836
+ update_post_meta( $post_id, $this->post_expiration_message, $post_expiration_message );
837
+ }
838
+ }
839
+ }
840
+ }
841
+
842
+
843
+ public function send_mail_for_guest($charging_enabled,$post_id,$form_id,$is_update,$post_author,$meta_vars) {
844
+
845
+ $show_message = false;
846
+ $redirect_to = false;
847
+ $response = array();
848
+ if ( $is_update ) {
849
+ if ( $this->form_settings['edit_redirect_to'] == 'page' ) {
850
+ $redirect_to = get_permalink( $this->form_settings['edit_page_id'] );
851
+ } elseif ( $this->form_settings['edit_redirect_to'] == 'url' ) {
852
+ $redirect_to = $this->form_settings['edit_url'];
853
+ } elseif ( $this->form_settings['edit_redirect_to'] == 'same' ) {
854
+ $redirect_to = add_query_arg( array(
855
+ 'pid' => $post_id,
856
+ '_wpnonce' => wp_create_nonce( 'wpuf_edit' ),
857
+ 'msg' => 'post_updated'
858
+ ), get_permalink( $_POST['page_id'] )
859
+ );
860
+ } else {
861
+ $redirect_to = get_permalink( $post_id );
862
+ }
863
+ } else {
864
+ if ( $this->form_settings['redirect_to'] == 'page' ) {
865
+ $redirect_to = get_permalink( $this->form_settings['page_id'] );
866
+ } elseif ( $this->form_settings['redirect_to'] == 'url' ) {
867
+ $redirect_to = $this->form_settings['url'];
868
+ } elseif ( $this->form_settings['redirect_to'] == 'same' ) {
869
+ $show_message = true;
870
+ } else {
871
+ $redirect_to = get_permalink( $post_id );
872
+ }
873
+ }
874
+ $response = array(
875
+ 'success' => true,
876
+ 'redirect_to' => $redirect_to,
877
+ 'show_message' => $show_message,
878
+ 'message' => $this->form_settings['message']
879
+ );
880
+ global $wp;
881
+ $guest_mode = isset( $this->form_settings['guest_post'] ) ? $this->form_settings['guest_post'] : '';
882
+ $guest_verify = isset( $this->form_settings['guest_email_verify'] ) ? $this->form_settings['guest_email_verify'] : 'false' ;
883
+ if ( $guest_mode == 'true' && $guest_verify == 'true' && !is_user_logged_in() && $charging_enabled != 'yes') {
884
+ $post_id_encoded = wpuf_encryption( $post_id ) ;
885
+ $form_id_encoded = wpuf_encryption( $form_id ) ;
886
+ wpuf_send_mail_to_guest ( $post_id_encoded, $form_id_encoded, 'no', 1 );
887
+ $response['show_message'] = true;
888
+ $response['redirect_to'] = add_query_arg( $wp->query_string, '', home_url( $wp->request ) );
889
+ $response['message'] = __( 'Thank you for posting on our site. We have sent you an confirmation email. Please check your inbox!', 'wp-user-frontend' );
890
+ } elseif ( $guest_mode == 'true' && $guest_verify == 'true' && !is_user_logged_in() && $charging_enabled == 'yes' ) {
891
+ $post_id_encoded = wpuf_encryption( $post_id ) ;
892
+ $form_id_encoded = wpuf_encryption( $form_id ) ;
893
+ $response['show_message'] = true;
894
+ $response['redirect_to'] = add_query_arg( $wp->query_string, '', home_url( $wp->request ) );
895
+ $response['message'] = __( 'Thank you for posting on our site. We have sent you an confirmation email. Please check your inbox!', 'wp-user-frontend' );
896
+ update_post_meta ( $post_id, '_wpuf_payment_status', 'pending' );
897
+ wpuf_send_mail_to_guest ( $post_id_encoded, $form_id_encoded, 'yes', 2 );
898
+ }
899
+ if ( $guest_mode == 'true' && $guest_verify == 'true' && !is_user_logged_in() ) {
900
+ $response = apply_filters( 'wpuf_edit_post_redirect', $response, $post_id, $form_id, $this->form_settings );
901
+ } elseif ( $is_update ) {
902
+ //send mail notification
903
+ if ( isset( $this->form_settings['notification'] ) && $this->form_settings['notification']['edit'] == 'on' ) {
904
+ $mail_body = $this->prepare_mail_body( $this->form_settings['notification']['edit_body'], $post_author, $post_id );
905
+ $to = $this->prepare_mail_body( $this->form_settings['notification']['edit_to'], $post_author, $post_id );
906
+ $subject = $this->prepare_mail_body( $this->form_settings['notification']['edit_subject'], $post_author, $post_id );
907
+ $subject = wp_strip_all_tags( $subject );
908
+ $headers = array('Content-Type: text/html; charset=UTF-8');
909
+ wp_mail( $to, $subject, $mail_body, $headers );
910
+ }
911
+ //now redirect the user
912
+ $response = apply_filters( 'wpuf_edit_post_redirect', $response, $post_id, $form_id, $this->form_settings );
913
+ //now perform some post related actions
914
+ do_action( 'wpuf_edit_post_after_update', $post_id, $form_id, $this->form_settings, $this->form_fields ); // plugin API to extend the functionality
915
+ } else {
916
+ // send mail notification
917
+ if ( isset( $this->form_settings['notification'] ) && $this->form_settings['notification']['new'] == 'on' ) {
918
+ $mail_body = $this->prepare_mail_body( $this->form_settings['notification']['new_body'], $post_author, $post_id );
919
+ $to = $this->prepare_mail_body( $this->form_settings['notification']['new_to'], $post_author, $post_id );
920
+ $subject = $this->prepare_mail_body( $this->form_settings['notification']['new_subject'], $post_author, $post_id );
921
+ $subject = wp_strip_all_tags( $subject );
922
+ wp_mail( $to, $subject, $mail_body );
923
+ }
924
+ //redirect the user
925
+ $response = apply_filters( 'wpuf_add_post_redirect', $response, $post_id, $form_id, $this->form_settings );
926
+ //now perform some post related actions
927
+ do_action( 'wpuf_add_post_after_insert', $post_id, $form_id, $this->form_settings, $meta_vars ); // plugin API to extend the functionality
928
+ }
929
+
930
+ return $response;
931
+ }
932
+
933
+ }
includes/class-frontend-render-form.php ADDED
@@ -0,0 +1,751 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class WPUF_Frontend_Render_Form{
4
+
5
+ private static $_instance;
6
+ static $meta_key = 'wpuf_form';
7
+ static $separator = ' | ';
8
+ static $config_id = '_wpuf_form_id';
9
+ private $form_condition_key = 'wpuf_cond';
10
+ private $field_count = 0;
11
+ public $multiform_start = 0;
12
+
13
+ public $wp_post_types = array();
14
+ public $form_fields = array();
15
+ public $form_settings = array();
16
+
17
+ /**
18
+ * Send json error message
19
+ *
20
+ * @param string $error
21
+ */
22
+ function send_error( $error ) {
23
+ echo json_encode( array(
24
+ 'success' => false,
25
+ 'error' => $error
26
+ ) );
27
+
28
+ die();
29
+ }
30
+
31
+ /**
32
+ * Search on multi dimentional array
33
+ *
34
+ * @param array $array
35
+ * @param string $key name of key
36
+ * @param string $value the value to search
37
+ * @return array
38
+ */
39
+ function search( $array, $key, $value ) {
40
+ $results = array();
41
+
42
+ if ( is_array( $array ) ) {
43
+ if ( isset( $array[$key] ) && $array[$key] == $value )
44
+ $results[] = $array;
45
+
46
+ foreach ($array as $subarray)
47
+ $results = array_merge( $results, $this->search( $subarray, $key, $value ) );
48
+ }
49
+
50
+ return $results;
51
+ }
52
+
53
+ /**
54
+ * Really simple captcha validation
55
+ *
56
+ * @return void
57
+ */
58
+ function validate_rs_captcha() {
59
+ $rs_captcha_input = isset( $_POST['rs_captcha'] ) ? $_POST['rs_captcha'] : '';
60
+ $rs_captcha_file = isset( $_POST['rs_captcha_val'] ) ? $_POST['rs_captcha_val'] : '';
61
+
62
+ if ( class_exists( 'ReallySimpleCaptcha' ) ) {
63
+ $captcha_instance = new ReallySimpleCaptcha();
64
+
65
+ if ( !$captcha_instance->check( $rs_captcha_file, $rs_captcha_input ) ) {
66
+
67
+ $this->send_error( __( 'Really Simple Captcha validation failed', 'wp-user-frontend' ) );
68
+ } else {
69
+ // validation success, remove the files
70
+ $captcha_instance->remove( $rs_captcha_file );
71
+ }
72
+ }
73
+ }
74
+
75
+ /**
76
+ * reCaptcha Validation
77
+ *
78
+ * @return void
79
+ */
80
+ function validate_re_captcha( $no_captcha = '', $invisible = '' ) {
81
+ // need to check if invisible reCaptcha need library or we can do it here.
82
+ // ref: https://shareurcodes.com/blog/google%20invisible%20recaptcha%20integration%20with%20php
83
+ $site_key = wpuf_get_option( 'recaptcha_public', 'wpuf_general' );
84
+ $private_key = wpuf_get_option( 'recaptcha_private', 'wpuf_general' );
85
+ if ( $no_captcha == 1 && 0 == $invisible ) {
86
+
87
+ if ( !class_exists( 'WPUF_ReCaptcha' ) ) {
88
+ require_once WPUF_ROOT . '/lib/recaptchalib_noCaptcha.php';
89
+ }
90
+
91
+ $response = null;
92
+ $reCaptcha = new WPUF_ReCaptcha($private_key);
93
+
94
+ $resp = $reCaptcha->verifyResponse(
95
+ $_SERVER["REMOTE_ADDR"],
96
+ $_POST["g-recaptcha-response"]
97
+ );
98
+
99
+ if ( !$resp->success ) {
100
+ $this->send_error( __( 'noCaptcha reCAPTCHA validation failed', 'wp-user-frontend' ) );
101
+ }
102
+
103
+ } elseif ( $no_captcha == 0 && 0 == $invisible ) {
104
+
105
+ $recap_challenge = isset( $_POST['recaptcha_challenge_field'] ) ? $_POST['recaptcha_challenge_field'] : '';
106
+ $recap_response = isset( $_POST['recaptcha_response_field'] ) ? $_POST['recaptcha_response_field'] : '';
107
+
108
+ $resp = recaptcha_check_answer( $private_key, $_SERVER["REMOTE_ADDR"], $recap_challenge, $recap_response );
109
+
110
+ if ( !$resp->is_valid ) {
111
+ $this->send_error( __( 'reCAPTCHA validation failed', 'wp-user-frontend' ) );
112
+ }
113
+
114
+ } elseif ( $no_captcha == 0 && 1 == $invisible ) {
115
+
116
+ $response = null;
117
+ $recaptcha = $_POST['g-recaptcha-response'];
118
+ $object = new Invisible_Recaptcha( $site_key , $private_key );
119
+
120
+ $response = $object->verifyResponse( $recaptcha );
121
+
122
+ if ( isset( $response['success'] ) and $response['success'] != true) {
123
+ $this->send_error( __( 'Invisible reCAPTCHA validation failed', 'wp-user-frontend' ) );
124
+ }
125
+ }
126
+
127
+ }
128
+
129
+ /**
130
+ * render submit button
131
+ * @param [type] $form_id [description]
132
+ * @param [type] $form_settings [description]
133
+ * @param [type] $post_id [description]
134
+ */
135
+ public function submit_button( $form_id, $form_settings, $post_id = null ) { ?>
136
+
137
+ <li class="wpuf-submit">
138
+ <div class="wpuf-label">
139
+ &nbsp;
140
+ </div>
141
+
142
+ <?php wp_nonce_field( 'wpuf_form_add' ); ?>
143
+ <input type="hidden" name="form_id" value="<?php echo $form_id; ?>">
144
+ <input type="hidden" name="page_id" value="<?php echo get_post() ? get_the_ID() : '0'; ?>">
145
+ <input type="hidden" id="del_attach" name="delete_attachments[]">
146
+ <input type="hidden" name="action" value="wpuf_submit_post">
147
+
148
+ <?php
149
+ if ( $post_id ) {
150
+ $cur_post = get_post( $post_id );
151
+ ?>
152
+ <input type="hidden" name="post_id" value="<?php echo $post_id; ?>">
153
+ <input type="hidden" name="post_date" value="<?php echo esc_attr( $cur_post->post_date ); ?>">
154
+ <input type="hidden" name="comment_status" value="<?php echo esc_attr( $cur_post->comment_status ); ?>">
155
+ <input type="hidden" name="post_author" value="<?php echo esc_attr( $cur_post->post_author ); ?>">
156
+ <input type="submit" class="wpuf-submit-button" name="submit" value="<?php echo $form_settings['update_text']; ?>" />
157
+ <?php } else { ?>
158
+ <input type="submit" class="wpuf-submit-button" name="submit" value="<?php echo $form_settings['submit_text']; ?>" />
159
+ <?php } ?>
160
+
161
+ <?php if ( isset( $form_settings['draft_post'] ) && $form_settings['draft_post'] == 'true' ) { ?>
162
+ <a href="#" class="btn" id="wpuf-post-draft"><?php _e( 'Save Draft', 'wp-user-frontend' ); ?></a>
163
+ <?php } ?>
164
+ </li>
165
+
166
+ <?php
167
+ }
168
+
169
+ /**
170
+ * guest post field
171
+ * @param [type] $form_settings [description]
172
+ */
173
+ public function guest_fields( $form_settings ) {
174
+ ?>
175
+ <li class="el-name">
176
+ <div class="wpuf-label">
177
+ <label><?php echo $form_settings['name_label']; ?> <span class="required">*</span></label>
178
+ </div>
179
+
180
+ <div class="wpuf-fields">
181
+ <input type="text" required="required" data-required="yes" data-type="text" name="guest_name" value="" size="40">
182
+ </div>
183
+ </li>
184
+
185
+ <li class="el-email">
186
+ <div class="wpuf-label">
187
+ <label><?php echo $form_settings['email_label']; ?> <span class="required">*</span></label>
188
+ </div>
189
+
190
+ <div class="wpuf-fields">
191
+ <input type="email" required="required" data-required="yes" data-type="email" name="guest_email" value="" size="40">
192
+ </div>
193
+ </li>
194
+ <?php
195
+ }
196
+
197
+ /**
198
+ * Form preview handler
199
+ *
200
+ * @return void
201
+ */
202
+ function preview_form() {
203
+ $form_id = isset( $_GET['form_id'] ) ? intval( $_GET['form_id'] ) : 0;
204
+
205
+
206
+ if ( $form_id ) {
207
+ ?>
208
+
209
+ <!doctype html>
210
+ <html lang="en">
211
+ <head>
212
+ <meta charset="UTF-8">
213
+ <title>Form Preview</title>
214
+ <link rel="stylesheet" href="<?php echo plugins_url( 'assets/css/frontend-forms.css', dirname( __FILE__ ) ); ?>">
215
+
216
+ <style type="text/css">
217
+ body {
218
+ margin: 0;
219
+ padding: 0;
220
+ background: #eee;
221
+ }
222
+
223
+ .container {
224
+ width: 700px;
225
+ margin: 0 auto;
226
+ margin-top: 20px;
227
+ padding: 20px;
228
+ background: #fff;
229
+ border: 1px solid #DFDFDF;
230
+ -webkit-box-shadow: 1px 1px 2px rgba(0,0,0,0.1);
231
+ box-shadow: 1px 1px 2px rgba(0,0,0,0.1);
232
+ }
233
+ </style>
234
+
235
+ <script type="text/javascript" src="<?php echo includes_url( 'js/jquery/jquery.js' ); ?>"></script>
236
+ </head>
237
+ <body>
238
+ <div class="container">
239
+ <?php $this->render_form( $form_id, null,null,null); ?>
240
+ </div>
241
+ </body>
242
+ </html>
243
+
244
+ <?php
245
+ } else {
246
+ wp_die( 'Error generating the form preview' );
247
+ }
248
+
249
+ exit;
250
+ }
251
+
252
+ /**
253
+ * render form
254
+ * @param [type] $form_id [description]
255
+ * @param [type] $post_id [description]
256
+ * @param array $atts [description]
257
+ * @param [type] $form [description]
258
+ */
259
+ function render_form( $form_id, $post_id = NULL, $atts = array(), $form = NULL) {
260
+
261
+ $form_status = get_post_status( $form_id );
262
+
263
+ if ( ! $form_status ) {
264
+ echo '<div class="wpuf-message">' . __( 'Your selected form is no longer available.', 'wp-user-frontend' ) . '</div>';
265
+ return;
266
+ }
267
+
268
+ if ( $form_status != 'publish' ) {
269
+ echo '<div class="wpuf-message">' . __( "Please make sure you've published your form.", 'wp-user-frontend' ) . '</div>';
270
+ return;
271
+ }
272
+
273
+ $label_position = isset( $this->form_settings['label_position'] ) ? $this->form_settings['label_position'] : 'left';
274
+
275
+ $layout = isset( $this->form_settings['form_layout'] ) ? $this->form_settings['form_layout'] : 'layout1';
276
+
277
+ $theme_css = isset( $this->form_settings['use_theme_css'] ) ? $this->form_settings['use_theme_css'] : 'wpuf-style';
278
+
279
+ do_action( 'wpuf_before_form_render', $form_id);
280
+
281
+ if ( !empty( $layout ) ) {
282
+ wp_enqueue_style( 'wpuf-' . $layout );
283
+ }
284
+
285
+ if ( ! is_user_logged_in() && $this->form_settings['guest_post'] != 'true' ) {
286
+ echo '<div class="wpuf-message">' . $this->form_settings['message_restrict'] . '</div>';
287
+ return;
288
+ }
289
+
290
+ if($this->form_fields) { ?>
291
+
292
+ <form class="wpuf-form-add wpuf-form-<?php echo $layout; ?> <?php echo ($layout == 'layout1') ? $theme_css : 'wpuf-style'; ?>" action="" method="post">
293
+
294
+
295
+ <script type="text/javascript">
296
+ if ( typeof wpuf_conditional_items === 'undefined' ) {
297
+ wpuf_conditional_items = [];
298
+ }
299
+
300
+ if ( typeof wpuf_plupload_items === 'undefined' ) {
301
+ wpuf_plupload_items = [];
302
+ }
303
+
304
+ if ( typeof wpuf_map_items === 'undefined' ) {
305
+ wpuf_map_items = [];
306
+ }
307
+ </script>
308
+
309
+ <ul class="wpuf-form form-label-<?php echo $label_position; ?>">
310
+
311
+ <?php
312
+
313
+ do_action( 'wpuf_form_fields_top', $form, $this->form_fields );
314
+
315
+ if ( !$post_id ) {
316
+ do_action( 'wpuf_add_post_form_top', $form_id, $this->form_settings );
317
+ } else {
318
+ do_action( 'wpuf_edit_post_form_top', $form_id, $post_id, $this->form_settings );
319
+ }
320
+
321
+ if ( !is_user_logged_in() && $this->form_settings['guest_post'] == 'true' && $this->form_settings['guest_details'] == 'true' ) {
322
+ $this->guest_fields( $this->form_settings );
323
+ }
324
+
325
+
326
+ wpuf()->fields->render_fields( $this->form_fields, $form_id, $atts , $type = 'post', $post_id );
327
+
328
+
329
+ $this->submit_button( $form_id, $this->form_settings,$post_id);
330
+
331
+ if ( !$post_id ) {
332
+ do_action( 'wpuf_add_post_form_bottom', $form_id, $this->form_settings );
333
+ } else {
334
+ do_action( 'wpuf_edit_post_form_bottom', $form_id, $post_id, $this->form_settings );
335
+ }
336
+
337
+ ?>
338
+
339
+ </ul>
340
+
341
+ </form>
342
+
343
+ <?php
344
+
345
+ } //endif
346
+
347
+ do_action( 'wpuf_after_form_render', $form_id );
348
+
349
+ }
350
+
351
+ /**
352
+ * add post field setting on form builder
353
+ * @param array $field_settings
354
+ */
355
+ public function add_field_settings( $field_settings ) {
356
+
357
+ if ( class_exists( 'WPUF_Field_Contract' ) ) {
358
+ require_once WPUF_ROOT . '/includes/fields/class-field-post-title.php';
359
+ require_once WPUF_ROOT . '/includes/fields/class-field-post-content.php';
360
+ require_once WPUF_ROOT . '/includes/fields/class-field-post-tags.php';
361
+ require_once WPUF_ROOT . '/includes/fields/class-field-post-excerpt.php';
362
+ require_once WPUF_ROOT . '/includes/fields/class-field-post-taxonomy.php';
363
+ require_once WPUF_ROOT . '/includes/fields/class-field-featured-image.php';
364
+
365
+ $field_settings['post_title'] = new WPUF_Form_Field_Post_Title();
366
+ $field_settings['post_content'] = new WPUF_Form_Field_Post_Content();
367
+ $field_settings['post_excerpt'] = new WPUF_Form_Field_Post_Excerpt();
368
+ $field_settings['featured_image'] = new WPUF_Form_Field_Featured_Image();
369
+
370
+ $taxonomy_templates = array();
371
+
372
+ foreach ( $this->wp_post_types as $post_type => $taxonomies ) {
373
+
374
+ if ( ! empty( $taxonomies ) ) {
375
+
376
+ foreach ( $taxonomies as $tax_name => $taxonomy ) {
377
+ if ( 'post_tag' === $tax_name ) {
378
+ // $taxonomy_templates['post_tag'] = self::post_tags();
379
+ $taxonomy_templates['post_tags'] = new WPUF_Form_Field_Post_Tags();
380
+
381
+ } else {
382
+ // $taxonomy_templates[ $tax_name ] = self::taxonomy_template( $tax_name, $taxonomy );
383
+ $taxonomy_templates[ 'taxonomy' ] = new WPUF_Form_Field_Post_Taxonomy($tax_name, $taxonomy);
384
+
385
+ }
386
+ }
387
+
388
+ }
389
+
390
+ }
391
+
392
+ $field_settings = array_merge( $field_settings, $taxonomy_templates );
393
+
394
+ }
395
+
396
+ return $field_settings;
397
+
398
+ }
399
+
400
+
401
+ /**
402
+ * Guess a suitable username for registration based on email address
403
+ * @param string $email email address
404
+ * @return string username
405
+ */
406
+ function guess_username( $email ) {
407
+ // username from email address
408
+ $username = sanitize_user( substr( $email, 0, strpos( $email, '@' ) ) );
409
+
410
+ if ( !username_exists( $username ) ) {
411
+ return $username;
412
+ }
413
+
414
+ // try to add some random number in username
415
+ // and may be we got our username
416
+ $username .= rand( 1, 199 );
417
+ if ( !username_exists( $username ) ) {
418
+ return $username;
419
+ }
420
+ }
421
+
422
+ /**
423
+ * Populate available wp post types
424
+ *
425
+ * @since 2.5
426
+ *
427
+ * @return void
428
+ */
429
+ public function set_wp_post_types( ) {
430
+
431
+ $args = array( '_builtin' => true );
432
+
433
+ $wpuf_post_types = wpuf_get_post_types( $args );
434
+
435
+ $ignore_taxonomies = apply_filters( 'wpuf-ignore-taxonomies', array(
436
+ 'post_format'
437
+ ) );
438
+
439
+ foreach ( $wpuf_post_types as $post_type ) {
440
+
441
+ $this->wp_post_types[ $post_type ] = array();
442
+
443
+ $taxonomies = get_object_taxonomies( $post_type, 'object' );
444
+
445
+ foreach ( $taxonomies as $tax_name => $taxonomy ) {
446
+ if ( ! in_array( $tax_name, $ignore_taxonomies ) ) {
447
+ $this->wp_post_types[ $post_type ][ $tax_name ] = array(
448
+ 'title' => $taxonomy->label,
449
+ 'hierarchical' => $taxonomy->hierarchical
450
+ );
451
+
452
+ $this->wp_post_types[ $post_type ][ $tax_name ]['terms'] = get_terms( array(
453
+ 'taxonomy' => $tax_name,
454
+ 'hide_empty' => false
455
+ ) );
456
+ }
457
+ }
458
+ }
459
+ }
460
+
461
+ /**
462
+ * get Input fields
463
+ * @param array $form_vars
464
+ * @return array
465
+ */
466
+ public function get_input_fields( $form_vars ) {
467
+
468
+ $ignore_lists = array('section_break', 'html');
469
+
470
+ $post_vars = $meta_vars = $taxonomy_vars = array();
471
+
472
+ foreach ($form_vars as $key => $value) {
473
+
474
+ // ignore section break and HTML input type
475
+ if ( in_array( $value['input_type'], $ignore_lists ) ) {
476
+ continue;
477
+ }
478
+
479
+ //separate the post and custom fields
480
+ if ( isset( $value['is_meta'] ) && $value['is_meta'] == 'yes' ) {
481
+ $meta_vars[] = $value;
482
+ continue;
483
+ }
484
+
485
+ if ( $value['input_type'] == 'taxonomy' ) {
486
+
487
+ // don't add "category"
488
+ if ( $value['name'] == 'category' ) {
489
+ continue;
490
+ }
491
+
492
+ $taxonomy_vars[] = $value;
493
+ } else {
494
+ $post_vars[] = $value;
495
+ }
496
+ }
497
+
498
+ return array($post_vars, $taxonomy_vars, $meta_vars);
499
+ }
500
+
501
+ /**
502
+ * set custom taxonomy
503
+ * @param int $post_id
504
+ * @param array $taxonomy_vars
505
+ */
506
+ public function set_custom_taxonomy( $post_id,$taxonomy_vars ) {
507
+
508
+ // save any custom taxonomies
509
+ $woo_attr = array();
510
+
511
+ foreach ($taxonomy_vars as $taxonomy ) {
512
+
513
+ if(isset($_POST[$taxonomy['name']] ) && ( $_POST[$taxonomy['name']] !='' && $_POST[$taxonomy['name']] !='0' && $_POST[$taxonomy['name']][0] !='-1' ) ) {
514
+
515
+ if ( is_object_in_taxonomy( $this->form_settings['post_type'], $taxonomy['name'] ) ) {
516
+
517
+ $tax = $_POST[$taxonomy['name']];
518
+
519
+ // if it's not an array, make it one
520
+ if ( !is_array( $tax ) ) {
521
+ $tax = array( $tax );
522
+ }
523
+
524
+ if ( $taxonomy['type'] == 'text' ) {
525
+
526
+ $hierarchical = array_map( 'trim', array_map( 'strip_tags', explode( ',', $_POST[$taxonomy['name']] ) ) );
527
+
528
+ wp_set_object_terms( $post_id, $hierarchical, $taxonomy['name'] );
529
+
530
+ // woocommerce check
531
+ if ( isset( $taxonomy['woo_attr'] ) && $taxonomy['woo_attr'] == 'yes' && !empty( $_POST[$taxonomy['name']] ) ) {
532
+ $woo_attr[sanitize_title( $taxonomy['name'] )] = $this->woo_attribute( $taxonomy );
533
+ }
534
+ } else {
535
+
536
+ if ( is_taxonomy_hierarchical( $taxonomy['name'] ) ) {
537
+ wp_set_post_terms( $post_id, $_POST[$taxonomy['name']], $taxonomy['name'] );
538
+
539
+ // woocommerce check
540
+ if ( isset( $taxonomy['woo_attr'] ) && $taxonomy['woo_attr'] == 'yes' && !empty( $_POST[$taxonomy['name']] ) ) {
541
+ $woo_attr[sanitize_title( $taxonomy['name'] )] = $this->woo_attribute( $taxonomy );
542
+ }
543
+ } else {
544
+ if ( $tax ) {
545
+ $non_hierarchical = array();
546
+
547
+ foreach ( $tax as $value ) {
548
+ $term = get_term_by( 'id', $value, $taxonomy['name'] );
549
+ if ( $term && !is_wp_error( $term ) ) {
550
+ $non_hierarchical[] = $term->name;
551
+ }
552
+ }
553
+
554
+ wp_set_post_terms( $post_id, $non_hierarchical, $taxonomy['name'] );
555
+
556
+ // woocommerce check
557
+ if ( isset( $taxonomy['woo_attr'] ) && $taxonomy['woo_attr'] == 'yes' && !empty( $_POST[$taxonomy['name']] ) ) {
558
+ $woo_attr[sanitize_title( $taxonomy['name'] )] = $this->woo_attribute( $taxonomy );
559
+ }
560
+
561
+ }
562
+ } // hierarchical
563
+ } // is text
564
+ } // is object tax
565
+ } // isset tax
566
+
567
+ else {
568
+
569
+ if ( is_object_in_taxonomy( $this->form_settings['post_type'], $taxonomy['name'] ) ) {
570
+
571
+ foreach ($this->form_settings['default_cat'] as $value) {
572
+ $term = get_term( $value );
573
+ wp_set_post_terms( $post_id, $value , $term->taxonomy);
574
+ }
575
+ // wp_set_post_terms( $post_id, $form_settings['default_cat'], $taxonomy['name'] );
576
+ }
577
+ }
578
+ }
579
+
580
+ // if a woocommerce attribute
581
+ if ( $woo_attr ) {
582
+ update_post_meta( $post_id, '_product_attributes', $woo_attr );
583
+ }
584
+
585
+ return $woo_attr;
586
+ }
587
+
588
+ /**
589
+ * prepare meta fields
590
+ * @param array $meta_vars
591
+ * @return array
592
+ */
593
+ public static function prepare_meta_fields( $meta_vars ) {
594
+ // loop through custom fields
595
+ // skip files, put in a key => value paired array for later executation
596
+ // process repeatable fields separately
597
+ // if the input is array type, implode with separator in a field
598
+
599
+ $files = array();
600
+ $meta_key_value = array();
601
+ $multi_repeated = array(); //multi repeated fields will in sotre duplicated meta key
602
+
603
+ foreach ($meta_vars as $key => $value) {
604
+
605
+ switch ( $value['input_type'] ) {
606
+
607
+ // put files in a separate array, we'll process it later
608
+ case 'file_upload':
609
+ case 'image_upload':
610
+
611
+ $files[] = array(
612
+ 'name' => $value['name'],
613
+ 'value' => isset( $_POST['wpuf_files'][$value['name']] ) ? $_POST['wpuf_files'][$value['name']] : array(),
614
+ 'count' => $value['count']
615
+ );
616
+ break;
617
+
618
+ case 'repeat':
619
+
620
+ // if it is a multi column repeat field
621
+ if ( isset( $value['multiple'] ) && $value['multiple'] == 'true' ) {
622
+
623
+ // if there's any items in the array, process it
624
+ if ( $_POST[$value['name']] ) {
625
+
626
+ $ref_arr = array();
627
+ $cols = count( $value['columns'] );
628
+ $first = array_shift( array_values( $_POST[$value['name']] ) ); //first element
629
+ $rows = count( $first );
630
+
631
+ // loop through columns
632
+ for ($i = 0; $i < $rows; $i++) {
633
+
634
+ // loop through the rows and store in a temp array
635
+ $temp = array();
636
+ for ($j = 0; $j < $cols; $j++) {
637
+
638
+ $temp[] = $_POST[$value['name']][$j][$i];
639
+ }
640
+
641
+ // store all fields in a row with self::$separator separated
642
+ $ref_arr[] = implode( self::$separator, $temp );
643
+ }
644
+
645
+ // now, if we found anything in $ref_arr, store to $multi_repeated
646
+ if ( $ref_arr ) {
647
+ $multi_repeated[$value['name']] = array_slice( $ref_arr, 0, $rows );
648
+ }
649
+ }
650
+ } else {
651
+ $meta_key_value[$value['name']] = implode( self::$separator, $_POST[$value['name']] );
652
+ }
653
+
654
+ break;
655
+
656
+ case 'address':
657
+
658
+ if ( isset( $_POST[ $value['name'] ] ) && is_array( $_POST[ $value['name'] ] ) ) {
659
+ foreach ( $_POST[ $value['name'] ] as $address_field => $field_value ) {
660
+ $meta_key_value[ $value['name'] ][ $address_field ] = sanitize_text_field( $field_value );
661
+ }
662
+ }
663
+
664
+ break;
665
+
666
+ case 'text':
667
+ case 'email':
668
+ case 'number':
669
+ case 'date':
670
+
671
+ $meta_key_value[$value['name']] = sanitize_text_field( trim( $_POST[$value['name']] ) );
672
+
673
+ break;
674
+
675
+ case 'textarea':
676
+
677
+ $meta_key_value[$value['name']] = wp_kses_post( $_POST[$value['name']] );
678
+
679
+ break;
680
+
681
+ case 'map':
682
+ $data = array();
683
+ $map_field_data = sanitize_text_field( trim( $_POST[$value['name']] ) );
684
+
685
+ if ( !empty( $map_field_data ) ) {
686
+ list($data['address'], $data['lat'], $data['lng']) = explode(" || ", $map_field_data);
687
+ $meta_key_value[$value['name']] = $data;
688
+ }
689
+ break;
690
+
691
+ default:
692
+ // if it's an array, implode with this->separator
693
+ if ( is_array( $_POST[$value['name']] ) ) {
694
+ $acf_compatibility = wpuf_get_option( 'wpuf_compatibility_acf', 'wpuf_general', 'no' );
695
+
696
+ if ( $value['input_type'] == 'address' ) {
697
+ $meta_key_value[$value['name']] = $_POST[$value['name']];
698
+ } elseif ( !empty( $acf_compatibility ) && $acf_compatibility == 'yes' ) {
699
+ $meta_key_value[$value['name']] = maybe_serialize( $_POST[$value['name']] );
700
+ } else {
701
+ $meta_key_value[$value['name']] = implode( self::$separator, $_POST[$value['name']] );
702
+ }
703
+ } else {
704
+ $meta_key_value[$value['name']] = trim( $_POST[$value['name']] );
705
+ }
706
+
707
+ break;
708
+ }
709
+
710
+ } //end foreach
711
+
712
+ return array($meta_key_value, $multi_repeated, $files);
713
+ }
714
+
715
+
716
+ /**
717
+ * checking recaptcha
718
+ * @param [type] $post_vars [description]
719
+ * @return void
720
+ */
721
+ public function on_edit_no_check_recaptcha( $post_vars ) {
722
+ // search if rs captcha is there
723
+ if ( $this->search( $post_vars, 'input_type', 'really_simple_captcha' ) ) {
724
+ $this->validate_rs_captcha();
725
+ }
726
+ $no_captcha = $invisible_captcha = $recaptcha_type = '';
727
+ $check_recaptcha = $this->search( $post_vars, 'input_type', 'recaptcha' );
728
+ if ( !empty( $check_recaptcha ) ) {
729
+ $recaptcha_type = $check_recaptcha[0]['recaptcha_type'];
730
+ }
731
+ // check recaptcha
732
+ if ( $check_recaptcha ) {
733
+ if ( isset ( $_POST["g-recaptcha-response"] ) ) {
734
+ if ( empty( $_POST['g-recaptcha-response'] ) && $check_recaptcha[0]['recaptcha_type'] !== 'invisible_recaptcha') {
735
+ $this->send_error( __( 'Empty reCaptcha Field', 'wp-user-frontend' ) );
736
+ }
737
+ if ( $recaptcha_type == 'enable_no_captcha' ) {
738
+ $no_captcha = 1;
739
+ $invisible_captcha = 0;
740
+ } elseif ( $recaptcha_type == 'invisible_recaptcha' ) {
741
+ $invisible_captcha = 1;
742
+ $no_captcha = 0;
743
+ } else {
744
+ $invisible_captcha = 0;
745
+ $no_captcha = 0;
746
+ }
747
+ }
748
+ $this->validate_re_captcha( $no_captcha, $invisible_captcha );
749
+ }
750
+ }
751
+ }
includes/class-gutenblock.php CHANGED
@@ -1,101 +1,121 @@
1
- <?php
2
-
3
- if ( ! defined( 'ABSPATH' ) )
4
- exit;
5
  /**
6
- * Adds WPUF Forms widget.
7
  */
8
  class WPUF_Form_Block {
9
-
 
 
10
  public function __construct() {
 
 
 
 
 
11
  // load the preview information and form
12
  add_action( 'wp_head', array( $this, 'load_preview_data' ) );
13
- add_action( 'enqueue_block_editor_assets', array ( $this, 'load_block_assets' ) );
14
  }
15
 
16
- function load_block_assets() {
 
 
 
 
 
 
17
  $js_dir = WPUF_ASSET_URI . '/js/admin/';
18
  $css_dir = WPUF_ASSET_URI . '/css/admin/';
19
 
20
- $block_logo = $thumbnail_logo = WPUF_ASSET_URI . '/images/icon-128x128.png';
21
-
22
  // Once we have Gutenberg block javascript, we can enqueue our assets
23
  wp_register_script(
24
- 'wpuf_block',
25
  $js_dir . 'gutenblock.js',
26
- array( 'wp-blocks', 'wp-i18n', 'wp-element', 'underscore' )
27
  );
28
 
29
  wp_register_style(
30
- 'wpuf-block-editor',
31
- $css_dir . 'gutenblock.css'
 
 
 
 
 
 
32
  );
33
 
34
  /**
35
  * we need to get our forms so that the block can build a dropdown
36
  * with the forms
37
  * */
38
- wp_enqueue_script( 'wpuf_block' );
39
- wp_enqueue_style( 'wpuf-block-editor' );
40
-
41
- $forms = array();
42
- $forms[] = array (
43
- 'value' => '',
44
- 'label' => __('-- Select a Form --', 'wp-user-frontend' ),
45
- );
46
 
47
- $all_forms = wpuf()->forms->get_forms( array( 'post_status' => 'publish' ) );
 
48
 
49
- foreach ( $all_forms['forms'] as $form ) {
50
  $forms[] = array (
51
  'value' => $form->id,
52
  'label' => $form->get_title(),
53
  );
54
  }
55
 
56
- wp_localize_script( 'wpuf_block', 'wpufblock', array(
 
 
 
57
  'forms' => $forms,
58
  'siteUrl' => get_site_url(),
59
  'block_logo' => $block_logo,
60
  'thumbnail_logo' => $thumbnail_logo
61
  ) );
 
 
62
  }
63
 
64
  public function load_preview_data() {
 
 
65
  // check for preview and iframe get parameters
66
- if ( isset( $_GET[ 'wpuf_preview' ] ) && isset( $_GET[ 'wpuf_iframe' ] ) ) {
 
 
67
  ?>
68
  <style media="screen">
69
  #wpadminbar {
70
  display: none;
71
  }
72
- header{
 
73
  display: none;
74
  }
 
75
  .wpuf-form-add {
76
  z-index: 9001;
77
- position: fixed !important;
78
- top: 0; left: 0;
 
79
  width: 100vw;
80
  height: 100vh;
81
- background-color: #ffffff;
82
- /* overflow-x: hidden; */
83
  }
 
84
  </style>
85
- <script type="text/javascript">
86
- jQuery( document ).ready( function() {
87
- var frameEl = window.frameElement;
88
- // get the form element
89
- var $form = jQuery('.wpuf-form-add');
90
- // get the height of the form
91
- var height = $form.find( '.wpuf-form' ).outerHeight(true);
92
-
93
- if ( frameEl ) {
94
- frameEl.height = height + 50;
95
- }
96
- });
97
- </script>
98
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
99
  }
100
  }
101
- }
1
+ <?php if ( ! defined( 'ABSPATH' ) ) exit;
 
 
 
2
  /**
3
+ * Adds WPUF block
4
  */
5
  class WPUF_Form_Block {
6
+ /**
7
+ * Register widget with WordPress.
8
+ */
9
  public function __construct() {
10
+ //Enqueue the Dashicons script as they are not loading
11
+ //when wpuf_form shortcode exists in admin pages.
12
+ add_action( 'admin_enqueue_scripts', array( $this, 'load_dashicons' ) );
13
+ // wait for Gutenberg to enqueue it's block assets
14
+ add_action( 'enqueue_block_editor_assets', array( $this, 'wpuf_form_block' ) );
15
  // load the preview information and form
16
  add_action( 'wp_head', array( $this, 'load_preview_data' ) );
 
17
  }
18
 
19
+ function load_dashicons() {
20
+ // load dashicons & editor style as they are not loading when wpuf_form shortcode exists in admin pages.
21
+ wp_register_style( 'wpuf_dashicons', includes_url() . 'css/dashicons.css', false, '1.0.0' );
22
+ wp_enqueue_style( 'wpuf_dashicons' );
23
+ }
24
+
25
+ function wpuf_form_block() {
26
  $js_dir = WPUF_ASSET_URI . '/js/admin/';
27
  $css_dir = WPUF_ASSET_URI . '/css/admin/';
28
 
 
 
29
  // Once we have Gutenberg block javascript, we can enqueue our assets
30
  wp_register_script(
31
+ 'wpuf-forms-block',
32
  $js_dir . 'gutenblock.js',
33
+ array( 'wp-blocks', 'wp-editor', 'wp-components', 'wp-i18n', 'wp-element', 'underscore' )
34
  );
35
 
36
  wp_register_style(
37
+ 'wpuf-forms-block-style',
38
+ $css_dir . 'gutenblock.css',
39
+ array( 'wp-edit-blocks' )
40
+ );
41
+ wp_register_style(
42
+ 'wpuf-forms-block-editor',
43
+ $css_dir . 'gutenblock-editor.css',
44
+ array( 'wp-edit-blocks', 'form-blocks-style' )
45
  );
46
 
47
  /**
48
  * we need to get our forms so that the block can build a dropdown
49
  * with the forms
50
  * */
51
+ wp_enqueue_script( 'wpuf-forms-block' );
 
 
 
 
 
 
 
52
 
53
+ $forms = array();
54
+ $all_forms = wpuf()->forms->get_forms( array( 'post_status' => 'publish' ) );
55
 
56
+ foreach( $all_forms['forms'] as $form ){
57
  $forms[] = array (
58
  'value' => $form->id,
59
  'label' => $form->get_title(),
60
  );
61
  }
62
 
63
+ $block_logo = WPUF_ASSET_URI . '/images/icon-128x128.png';
64
+ $thumbnail_logo = WPUF_ASSET_URI . '/images/icon-128x128.png';
65
+
66
+ wp_localize_script( 'wpuf-forms-block', 'wpufBlock', array(
67
  'forms' => $forms,
68
  'siteUrl' => get_site_url(),
69
  'block_logo' => $block_logo,
70
  'thumbnail_logo' => $thumbnail_logo
71
  ) );
72
+ wp_enqueue_style( 'wpuf-forms-block-style' );
73
+ wp_enqueue_style( 'wpuf-forms-block-editor' );
74
  }
75
 
76
  public function load_preview_data() {
77
+ $js_dir = WPUF_ASSET_URI . '/js/admin/';
78
+
79
  // check for preview and iframe get parameters
80
+ if( isset( $_GET[ 'wpuf_preview' ] ) && isset( $_GET[ 'wpuf_iframe' ] ) ){
81
+ $form_id = intval( $_GET[ 'wpuf_preview' ] );
82
+ // Style below: update width and height for particular form
83
  ?>
84
  <style media="screen">
85
  #wpadminbar {
86
  display: none;
87
  }
88
+ header,
89
+ footer{
90
  display: none;
91
  }
92
+
93
  .wpuf-form-add {
94
  z-index: 9001;
95
+ position: fixed;
96
+ top: 0;
97
+ left: 0;
98
  width: 100vw;
99
  height: 100vh;
100
+ background-color: white;
101
+ display: block !important;
102
  }
103
+
104
  </style>
 
 
 
 
 
 
 
 
 
 
 
 
 
105
  <?php
106
+
107
+ // register our script to target the form iFrame in page builder
108
+ wp_register_script(
109
+ 'wpuf-block-setup',
110
+ $js_dir . 'blockFrameSetup.js',
111
+ array( 'underscore', 'jquery' )
112
+ );
113
+
114
+ wp_localize_script( 'wpuf-block-setup', 'wpufBlockSetup', array(
115
+ 'form_id' => $form_id
116
+ ) );
117
+
118
+ wp_enqueue_script( 'wpuf-block-setup' );
119
  }
120
  }
121
+ }
includes/class-pro-upgrades.php ADDED
@@ -0,0 +1,109 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class WPUF_Pro_Upgrades{
4
+
5
+ /**
6
+ * Initialize
7
+ */
8
+ function __construct() {
9
+
10
+ if ( class_exists( 'WP_User_Frontend_Pro')){
11
+ return;
12
+ }
13
+ // form fields
14
+ add_filter( 'wpuf_field_get_js_settings', array( $this, 'add_conditional_field_prompt' ) );
15
+ add_filter( 'wpuf-form-fields', array( $this, 'register_pro_fields' ),10, 1 );
16
+ // add_filter( 'wpuf-form-builder-field-settings', array( $this, 'register_pro_fields'), 10, 1 );
17
+ add_filter( 'wpuf_field_groups_custom', array( $this, 'add_to_custom_fields' ) );
18
+ add_filter( 'wpuf-form-fields-custom-fields', array( $this, 'add_to_custom_fields' ) );
19
+ add_filter( 'wpuf_field_groups_others', array( $this, 'add_to_others_fields' ) );
20
+ add_filter( 'wpuf-form-fields-others-fields', array( $this, 'add_to_others_fields' ) );
21
+ }
22
+
23
+ /**
24
+ * Register pro fields
25
+ *
26
+ * @param array $fields
27
+ *
28
+ * @return array
29
+ */
30
+ public function register_pro_fields( $fields ) {
31
+
32
+ if(!class_exists( 'WPUF_Form_Field_Pro' )){
33
+ if(class_exists('WPUF_Field_Contract')){
34
+ require_once WPUF_ROOT . '/includes/fields/class-field-pro.php';
35
+ }
36
+ }
37
+
38
+ if ( class_exists( 'WPUF_Form_Field_Pro' ) ) {
39
+
40
+ require_once WPUF_ROOT . '/includes/fields/class-pro-upgrade-fields.php';
41
+
42
+ $fields['action_hook'] = new WPUF_Form_Field_Hook();
43
+ $fields['address_field'] = new WPUF_Form_Field_Address();
44
+ $fields['repeat_field'] = new WPUF_Form_Field_Repeat();
45
+ $fields['country_list_field'] = new WPUF_Form_Field_Country();
46
+ $fields['date_field'] = new WPUF_Form_Field_Date();
47
+ $fields['embed'] = new WPUF_Form_Field_Embed();
48
+ $fields['file_upload'] = new WPUF_Form_Field_File();
49
+ $fields['google_map'] = new WPUF_Form_Field_GMap();
50
+ $fields['numeric_text_field'] = new WPUF_Form_Field_Numeric();
51
+ $fields['ratings'] = new WPUF_Form_Field_Rating();
52
+ $fields['really_simple_captcha'] = new WPUF_Form_Field_Really_Simple_Captcha();
53
+ $fields['shortcode'] = new WPUF_Form_Field_Shortcode();
54
+ $fields['step_start'] = new WPUF_Form_Field_Step();
55
+ $fields['toc'] = new WPUF_Form_Field_Toc();
56
+
57
+ }
58
+
59
+ return $fields;
60
+ }
61
+
62
+ /**
63
+ * Register fields to custom field section
64
+ *
65
+ * @param array $fields
66
+ */
67
+ public function add_to_custom_fields( $fields ) {
68
+
69
+ $pro_fields = array(
70
+ 'repeat_field', 'date_field', 'file_upload', 'country_list_field',
71
+ 'numeric_text_field', 'address_field', 'google_map', 'step_start'
72
+ );
73
+
74
+ return array_merge( $fields, $pro_fields );
75
+ }
76
+
77
+ /**
78
+ * Register fields to others field section
79
+ *
80
+ * @param array $fields
81
+ */
82
+ public function add_to_others_fields( $fields ) {
83
+ $pro_fields = array(
84
+ 'shortcode', 'action_hook', 'toc', 'ratings','embed','really_simple_captcha'
85
+ );
86
+ return array_merge( $fields, $pro_fields );
87
+
88
+ }
89
+
90
+ /**
91
+ * Add conditional logic prompt
92
+ *
93
+ * @param array $settings
94
+ */
95
+ public function add_conditional_field_prompt( $settings ) {
96
+
97
+ $settings['settings'][] = array(
98
+ 'name' => 'wpuf_cond',
99
+ 'title' => __( 'Conditional Logic', 'wp-user-frontend' ),
100
+ 'type' => 'option-pro-feature-alert',
101
+ 'section' => 'advanced',
102
+ 'priority' => 30,
103
+ 'help_text' => '',
104
+ 'is_pro_feature' => true
105
+ );
106
+
107
+ return $settings;
108
+ }
109
+ }
includes/class-user.php CHANGED
@@ -61,6 +61,24 @@ class WPUF_User {
61
  return get_user_meta( $this->id, 'wpuf_lock_cause', true );
62
  }
63
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
64
  /**
65
  * Handles user subscription
66
  *
61
  return get_user_meta( $this->id, 'wpuf_lock_cause', true );
62
  }
63
 
64
+ /**
65
+ * Check if a user's post edit capability is locked
66
+ *
67
+ * @return boolean
68
+ */
69
+ public function edit_post_locked() {
70
+ return 'yes' == get_user_meta( $this->id, 'wpuf_edit_postlock', true );
71
+ }
72
+
73
+ /**
74
+ * Get the edit post lock reason
75
+ *
76
+ * @return string
77
+ */
78
+ public function edit_post_lock_reason() {
79
+ return get_user_meta( $this->id, 'wpuf_edit_post_lock_cause', true );
80
+ }
81
+
82
  /**
83
  * Handles user subscription
84
  *
includes/fields/class-abstract-fields.php ADDED
@@ -0,0 +1,880 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Form field abstract class
5
+ *
6
+ * @since 1.1.0
7
+ */
8
+ abstract class WPUF_Field_Contract {
9
+
10
+ /**
11
+ * The field name
12
+ *
13
+ * @var string
14
+ */
15
+ protected $name = '';
16
+
17
+ /**
18
+ * Type of the field
19
+ *
20
+ * @var string
21
+ */
22
+ protected $input_type = '';
23
+
24
+ /**
25
+ * Icon of the field
26
+ *
27
+ * @var string
28
+ */
29
+ // protected $icon = '';
30
+ protected $icon = 'header';
31
+
32
+ /**
33
+ * Get the name of the field
34
+ *
35
+ * @return string
36
+ */
37
+ public function get_name() {
38
+ return $this->name;
39
+ }
40
+
41
+ /**
42
+ * Get field type
43
+ *
44
+ * @return string
45
+ */
46
+ public function get_type() {
47
+ return $this->input_type;
48
+ }
49
+
50
+ /**
51
+ * Get the fontawesome icon for this field
52
+ *
53
+ * @return string
54
+ */
55
+ public function get_icon() {
56
+ return $this->icon;
57
+ }
58
+
59
+ /**
60
+ * Render of the field in the frontend
61
+ *
62
+ * @param array $field_settings The field configuration from the db
63
+ * @param integer $form_id The form id
64
+ *
65
+ * @return void
66
+ */
67
+ abstract function render( $field_settings, $form_id, $type = 'post', $post_id = null );
68
+
69
+
70
+ /**
71
+ * Get the field option settings for form builder
72
+ *
73
+ * @return array
74
+ */
75
+ abstract function get_options_settings();
76
+
77
+ /**
78
+ * Get the field props
79
+ *
80
+ * Field props are the field properties that saves in the database
81
+ *
82
+ * @return array
83
+ */
84
+ abstract function get_field_props();
85
+
86
+
87
+ public function get_user_data( $user_id, $field ) {
88
+ return get_user_by( 'id', $user_id )->$field;
89
+ }
90
+
91
+
92
+ /**
93
+ * Check if its a meta field
94
+ *
95
+ * @param array $attr
96
+ * @return boolean
97
+ */
98
+
99
+ public function is_meta( $field_settings ) {
100
+
101
+ if ( isset( $field_settings['is_meta'] ) && $field_settings['is_meta'] == 'yes' ) {
102
+ return true;
103
+ }
104
+
105
+ return false;
106
+ }
107
+
108
+
109
+ /**
110
+ * Get a meta value
111
+ *
112
+ * @param int $object_id user_ID or post_ID
113
+ * @param string $meta_key
114
+ * @param string $type post or user
115
+ * @param bool $single
116
+ * @return string
117
+ */
118
+
119
+ function get_meta( $object_id, $meta_key, $type = 'post', $single = true ) {
120
+ if ( !$object_id ) {
121
+ return '';
122
+ }
123
+
124
+ if ( $type == 'post' ) {
125
+ return get_post_meta( $object_id, $meta_key, $single );
126
+ }
127
+
128
+ return get_user_meta( $object_id, $meta_key, $single );
129
+ }
130
+
131
+ /**
132
+ * The JS template for using in the form builder
133
+ *
134
+ * @return array
135
+ */
136
+ public function get_js_settings() {
137
+ $settings = array(
138
+ 'template' => $this->get_type(),
139
+ 'title' => $this->get_name(),
140
+ 'icon' => $this->get_icon(),
141
+ 'pro_feature' => $this->is_pro(),
142
+ 'settings' => $this->get_options_settings(),
143
+ 'field_props' => $this->get_field_props(),
144
+ 'is_full_width' => $this->is_full_width()
145
+ );
146
+
147
+ if ( $validator = $this->get_validator() ) {
148
+ $settings['validator'] = $validator;
149
+ }
150
+
151
+ return apply_filters( 'wpuf_field_get_js_settings', $settings );
152
+
153
+
154
+
155
+ }
156
+
157
+ /**
158
+ * Custom field validator if exists
159
+ *
160
+ * @return boolean|array
161
+ */
162
+ public function get_validator() {
163
+ return false;
164
+ }
165
+
166
+ /**
167
+ * Check if it's a pro feature
168
+ *
169
+ * @return boolean
170
+ */
171
+ public function is_pro() {
172
+ return false;
173
+ }
174
+
175
+ /**
176
+ * If this field is full width
177
+ *
178
+ * Used in form builder preview (hides the label)
179
+ *
180
+ * @return boolean
181
+ */
182
+ public function is_full_width() {
183
+ return false;
184
+ }
185
+
186
+ /**
187
+ * Conditional property for all fields
188
+ *
189
+ * @return array
190
+ */
191
+ public function default_conditional_prop() {
192
+ return array(
193
+ 'condition_status' => 'no',
194
+ 'cond_field' => array(),
195
+ 'cond_operator' => array( '=' ),
196
+ 'cond_option' => array( __( '- select -', 'wp-user-frontend' ) ),
197
+ 'cond_logic' => 'all'
198
+ );
199
+ }
200
+
201
+ /**
202
+ * Default attributes of a field
203
+ *
204
+ * Child classes should use this default setting and extend it by using `get_field_settings()` function
205
+ *
206
+ * @return array
207
+ */
208
+ public function default_attributes() {
209
+ return array(
210
+ 'template' => $this->get_type(),
211
+ 'name' => '',
212
+ 'label' => $this->get_name(),
213
+ 'required' => 'no',
214
+ 'id' => 0,
215
+ 'width' => 'large',
216
+ 'css' => '',
217
+ 'placeholder' => '',
218
+ 'default' => '',
219
+ 'size' => 40,
220
+ 'help' => '',
221
+ 'is_meta' => 'yes', // wpuf uses it to differentiate meta fields with core fields, maybe removed
222
+ 'is_new' => true, // introduced by @edi, not sure what it does. Have to remove
223
+ 'wpuf_cond' => $this->default_conditional_prop(),
224
+ 'wpuf_visibility' => $this->get_default_visibility_prop(),
225
+ );
226
+ }
227
+
228
+ /**
229
+ * Common properties for all kinds of fields
230
+ *
231
+ * @param boolean $is_meta
232
+ *
233
+ * @return array
234
+ */
235
+ public static function get_default_option_settings( $is_meta = true, $exclude = array() ) {
236
+ $common_properties = array(
237
+ array(
238
+ 'name' => 'label',
239
+ 'title' => __( 'Field Label', 'wp-user-frontend' ),
240
+ 'type' => 'text',
241
+ 'section' => 'basic',
242
+ 'priority' => 10,
243
+ 'help_text' => __( 'Enter a title of this field', 'wp-user-frontend' ),
244
+ ),
245
+
246
+ array(
247
+ 'name' => 'help',
248
+ 'title' => __( 'Help text', 'wp-user-frontend' ),
249
+ 'type' => 'text',
250
+ 'section' => 'basic',
251
+ 'priority' => 20,
252
+ 'help_text' => __( 'Give the user some information about this field', 'wp-user-frontend' ),
253
+ ),
254
+
255
+ array(
256
+ 'name' => 'required',
257
+ 'title' => __( 'Required', 'wp-user-frontend' ),
258
+ 'type' => 'radio',
259
+ 'options' => array(
260
+ 'yes' => __( 'Yes', 'wp-user-frontend' ),
261
+ 'no' => __( 'No', 'wp-user-frontend' ),
262
+ ),
263
+ 'section' => 'basic',
264
+ 'priority' => 21,
265
+ 'default' => 'no',
266
+ 'inline' => true,
267
+ 'help_text' => __( 'Check this option to mark the field required. A form will not submit unless all required fields are provided.', 'wp-user-frontend' ),
268
+ ),
269
+
270
+ array(
271
+ 'name' => 'width',
272
+ 'title' => __( 'Field Size', 'wp-user-frontend' ),
273
+ 'type' => 'radio',
274
+ 'options' => array(
275
+ 'small' => __( 'Small', 'wp-user-frontend' ),
276
+ 'medium' => __( 'Medium', 'wp-user-frontend' ),
277
+ 'large' => __( 'Large', 'wp-user-frontend' ),
278
+ ),
279
+ 'section' => 'advanced',
280
+ 'priority' => 21,
281
+ 'default' => 'large',
282
+ 'inline' => true,
283
+ ),
284
+
285
+ array(
286
+ 'name' => 'css',
287
+ 'title' => __( 'CSS Class Name', 'wp-user-frontend' ),
288
+ 'type' => 'text',
289
+ 'section' => 'advanced',
290
+ 'priority' => 22,
291
+ 'help_text' => __( 'Provide a container class name for this field. Available classes: wpuf-col-half, wpuf-col-half-last, wpuf-col-one-third, wpuf-col-one-third-last', 'wp-user-frontend' ),
292
+ ),
293
+
294
+ // array(
295
+ // 'name' => 'dynamic',
296
+ // 'title' => '',
297
+ // 'type' => 'dynamic-field',
298
+ // 'section' => 'advanced',
299
+ // 'priority' => 23,
300
+ // 'help_text' => __( 'Check this option to allow field to be populated dynamically using hooks/query string/shortcode', 'wp-user-frontend' ),
301
+ // ),
302
+ );
303
+
304
+
305
+ if ( is_wpuf_post_form_builder() ) {
306
+ $common_properties[] =
307
+ array(
308
+ 'name' => 'wpuf_visibility',
309
+ 'title' => __( 'Visibility', 'wp-user-frontend' ),
310
+ 'type' => 'visibility',
311
+ 'section' => 'advanced',
312
+ 'options' => array(
313
+ 'everyone' => __( 'Everyone', 'wp-user-frontend' ),
314
+ 'hidden' => __( 'Hidden', 'wp-user-frontend' ),
315
+ 'logged_in' => __( 'Logged in users only', 'wp-user-frontend' ),
316
+ 'subscribed_users' => __( 'Subscription users only', 'wp-user-frontend' ),
317
+ ),
318
+ 'priority' => 30,
319
+ 'inline' => true,
320
+ 'help_text' => __( 'Select option', 'wp-user-frontend' ),
321
+ );
322
+ }
323
+
324
+
325
+ if ( $is_meta ) {
326
+
327
+ $common_properties[] = array(
328
+ 'name' => 'name',
329
+ 'title' => __( 'Meta Key', 'wp-user-frontend' ),
330
+ 'type' => 'text-meta',
331
+ 'section' => 'basic',
332
+ 'priority' => 11,
333
+ 'help_text' => __( 'Name of the meta key this field will save to', 'wp-user-frontend' ),
334
+ );
335
+
336
+ if ( is_wpuf_post_form_builder() ) {
337
+
338
+ $common_properties = array_merge($common_properties, array(
339
+ array(
340
+ 'name' => 'show_in_post',
341
+ 'title' => __( 'Show Data in Post', 'wp-user-frontend' ),
342
+ 'type' => 'radio',
343
+ 'options' => array(
344
+ 'yes' => __( 'Yes', 'wp-user-frontend' ),
345
+ 'no' => __( 'No', 'wp-user-frontend' ),
346
+ ),
347
+ 'section' => 'advanced',
348
+ 'priority' => 24,
349
+ 'default' => 'yes',
350
+ 'inline' => true,
351
+ 'help_text' => __( 'Select Yes if you want to show the field data in single post.', 'wp-user-frontend' ),
352
+ ),
353
+ array(
354
+ 'name' => 'hide_field_label',
355
+ 'title' => __( 'Hide Field Label in Post', 'wp-user-frontend' ),
356
+ 'type' => 'radio',
357
+ 'options' => array(
358
+ 'yes' => __( 'Yes', 'wp-user-frontend' ),
359
+ 'no' => __( 'No', 'wp-user-frontend' ),
360
+ ),
361
+ 'section' => 'advanced',
362
+ 'priority' => 24,
363
+ 'default' => 'no',
364
+ 'inline' => true,
365
+ 'help_text' => __( 'Select Yes if you want to hide the field label in single post.', 'wp-user-frontend' ),
366
+ )
367
+ ));
368
+ }
369
+ }
370
+
371
+ if ( count( $exclude ) ) {
372
+ foreach ( $common_properties as $key => &$option ) {
373
+
374
+ if ( in_array( $option['name'] , $exclude) ) {
375
+ unset( $common_properties[$key] );
376
+ }
377
+ }
378
+
379
+ }
380
+
381
+ return $common_properties;
382
+ }
383
+
384
+ /**
385
+ * Common properties of a taxonomy select field
386
+ *
387
+ * @param boolean $word_restriction
388
+ *
389
+ * @return array
390
+ */
391
+
392
+
393
+ public function get_default_taxonomy_option_setttings($word_restriction = false, $tax_name){
394
+
395
+ $properties = array(
396
+ array(
397
+ 'name' => 'type',
398
+ 'title' => __( 'Type', 'wp-user-frontend' ),
399
+ 'type' => 'select',
400
+ 'options' => array(
401
+ 'select' => __( 'Select', 'wp-user-frontend' ),
402
+ 'multiselect' => __( 'Multi Select', 'wp-user-frontend' ),
403
+ 'checkbox' => __( 'Checkbox', 'wp-user-frontend' ),
404
+ 'text' => __( 'Text Input', 'wp-user-frontend' ),
405
+ 'ajax' => __( 'Ajax', 'wp-user-frontend' ),
406
+ ),
407
+ 'section' => 'advanced',
408
+ 'priority' => 23,
409
+ 'default' => 'select',
410
+ ),
411
+
412
+ array(
413
+ 'name' => 'first',
414
+ 'title' => __( 'Select Text', 'wp-user-frontend' ),
415
+ 'type' => 'text',
416
+ 'section' => 'basic',
417
+ 'priority' => 13,
418
+ 'help_text' => __( "First element of the select dropdown. Leave this empty if you don't want to show this field", 'wp-user-frontend' ),
419
+ ),
420
+
421
+ array(
422
+ 'name' => 'show_inline',
423
+ 'title' => __( 'Show in inline list', 'wp-user-frontend' ),
424
+ 'type' => 'radio',
425
+ 'options' => array(
426
+ 'yes' => __( 'Yes', 'wp-user-frontend' ),
427
+ 'no' => __( 'No', 'wp-user-frontend' ),
428
+ ),
429
+ 'default' => 'no',
430
+ 'inline' => true,
431
+ 'section' => 'advanced',
432
+ 'priority' => 23,
433
+ 'help_text' => __( 'Show this option in an inline list', 'wp-user-frontend' ),
434
+ ),
435
+
436
+ array(
437
+ 'name' => 'orderby',
438
+ 'title' => __( 'Order By', 'wp-user-frontend' ),
439
+ 'type' => 'select',
440
+ 'options' => array(
441
+ 'name' => __( 'Name', 'wp-user-frontend' ),
442
+ 'term_id' => __( 'Term ID', 'wp-user-frontend' ), // NOTE: before 2.5 the key was 'id' not 'term_id'
443
+ 'slug' => __( 'Slug', 'wp-user-frontend' ),
444
+ 'count' => __( 'Count', 'wp-user-frontend' ),
445
+ 'term_group' => __( 'Term Group', 'wp-user-frontend' ),
446
+ ),
447
+ 'section' => 'advanced',
448
+ 'priority' => 24,
449
+ 'default' => 'name',
450
+ ),
451
+
452
+ array(
453
+ 'name' => 'order',
454
+ 'title' => __( 'Order', 'wp-user-frontend' ),
455
+ 'type' => 'radio',
456
+ 'inline' => true,
457
+ 'options' => array(
458
+ 'ASC' => __( 'ASC', 'wp-user-frontend' ),
459
+ 'DESC' => __( 'DESC', 'wp-user-frontend' ),
460
+ ),
461
+ 'section' => 'advanced',
462
+ 'priority' => 25,
463
+ 'default' => 'ASC',
464
+ ),
465
+
466
+ array(
467
+ 'name' => 'exclude_type',
468
+ 'title' => __( 'Selection Type', 'wp-user-frontend' ),
469
+ 'type' => 'select',
470
+ 'options' => array(
471
+ 'exclude' => __( 'Exclude', 'wp-user-frontend' ),
472
+ 'include' => __( 'Include', 'wp-user-frontend' ),
473
+ 'child_of' => __( 'Child of', 'wp-user-frontend' ),
474
+ ),
475
+ 'section' => 'advanced',
476
+ 'priority' => 26,
477
+ 'default' => '',
478
+ ),
479
+
480
+ array(
481
+ 'name' => 'exclude',
482
+ 'title' => __( 'Selection Terms', 'wp-user-frontend' ),
483
+ 'type' => 'multiselect',
484
+ 'section' => 'advanced',
485
+ 'priority' => 27,
486
+ 'help_text' => __( 'Enter the term IDs as comma separated (without space) to exclude/include in the form.', 'wp-user-frontend' ),
487
+ 'options' => wpuf_get_terms( $tax_name ),
488
+ ),
489
+
490
+ array(
491
+ 'name' => 'woo_attr',
492
+ 'type' => 'checkbox',
493
+ 'is_single_opt' => true,
494
+ 'options' => array(
495
+ 'yes' => __( 'This taxonomy is a WooCommerce attribute', 'wp-user-frontend' )
496
+ ),
497
+ 'section' => 'advanced',
498
+ 'priority' => 28,
499
+ ),
500
+
501
+ array(
502
+ 'name' => 'woo_attr_vis',
503
+ 'type' => 'checkbox',
504
+ 'is_single_opt' => true,
505
+ 'options' => array(
506
+ 'yes' => __( 'Visible on product page', 'wp-user-frontend' )
507
+ ),
508
+ 'section' => 'advanced',
509
+ 'priority' => 29,
510
+ 'dependencies' => array(
511
+ 'woo_attr' => 'yes'
512
+ )
513
+ ),
514
+ );
515
+
516
+ if ( $word_restriction ) {
517
+ $properties[] = array(
518
+ 'name' => 'word_restriction',
519
+ 'title' => __( 'Word Restriction', 'wp-user-frontend' ),
520
+ 'type' => 'text',
521
+ 'section' => 'advanced',
522
+ 'priority' => 15,
523
+ 'help_text' => __( 'Numebr of words the author to be restricted in', 'wp-user-frontend' ),
524
+ );
525
+ }
526
+
527
+ return apply_filters( 'wpuf-form-builder-common-taxonomy-fields-properties', $properties );
528
+ }
529
+
530
+ /**
531
+ * Common properties of a text input field
532
+ *
533
+ * @param boolean $word_restriction
534
+ *
535
+ * @return array
536
+ */
537
+ public static function get_default_text_option_settings( $word_restriction = false ) {
538
+ $properties = array(
539
+ array(
540
+ 'name' => 'placeholder',
541
+ 'title' => __( 'Placeholder text', 'wp-user-frontend' ),
542
+ // 'type' => 'text-with-tag',
543
+ 'type' => 'text',
544
+ 'tag_filter' => 'no_fields', // we don't want to show any fields with merge tags, just basic tags
545
+ 'section' => 'advanced',
546
+ 'priority' => 10,
547
+ 'help_text' => __( 'Text for HTML5 placeholder attribute', 'wp-user-frontend' ),
548
+ ),
549
+
550
+ array(
551
+ 'name' => 'default',
552
+ 'title' => __( 'Default value', 'wp-user-frontend' ),
553
+ // 'type' => 'text-with-tag',
554
+ 'type' => 'text',
555
+ 'tag_filter' => 'no_fields',
556
+ 'section' => 'advanced',
557
+ 'priority' => 11,
558
+ 'help_text' => __( 'The default value this field will have', 'wp-user-frontend' ),
559
+ ),
560
+
561
+ array(
562
+ 'name' => 'size',
563
+ 'title' => __( 'Size', 'wp-user-frontend' ),
564
+ 'type' => 'text',
565
+ 'variation' => 'number',
566
+ 'section' => 'advanced',
567
+ 'priority' => 20,
568
+ 'help_text' => __( 'Size of this input field', 'wp-user-frontend' ),
569
+ ),
570
+ );
571
+
572
+ if ( $word_restriction ) {
573
+ $properties[] = array(
574
+ 'name' => 'word_restriction',
575
+ 'title' => __( 'Word Restriction', 'wp-user-frontend' ),
576
+ 'type' => 'text',
577
+ 'section' => 'advanced',
578
+ 'priority' => 15,
579
+ 'help_text' => __( 'Numebr of words the author to be restricted in', 'wp-user-frontend' ),
580
+ );
581
+ }
582
+
583
+ return apply_filters( 'wpuf-form-builder-common-text-fields-properties', $properties );
584
+ }
585
+
586
+ /**
587
+ * Option data for option based fields
588
+ *
589
+ * @param boolean $is_multiple
590
+ *
591
+ * @return array
592
+ */
593
+ public function get_default_option_dropdown_settings( $is_multiple = false ) {
594
+ return array(
595
+ 'name' => 'options',
596
+ 'title' => __( 'Options', 'wp-user-frontend' ),
597
+ 'type' => 'option-data',
598
+ 'is_multiple' => $is_multiple,
599
+ 'section' => 'basic',
600
+ 'priority' => 12,
601
+ 'help_text' => __( 'Add options for the form field', 'wp-user-frontend' ),
602
+ );
603
+ }
604
+
605
+ /**
606
+ * Common properties of a textarea field
607
+ *
608
+ * @return array
609
+ */
610
+ public function get_default_textarea_option_settings() {
611
+ return array(
612
+ array(
613
+ 'name' => 'rows',
614
+ 'title' => __( 'Rows', 'wp-user-frontend' ),
615
+ 'type' => 'text',
616
+ 'section' => 'advanced',
617
+ 'priority' => 10,
618
+ 'help_text' => __( 'Number of rows in textarea', 'wp-user-frontend' ),
619
+ ),
620
+
621
+ array(
622
+ 'name' => 'cols',
623
+ 'title' => __( 'Columns', 'wp-user-frontend' ),
624
+ 'type' => 'text',
625
+ 'section' => 'advanced',
626
+ 'priority' => 11,
627
+ 'help_text' => __( 'Number of columns in textarea', 'wp-user-frontend' ),
628
+ ),
629
+
630
+ array(
631
+ 'name' => 'placeholder',
632
+ 'title' => __( 'Placeholder text', 'wp-user-frontend' ),
633
+ 'type' => 'text',
634
+ 'section' => 'advanced',
635
+ 'priority' => 12,
636
+ 'help_text' => __( 'Text for HTML5 placeholder attribute', 'wp-user-frontend' ),
637
+ 'dependencies' => array(
638
+ 'rich' => 'no'
639
+ )
640
+ ),
641
+
642
+ array(
643
+ 'name' => 'default',
644
+ 'title' => __( 'Default value', 'wp-user-frontend' ),
645
+ 'type' => 'text',
646
+ 'section' => 'advanced',
647
+ 'priority' => 13,
648
+ 'help_text' => __( 'The default value this field will have', 'wp-user-frontend' ),
649
+ ),
650
+
651
+ array(
652
+ 'name' => 'rich',
653
+ 'title' => __( 'Textarea', 'wp-user-frontend' ),
654
+ 'type' => 'radio',
655
+ 'options' => array(
656
+ 'no' => __( 'Normal', 'wp-user-frontend' ),
657
+ 'yes' => __( 'Rich textarea', 'wp-user-frontend' ),
658
+ 'teeny' => __( 'Teeny Rich textarea', 'wp-user-frontend' ),
659
+ ),
660
+ 'section' => 'advanced',
661
+ 'priority' => 14,
662
+ 'default' => 'no',
663
+ ),
664
+
665
+ array(
666
+ 'name' => 'word_restriction',
667
+ 'title' => __( 'Word Restriction', 'wp-user-frontend' ),
668
+ 'type' => 'text',
669
+ 'section' => 'advanced',
670
+ 'priority' => 15,
671
+ 'help_text' => __( 'Numebr of words the author to be restricted in', 'wp-user-frontend' ),
672
+ ),
673
+ );
674
+ }
675
+
676
+
677
+
678
+ /**
679
+ * Prints form input label for admin
680
+ *
681
+ * @param array $attr
682
+ * @param integer $form_id
683
+ */
684
+ function field_print_label( $field, $form_id = 0 ) {
685
+
686
+ if(is_admin()){ ?>
687
+ <tr> <th><strong> <?php echo $field['label'] . $this->required_mark( $field ); ?> </strong></th> <td>
688
+ <?php } else { ?>
689
+
690
+ <li <?php $this->print_list_attributes( $field ); ?>>
691
+
692
+ <?php $this->print_label( $field, $form_id );
693
+ }
694
+ }
695
+
696
+
697
+ public function after_field_print_label(){
698
+
699
+ if(is_admin()){
700
+ echo '</td> </tr>';
701
+ } else {
702
+ echo '</li>';
703
+ }
704
+
705
+ }
706
+
707
+
708
+ /*
709
+ |--------------------------------------------------------------------------
710
+ | Field helper methods
711
+ |--------------------------------------------------------------------------
712
+ |
713
+ | Various helper method for rendering form fields
714
+ */
715
+
716
+ public function print_list_attributes( $field ) {
717
+ $label = isset( $field['label'] ) ? $field['label'] : '';
718
+ $el_name = !empty( $field['name'] ) ? $field['name'] : '';
719
+ $class_name = !empty( $field['css'] ) ? ' ' . $field['css'] : '';
720
+ $field_size = !empty( $field['width'] ) ? ' field-size-' . $field['width'] : '';
721
+
722
+ printf( 'class="wpuf-el %s%s%s" data-label="%s"', $el_name, $class_name, $field_size, $label );
723
+ }
724
+
725
+ /**
726
+ * Prints form input label
727
+ *
728
+ * @param array $attr
729
+ * @param integer $form_id
730
+ */
731
+ function print_label( $field, $form_id = 0 ) {
732
+ ?>
733
+ <div class="wpuf-label">
734
+ <label for="<?php echo isset( $field['name'] ) ? $field['name'] . '_' . $form_id : 'cls'; ?>"><?php echo $field['label'] . $this->required_mark( $field ); ?></label>
735
+ </div>
736
+ <?php
737
+ }
738
+
739
+ /**
740
+ * Check if a field is required
741
+ *
742
+ * @param array $field
743
+ *
744
+ * @return boolean
745
+ */
746
+ public function is_required( $field ) {
747
+ if ( isset( $field['required'] ) && $field['required'] == 'yes' ) {
748
+ return true;
749
+ }
750
+
751
+ return false;
752
+ }
753
+
754
+ /**
755
+ * Prints required field asterisk
756
+ *
757
+ * @param array $attr
758
+ * @return string
759
+ */
760
+ function required_mark( $field ) {
761
+ if ( $this->is_required( $field ) ) {
762
+ return ' <span class="required">*</span>';
763
+ }
764
+ }
765
+
766
+ /**
767
+ * Prints help text for a field
768
+ *
769
+ * @param array $field
770
+ */
771
+ function help_text( $field ) {
772
+ if ( empty( $field['help'] ) ) {
773
+ return;
774
+ }
775
+ ?>
776
+ <span class="wpuf-help"><?php echo stripslashes( $field['help'] ); ?></span>
777
+ <?php
778
+ }
779
+
780
+ /**
781
+ * Push logic to conditional array for processing
782
+ *
783
+ * @param array $form_field
784
+ * @param integer $form_id
785
+ *
786
+ * @return void
787
+ */
788
+ function conditional_logic( $form_field, $form_id ) {
789
+
790
+ if ( !isset( $form_field['wpuf_cond']['condition_status'] ) || $form_field['wpuf_cond']['condition_status'] != 'yes' ) {
791
+ return;
792
+ }
793
+
794
+ $cond_inputs = $form_field['wpuf_cond'];
795
+ $cond_inputs['condition_status'] = isset( $cond_inputs['condition_status'] ) ? $cond_inputs['condition_status'] : '';
796
+
797
+ if ( $cond_inputs['condition_status'] == 'yes') {
798
+ $cond_inputs['type'] = $form_field['template'];
799
+ $cond_inputs['name'] = $form_field['name'];
800
+ $cond_inputs['form_id'] = $form_id;
801
+ $condition = json_encode( $cond_inputs );
802
+
803
+ } else {
804
+ $condition = '';
805
+ }
806
+
807
+ // for section break
808
+ // if ( $form_field['template'] == 'section_break' ) {
809
+ // $cond_inputs['name'] = $form_field['name'] .'_'. $form_field['id'];
810
+ // $condition = json_encode( $cond_inputs );
811
+ // }
812
+
813
+ ?>
814
+ <script type="text/javascript">
815
+ wpuf_conditional_items.push(<?php echo $condition; ?>);
816
+ </script>
817
+ <?php
818
+ }
819
+
820
+ /**
821
+ * Prepare entry default, can be replaced through field classes
822
+ *
823
+ * @param $field
824
+ *
825
+ * @return mixed
826
+ */
827
+ public function prepare_entry( $field ) {
828
+
829
+ $value = !empty( $_POST[$field['name']] ) ? $_POST[$field['name']] : '';
830
+
831
+ if ( is_array( $value ) ) {
832
+
833
+ $entry_value = implode( WP_User_Frontend::$field_separator, $_POST[$field['name']] );
834
+
835
+ } else {
836
+ $entry_value = trim( $value );
837
+ }
838
+
839
+ return $entry_value;
840
+ }
841
+
842
+
843
+
844
+ /**
845
+ * Function to check word restriction
846
+ *
847
+ * @param $word_nums number of words allowed
848
+ */
849
+ function check_word_restriction_func($word_nums, $rich_text, $field_name) {
850
+ // bail out if it is dashboard
851
+ if ( is_admin() ) {
852
+ return;
853
+ }
854
+ ?>
855
+ <script type="text/javascript">
856
+ ;(function($) {
857
+ $(document).ready( function(){
858
+ WP_User_Frontend.editorLimit.bind(<?php printf( '%d, "%s", "%s"', $word_nums, $field_name, $rich_text ); ?>);
859
+ });
860
+ })(jQuery);
861
+ </script>
862
+ <?php
863
+
864
+ }
865
+
866
+
867
+ /**
868
+ * wpuf_visibility property for all fields
869
+ *
870
+ * @since 2.6
871
+ *
872
+ * @return array
873
+ */
874
+ public function get_default_visibility_prop( $default = 'everyone' ) {
875
+ return array(
876
+ 'selected' => $default,
877
+ 'choices' => array()
878
+ );
879
+ }
880
+ }
includes/fields/class-field-checkbox.php ADDED
@@ -0,0 +1,145 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Checkbox Field Class
5
+ */
6
+ class WPUF_Form_Field_Checkbox extends WPUF_Field_Contract {
7
+
8
+ function __construct() {
9
+ $this->name = __( 'Checkbox', 'wp-user-frontend' );
10
+ $this->input_type = 'checkbox_field';
11
+ $this->icon = 'check-square-o';
12
+ }
13
+
14
+ /**
15
+ * Render the Text field
16
+ *
17
+ * @param array $field_settings
18
+ * @param integer $form_id
19
+ * @param string $type
20
+ * @param integer $post_id
21
+ *
22
+ * @return void
23
+ */
24
+ public function render( $field_settings, $form_id, $type = 'post', $post_id = null ) {
25
+
26
+ if ( isset($post_id) && $post_id != '0' ) {
27
+ if ( $this->is_meta( $field_settings ) ) {
28
+ $selected = $this->get_meta( $post_id, $field_settings['name'], $type );
29
+ $selected = explode(" | ",$selected);
30
+ }
31
+ }else{
32
+ $selected = !empty( $field_settings['selected'] ) ? $field_settings['selected'] : array();
33
+ }
34
+
35
+ $this->field_print_label($field_settings, $form_id );
36
+
37
+ ?>
38
+
39
+ <div class="wpuf-fields" data-required="<?php echo $field_settings['required'] ?>" data-type="radio">
40
+
41
+ <?php
42
+ if ( $field_settings['options'] && count( $field_settings['options'] ) > 0 ) {
43
+
44
+ foreach ($field_settings['options'] as $value => $option) {
45
+
46
+ ?>
47
+ <label <?php echo $field_settings['inline'] == 'yes' ? 'class="wpuf-checkbox-inline"' : 'class="wpuf-checkbox-block"'; ?>>
48
+ <input type="checkbox" class="<?php echo 'wpuf_' . $field_settings['name']. '_'. $form_id; ?>" name="<?php echo $field_settings['name']; ?>[]" value="<?php echo esc_attr( $value ); ?>"<?php echo in_array( $value, $selected ) ? ' checked="checked"' : ''; ?> />
49
+ <?php echo $option; ?>
50
+ </label>
51
+ <?php
52
+ }
53
+ }
54
+ ?>
55
+
56
+ <?php $this->help_text( $field_settings ); ?>
57
+
58
+ </div>
59
+
60
+ <?php $this->after_field_print_label();
61
+
62
+ }
63
+
64
+ /**
65
+ * Get field options setting
66
+ *
67
+ * @return array
68
+ */
69
+ public function get_options_settings() {
70
+
71
+ $default_options = $this->get_default_option_settings();
72
+
73
+ $dropdown_options = array(
74
+ $this->get_default_option_dropdown_settings( true ),
75
+
76
+ array(
77
+ 'name' => 'inline',
78
+ 'title' => __( 'Show in inline list', 'wp-user-frontend' ),
79
+ 'type' => 'radio',
80
+ 'options' => array(
81
+ 'yes' => __( 'Yes', 'wp-user-frontend' ),
82
+ 'no' => __( 'No', 'wp-user-frontend' ),
83
+ ),
84
+ 'default' => 'no',
85
+ 'inline' => true,
86
+ 'section' => 'advanced',
87
+ 'priority' => 23,
88
+ 'help_text' => __( 'Show this option in an inline list', 'wp-user-frontend' ),
89
+ ),
90
+
91
+ );
92
+
93
+ return array_merge( $default_options, $dropdown_options );
94
+ }
95
+
96
+ /**
97
+ * Get the field props
98
+ *
99
+ * @return array
100
+ */
101
+ public function get_field_props() {
102
+
103
+ $defaults = $this->default_attributes();
104
+
105
+ $props = array(
106
+ 'input_type' => 'checkbox',
107
+ 'is_meta' => 'yes',
108
+ 'selected' => array(),
109
+ 'inline' => 'no',
110
+ 'options' => array( 'Option' => __( 'Option', 'wp-user-frontend' ) ),
111
+ 'id' => 0,
112
+ 'is_new' => true,
113
+ 'show_in_post' => 'yes',
114
+ 'hide_field_label' => 'no',
115
+ );
116
+
117
+ return array_merge( $defaults, $props );
118
+ }
119
+
120
+ /**
121
+ * Prepare entry
122
+ *
123
+ * @param $field
124
+ *
125
+ * @return mixed
126
+ */
127
+ public function prepare_entry( $field ) {
128
+
129
+ $entry_value = ( is_array( $_POST[$field['name']] ) && $_POST[$field['name']] ) ? $_POST[$field['name']] : array();
130
+
131
+ if ( $entry_value ) {
132
+ $new_val = array();
133
+
134
+ foreach ($entry_value as $option_key) {
135
+ $new_val[] = isset( $field['options'][$option_key] ) ? $field['options'][$option_key] : '';
136
+ }
137
+
138
+ $entry_value = implode( "|", $new_val );
139
+ } else {
140
+ $entry_value = '';
141
+ }
142
+
143
+ return $entry_value;
144
+ }
145
+ }
includes/fields/class-field-dropdown.php ADDED
@@ -0,0 +1,124 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * DropDown Field Class
5
+ */
6
+ class WPUF_Form_Field_Dropdown extends WPUF_Field_Contract {
7
+
8
+ function __construct() {
9
+ $this->name = __( 'Dropdown', 'wp-user-frontend' );
10
+ $this->input_type = 'dropdown_field';
11
+ $this->icon = 'caret-square-o-down';
12
+ }
13
+
14
+ /**
15
+ * Render the Dropdown field
16
+ *
17
+ * @param array $field_settings
18
+ * @param integer $form_id
19
+ * @param string $type
20
+ * @param integer $post_id
21
+ *
22
+ * @return void
23
+ */
24
+ public function render( $field_settings, $form_id, $type = 'post', $post_id = null ) {
25
+
26
+ if ( isset( $post_id ) && $post_id != '0' ) {
27
+ $selected = $this->get_meta( $post_id, $field_settings['name'], $type );
28
+ } else {
29
+ $selected = isset( $field_settings['selected'] ) ? $field_settings['selected'] : '';
30
+ }
31
+
32
+ $name = $field_settings['name'];
33
+
34
+ $this->field_print_label($field_settings, $form_id );
35
+
36
+ ?>
37
+
38
+ <div class="wpuf-fields">
39
+ <select
40
+ class="<?php echo 'wpuf_'. $field_settings['name'] .'_'. $form_id; ?>"
41
+ id="<?php echo $field_settings['name'] . '_' . $form_id; ?>"
42
+ name="<?php echo $name; ?>"
43
+ data-required="<?php echo $field_settings['required'] ?>"
44
+ data-type="select">
45
+
46
+ <?php if ( !empty( $field_settings['first'] ) ) { ?>
47
+ <option value=""><?php echo $field_settings['first']; ?></option>
48
+ <?php } ?>
49
+
50
+ <?php
51
+ if ( $field_settings['options'] && count( $field_settings['options'] ) > 0 ) {
52
+ foreach ($field_settings['options'] as $value => $option) {
53
+ $current_select = selected( $selected, $value, false );
54
+ ?>
55
+ <option value="<?php echo esc_attr( $value ); ?>"<?php echo $current_select; ?>><?php echo $option; ?></option>
56
+ <?php
57
+ }
58
+ }
59
+ ?>
60
+ </select>
61
+ <?php $this->help_text( $field_settings ); ?>
62
+ </div>
63
+
64
+ <?php $this->after_field_print_label();
65
+ }
66
+
67
+ /**
68
+ * Get field options setting
69
+ *
70
+ * @return array
71
+ */
72
+ public function get_options_settings() {
73
+ $default_options = $this->get_default_option_settings();
74
+ $dropdown_options = array(
75
+ $this->get_default_option_dropdown_settings(),
76
+
77
+ array(
78
+ 'name' => 'first',
79
+ 'title' => __( 'Select Text', 'wp-user-frontend' ),
80
+ 'type' => 'text',
81
+ 'section' => 'basic',
82
+ 'priority' => 13,
83
+ 'help_text' => __( "First element of the select dropdown. Leave this empty if you don't want to show this field", 'wp-user-frontend' ),
84
+ ),
85
+ );
86
+
87
+ return array_merge( $default_options, $dropdown_options );
88
+ }
89
+
90
+ /**
91
+ * Get the field props
92
+ *
93
+ * @return array
94
+ */
95
+ public function get_field_props() {
96
+ $defaults = $this->default_attributes();
97
+ $props = array(
98
+ 'input_type' => 'select',
99
+ 'label' => __( 'Dropdown', 'wp-user-frontend' ),
100
+ 'is_meta' => 'yes',
101
+ 'options' => array( 'Option' => __( 'Option', 'wp-user-frontend' ) ),
102
+ 'first' => __( '- select -', 'wp-user-frontend' ),
103
+ 'id' => 0,
104
+ 'is_new' => true,
105
+ 'show_in_post' => 'yes',
106
+ 'hide_field_label' => 'no',
107
+ );
108
+
109
+ return array_merge( $defaults, $props );
110
+ }
111
+
112
+ /**
113
+ * Prepare entry
114
+ *
115
+ * @param $field
116
+ *
117
+ * @return mixed
118
+ */
119
+ public function prepare_entry( $field ) {
120
+
121
+ $val = $_POST[$field['name']];
122
+ return isset( $field['options'][$val] ) ? $field['options'][$val] : '';
123
+ }
124
+ }
includes/fields/class-field-email.php ADDED
@@ -0,0 +1,123 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Email Field Class
5
+ */
6
+ class WPUF_Form_Field_Email extends WPUF_Form_Field_Text {
7
+
8
+ function __construct() {
9
+ $this->name = __( 'Email Address', 'wp-user-frontend' );
10
+ $this->input_type = 'email_address';
11
+ $this->icon = 'envelope-o';
12
+ }
13
+
14
+ /**
15
+ * Render the Email field
16
+ *
17
+ * @param array $field_settings
18
+ * @param integer $form_id
19
+ * @param string $type
20
+ * @param integer $post_id
21
+ *
22
+ * @return void
23
+ */
24
+ public function render( $field_settings, $form_id, $type = 'post', $post_id = null ) {
25
+
26
+
27
+ // let's not show the email field if user choose to auto populate for logged users
28
+ if ( isset( $field_settings['auto_populate'] ) && $field_settings['auto_populate'] == 'yes' && is_user_logged_in() ) {
29
+ return;
30
+ }
31
+
32
+ if ( isset( $post_id ) && $post_id != '0' ) {
33
+
34
+ if ( $this->is_meta( $field_settings ) ) {
35
+ $value = $this->get_meta( $post_id, $field_settings['name'], $type );
36
+ }
37
+
38
+ } else {
39
+ $value = $field_settings['default'];
40
+ }
41
+
42
+ $this->field_print_label($field_settings, $form_id );
43
+
44
+ ?>
45
+
46
+ <div class="wpuf-fields">
47
+ <input
48
+ id="<?php echo $field_settings['name'] . '_' . $form_id; ?>"
49
+ type="email"
50
+ class="email <?php echo ' wpuf_'.$field_settings['name'].'_'.$form_id; ?>"
51
+ data-duplicate="<?php echo isset( $field_settings['duplicate'] ) ? $field_settings['duplicate'] : 'no'; ?>"
52
+ data-required="<?php echo $field_settings['required'] ?>"
53
+ data-type="email"
54
+ name="<?php echo esc_attr( $field_settings['name'] ); ?>"
55
+ placeholder="<?php echo esc_attr( $field_settings['placeholder'] ); ?>"
56
+ value="<?php echo esc_attr( $value ) ?>"
57
+ size="<?php echo esc_attr( $field_settings['size'] ) ?>"
58
+ autocomplete="email"
59
+ />
60
+ <?php $this->help_text( $field_settings ); ?>
61
+ </div>
62
+
63
+ <?php $this->after_field_print_label();
64
+
65
+
66
+ }
67
+
68
+ /**
69
+ * Get field options setting
70
+ *
71
+ * @return array
72
+ */
73
+ public function get_options_settings() {
74
+ $default_options = $this->get_default_option_settings();
75
+ $default_text_options = $this->get_default_text_option_settings();
76
+ return array_merge( $default_options, $default_text_options);
77
+ }
78
+
79
+ /**
80
+ * Prepare entry default, can be replaced through field classes
81
+ *
82
+ * @param $field
83
+ *
84
+ * @return mixed
85
+ */
86
+ public function prepare_entry( $field ) {
87
+
88
+ if ( isset( $field['auto_populate'] ) && $field['auto_populate'] == 'yes' && is_user_logged_in() ) {
89
+
90
+ $user = wp_get_current_user();
91
+
92
+ if ( ! empty( $user->user_email ) ) {
93
+ return $user->user_email;
94
+ }
95
+ }
96
+
97
+ $value = !empty( $_POST[$field['name']] ) ? $_POST[$field['name']] : '';
98
+
99
+ return sanitize_text_field( trim( $value ) );
100
+ }
101
+
102
+ /**
103
+ * Get the field props
104
+ *
105
+ * @return array
106
+ */
107
+ public function get_field_props() {
108
+
109
+ $defaults = $this->default_attributes();
110
+
111
+ $props=array(
112
+ 'input_type' => 'email',
113
+ 'size' => 40,
114
+ 'id' => 0,
115
+ 'is_new' => true,
116
+ 'show_in_post' => 'yes',
117
+ 'hide_field_label' => 'no',
118
+ );
119
+
120
+ return array_merge($defaults,$props);
121
+
122
+ }
123
+ }
includes/fields/class-field-featured-image.php ADDED
@@ -0,0 +1,144 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Feature Image Field Class
5
+ */
6
+ class WPUF_Form_Field_Featured_Image extends WPUF_Field_Contract {
7
+
8
+ function __construct() {
9
+ $this->name = __( 'Featured Image', 'wp-user-frontend' );
10
+ $this->input_type = 'featured_image';
11
+ $this->icon = 'file-image-o';
12
+ }
13
+
14
+ /**
15
+ * Render the Feature Image field
16
+ *
17
+ * @param array $field_settings
18
+ * @param integer $form_id
19
+ * @param string $type
20
+ * @param integer $post_id
21
+ *
22
+ * @return void
23
+ */
24
+ public function render( $field_settings, $form_id, $type = 'post', $post_id = null ) {
25
+
26
+
27
+ $has_featured_image = false;
28
+
29
+ $unique_id = sprintf( '%s-%d', $field_settings['name'], $form_id );
30
+
31
+ if ( isset( $post_id ) ) {
32
+
33
+ // it's a featured image then
34
+ $thumb_id = get_post_thumbnail_id( $post_id );
35
+
36
+ if ( $thumb_id ) {
37
+ $featured_image = WPUF_Upload::attach_html( $thumb_id, 'featured_image' );
38
+ $has_featured_image=true;
39
+ }
40
+
41
+ }
42
+
43
+ $this->field_print_label($field_settings, $form_id );
44
+
45
+
46
+
47
+ ?>
48
+
49
+ <div class="wpuf-fields">
50
+ <div id="wpuf-<?php echo $unique_id; ?>-upload-container">
51
+ <div class="wpuf-attachment-upload-filelist" data-type="file" data-required="<?php echo $field_settings['required']; ?>">
52
+ <a id="wpuf-<?php echo $unique_id; ?>-pickfiles" data-form_id="<?php echo $form_id; ?>" class="button file-selector <?php echo ' wpuf_' . $field_settings['name'] . '_' . $form_id; ?>" href="#"><?php echo $field_settings['button_label']; ?></a>
53
+
54
+ <ul class="wpuf-attachment-list thumbnails">
55
+
56
+ <?php
57
+ if ( $has_featured_image ) {
58
+ echo $featured_image;
59
+ }
60
+ ?>
61
+
62
+ </ul>
63
+ </div>
64
+ </div><!-- .container -->
65
+
66
+ <?php $this->help_text( $field_settings ); ?>
67
+
68
+ </div> <!-- .wpuf-fields -->
69
+
70
+ <script type="text/javascript">
71
+ ;(function($) {
72
+ $(document).ready( function(){
73
+ var uploader = new WPUF_Uploader('wpuf-<?php echo $unique_id; ?>-pickfiles', 'wpuf-<?php echo $unique_id; ?>-upload-container', <?php echo $field_settings['count']; ?>, '<?php echo $field_settings['name']; ?>', 'jpg,jpeg,gif,png,bmp', <?php echo $field_settings['max_size'] ?>);
74
+ wpuf_plupload_items.push(uploader);
75
+ });
76
+ })(jQuery);
77
+ </script>
78
+
79
+ <?php $this->after_field_print_label();
80
+ }
81
+
82
+ /**
83
+ * Get field options setting
84
+ *
85
+ * @return array
86
+ */
87
+ public function get_options_settings() {
88
+ $default_options = $this->get_default_option_settings(false, array('dynamic') ); // exclude dynamic
89
+
90
+ $settings = array(
91
+ array(
92
+ 'name' => 'max_size',
93
+ 'title' => __( 'Max. file size', 'wp-user-frontend' ),
94
+ 'type' => 'text',
95
+ 'section' => 'advanced',
96
+ 'priority' => 20,
97
+ 'help_text' => __( 'Enter maximum upload size limit in KB', 'wp-user-frontend' ),
98
+ ),
99
+ array(
100
+ 'name' => 'button_label',
101
+ 'title' => __( 'Button Label', 'wp-user-frontend' ),
102
+ 'type' => 'text',
103
+ 'default' => __( 'Select Image', 'wp-user-frontend' ),
104
+ 'section' => 'basic',
105
+ 'priority' => 22,
106
+ 'help_text' => __( 'Enter a label for the Select button', 'wp-user-frontend' ),
107
+ )
108
+ );
109
+
110
+ return array_merge( $default_options, $settings );
111
+ }
112
+
113
+ /**
114
+ * Get the field props
115
+ *
116
+ * @return array
117
+ */
118
+ public function get_field_props() {
119
+ $defaults = $this->default_attributes();
120
+ $props = array(
121
+ 'input_type' => 'image_upload',
122
+ 'max_size' => '1024',
123
+ 'button_label' => __( 'Featured Image', 'wp-user-frontend' ),
124
+ 'is_meta' => 'no',
125
+ 'max_size' => '1024',
126
+ 'count' => '1',
127
+ 'id' => 0,
128
+ 'is_new' => true,
129
+ );
130
+
131
+ return array_merge( $defaults, $props );
132
+ }
133
+
134
+ /**
135
+ * Prepare entry
136
+ *
137
+ * @param $field
138
+ *
139
+ * @return @return mixed
140
+ */
141
+ public function prepare_entry( $field ) {
142
+ return isset( $_POST['wpuf_files'][$field['name']] ) ? $_POST['wpuf_files'][$field['name']] : array();
143
+ }
144
+ }
includes/fields/class-field-hidden.php ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Hidden Field Class
5
+ */
6
+ class WPUF_Form_Field_Hidden extends WPUF_Field_Contract {
7
+
8
+ function __construct() {
9
+ $this->name = __( 'Hidden Field', 'wp-user-frontend' );
10
+ $this->input_type = 'custom_hidden_field';
11
+ $this->icon = 'eye-slash';
12
+ }
13
+
14
+ /**
15
+ * Render the Hidden field
16
+ *
17
+ * @param array $field_settings
18
+ * @param integer $form_id
19
+ * @param string $type
20
+ * @param integer $post_id
21
+ *
22
+ * @return void
23
+ */
24
+ public function render( $field_settings, $form_id, $type = 'post', $post_id = null) {
25
+
26
+ ?>
27
+ <input type="hidden" name="<?php echo esc_attr( $field_settings['name'] ); ?>" value="<?php echo esc_attr( $field_settings['meta_value'] ); ?>">
28
+ <?php
29
+ }
30
+
31
+ /**
32
+ * Get field options setting
33
+ *
34
+ * @return array
35
+ */
36
+ public function get_options_settings() {
37
+
38
+ $settings = array(
39
+ array(
40
+ 'name' => 'name',
41
+ 'title' => __( 'Meta Key', 'wp-user-frontend' ),
42
+ 'type' => 'text',
43
+ 'section' => 'basic',
44
+ 'priority' => 10,
45
+ 'help_text' => __( 'Name of the meta key this field will save to', 'wp-user-frontend' ),
46
+ ),
47
+
48
+ array(
49
+ 'name' => 'meta_value',
50
+ 'title' => __( 'Meta Value', 'wp-user-frontend' ),
51
+ 'type' => 'text',
52
+ 'section' => 'basic',
53
+ 'priority' => 11,
54
+ 'help_text' => __( 'Enter the meta value', 'wp-user-frontend' ),
55
+ ),
56
+ );
57
+
58
+ return $settings;
59
+ }
60
+
61
+ /**
62
+ * Get the field props
63
+ *
64
+ * @return array
65
+ */
66
+ public function get_field_props() {
67
+
68
+ $defaults = $this->default_attributes();
69
+
70
+ $props = array(
71
+ 'input_type' => 'hidden',
72
+ 'template' => $this->get_type(),
73
+ 'name' => '',
74
+ 'meta_value' => '',
75
+ 'is_meta' => 'yes',
76
+ 'id' => 0,
77
+ 'is_new' => true,
78
+ 'wpuf_cond' => null
79
+ );
80
+
81
+ return array_merge($defaults,$props);
82
+ }
83
+ }
includes/fields/class-field-html.php ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Html Field Class
5
+ */
6
+ class WPUF_Form_Field_HTML extends WPUF_Field_Contract {
7
+
8
+ function __construct() {
9
+ $this->name = __( 'Custom HTML', 'wp-user-frontend' );
10
+ $this->input_type = 'custom_html';
11
+ $this->icon = 'code';
12
+ }
13
+
14
+ /**
15
+ * Render the html field
16
+ *
17
+ * @param array $field_settings
18
+ * @param integer $form_id
19
+ * @param string $type
20
+ * @param integer $post_id
21
+ *
22
+ * @return void
23
+ */
24
+ public function render( $field_settings, $form_id, $type = 'post', $post_id = null) {
25
+
26
+ ?>
27
+ <li <?php $this->print_list_attributes( $field_settings ); ?>>
28
+
29
+ <div class="wpuf-fields <?php echo 'html_' . $form_id; ?><?php echo ' wpuf_'.$field_settings['name'].'_'.$form_id; ?>">
30
+ <?php echo $field_settings['html']; ?>
31
+ </div>
32
+
33
+ </li>
34
+
35
+ <?php
36
+ }
37
+
38
+ /**
39
+ * It's a full width block
40
+ *
41
+ * @return boolean
42
+ */
43
+ public function is_full_width() {
44
+ return true;
45
+ }
46
+
47
+ /**
48
+ * Get field options setting
49
+ *
50
+ * @return array
51
+ */
52
+ public function get_options_settings() {
53
+ $settings = array(
54
+ array(
55
+ 'name' => 'html',
56
+ 'title' => __( 'Html Codes', 'wp-user-frontend' ),
57
+ 'type' => 'textarea',
58
+ 'section' => 'basic',
59
+ 'priority' => 11,
60
+ 'help_text' => __( 'Paste your HTML codes, WordPress shortcodes will also work here', 'wp-user-frontend' ),
61
+ ),
62
+ );
63
+
64
+ return $settings;
65
+ }
66
+
67
+ /**
68
+ * Get the field props
69
+ *
70
+ * @return array
71
+ */
72
+ public function get_field_props() {
73
+ $props = array(
74
+ 'input_type' => 'html',
75
+ 'template' => $this->get_type(),
76
+ 'label' => $this->get_name(),
77
+ 'html' => sprintf( '%s', __( 'HTML Section', 'wp-user-frontend' ) ),
78
+ 'id' => 0,
79
+ 'is_new' => true,
80
+ 'wpuf_cond' => null
81
+ );
82
+
83
+ return $props;
84
+ }
85
+ }
includes/fields/class-field-image.php ADDED
@@ -0,0 +1,166 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Image Field Class
5
+ */
6
+ class WPUF_Form_Field_Image extends WPUF_Field_Contract {
7
+
8
+ function __construct() {
9
+ $this->name = __( 'Image Upload', 'wp-user-frontend' );
10
+ $this->input_type = 'image_upload';
11
+ $this->icon = 'file-image-o';
12
+ }
13
+
14
+ /**
15
+ * Render the Image field
16
+ *
17
+ * @param array $field_settings
18
+ * @param integer $form_id
19
+ * @param string $type
20
+ * @param integer $post_id
21
+ *
22
+ * @return void
23
+ */
24
+ public function render( $field_settings, $form_id, $type = 'post', $post_id = null) {
25
+
26
+ $has_images = false;
27
+
28
+ if ( isset($post_id) && $post_id != '0' ) {
29
+
30
+ if ( $this->is_meta( $field_settings ) ) {
31
+
32
+ $images = $this->get_meta( $post_id, $field_settings['name'], $type, false );
33
+
34
+ if ( $images ) {
35
+
36
+ if( is_serialized( $images[0] ) ) {
37
+ $images = maybe_unserialize( $images[0] );
38
+ }
39
+
40
+ if ( is_array( $images[0] ) ) {
41
+ $images = $images[0];
42
+ }
43
+ }
44
+ $has_images = true;
45
+ }
46
+
47
+ }
48
+
49
+ $unique_id = sprintf( '%s-%d', $field_settings['name'], $form_id );
50
+
51
+
52
+ $this->field_print_label($field_settings, $form_id );
53
+
54
+ ?>
55
+
56
+ <div class="wpuf-fields">
57
+ <div id="wpuf-<?php echo $unique_id; ?>-upload-container">
58
+ <div class="wpuf-attachment-upload-filelist" data-type="file" data-required="<?php echo $field_settings['required']; ?>">
59
+ <a id="wpuf-<?php echo $unique_id; ?>-pickfiles" data-form_id="<?php echo $form_id; ?>" class="button file-selector <?php echo ' wpuf_' . $field_settings['name'] . '_' . $form_id; ?>" href="#"><?php echo $field_settings['button_label']; ?></a>
60
+
61
+ <ul class="wpuf-attachment-list thumbnails">
62
+
63
+ <?php
64
+ if ( $has_images ) {
65
+ foreach ($images as $attach_id) {
66
+ echo WPUF_Upload::attach_html( $attach_id, $field_settings['name'] );
67
+ }
68
+ }
69
+ ?>
70
+ </ul>
71
+ </div>
72
+ </div><!-- .container -->
73
+
74
+ <?php $this->help_text( $field_settings ); ?>
75
+
76
+ </div> <!-- .wpuf-fields -->
77
+
78
+ <script type="text/javascript">
79
+ ;(function($) {
80
+ $(document).ready( function(){
81
+ var uploader = new WPUF_Uploader('wpuf-<?php echo $unique_id; ?>-pickfiles', 'wpuf-<?php echo $unique_id; ?>-upload-container', <?php echo $field_settings['count']; ?>, '<?php echo $field_settings['name']; ?>', 'jpg,jpeg,gif,png,bmp', <?php echo $field_settings['max_size'] ?>);
82
+ wpuf_plupload_items.push(uploader);
83
+ });
84
+ })(jQuery);
85
+ </script>
86
+
87
+
88
+ <?php $this->after_field_print_label();
89
+
90
+ }
91
+
92
+ /**
93
+ * Get field options setting
94
+ *
95
+ * @return array
96
+ */
97
+ public function get_options_settings() {
98
+ $default_options = $this->get_default_option_settings(true, array('dynamic', 'width') ); // exclude dynamic
99
+
100
+ $settings = array(
101
+ array(
102
+ 'name' => 'max_size',
103
+ 'title' => __( 'Max. file size', 'wp-user-frontend' ),
104
+ 'type' => 'text',
105
+ 'section' => 'advanced',
106
+ 'priority' => 20,
107
+ 'help_text' => __( 'Enter maximum upload size limit in KB', 'wp-user-frontend' ),
108
+ ),
109
+
110
+ array(
111
+ 'name' => 'count',
112
+ 'title' => __( 'Max. files', 'wp-user-frontend' ),
113
+ 'type' => 'text',
114
+ 'section' => 'advanced',
115
+ 'priority' => 21,
116
+ 'help_text' => __( 'Number of images can be uploaded', 'wp-user-frontend' ),
117
+ ),
118
+ array(
119
+ 'name' => 'button_label',
120
+ 'title' => __( 'Button Label', 'wp-user-frontend' ),
121
+ 'type' => 'text',
122
+ 'default' => __( 'Select Image', 'wp-user-frontend' ),
123
+ 'section' => 'basic',
124
+ 'priority' => 22,
125
+ 'help_text' => __( 'Enter a label for the Select button', 'wp-user-frontend' ),
126
+ )
127
+ );
128
+
129
+ return array_merge( $default_options, $settings );
130
+ }
131
+
132
+ /**
133
+ * Get the field props
134
+ *
135
+ * @return array
136
+ */
137
+ public function get_field_props() {
138
+ $defaults = $this->default_attributes();
139
+ $props = array(
140
+ 'input_type' => 'image_upload',
141
+ 'max_size' => '1024',
142
+ 'count' => '1',
143
+ 'button_label' => __( 'Select Image', 'wp-user-frontend' ),
144
+ 'is_meta' => 'yes',
145
+ 'max_size' => '1024',
146
+ 'count' => '1',
147
+ 'id' => 0,
148
+ 'is_new' => true,
149
+ 'show_in_post' => 'yes',
150
+ 'hide_field_label' => 'no',
151
+ );
152
+
153
+ return array_merge( $defaults, $props );
154
+ }
155
+
156
+ /**
157
+ * Prepare entry
158
+ *
159
+ * @param $field
160
+ *
161
+ * @return @return mixed
162
+ */
163
+ public function prepare_entry( $field ) {
164
+ return isset( $_POST['wpuf_files'][$field['name']] ) ? $_POST['wpuf_files'][$field['name']] : array();
165
+ }
166
+ }
includes/fields/class-field-multidropdown.php ADDED
@@ -0,0 +1,127 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * MultiDropdown Field Class
5
+ */
6
+ class WPUF_Form_Field_MultiDropdown extends WPUF_Form_Field_Dropdown {
7
+
8
+ function __construct() {
9
+ $this->name = __( 'Multi Select', 'wp-user-frontend' );
10
+ $this->input_type = 'multiple_select';
11
+ $this->icon = 'list-ul';
12
+ }
13
+
14
+ /**
15
+ * Render the MultiDropDown field
16
+ *
17
+ * @param array $field_settings
18
+ * @param integer $form_id
19
+ * @param string $type
20
+ * @param integer $post_id
21
+ *
22
+ * @return void
23
+ */
24
+ public function render( $field_settings, $form_id, $type = 'post', $post_id = null) {
25
+
26
+ if ( isset( $post_id ) && $post_id != '0' ) {
27
+
28
+ $selected = $this->get_meta( $post_id, $field_settings['name'], $type );
29
+
30
+ if ( is_serialized( $selected ) ) {
31
+ $selected = maybe_unserialize( $selected );
32
+ } elseif ( is_array( $selected ) ) {
33
+ $selected = $selected;
34
+ } else {
35
+ $selected = explode( " | ", $selected );
36
+ }
37
+
38
+ } else {
39
+
40
+ $selected = isset( $field_settings['selected'] ) ? $field_settings['selected'] : '';
41
+
42
+ $selected = is_array( $selected ) ? $selected : array();
43
+
44
+ }
45
+
46
+ $name = $field_settings['name'] . '[]';
47
+
48
+ $this->field_print_label($field_settings, $form_id );
49
+
50
+ ?>
51
+
52
+ <?php do_action( 'WPUF_multidropdown_field_after_label', $field_settings ); ?>
53
+
54
+ <div class="wpuf-fields">
55
+ <select multiple="multiple" class="multiselect <?php echo 'wpuf_'. $field_settings['name'] .'_'. $form_id; ?>" id="<?php echo $field_settings['name'] . '_' . $form_id; ?>" name="<?php echo $name; ?>" mulitple="multiple" data-required="<?php echo $field_settings['required'] ?>" data-type="multiselect">
56
+
57
+ <?php if ( !empty( $field_settings['first'] ) ) { ?>
58
+ <option value=""><?php echo $field_settings['first']; ?></option>
59
+ <?php } ?>
60
+
61
+ <?php
62
+ if ( $field_settings['options'] && count( $field_settings['options'] ) > 0 ) {
63
+ foreach ($field_settings['options'] as $value => $option) {
64
+ $current_select = selected( in_array( $value, $selected ), true, false );
65
+ ?>
66
+ <option value="<?php echo esc_attr( $value ); ?>"<?php echo $current_select; ?>><?php echo $option; ?></option>
67
+ <?php
68
+ }
69
+ }
70
+ ?>
71
+ </select>
72
+ <?php $this->help_text( $field_settings ); ?>
73
+ </div>
74
+
75
+
76
+ <?php $this->after_field_print_label();
77
+
78
+
79
+ }
80
+
81
+ /**
82
+ * Get the field props
83
+ *
84
+ * @return array
85
+ */
86
+ public function get_field_props() {
87
+ $defaults = $this->default_attributes();
88
+ $props = array(
89
+ 'input_type' => 'multiselect',
90
+ 'label' => __( 'Multi Select', 'wp-user-frontend' ),
91
+ 'is_meta' => 'yes',
92
+ 'selected' => array(),
93
+ 'options' => array( 'Option' => __( 'Option', 'wp-user-frontend' ) ),
94
+ 'first' => __( '- select -', 'wp-user-frontend' ),
95
+ 'id' => 0,
96
+ 'is_new' => true,
97
+ 'show_in_post' => 'yes',
98
+ 'hide_field_label' => 'no',
99
+ );
100
+ return array_merge( $defaults, $props );
101
+ }
102
+
103
+ /**
104
+ * Prepare entry
105
+ *
106
+ * @param $field
107
+ *
108
+ * @return mixed
109
+ */
110
+ public function prepare_entry( $field ) {
111
+
112
+ $entry_value = ( is_array( $_POST[$field['name']] ) && $_POST[$field['name']] ) ? $_POST[$field['name']] : array();
113
+
114
+ if ( $entry_value ) {
115
+ $new_val = array();
116
+
117
+ foreach ($entry_value as $option_key) {
118
+ $new_val[] = isset( $field['options'][$option_key] ) ? $field['options'][$option_key] : '';
119
+ }
120
+ $entry_value = implode( WP_User_Frontend::$field_separator, $new_val );
121
+ } else {
122
+ $entry_value = '';
123
+ }
124
+
125
+ return $entry_value;
126
+ }
127
+ }
includes/fields/class-field-numeric.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // Numeric Field Class
3
+ class WPUF_Form_Field_Numeric extends WPUF_Field_Contract {
4
+
5
+ function __construct() {
6
+ $this->name = __( 'Numeric Field', 'wp-user-frontend' );
7
+ $this->input_type = 'numeric_text_field';
8
+ $this->icon = 'hashtag';
9
+ }
10
+
11
+ /**
12
+ * Check if it's a pro feature
13
+ *
14
+ * @return boolean
15
+ */
16
+
17
+ public function is_pro() {
18
+ return true;
19
+ }
20
+
21
+ public function render( $field_settings, $form_id, $post_id=null, $user_id=null ){
22
+
23
+ }
24
+
25
+ public function get_options_settings(){
26
+ }
27
+
28
+ public function get_field_props(){
29
+ $defaults = $this->default_attributes();
30
+ $props = array();
31
+ return array_merge( $defaults, $props );
32
+ }
33
+
34
+ }
includes/fields/class-field-post-content.php ADDED
@@ -0,0 +1,179 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ //Post Title Field class
3
+ class WPUF_Form_Field_Post_Content extends WPUF_Field_Contract {
4
+
5
+ function __construct() {
6
+ $this->name = __( 'Post Content', 'wp-user-frontend' );
7
+ $this->input_type = 'post_content';
8
+ $this->icon = 'text-width';
9
+ }
10
+
11
+ /**
12
+ * Render the PostTitle field
13
+ *
14
+ * @param array $field_settings
15
+ * @param integer $form_id
16
+ * @param string $type
17
+ * @param integer $post_id
18
+ *
19
+ * @return void
20
+ */
21
+ public function render( $field_settings, $form_id, $type = 'post', $post_id = null ) {
22
+
23
+ if( isset( $post_id ) ) {
24
+ $value = get_post_field( $field_settings['name'], $post_id );
25
+ } else {
26
+ $value = $field_settings['default'];
27
+ }
28
+
29
+ $req_class = ( $field_settings['required'] == 'yes' ) ? 'required' : 'rich-editor';
30
+ $textarea_id = $field_settings['name'] ? $field_settings['name'] . '_' . $form_id : 'textarea_';
31
+ ?>
32
+ <li <?php $this->print_list_attributes( $field_settings ); ?>>
33
+ <?php $this->print_label( $field_settings, $form_id ); ?>
34
+
35
+ <?php if ( in_array( $field_settings['rich'], array( 'yes', 'teeny' ) ) ) { ?>
36
+ <div class="wpuf-fields wpuf-rich-validation <?php printf( 'wpuf_%s_%s', $field_settings['name'], $form_id ); ?>" data-type="rich" data-required="<?php echo esc_attr( $field_settings['required'] ); ?>" data-id="<?php echo esc_attr( $field_settings['name'] ) . '_' . $form_id; ?>" data-name="<?php echo esc_attr( $field_settings['name'] ); ?>">
37
+ <?php } else { ?>
38
+ <div class="wpuf-fields">
39
+ <?php } ?>
40
+
41
+ <?php
42
+
43
+ if ( isset( $field_settings['insert_image'] ) && $field_settings['insert_image'] == 'yes' ) { ?>
44
+ <div id="wpuf-insert-image-container">
45
+ <a class="wpuf-button wpuf-insert-image" id="wpuf-insert-image_<?php echo $form_id; ?>" href="#" data-form_id="<?php echo $form_id; ?>">
46
+ <span class="wpuf-media-icon"></span>
47
+ <?php _e( 'Insert Photo', 'wp-user-frontend' ); ?>
48
+ </a>
49
+ </div>
50
+
51
+ <script type="text/javascript">
52
+ ;(function($) {
53
+ $(document).ready( function(){
54
+ WP_User_Frontend.insertImage('wpuf-insert-image_<?php echo $form_id; ?>', '<?php echo $form_id; ?>');
55
+ });
56
+ })(jQuery);
57
+ </script>
58
+ <?php }
59
+
60
+ if ( $field_settings['rich'] == 'yes' ) {
61
+ $editor_settings = array(
62
+ // 'textarea_rows' => $field_settings['rows'],
63
+ 'quicktags' => false,
64
+ 'media_buttons' => false,
65
+ 'editor_class' => $req_class,
66
+ 'textarea_name' => $field_settings['name']
67
+ );
68
+
69
+ $editor_settings = apply_filters( 'wpuf_textarea_editor_args' , $editor_settings );
70
+ wp_editor( $value, $textarea_id, $editor_settings );
71
+
72
+ } elseif( $field_settings['rich'] == 'teeny' ) {
73
+
74
+ $editor_settings = array(
75
+ 'textarea_rows' => $field_settings['rows'],
76
+ 'quicktags' => false,
77
+ 'media_buttons' => false,
78
+ 'teeny' => true,
79
+ 'editor_class' => $req_class,
80
+ 'textarea_name' => $field_settings['name']
81
+ );
82
+
83
+ $editor_settings = apply_filters( 'wpuf_textarea_editor_args' , $editor_settings );
84
+ wp_editor( $value, $textarea_id, $editor_settings );
85
+
86
+ } else {
87
+ ?>
88
+ <textarea
89
+ class="textareafield <?php echo ' wpuf_'.$field_settings['name'].'_'.$form_id; ?>"
90
+ id="<?php echo $field_settings['name'] . '_' . $form_id; ?>"
91
+ name="<?php echo $field_settings['name']; ?>"
92
+ data-required="<?php echo $field_settings['required'] ?>"
93
+ data-type="textarea"
94
+ placeholder="<?php echo esc_attr( $field_settings['placeholder'] ); ?>"
95
+ rows="<?php echo $field_settings['rows']; ?>"
96
+ cols="<?php echo $field_settings['cols']; ?>"
97
+ ><?php echo esc_textarea( $value ) ?></textarea>
98
+ <span class="wpuf-wordlimit-message wpuf-help"></span>
99
+
100
+ <?php } ?>
101
+
102
+ <?php
103
+ $this->help_text( $field_settings );
104
+ if ( isset( $field_settings['word_restriction'] ) && $field_settings['word_restriction'] ) {
105
+ $this->check_word_restriction_func(
106
+ $field_settings['word_restriction'],
107
+ $field_settings['rich'],
108
+ $field_settings['name'] . '_' . $form_id
109
+ );
110
+ }
111
+
112
+ ?>
113
+ </li>
114
+ <?php
115
+ }
116
+
117
+ /**
118
+ * Get field options setting
119
+ *
120
+ * @return array
121
+ */
122
+ public function get_options_settings() {
123
+
124
+ $default_options = $this->get_default_option_settings(false,array('dynamic'));
125
+
126
+ $default_text_options = $this->get_default_textarea_option_settings();
127
+
128
+
129
+ $settings = array(
130
+ array(
131
+ 'name' => 'insert_image',
132
+ 'title' => __( 'Enable Image Insertion', 'wp-user-frontend' ),
133
+ 'type' => 'checkbox',
134
+ 'options' => array( 'yes' => __( 'Enable image upload in post area', 'wp-user-frontend' ) ),
135
+ 'is_single_opt' => true,
136
+ 'section' => 'advanced',
137
+ 'priority' => 14,
138
+ ),
139
+ );
140
+
141
+ return array_merge( $default_options, $default_text_options,$settings);
142
+
143
+ }
144
+
145
+ /**
146
+ * Get the field props
147
+ *
148
+ * @return array
149
+ */
150
+ public function get_field_props() {
151
+
152
+ $defaults = $this->default_attributes();
153
+
154
+ $props = array(
155
+ 'input_type' => 'textarea',
156
+ 'is_meta' => 'no',
157
+ 'rows' => 5,
158
+ 'cols' => 25,
159
+ 'rich' => 'yes',
160
+ 'id' => 0,
161
+ 'is_new' => true,
162
+ );
163
+
164
+ return array_merge( $defaults, $props );
165
+ }
166
+
167
+
168
+ /**
169
+ * Prepare entry
170
+ *
171
+ * @param $field
172
+ *
173
+ * @return mixed
174
+ */
175
+
176
+ public function prepare_entry( $field ) {
177
+ return trim($_POST[$field['name']]);
178
+ }
179
+ }
includes/fields/class-field-post-excerpt.php ADDED
@@ -0,0 +1,163 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // Post Excerpt Class
3
+ class WPUF_Form_Field_Post_Excerpt extends WPUF_Field_Contract {
4
+
5
+ function __construct() {
6
+ $this->name = __( 'Post Excerpt', 'wp-user-frontend' );
7
+ $this->input_type = 'post_excerpt';
8
+ $this->icon = 'compress';
9
+ }
10
+
11
+ /**
12
+ * Render the PostTitle field
13
+ *
14
+ * @param array $field_settings
15
+ * @param integer $form_id
16
+ *
17
+ * @return void
18
+ */
19
+ /**
20
+ * Render the Post Excerpt field
21
+ *
22
+ * @param array $field_settings
23
+ * @param integer $form_id
24
+ * @param string $type
25
+ * @param integer $post_id
26
+ *
27
+ * @return void
28
+ */
29
+ public function render( $field_settings, $form_id, $type = 'post', $post_id = null ) {
30
+
31
+ // $req_class = ( $field_settings['required'] == 'yes' ) ? 'required' : 'rich-editor';
32
+ // $value = $field_settings['default'];
33
+ // $textarea_id = $field_settings['name'] ? $field_settings['name'] . '_' . $form_id : 'textarea_';
34
+
35
+ if( isset( $post_id ) ){
36
+ $value = get_post_field( $field_settings['name'], $post_id );
37
+ } else {
38
+ $value = $field_settings['default'];
39
+ }
40
+
41
+ $req_class = ( $field_settings['required'] == 'yes' ) ? 'required' : 'rich-editor';
42
+ $textarea_id = $field_settings['name'] ? $field_settings['name'] . '_' . $form_id : 'textarea_';
43
+
44
+ ?>
45
+ <li <?php $this->print_list_attributes( $field_settings ); ?>>
46
+ <?php $this->print_label( $field_settings, $form_id ); ?>
47
+
48
+ <?php if ( in_array( $field_settings['rich'], array( 'yes', 'teeny' ) ) ) { ?>
49
+ <div class="wpuf-fields wpuf-rich-validation <?php printf( 'wpuf_%s_%s', $field_settings['name'], $form_id ); ?>" data-type="rich" data-required="<?php echo esc_attr( $field_settings['required'] ); ?>" data-id="<?php echo esc_attr( $field_settings['name'] ) . '_' . $form_id; ?>" data-name="<?php echo esc_attr( $field_settings['name'] ); ?>">
50
+ <?php } else { ?>
51
+ <div class="wpuf-fields">
52
+ <?php } ?>
53
+
54
+ <?php
55
+
56
+ if ( $field_settings['rich'] == 'yes' ) {
57
+ $editor_settings = array(
58
+ // 'textarea_rows' => $field_settings['rows'],
59
+ 'quicktags' => false,
60
+ 'media_buttons' => false,
61
+ 'editor_class' => $req_class,
62
+ 'textarea_name' => $field_settings['name']
63
+ );
64
+
65
+ $editor_settings = apply_filters( 'wpuf_textarea_editor_args' , $editor_settings );
66
+ wp_editor( $value, $textarea_id, $editor_settings );
67
+
68
+ } elseif( $field_settings['rich'] == 'teeny' ) {
69
+
70
+ $editor_settings = array(
71
+ 'textarea_rows' => $field_settings['rows'],
72
+ 'quicktags' => false,
73
+ 'media_buttons' => false,
74
+ 'teeny' => true,
75
+ 'editor_class' => $req_class,
76
+ 'textarea_name' => $field_settings['name']
77
+ );
78
+
79
+ $editor_settings = apply_filters( 'wpuf_textarea_editor_args' , $editor_settings );
80
+ wp_editor( $value, $textarea_id, $editor_settings );
81
+
82
+ } else {
83
+ ?>
84
+ <textarea
85
+ class="textareafield <?php echo ' wpuf_'.$field_settings['name'].'_'.$form_id; ?>"
86
+ id="<?php echo $field_settings['name'] . '_' . $form_id; ?>"
87
+ name="<?php echo $field_settings['name']; ?>"
88
+ data-required="<?php echo $field_settings['required'] ?>"
89
+ data-type="textarea"
90
+ placeholder="<?php echo esc_attr( $field_settings['placeholder'] ); ?>"
91
+ rows="<?php echo $field_settings['rows']; ?>"
92
+ cols="<?php echo $field_settings['cols']; ?>"
93
+ ><?php echo esc_textarea( $value ) ?></textarea>
94
+ <span class="wpuf-wordlimit-message wpuf-help"></span>
95
+
96
+ <?php } ?>
97
+
98
+ <?php
99
+ $this->help_text( $field_settings );
100
+ if ( isset( $field_settings['word_restriction'] ) && $field_settings['word_restriction'] ) {
101
+ $this->check_word_restriction_func(
102
+ $field_settings['word_restriction'],
103
+ $field_settings['rich'],
104
+ $field_settings['name'] . '_' . $form_id
105
+ );
106
+ }
107
+
108
+ ?>
109
+ </li>
110
+ <?php
111
+ }
112
+
113
+ /**
114
+ * Get field options setting
115
+ *
116
+ * @return array
117
+ */
118
+ public function get_options_settings() {
119
+
120
+ $default_options = $this->get_default_option_settings(false,array('dynamic'));
121
+
122
+ $default_text_options = $this->get_default_textarea_option_settings();
123
+
124
+ return array_merge( $default_options, $default_text_options);
125
+
126
+ }
127
+
128
+ /**
129
+ * Get the field props
130
+ *
131
+ * @return array
132
+ */
133
+ public function get_field_props() {
134
+
135
+ $defaults = $this->default_attributes();
136
+
137
+ $props = array(
138
+ 'input_type' => 'textarea',
139
+ 'is_meta' => 'no',
140
+ 'rows' => 5,
141
+ 'cols' => 25,
142
+ 'rich' => 'no',
143
+ 'id' => 0,
144
+ 'is_new' => true,
145
+ );
146
+
147
+ return array_merge( $defaults, $props );
148
+ }
149
+
150
+
151
+ /**
152
+ * Prepare entry
153
+ *
154
+ * @param $field
155
+ *
156
+ * @return mixed
157
+ */
158
+
159
+ public function prepare_entry( $field ) {
160
+ return wp_kses_post($_POST[$field['name']]);
161
+ }
162
+
163
+ }
includes/fields/class-field-post-tags.php ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ //Post Tags Class
3
+ class WPUF_Form_Field_Post_Tags extends WPUF_Field_Contract {
4
+
5
+ function __construct() {
6
+ $this->name = __( 'Tags', 'wp-user-frontend' );
7
+ $this->input_type = 'post_tags';
8
+ $this->icon = 'text-width';
9
+ }
10
+
11
+ /**
12
+ * Render the Post Tags field
13
+ *
14
+ * @param array $field_settings
15
+ * @param integer $form_id
16
+ * @param string $type
17
+ * @param integer $post_id
18
+ *
19
+ * @return void
20
+ */
21
+ public function render( $field_settings, $form_id, $type = 'post', $post_id = null ) {
22
+
23
+ if ( isset( $post_id ) ) {
24
+ $post_tags = wp_get_post_tags( $post_id );
25
+ $tagsarray = array();
26
+ foreach ($post_tags as $tag) {
27
+ $tagsarray[] = $tag->name;
28
+ }
29
+ $value = implode( ', ', $tagsarray );
30
+ } else {
31
+ $value = $field_settings['default'];
32
+ }
33
+
34
+ ?>
35
+
36
+
37
+ <li <?php $this->print_list_attributes( $field_settings ); ?>>
38
+ <?php $this->print_label( $field_settings, $form_id ); ?>
39
+
40
+ <div class="wpuf-fields">
41
+ <input
42
+ class="textfield <?php echo 'wpuf_' . $field_settings['name'] . '_' . $form_id; ?>"
43
+ id="<?php echo $field_settings['name'] . '_' . $form_id; ?>"
44
+ type="text"
45
+ data-required="<?php echo $field_settings['required'] ?>"
46
+ data-type="text" name="<?php echo esc_attr( $field_settings['name'] ); ?>"
47
+ placeholder="<?php echo esc_attr( $field_settings['placeholder'] ); ?>"
48
+ value="<?php echo esc_attr( $value ) ?>"
49
+ size="<?php echo esc_attr( $field_settings['size'] ) ?>"
50
+ />
51
+
52
+ <span class="wpuf-wordlimit-message wpuf-help"></span>
53
+ <?php $this->help_text( $field_settings ); ?>
54
+ </div>
55
+
56
+ <script type="text/javascript">
57
+ ;(function($) {
58
+ $(document).ready( function(){
59
+ $('li.tags input[name=tags]').suggest( wpuf_frontend.ajaxurl + '?action=wpuf-ajax-tag-search&tax=post_tag', { delay: 500, minchars: 2, multiple: true, multipleSep: ', ' } );
60
+ });
61
+ })(jQuery);
62
+ </script>
63
+
64
+
65
+
66
+ </li>
67
+ <?php
68
+
69
+ }
70
+
71
+ /**
72
+ * Get field options setting
73
+ *
74
+ * @return array
75
+ */
76
+ public function get_options_settings() {
77
+ $default_options = $this->get_default_option_settings(false,array('dynamic'));
78
+ $settings = $this->get_default_text_option_settings();
79
+ return array_merge( $default_options, $settings );
80
+ }
81
+
82
+ /**
83
+ * Get the field props
84
+ *
85
+ * @return array
86
+ */
87
+ public function get_field_props() {
88
+ $defaults = $this->default_attributes();
89
+ $props = array(
90
+ 'input_type' => 'text',
91
+ 'is_meta' => 'no',
92
+ 'width' => 'large',
93
+ 'size' => 40,
94
+ 'id' => 0,
95
+ 'is_new' => true,
96
+ );
97
+ return array_merge( $defaults, $props );
98
+ }
99
+
100
+
101
+ /**
102
+ * Prepare entry
103
+ *
104
+ * @param $field
105
+ *
106
+ * @return mixed
107
+ */
108
+
109
+ public function prepare_entry( $field ) {
110
+ return sanitize_text_field(trim($_POST[$field['name']]));
111
+ }
112
+
113
+ }
includes/fields/class-field-post-taxonomy.php ADDED
@@ -0,0 +1,345 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // Post Taxonomy Class
3
+ class WPUF_Form_Field_Post_Taxonomy extends WPUF_Field_Contract {
4
+
5
+
6
+ protected $tax_name;
7
+
8
+ protected $taxonomy;
9
+
10
+ protected $terms=array();
11
+
12
+ protected $class;
13
+
14
+ protected $field_settings;
15
+
16
+ protected $form_id;
17
+
18
+
19
+ function __construct( $tax_name, $taxonomy,$post_id = null , $user_id = null ) {
20
+ $this->name = __( $tax_name, 'wp-user-frontend' );
21
+ $this->input_type = 'taxonomy';
22
+ $this->tax_name = $tax_name;
23
+ // $this->taxonomy=$taxonomy;
24
+ // $this->icon = 'caret-square-o-down';
25
+ }
26
+
27
+ /**
28
+ * Render the Post Taxonomy field
29
+ *
30
+ * @param array $field_settings
31
+ * @param integer $form_id
32
+ * @param string $type
33
+ * @param integer $post_id
34
+ *
35
+ * @return void
36
+ */
37
+ public function render( $field_settings, $form_id, $type = 'post', $post_id = null ) {
38
+
39
+ $this->field_settings = $field_settings;
40
+
41
+ $this->form_id = $form_id;
42
+
43
+ ?>
44
+
45
+ <li <?php $this->print_list_attributes( $this->field_settings ); ?>>
46
+
47
+ <?php
48
+
49
+ $this->print_label( $this->field_settings, $this->form_id );
50
+
51
+ $this->exclude_type = isset( $this->field_settings['exclude_type'] ) ? $this->field_settings['exclude_type'] : 'exclude';
52
+
53
+ $this->exclude = $this->field_settings['exclude'];
54
+
55
+ if ( $this->exclude_type == 'child_of' ) {
56
+ $this->exclude = $this->exclude[0];
57
+ }
58
+
59
+ $this->taxonomy = $this->field_settings['name'];
60
+
61
+ $this->class = ' wpuf_'.$this->field_settings['name'].'_'.$form_id;
62
+
63
+ $current_user = get_current_user_id();
64
+
65
+ if ( $post_id && $this->field_settings['type'] == 'text' ) {
66
+ $this->terms = wp_get_post_terms( $post_id, $this->taxonomy, array('fields' => 'names') );
67
+ } elseif( $post_id ) {
68
+ $this->terms = wp_get_post_terms( $post_id, $this->taxonomy, array('fields' => 'ids') );
69
+ }
70
+
71
+ if ( ! taxonomy_exists( $this->taxonomy ) ) {
72
+ echo '<br><div class="wpuf-message">' . __( 'This field is no longer available.', 'wp-user-frontend' ) . '</div>';
73
+ return;
74
+ }
75
+
76
+ $div_class = 'wpuf_' . $this->field_settings['name'] . '_' . $this->field_settings['type'] . '_' . $field_settings['id'] . '_' . $form_id;
77
+
78
+ if ( $this->field_settings['type'] == 'checkbox' ) { ?>
79
+ <div class="wpuf-fields <?php echo $div_class; ?>" data-required="<?php echo esc_attr( $field_settings['required'] ); ?>" data-type="tax-checkbox">
80
+ <?php } else { ?>
81
+ <div class="wpuf-fields <?php echo $div_class; ?>">
82
+ <?php }
83
+
84
+ switch ($this->field_settings['type']) {
85
+ case 'ajax':
86
+ $this->tax_ajax($post_id=NULL);
87
+ break;
88
+ case 'select':
89
+ $this->tax_select($post_id=NULL);
90
+ break;
91
+ case 'multiselect':
92
+ $this->tax_multiselect($post_id=NULL);
93
+ break;
94
+ case 'checkbox':
95
+ wpuf_category_checklist( $post_id, false, $this->field_settings, $this->class);
96
+ break;
97
+ case 'text':
98
+ $this->tax_input($post_id=NULL);
99
+ break;
100
+ default:
101
+ # code...
102
+ break;
103
+
104
+ }
105
+
106
+ }
107
+
108
+ public function taxnomy_select( $terms ) {
109
+
110
+ $attr = $this->field_settings;
111
+
112
+ $selected = $terms ? $terms : '';
113
+ $required = sprintf( 'data-required="%s" data-type="select"', $attr['required'] );
114
+ // $taxonomy = $attr['name'];
115
+ $class = ' wpuf_'.$attr['name'].'_'.$selected;
116
+ // $exclude_type = isset( $attr['exclude_type'] ) ? $attr['exclude_type'] : 'exclude';
117
+ // $exclude = $attr['exclude'];
118
+
119
+ // if ( $this->exclude_type == 'child_of' ) {
120
+ // $this->exclude = $this->exclude[0];
121
+ // }
122
+
123
+ $tax_args = array(
124
+ 'show_option_none' => __( '-- Select --', 'wp-user-frontend' ),
125
+ 'hierarchical' => 1,
126
+ 'hide_empty' => 0,
127
+ 'orderby' => isset( $attr['orderby'] ) ? $attr['orderby'] : 'name',
128
+ 'order' => isset( $attr['order'] ) ? $attr['order'] : 'ASC',
129
+ 'name' => $this->taxonomy . '[]',
130
+ 'taxonomy' => $this->taxonomy,
131
+ 'echo' => 0,
132
+ 'title_li' => '',
133
+ 'class' => 'cat-ajax '. $this->taxonomy . $this->class,
134
+ $this->exclude_type => $this->exclude,
135
+ 'selected' => $selected,
136
+ 'depth' => 1,
137
+ 'child_of' => isset( $attr['parent_cat'] ) ? $attr['parent_cat'] : ''
138
+ );
139
+
140
+ $tax_args = apply_filters( 'wpuf_taxonomy_checklist_args', $tax_args );
141
+
142
+ $select = wp_dropdown_categories( $tax_args );
143
+
144
+
145
+
146
+ echo str_replace( '<select', '<select ' . $required, $select );
147
+ $attr = array(
148
+ 'required' => $attr['required'],
149
+ 'name' => $attr['name'],
150
+ 'exclude_type' =>isset( $attr['exclude_type'] ) ? $attr['exclude_type'] : 'exclude',
151
+ // 'exclude_type' => $attr['exclude_type'],
152
+ 'exclude' => $attr['exclude'],
153
+ 'orderby' => $attr['orderby'],
154
+ 'order' => $attr['order'],
155
+ 'name' => $attr['name'],
156
+ //'last_term_id' => isset( $attr['parent_cat'] ) ? $attr['parent_cat'] : '',
157
+ //'term_id' => $selected
158
+ );
159
+ $attr = apply_filters( 'wpuf_taxonomy_checklist_args', $attr );
160
+ ?>
161
+ <span data-taxonomy=<?php echo json_encode( $attr ); ?>></span>
162
+ <?php
163
+ }
164
+
165
+ public function tax_ajax( $post_id = NULL ) {
166
+
167
+ // $class = ' wpuf_'.$attr['name'].'_'.$form_id;
168
+ ?>
169
+
170
+ <div class="category-wrap <?php echo $this->class; ?>">
171
+
172
+ <?php
173
+
174
+ if ( !count( $this->terms ) ) {
175
+
176
+ ?>
177
+ <div id="lvl0" level="0">
178
+ <?php $this->taxnomy_select( null); ?>
179
+ </div>
180
+ <?php
181
+ } else {
182
+
183
+ $level = 0;
184
+ asort( $terms );
185
+ $last_term_id = end( $terms );
186
+
187
+ foreach( $terms as $term_id) {
188
+ $class = ( $last_term_id != $term_id ) ? 'hasChild' : '';
189
+ ?>
190
+ <div id="lvl<?php echo $level; ?>" level="<?php echo $level; ?>" >
191
+ <?php $this->taxnomy_select( $term_id); ?>
192
+ </div>
193
+ <?php
194
+ $attr['parent_cat'] = $term_id;
195
+ $level++;
196
+ }
197
+ }
198
+
199
+ ?>
200
+ </div>
201
+ <span class="loading"></span>
202
+ <?php
203
+
204
+ }
205
+
206
+ public function tax_select( $post_id = NULL ) {
207
+
208
+ $attr = $this->field_settings;
209
+
210
+ $selected = $this->terms ? $this->terms[0] : '';
211
+
212
+ $required = sprintf( 'data-required="%s" data-type="select"', $attr['required'] );
213
+
214
+ $tax_args = array(
215
+ 'show_option_none' => isset ( $attr['first'] ) ? $attr['first'] : '--select--',
216
+ 'hierarchical' => 1,
217
+ 'hide_empty' => 0,
218
+ 'orderby' => isset( $attr['orderby'] ) ? $attr['orderby'] : 'name',
219
+ 'order' => isset( $attr['order'] ) ? $attr['order'] : 'ASC',
220
+ 'name' => $this->taxonomy . '[]',
221
+ 'taxonomy' => $this->taxonomy,
222
+ 'echo' => 0,
223
+ 'title_li' => '',
224
+ 'class' => $this->taxonomy . $this->class,
225
+ $this->exclude_type => $this->exclude,
226
+ 'selected' => $selected,
227
+ );
228
+
229
+ $tax_args = apply_filters( 'wpuf_taxonomy_checklist_args', $tax_args );
230
+
231
+ $select = wp_dropdown_categories( $tax_args );
232
+
233
+ echo str_replace( '<select', '<select ' . $required, $select );
234
+ }
235
+
236
+
237
+ public function tax_multiselect( $post_id = NULL ){
238
+
239
+ $attr = $this->field_settings;
240
+
241
+ $selected = $this->terms ? $this->terms : array();
242
+
243
+ $required = sprintf( 'data-required="%s" data-type="multiselect"', $attr['required'] );
244
+
245
+ $walker = new WPUF_Walker_Category_Multi();
246
+
247
+ $tax_args = array(
248
+ // 'show_option_none' => __( '-- Select --', 'wpuf' ),
249
+ 'hierarchical' => 1,
250
+ 'hide_empty' => 0,
251
+ 'orderby' => isset( $attr['orderby'] ) ? $attr['orderby'] : 'name',
252
+ 'order' => isset( $attr['order'] ) ? $attr['order'] : 'ASC',
253
+ 'name' => $this->taxonomy . '[]',
254
+ 'id' => 'cat-ajax',
255
+ 'taxonomy' => $this->taxonomy,
256
+ 'echo' => 0,
257
+ 'title_li' => '',
258
+ 'class' => $this->taxonomy . ' multiselect' . $this->class,
259
+ $this->exclude_type => $this->exclude,
260
+ 'selected' => $selected,
261
+ 'walker' => $walker
262
+ );
263
+
264
+ $tax_args = apply_filters( 'wpuf_taxonomy_checklist_args', $tax_args );
265
+
266
+ $select = wp_dropdown_categories( $tax_args );
267
+
268
+ echo str_replace( '<select', '<select multiple="multiple" ' . $required, $select );
269
+ }
270
+
271
+
272
+ public function tax_input( $post_id = NULL ){
273
+
274
+ $attr = $this->field_settings;
275
+
276
+ ?>
277
+
278
+ <input class="textfield<?php echo $this->required_class( $attr ); ?>" id="<?php echo $attr['name']; ?>" type="text" data-required="<?php echo $attr['required'] ?>" data-type="text"<?php $this->required_html5( $attr ); ?> name="<?php echo esc_attr( $attr['name'] ); ?>" value="<?php echo esc_attr( implode( ', ', $this->terms ) ); ?>" size="40" />
279
+
280
+ <script type="text/javascript">
281
+ ;(function($) {
282
+ $(document).ready( function(){
283
+ $('#<?php echo $attr['name']; ?>').suggest( wpuf_frontend.ajaxurl + '?action=wpuf-ajax-tag-search&tax=<?php echo $attr['name']; ?>', { delay: 500, minchars: 2, multiple: true, multipleSep: ', ' } );
284
+ });
285
+ })(jQuery);
286
+ </script>
287
+
288
+
289
+
290
+ <?php }
291
+
292
+ /**
293
+ * Get field options setting
294
+ *
295
+ * @return array
296
+ */
297
+ public function get_options_settings() {
298
+ $default_options = $this->get_default_option_settings(false,array('dynamic'));
299
+ $default_text_options = $this->get_default_taxonomy_option_setttings(false,$this->tax_name);
300
+ return array_merge( $default_options, $default_text_options );
301
+ }
302
+
303
+ /**
304
+ * Get the field props
305
+ *
306
+ * @return array
307
+ */
308
+ public function get_field_props() {
309
+ $defaults = $this->default_attributes();
310
+ $props = array(
311
+ 'input_type' => 'taxonomy',
312
+ 'label' => $this->tax_name,
313
+ 'name' => $this->tax_name,
314
+ 'is_meta' => 'no',
315
+ 'width' => 'small',
316
+ 'type' => 'select',
317
+ 'first' => __( '- select -', 'wp-user-frontend' ),
318
+ 'show_inline' => 'inline',
319
+ 'orderby' => 'name',
320
+ 'order' => 'ASC',
321
+ 'exclude' => array(),
322
+ 'id' => 0,
323
+ 'is_new' => true,
324
+ );
325
+ return array_merge( $defaults, $props );
326
+ }
327
+
328
+ /**
329
+ * Prepare entry
330
+ *
331
+ * @param $field
332
+ *
333
+ * @return mixed
334
+ */
335
+ public function prepare_entry( $field ) {
336
+ // $val = $_POST[$field['name']];
337
+ // return isset( $field['options'][$val] ) ? $field['options'][$val] : '';
338
+ // return sanitize_text_field($_POST[$field['name']]);
339
+
340
+ return $val = $_POST[$field['name']];
341
+ return isset( $field['options'][$val] ) ? $field['options'][$val] : '';
342
+
343
+ }
344
+
345
+ }
includes/fields/class-field-post-title.php ADDED
@@ -0,0 +1,133 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class WPUF_Form_Field_Post_Title extends WPUF_Field_Contract {
4
+
5
+ function __construct() {
6
+ $this->name = __( 'Post Title', 'wp-user-frontend' );
7
+ $this->input_type = 'post_title';
8
+ $this->icon = 'header';
9
+ }
10
+
11
+ /**
12
+ * Render the PostTitle field
13
+ *
14
+ * @param array $field_settings
15
+ * @param integer $form_id
16
+ *
17
+ * @return void
18
+ */
19
+ public function render( $field_settings, $form_id, $type = 'post', $post_id = null ) {
20
+
21
+ if( isset( $post_id ) ){
22
+ $value = get_post_field( $field_settings['name'], $post_id );
23
+ } else {
24
+ $value = $field_settings['default'];
25
+ }
26
+
27
+ ?>
28
+ <li <?php $this->print_list_attributes( $field_settings ); ?>>
29
+ <?php $this->print_label( $field_settings, $form_id ); ?>
30
+
31
+ <div class="wpuf-fields">
32
+ <input
33
+ class="textfield <?php echo 'wpuf_' . $field_settings['name'] . '_' . $form_id; ?>"
34
+ id="<?php echo $field_settings['name'] . '_' . $form_id; ?>"
35
+ type="text"
36
+ data-duplicate="<?php // echo $field_settings['duplicate'] ? $field_settings['duplicate'] : 'no'; ?>"
37
+ data-required="<?php echo $field_settings['required'] ?>"
38
+ data-type="text" name="<?php echo esc_attr( $field_settings['name'] ); ?>"
39
+ placeholder="<?php echo esc_attr( $field_settings['placeholder'] ); ?>"
40
+ value="<?php echo esc_attr( $value ) ?>"
41
+ size="<?php echo esc_attr( $field_settings['size'] ) ?>"
42
+ />
43
+
44
+ <span class="wpuf-wordlimit-message wpuf-help"></span>
45
+ <?php $this->help_text( $field_settings ); ?>
46
+ </div>
47
+ <?php
48
+ if ( isset( $field_settings['word_restriction'] ) && $field_settings['word_restriction'] ) {
49
+ $this->check_word_restriction_func(
50
+ $field_settings['word_restriction'],
51
+ 'no',
52
+ $field_settings['name'] . '_' . $form_id
53
+ );
54
+ }
55
+
56
+ $mask_option = isset( $field_settings['mask_options'] ) ? $field_settings['mask_options'] : '';
57
+
58
+ if ( $mask_option ) {
59
+ ?>
60
+ <script>
61
+ jQuery(document).ready(function($) {
62
+ var text_field = $( "input[name*=<?php echo esc_attr( $field_settings['name'] ); ?>]" );
63
+ switch ( '<?php echo $mask_option; ?>' ) {
64
+ case 'us_phone':
65
+ text_field.mask('(999) 999-9999');
66
+ break;
67
+ case 'date':
68
+ text_field.mask('99/99/9999');
69
+ break;
70
+ case 'tax_id':
71
+ text_field.mask('99-9999999');
72
+ break;
73
+ case 'ssn':
74
+ text_field.mask('999-99-9999');
75
+ break;
76
+ case 'zip':
77
+ text_field.mask('99999');
78
+ break;
79
+ default:
80
+ break;
81
+ }
82
+ });
83
+ </script>
84
+ <?php } ?>
85
+ </li>
86
+ <?php
87
+
88
+ }
89
+
90
+ /**
91
+ * Get field options setting
92
+ *
93
+ * @return array
94
+ */
95
+ public function get_options_settings() {
96
+ $default_options = $this->get_default_option_settings(false,array('dynamic'));
97
+ $default_text_options = $this->get_default_text_option_settings(true);
98
+ return array_merge( $default_options, $default_text_options);
99
+ }
100
+
101
+ /**
102
+ * Get the field props
103
+ *
104
+ * @return array
105
+ */
106
+ public function get_field_props() {
107
+ $defaults = $this->default_attributes();
108
+ $props = array(
109
+ 'input_type' => 'text',
110
+ 'is_meta' => 'no',
111
+ 'width' => 'large',
112
+ 'size' => 40,
113
+ 'word_restriction' => '',
114
+ 'id' => 0,
115
+ 'is_new' => true,
116
+ );
117
+ return array_merge( $defaults, $props );
118
+ }
119
+
120
+
121
+ /**
122
+ * Prepare entry
123
+ *
124
+ * @param $field
125
+ *
126
+ * @return mixed
127
+ */
128
+
129
+ public function prepare_entry( $field ) {
130
+ return sanitize_text_field(trim($_POST[$field['name']]));
131
+ }
132
+
133
+ }
includes/fields/class-field-pro.php ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class WPUF_Form_Field_Pro extends WPUF_Field_Contract {
4
+
5
+ /**
6
+ * Render the text field
7
+ *
8
+ * @param array $field_settings
9
+ * @param integer $form_id
10
+ *
11
+ * @return void
12
+ */
13
+ public function render( $field_settings, $form_id , $post_id = null , $user_id = null ) {
14
+ if ( current_user_can( 'manage_options' ) ) {
15
+ echo __($field_settings['template'] .' is a premium field. To use this field you need to upgrade to the premium version.', 'wp-user-frontend' );
16
+ echo "<br/>";
17
+ }
18
+ }
19
+
20
+ /**
21
+ * Check if it's a pro feature
22
+ *
23
+ * @return boolean
24
+ */
25
+ public function is_pro() {
26
+ return true;
27
+ }
28
+
29
+ /**
30
+ * Get field options setting
31
+ *
32
+ * @return array
33
+ */
34
+ public function get_options_settings() {
35
+ return __return_empty_array();
36
+ }
37
+
38
+ /**
39
+ * Get the field props
40
+ *
41
+ * @return array
42
+ */
43
+ public function get_field_props() {
44
+ return __return_empty_array();
45
+ }
46
+ }
includes/fields/class-field-radio.php ADDED
@@ -0,0 +1,138 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Radio Field Class
5
+ */
6
+ class WPUF_Form_Field_Radio extends WPUF_Form_Field_Checkbox {
7
+
8
+ function __construct() {
9
+ $this->name = __( 'Radio', 'wp-user-frontend' );
10
+ $this->input_type = 'radio_field';
11
+ $this->icon = 'dot-circle-o';
12
+
13
+ }
14
+
15
+ /**
16
+ * Render the Radio field
17
+ *
18
+ * @param array $field_settings
19
+ * @param integer $form_id
20
+ * @param string $type
21
+ * @param integer $post_id
22
+ *
23
+ * @return void
24
+ */
25
+ public function render( $field_settings, $form_id, $type = 'post', $post_id = null) {
26
+
27
+ if ( isset( $post_id ) && $post_id != '0' ) {
28
+
29
+ if ( $this->is_meta( $field_settings ) ) {
30
+ $selected = $this->get_meta( $post_id, $field_settings['name'], $type );
31
+ }
32
+
33
+ } else {
34
+
35
+ $selected = isset( $field_settings['selected'] ) ? $field_settings['selected'] : '';
36
+ }
37
+
38
+ $this->field_print_label($field_settings, $form_id );
39
+
40
+ do_action( 'WPUF_radio_field_after_label', $field_settings ); ?>
41
+
42
+ <div class="wpuf-fields" data-required="<?php echo $field_settings['required'] ?>" data-type="radio">
43
+
44
+ <?php
45
+ if ( $field_settings['options'] && count( $field_settings['options'] ) > 0 ) {
46
+ foreach ($field_settings['options'] as $value => $option) {
47
+ ?>
48
+
49
+ <label <?php echo $field_settings['inline'] == 'yes' ? 'class="wpuf-radio-inline"' : 'class="wpuf-radio-block"'; ?>>
50
+ <input
51
+ name="<?php echo $field_settings['name']; ?>"
52
+ class="<?php echo 'wpuf_'.$field_settings['name']. '_'. $form_id; ?>"
53
+ type="radio"
54
+ value="<?php echo esc_attr( $value ); ?>"<?php checked( $selected, $value ); ?>
55
+ />
56
+ <?php echo $option; ?>
57
+ </label>
58
+ <?php
59
+ }
60
+ }
61
+ ?>
62
+
63
+ <?php $this->help_text( $field_settings ); ?>
64
+
65
+ </div>
66
+
67
+ <?php $this->after_field_print_label();
68
+
69
+ }
70
+
71
+ /**
72
+ * Get field options setting
73
+ *
74
+ * @return array
75
+ */
76
+ public function get_options_settings() {
77
+ $default_options = $this->get_default_option_settings( true, array( 'width' ) );
78
+ $dropdown_options = array(
79
+ $this->get_default_option_dropdown_settings(),
80
+
81
+ array(
82
+ 'name' => 'inline',
83
+ 'title' => __( 'Show in inline list', 'wp-user-frontend' ),
84
+ 'type' => 'radio',
85
+ 'options' => array(
86
+ 'yes' => __( 'Yes', 'wp-user-frontend' ),
87
+ 'no' => __( 'No', 'wp-user-frontend' ),
88
+ ),
89
+ 'default' => 'no',
90
+ 'inline' => true,
91
+ 'section' => 'advanced',
92
+ 'priority' => 23,
93
+ 'help_text' => __( 'Show this option in an inline list', 'wp-user-frontend' ),
94
+ )
95
+ );
96
+
97
+
98
+ return array_merge( $default_options, $dropdown_options );
99
+ }
100
+
101
+ /**
102
+ * Get the field props
103
+ *
104
+ * @return array
105
+ */
106
+ public function get_field_props() {
107
+
108
+ $defaults = $this->default_attributes();
109
+
110
+ $props = array(
111
+ 'input_type' => 'radio',
112
+ 'selected' => '',
113
+ 'inline' => 'no',
114
+ 'options' => array( 'Option' => __( 'Option', 'wp-user-frontend' ) ),
115
+ 'id' => 0,
116
+ 'is_new' => true,
117
+ 'show_in_post' => 'yes',
118
+ 'hide_field_label' => 'no',
119
+ 'is_meta' => 'yes',
120
+
121
+ );
122
+
123
+ return array_merge( $defaults, $props );
124
+
125
+ }
126
+
127
+ /**
128
+ * Prepare entry
129
+ *
130
+ * @param $field
131
+ *
132
+ * @return mixed
133
+ */
134
+ public function prepare_entry( $field ) {
135
+ $val = $_POST[$field['name']];
136
+ return isset( $field['options'][$val] ) ? $field['options'][$val] : '';
137
+ }
138
+ }
includes/fields/class-field-recaptcha.php ADDED
@@ -0,0 +1,223 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Recaptcha Field Class
5
+ */
6
+ class WPUF_Form_Field_reCaptcha extends WPUF_Field_Contract {
7
+
8
+ function __construct() {
9
+ $this->name = __( 'reCaptcha', 'wp-user-frontend' );
10
+ $this->input_type = 'recaptcha';
11
+ $this->icon = 'qrcode';
12
+ }
13
+
14
+ /**
15
+ * Render the Recaptcha field
16
+ *
17
+ * @param array $field_settings
18
+ * @param integer $form_id
19
+ *
20
+ * @return void
21
+ */
22
+
23
+ public function render( $field_settings, $form_id, $type = 'post', $post_id = null ) {
24
+
25
+
26
+ if ( $post_id ) {
27
+ return;
28
+ }
29
+ $recaptcha_site = wpuf_get_option( 'recaptcha_public', 'wpuf_general' );
30
+ // 'recaptcha_secret' => wpuf_get_option( 'recaptcha_private', 'wpuf_general' ),
31
+
32
+ // $settings = wpuf_get_settings( 'recaptcha' );
33
+ $is_invisible = false;
34
+ // $public_key = isset( $settings->key ) ? $settings->key : '';
35
+ $public_key = isset( $recaptcha_site) ? $recaptcha_site : '';
36
+
37
+ $theme = isset( $field_settings['recaptcha_theme'] ) ? $field_settings['recaptcha_theme'] : 'light';
38
+
39
+ if ( isset ( $field_settings['recaptcha_type'] ) ) {
40
+ $is_invisible = $field_settings['recaptcha_type'] == 'invisible_recaptcha' ? true : false;
41
+ }
42
+
43
+ $invisible_css = $is_invisible ? ' style="margin: 0; padding: 0" ' : '';
44
+
45
+ ?> <li <?php $this->print_list_attributes( $field_settings ); echo $invisible_css; ?>>
46
+
47
+ <?php
48
+
49
+ if ( ! $is_invisible ) {
50
+ $this->print_label( $field_settings );
51
+ }
52
+
53
+ if ( ! $public_key ) {
54
+ _e( 'reCaptcha API key is missing.', 'wp-user-frontend');
55
+
56
+ } else {
57
+
58
+ ?>
59
+
60
+ <div class="wpuf-fields <?php echo ' wpuf_'.$field_settings['name'].'_'.$form_id; ?>">
61
+ <script>
62
+ function weformsRecaptchaCallback(token) {
63
+ jQuery('[name="g-recaptcha-response"]').val(token);
64
+ jQuery('.weforms_submit_btn').attr('disabled',false).show();
65
+ jQuery('.weforms_submit_btn_recaptcha').hide();
66
+ }
67
+
68
+ jQuery(document).ready( function($) {
69
+ $('.weforms_submit_btn').attr('disabled',true);
70
+ });
71
+ </script>
72
+
73
+ <input type="hidden" name="g-recaptcha-response">
74
+ <?php
75
+
76
+ if ( $is_invisible ) { ?>
77
+
78
+ <script src="https://www.google.com/recaptcha/api.js?onload=weFormsreCaptchaLoaded&render=explicit&hl=en" async defer></script>
79
+
80
+ <script>
81
+
82
+ jQuery(document).ready(function($) {
83
+ var btn = $('.weforms_submit_btn');
84
+ var gc_btn = btn.clone().removeClass().addClass('weforms_submit_btn_recaptcha').attr('disabled',false);
85
+ btn.after(gc_btn);
86
+ btn.hide();
87
+
88
+ $(document).on('click','.weforms_submit_btn_recaptcha',function(e){
89
+ e.preventDefault();
90
+ e.stopPropagation();
91
+ grecaptcha.execute();
92
+ })
93
+ });
94
+
95
+ var weFormsreCaptchaLoaded = function() {
96
+
97
+ grecaptcha.render('recaptcha', {
98
+ 'size' : 'invisible',
99
+ 'sitekey' : '<?php echo $public_key; ?>',
100
+ 'callback' : weformsRecaptchaCallback
101
+ });
102
+
103
+ grecaptcha.execute();
104
+ };
105
+ </script>
106
+
107
+ <div id='recaptcha' class="g-recaptcha" data-theme="<?php echo $theme; ?>" data-sitekey="<?php echo $public_key; ?>" data-callback="weformsRecaptchaCallback" data-size="invisible"></div>
108
+
109
+ <?php } else { ?>
110
+
111
+ <script src="https://www.google.com/recaptcha/api.js"></script>
112
+ <div id='recaptcha' data-theme="<?php echo $theme; ?>" class="g-recaptcha" data-sitekey="<?php echo $public_key; ?>" data-callback="weformsRecaptchaCallback"></div>
113
+ <?php } ?>
114
+
115
+ </div>
116
+
117
+ <?php } ?>
118
+
119
+ </li>
120
+
121
+ <?php
122
+
123
+ }
124
+
125
+ /**
126
+ * Custom validator
127
+ *
128
+ * @return array
129
+ */
130
+ public function get_validator() {
131
+ return array(
132
+ 'callback' => 'has_recaptcha_api_keys',
133
+ 'button_class' => 'button-faded',
134
+ 'msg_title' => __( 'Site key and Secret key', 'wp-user-frontend' ),
135
+ 'msg' => sprintf(
136
+ __( 'You need to set Site key and Secret key in <a href="%s" target="_blank">Settings</a> in order to use "Recaptcha" field. <a href="%s" target="_blank">Click here to get the these key</a>.', 'wp-user-frontend' ),
137
+ admin_url( 'admin.php?page=wpuf#/settings' ),
138
+ 'https://www.google.com/recaptcha/'
139
+ ),
140
+ );
141
+ }
142
+
143
+ /**
144
+ * Get field options setting
145
+ *
146
+ * @return array
147
+ */
148
+ public function get_options_settings() {
149
+
150
+ // $default_options = $this->get_default_option_settings(false,array('dynamic'));
151
+
152
+
153
+ $settings = array(
154
+ array(
155
+ 'name' => 'label',
156
+ 'title' => __( 'Title', 'wp-user-frontend' ),
157
+ 'type' => 'text',
158
+ 'section' => 'basic',
159
+ 'priority' => 10,
160
+ 'help_text' => __( 'Title of the section', 'wp-user-frontend' ),
161
+ ),
162
+
163
+ array(
164
+ 'name' => 'recaptcha_type',
165
+ 'title' => 'reCaptcha type',
166
+ 'type' => 'radio',
167
+ 'options' => array(
168
+ 'enable_no_captcha' => __( 'Enable noCaptcha', 'wp-user-frontend' ),
169
+ 'invisible_recaptcha' => __( 'Enable Invisible reCaptcha', 'wp-user-frontend' ),
170
+ ),
171
+ 'default' => 'enable_no_captcha',
172
+ 'section' => 'basic',
173
+ 'priority' => 11,
174
+ 'help_text' => __( 'Select reCaptcha type', 'wp-user-frontend' ),
175
+ ),
176
+
177
+ array(
178
+ 'name' => 'recaptcha_theme',
179
+ 'title' => 'reCaptcha Theme',
180
+ 'type' => 'radio',
181
+ 'options' => array(
182
+ 'light' => __( 'Light', 'wp-user-frontend' ),
183
+ 'dark' => __( 'Dark', 'wp-user-frontend' ),
184
+ ),
185
+ 'default' => 'light',
186
+ 'section' => 'advanced',
187
+ 'priority' => 12,
188
+ 'help_text' => __( 'Select reCaptcha Theme', 'wp-user-frontend' ),
189
+ ),
190
+ );
191
+
192
+ // return array_merge( $default_options,$settings);
193
+
194
+ return $settings;
195
+
196
+ }
197
+
198
+ /**
199
+ * Get the field props
200
+ *
201
+ * @return array
202
+ */
203
+ public function get_field_props() {
204
+
205
+ // $defaults = $this->default_attributes();
206
+
207
+ $props = array(
208
+ 'input_type' => 'recaptcha',
209
+ 'template' => $this->get_type(),
210
+ 'label' => '',
211
+ 'recaptcha_type' => 'enable_no_captcha',
212
+ 'is_meta' => 'yes',
213
+ 'id' => 0,
214
+ 'is_new' => true,
215
+ 'wpuf_cond' => null,
216
+ 'recaptcha_theme' => 'light',
217
+ );
218
+
219
+ // return array_merge( $defaults, $props );
220
+
221
+ return $props;
222
+ }
223
+ }
includes/fields/class-field-sectionbreak.php ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Section Break Field Class
5
+ */
6
+ class WPUF_Form_Field_SectionBreak extends WPUF_Field_Contract {
7
+
8
+ function __construct() {
9
+ $this->name = __( 'Section Break', 'wp-user-frontend' );
10
+ $this->input_type = 'section_break';
11
+ $this->icon = 'columns';
12
+ }
13
+
14
+ /**
15
+ * Render the Section Break field
16
+ *
17
+ * @param array $field_settings
18
+ * @param integer $form_id
19
+ * @param string $type
20
+ * @param integer $post_id
21
+ *
22
+ * @return void
23
+ */
24
+ public function render( $field_settings, $form_id, $type = 'post', $post_id = null) {
25
+
26
+ $field_settings['description'] = isset( $field_settings['description'] ) ? $field_settings['description'] : '';
27
+ ?>
28
+ <li <?php $this->print_list_attributes( $field_settings ); ?>>
29
+ <div class="wpuf-section-wrap wpuf-fields <?php echo 'section_' . $form_id; ?><?php echo ' wpuf_'.$field_settings['name'].'_'.$form_id; ?>">
30
+ <h2 class="wpuf-section-title"><?php echo $field_settings['label']; ?></h2>
31
+ <div class="wpuf-section-details"><?php echo $field_settings['description']; ?></div>
32
+ </div>
33
+
34
+ </li>
35
+ <?php
36
+ }
37
+
38
+ /**
39
+ * It's a full width block
40
+ *
41
+ * @return boolean
42
+ */
43
+ public function is_full_width() {
44
+ return true;
45
+ }
46
+
47
+ /**
48
+ * Get field options setting
49
+ *
50
+ * @return array
51
+ */
52
+ public function get_options_settings() {
53
+ $options = array(
54
+ array(
55
+ 'name' => 'label',
56
+ 'title' => __( 'Title', 'wp-user-frontend' ),
57
+ 'type' => 'text',
58
+ 'section' => 'basic',
59
+ 'priority' => 10,
60
+ 'help_text' => __( 'Title of the section', 'wp-user-frontend' ),
61
+ ),
62
+ array(
63
+ 'name' => 'description',
64
+ 'title' => __( 'Description', 'wp-user-frontend' ),
65
+ 'type' => 'textarea',
66
+ 'section' => 'basic',
67
+ 'priority' => 12,
68
+ 'help_text' => __( 'Some details text about the section', 'wp-user-frontend' ),
69
+ ),
70
+ );
71
+
72
+ return $options;
73
+ }
74
+
75
+ /**
76
+ * Get the field props
77
+ *
78
+ * @return array
79
+ */
80
+ public function get_field_props() {
81
+ $props = array(
82
+ 'input_type' => 'section_break',
83
+ 'template' => $this->get_type(),
84
+ 'label' => $this->get_name(),
85
+ 'description' => __( 'Some description about this section', 'wp-user-frontend' ),
86
+ 'id' => 0,
87
+ 'is_new' => true,
88
+ 'show_in_post' => 'yes',
89
+ 'hide_field_label' => 'no',
90
+ 'wpuf_cond' => null
91
+ );
92
+
93
+ return $props;
94
+ }
95
+ }
includes/fields/class-field-text.php ADDED
@@ -0,0 +1,158 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Text Field Class
5
+ */
6
+ class WPUF_Form_Field_Text extends WPUF_Field_Contract {
7
+
8
+ function __construct() {
9
+ $this->name = __( 'Text', 'wp-user-frontend' );
10
+ $this->input_type = 'text_field';
11
+ $this->icon = 'text-width';
12
+ }
13
+
14
+ /**
15
+ * Render the Text field
16
+ *
17
+ * @param array $field_settings
18
+ * @param integer $form_id
19
+ * @param string $type
20
+ * @param integer $post_id
21
+ *
22
+ * @return void
23
+ */
24
+ public function render( $field_settings, $form_id, $type = 'post', $post_id = null) {
25
+
26
+
27
+ if ( isset ( $post_id ) && $post_id != '0' ) {
28
+ if ( $this->is_meta( $field_settings ) ) {
29
+ $value = $this->get_meta( $post_id, $field_settings['name'], $type );
30
+ }
31
+
32
+ } else {
33
+ $value = $field_settings['default'];
34
+ }
35
+
36
+ $this->field_print_label($field_settings, $form_id );
37
+
38
+ ?>
39
+
40
+ <div class="wpuf-fields">
41
+ <input
42
+ class="textfield <?php echo 'wpuf_' . $field_settings['name'] . '_' . $form_id; ?>"
43
+ id="<?php echo $field_settings['name'] . '_' . $form_id; ?>"
44
+ type="text"
45
+ data-required="<?php echo $field_settings['required'] ?>"
46
+ data-type="text" name="<?php echo esc_attr( $field_settings['name'] ); ?>"
47
+ placeholder="<?php echo esc_attr( $field_settings['placeholder'] ); ?>"
48
+ value="<?php echo esc_attr( $value ) ?>"
49
+ size="<?php echo esc_attr( $field_settings['size'] ) ?>"
50
+ />
51
+
52
+ <span class="wpuf-wordlimit-message wpuf-help"></span>
53
+ <?php $this->help_text( $field_settings ); ?>
54
+ </div>
55
+
56
+ <?php
57
+
58
+ if ( isset( $field_settings['word_restriction'] ) && $field_settings['word_restriction'] ) {
59
+ $this->check_word_restriction_func(
60
+ $field_settings['word_restriction'],
61
+ 'no',
62
+ $field_settings['name'] . '_' . $form_id
63
+ );
64
+ }
65
+
66
+ $mask_option = isset( $field_settings['mask_options'] ) ? $field_settings['mask_options'] : '';
67
+
68
+ if ( $mask_option ) {
69
+
70
+ ?>
71
+ <script>
72
+ jQuery(document).ready(function($) {
73
+ var text_field = $( "input[name*=<?php echo esc_attr( $field_settings['name'] ); ?>]" );
74
+ switch ( '<?php echo $mask_option; ?>' ) {
75
+ case 'us_phone':
76
+ text_field.mask('(999) 999-9999');
77
+ break;
78
+ case 'date':
79
+ text_field.mask('99/99/9999');
80
+ break;
81
+ case 'tax_id':
82
+ text_field.mask('99-9999999');
83
+ break;
84
+ case 'ssn':
85
+ text_field.mask('999-99-9999');
86
+ break;
87
+ case 'zip':
88
+ text_field.mask('99999');
89
+ break;
90
+ default:
91
+ break;
92
+ }
93
+ });
94
+ </script>
95
+
96
+ <?php } ?>
97
+
98
+ </li>
99
+
100
+ <?php $this->after_field_print_label();
101
+ }
102
+
103
+ /**
104
+ * Get field options setting
105
+ *
106
+ * @return array
107
+ */
108
+
109
+ public function get_options_settings() {
110
+
111
+ $default_options = $this->get_default_option_settings();
112
+
113
+ $default_text_options = $this->get_default_text_option_settings( true );
114
+
115
+ $text_options = array_merge( $default_options, $default_text_options);
116
+
117
+ return apply_filters( 'wpuf_text_field_option_settings', $text_options );
118
+ }
119
+
120
+ /**
121
+ * Get the field props
122
+ *
123
+ * @return array
124
+ */
125
+
126
+
127
+ public function get_field_props() {
128
+
129
+ $defaults = $this->default_attributes();
130
+
131
+ $props = array(
132
+ 'input_type' => 'text',
133
+ 'label' => __( 'Text', 'wp-user-frontend' ),
134
+ 'is_meta' => 'yes',
135
+ 'size' => 40,
136
+ 'id' => 0,
137
+ 'is_new' => true,
138
+ 'show_in_post' => 'yes',
139
+ 'hide_field_label' => 'no',
140
+ );
141
+
142
+ return array_merge( $defaults, $props );
143
+ }
144
+
145
+ /**
146
+ * Prepare entry
147
+ *
148
+ * @param $field
149
+ *
150
+ * @return mixed
151
+ */
152
+ public function prepare_entry( $field ) {
153
+ $value = isset( $_POST[$field['name']] ) ? $_POST[$field['name']] : '';
154
+ // return sanitize_text_field( trim( $_POST[$field['name']] ) );
155
+ return sanitize_text_field( $value );
156
+
157
+ }
158
+ }
includes/fields/class-field-textarea.php ADDED
@@ -0,0 +1,153 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Textarea Field Class
5
+ */
6
+ class WPUF_Form_Field_Textarea extends WPUF_Field_Contract {
7
+
8
+ function __construct() {
9
+ $this->name = __( 'Textarea', 'wp-user-frontend' );
10
+ $this->input_type = 'textarea_field';
11
+ $this->icon = 'paragraph';
12
+ }
13
+
14
+ /**
15
+ * Render the Textarea field
16
+ *
17
+ * @param array $field_settings
18
+ * @param integer $form_id
19
+ * @param string $type
20
+ * @param integer $post_id
21
+ *
22
+ * @return void
23
+ */
24
+ public function render( $field_settings, $form_id, $type = 'post', $post_id = null) {
25
+
26
+
27
+ if ( isset( $post_id ) && $post_id != '0' ) {
28
+ if ( $this->is_meta( $field_settings ) ) {
29
+ $value = $this->get_meta( $post_id, $field_settings['name'], $type );
30
+ }
31
+ } else {
32
+ $value = $field_settings['default'];
33
+ }
34
+
35
+ $req_class = ( $field_settings['required'] == 'yes' ) ? 'required' : 'rich-editor';
36
+ $textarea_id = $field_settings['name'] ? $field_settings['name'] . '_' . $form_id : 'textarea_';
37
+
38
+
39
+ $this->field_print_label($field_settings, $form_id );
40
+
41
+ ?>
42
+
43
+ <?php if ( in_array( $field_settings['rich'], array( 'yes', 'teeny' ) ) ) { ?>
44
+ <div class="wpuf-fields wpuf-rich-validation <?php printf( 'wpuf_%s_%s', $field_settings['name'], $form_id ); ?>" data-type="rich" data-required="<?php echo esc_attr( $field_settings['required'] ); ?>" data-id="<?php echo esc_attr( $field_settings['name'] ) . '_' . $form_id; ?>" data-name="<?php echo esc_attr( $field_settings['name'] ); ?>">
45
+ <?php } else { ?>
46
+ <div class="wpuf-fields">
47
+ <?php } ?>
48
+
49
+ <?php
50
+
51
+ if ( $field_settings['rich'] == 'yes' ) {
52
+ $editor_settings = array(
53
+ 'textarea_rows' => $field_settings['rows'],
54
+ 'quicktags' => false,
55
+ 'media_buttons' => false,
56
+ 'editor_class' => $req_class,
57
+ 'textarea_name' => $field_settings['name']
58
+ );
59
+
60
+ $editor_settings = apply_filters( 'wpuf_textarea_editor_args' , $editor_settings );
61
+ wp_editor( $value, $textarea_id, $editor_settings );
62
+
63
+ } elseif( $field_settings['rich'] == 'teeny' ) {
64
+
65
+ $editor_settings = array(
66
+ 'textarea_rows' => $field_settings['rows'],
67
+ 'quicktags' => false,
68
+ 'media_buttons' => false,
69
+ 'teeny' => true,
70
+ 'editor_class' => $req_class,
71
+ 'textarea_name' => $field_settings['name']
72
+ );
73
+
74
+ $editor_settings = apply_filters( 'wpuf_textarea_editor_args' , $editor_settings );
75
+ wp_editor( $value, $textarea_id, $editor_settings );
76
+
77
+ } else {
78
+ ?>
79
+ <textarea
80
+ class="textareafield <?php echo ' wpuf_'.$field_settings['name'].'_'.$form_id; ?>"
81
+ id="<?php echo $field_settings['name'] . '_' . $form_id; ?>"
82
+ name="<?php echo $field_settings['name']; ?>"
83
+ data-required="<?php echo $field_settings['required'] ?>"
84
+ data-type="textarea"
85
+ placeholder="<?php echo esc_attr( $field_settings['placeholder'] ); ?>"
86
+ rows="<?php echo $field_settings['rows']; ?>"
87
+ cols="<?php echo $field_settings['cols']; ?>"
88
+ ><?php echo esc_textarea( $value ) ?></textarea>
89
+ <span class="wpuf-wordlimit-message wpuf-help"></span>
90
+
91
+ <?php } ?>
92
+
93
+ <?php
94
+ $this->help_text( $field_settings );
95
+ if ( isset( $field_settings['word_restriction'] ) && $field_settings['word_restriction'] ) {
96
+ $this->check_word_restriction_func(
97
+ $field_settings['word_restriction'],
98
+ $field_settings['rich'],
99
+ $field_settings['name'] . '_' . $form_id
100
+ );
101
+ }
102
+
103
+ ?>
104
+
105
+ <?php $this->after_field_print_label();
106
+ }
107
+
108
+ /**
109
+ * Get field options setting
110
+ *
111
+ * @return array
112
+ */
113
+ public function get_options_settings() {
114
+ $default_options = $this->get_default_option_settings();
115
+ $default_text_options = $this->get_default_textarea_option_settings();
116
+
117
+ return array_merge( $default_options, $default_text_options );
118
+ }
119
+
120
+ /**
121
+ * Get the field props
122
+ *
123
+ * @return array
124
+ */
125
+ public function get_field_props() {
126
+ $defaults = $this->default_attributes();
127
+ $props = array(
128
+ 'input_type' => 'textarea',
129
+ 'label' => __( 'Textarea', 'wp-user-frontend' ),
130
+ 'is_meta' => 'yes',
131
+ 'rows' => 5,
132
+ 'cols' => 25,
133
+ 'rich' => 'no',
134
+ 'id' => 0,
135
+ 'is_new' => true,
136
+ 'show_in_post' => 'yes',
137
+ 'hide_field_label' => 'no',
138
+ );
139
+
140
+ return array_merge( $defaults, $props );
141
+ }
142
+
143
+ /**
144
+ * Prepare entry
145
+ *
146
+ * @param $field
147
+ *
148
+ * @return mixed
149
+ */
150
+ public function prepare_entry( $field ) {
151
+ return trim( $_POST[$field['name']] );
152
+ }
153
+ }
includes/fields/class-field-url.php ADDED
@@ -0,0 +1,119 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Url Field Class
5
+ */
6
+ class WPUF_Form_Field_URL extends WPUF_Form_Field_Text {
7
+
8
+ function __construct() {
9
+ $this->name = __( 'Website URL', 'wp-user-frontend' );
10
+ $this->input_type = 'website_url';
11
+ $this->icon = 'link';
12
+ }
13
+
14
+ /**
15
+ * Render the URL field
16
+ *
17
+ * @param array $field_settings
18
+ * @param integer $form_id
19
+ * @param string $type
20
+ * @param integer $post_id
21
+ *
22
+ * @return void
23
+ */
24
+ public function render( $field_settings, $form_id, $type = 'post', $post_id = null) {
25
+
26
+ if ( isset( $post_id ) && $post_id != '0' ) {
27
+
28
+ if ( $this->is_meta( $field_settings ) ) {
29
+ $value = $this->get_meta( $post_id, $field_settings['name'], $type );
30
+ }
31
+
32
+ } else {
33
+
34
+ $value = $field_settings['default'];
35
+ }
36
+
37
+ $this->field_print_label($field_settings, $form_id );
38
+
39
+ ?>
40
+ <div class="wpuf-fields">
41
+ <input
42
+ id="<?php echo $field_settings['name'] . '_' . $form_id; ?>"
43
+ type="url" class="url <?php echo ' wpuf_'.$field_settings['name'].'_'.$form_id; ?>"
44
+ data-required="<?php echo $field_settings['required'] ?>"
45
+ data-type="text"
46
+ name="<?php echo esc_attr( $field_settings['name'] ); ?>"
47
+ placeholder="<?php echo esc_attr( $field_settings['placeholder'] ); ?>"
48
+ value="<?php echo esc_attr( $value ) ?>" size="<?php echo esc_attr( $field_settings['size'] ) ?>"
49
+ autocomplete="url"
50
+ />
51
+ <?php $this->help_text( $field_settings ); ?>
52
+ </div>
53
+
54
+ <?php $this->after_field_print_label();
55
+ }
56
+
57
+ /**
58
+ * Get field options setting
59
+ *
60
+ * @return array
61
+ */
62
+ public function get_options_settings() {
63
+ $default_options = $this->get_default_option_settings();
64
+ $settings = $this->get_default_text_option_settings( false ); // word_restriction = false
65
+
66
+ $settings[] = array(
67
+ 'name' => 'open_window',
68
+ 'title' => __( 'Open in : ', 'wp-user-frontend' ),
69
+ 'type' => 'radio',
70
+ 'options' => array(
71
+ 'same' => __( 'Same Window', 'wp-user-frontend' ),
72
+ 'new' => __( 'New Window', 'wp-user-frontend' ),
73
+ ),
74
+ 'section' => 'basic',
75
+ 'default' => 'same',
76
+ 'inline' => true,
77
+ 'priority' => 32,
78
+ 'help_text' => __( 'Choose whether the link will open in new tab or same window', 'wp-user-frontend' ),
79
+ );
80
+ return array_merge( $default_options, $settings);
81
+ }
82
+
83
+ /**
84
+ * Get the field props
85
+ *
86
+ * @return array
87
+ */
88
+ public function get_field_props() {
89
+
90
+ $defaults = $this->default_attributes();
91
+
92
+ $props=array(
93
+ 'input_type' => 'url',
94
+ 'is_meta' => 'yes',
95
+ 'width' => 'large',
96
+ 'open_window' => 'same',
97
+ 'size' => 40,
98
+ 'id' => 0,
99
+ 'is_new' => true,
100
+ 'show_in_post' => 'yes',
101
+ 'hide_field_label' => 'no',
102
+ );
103
+
104
+ return array_merge($defaults,$props) ;
105
+
106
+ }
107
+
108
+
109
+ /**
110
+ * Prepare entry
111
+ *
112
+ * @param $field
113
+ *
114
+ * @return mixed
115
+ */
116
+ public function prepare_entry( $field ) {
117
+ return esc_url( trim( $_POST[$field['name']] ) );
118
+ }
119
+ }
includes/fields/class-pro-upgrade-fields.php ADDED
@@ -0,0 +1,209 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Address Field Class
5
+ */
6
+ class WPUF_Form_Field_Address extends WPUF_Form_Field_Pro {
7
+
8
+ function __construct() {
9
+ $this->name = __( 'Address Field', 'wp-user-frontend' );
10
+ $this->input_type = 'address_field';
11
+ $this->icon = 'address-card-o';
12
+ }
13
+ }
14
+
15
+ /**
16
+ * Country Field Class
17
+ */
18
+ class WPUF_Form_Field_Country extends WPUF_Form_Field_Pro {
19
+
20
+ function __construct() {
21
+ $this->name = __( 'Country List', 'wp-user-frontend' );
22
+ $this->input_type = 'country_list_field';
23
+ $this->icon = 'globe';
24
+ }
25
+ }
26
+
27
+ /**
28
+ * Date Field Class
29
+ */
30
+
31
+ class WPUF_Form_Field_Date extends WPUF_Form_Field_Pro {
32
+
33
+ function __construct() {
34
+ $this->name = __( 'Date / Time', 'wp-user-frontend' );
35
+ $this->input_type = 'date_field';
36
+ $this->icon = 'calendar-o';
37
+ }
38
+
39
+ }
40
+
41
+ class WPUF_Form_Field_Embed extends WPUF_Form_Field_Pro {
42
+
43
+ function __construct() {
44
+ $this->name = __( 'Embed', 'wp-user-frontend' );
45
+ $this->input_type = 'embed';
46
+ $this->icon = 'address-card-o';
47
+ }
48
+
49
+ }
50
+
51
+ /**
52
+ * File Field Class
53
+ */
54
+ class WPUF_Form_Field_File extends WPUF_Form_Field_Pro {
55
+
56
+ function __construct() {
57
+ $this->name = __( 'File Upload', 'wp-user-frontend' );
58
+ $this->input_type = 'file_upload';
59
+ $this->icon = 'upload';
60
+ }
61
+ }
62
+
63
+ /**
64
+ * Text Field Class
65
+ */
66
+ class WPUF_Form_Field_GMap extends WPUF_Form_Field_Pro {
67
+
68
+ function __construct() {
69
+ $this->name = __( 'Google Map', 'wp-user-frontend' );
70
+ $this->input_type = 'google_map';
71
+ $this->icon = 'map-marker';
72
+ }
73
+ }
74
+
75
+ /**
76
+ * Text Field Class
77
+ */
78
+ class WPUF_Form_Field_Hook extends WPUF_Form_Field_Pro {
79
+
80
+ function __construct() {
81
+ $this->name = __( 'Action Hook', 'wp-user-frontend' );
82
+ $this->input_type = 'action_hook';
83
+ $this->icon = 'anchor';
84
+ }
85
+ }
86
+
87
+ /**
88
+ * Numeric Field Class
89
+ */
90
+ class WPUF_Form_Field_Numeric extends WPUF_Form_Field_Pro {
91
+
92
+ function __construct() {
93
+ $this->name = __( 'Numeric Field', 'wp-user-frontend' );
94
+ $this->input_type = 'numeric_text_field';
95
+ $this->icon = 'hashtag';
96
+ }
97
+ }
98
+
99
+ /**
100
+ * Rating Field Class
101
+ */
102
+ class WPUF_Form_Field_Rating extends WPUF_Form_Field_Pro {
103
+
104
+ function __construct() {
105
+ $this->name = __( 'Ratings', 'wp-user-frontend' );
106
+ $this->input_type = 'ratings';
107
+ $this->icon = 'star-half-o';
108
+ }
109
+ }
110
+
111
+ /**
112
+ * Rating Field Class
113
+ */
114
+ class WPUF_Form_Field_Linear_Scale extends WPUF_Form_Field_Pro {
115
+
116
+ function __construct() {
117
+ $this->name = __( 'Linear Scale', 'wp-user-frontend' );
118
+ $this->input_type = 'linear_scale';
119
+ $this->icon = 'ellipsis-h';
120
+ }
121
+ }
122
+
123
+ /**
124
+ * Checkbox Grids Field Class
125
+ */
126
+ class WPUF_Form_Field_Checkbox_Grid extends WPUF_Form_Field_Pro {
127
+
128
+ function __construct() {
129
+ $this->name = __( 'Checkbox Grid', 'wp-user-frontend' );
130
+ $this->input_type = 'checkbox_grid';
131
+ $this->icon = 'th';
132
+ }
133
+ }
134
+
135
+ /**
136
+ * Multiple Choice Grids Field Class
137
+ */
138
+ class WPUF_Form_Field_Multiple_Choice_Grid extends WPUF_Form_Field_Pro {
139
+
140
+ function __construct() {
141
+ $this->name = __( 'Multiple Choice Grid', 'wp-user-frontend' );
142
+ $this->input_type = 'multiple_choice_grid';
143
+ $this->icon = 'braille';
144
+ }
145
+ }
146
+
147
+ /**
148
+ * Repeat Field Class
149
+ */
150
+ class WPUF_Form_Field_Repeat extends WPUF_Form_Field_Pro {
151
+
152
+ function __construct() {
153
+ $this->name = __( 'Repeat Field', 'wp-user-frontend' );
154
+ $this->input_type = 'repeat_field';
155
+ $this->icon = 'text-width';
156
+ }
157
+ }
158
+
159
+
160
+ /**
161
+ * Really Simple Captcha Field Class
162
+ */
163
+
164
+ class WPUF_Form_Field_Really_Simple_Captcha extends WPUF_Form_Field_Pro {
165
+
166
+ function __construct() {
167
+ $this->name = __( 'Really Simple Captcha', 'wp-user-frontend' );
168
+ $this->input_type = 'shortcode';
169
+ $this->icon = '';
170
+ }
171
+
172
+ }
173
+
174
+
175
+ /**
176
+ * Shortcode Field Class
177
+ */
178
+ class WPUF_Form_Field_Shortcode extends WPUF_Form_Field_Pro {
179
+
180
+ function __construct() {
181
+ $this->name = __( 'Shortcode', 'wp-user-frontend' );
182
+ $this->input_type = 'shortcode';
183
+ $this->icon = 'calendar-o';
184
+ }
185
+ }
186
+
187
+ /**
188
+ * Step Field Class
189
+ */
190
+ class WPUF_Form_Field_Step extends WPUF_Form_Field_Pro {
191
+
192
+ function __construct() {
193
+ $this->name = __( 'Step Start', 'wp-user-frontend' );
194
+ $this->input_type = 'step_start';
195
+ $this->icon = 'step-forward';
196
+ }
197
+ }
198
+
199
+ /**
200
+ * TOC Field Class
201
+ */
202
+ class WPUF_Form_Field_Toc extends WPUF_Form_Field_Pro {
203
+
204
+ function __construct() {
205
+ $this->name = __( 'Terms & Conditions', 'wp-user-frontend' );
206
+ $this->input_type = 'toc';
207
+ $this->icon = 'file-text';
208
+ }
209
+ }
includes/fields/field-trait.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ trait WPUF_Form_Field_Post_trait {
4
+
5
+ /**
6
+ * Prints HTML5 required attribute
7
+ *
8
+ * @param array $attr
9
+ * @return string
10
+ */
11
+ function required_html5( $attr ) {
12
+ if ( $attr['required'] == 'yes' ) {
13
+ // echo ' required="required"';
14
+ }
15
+ }
16
+
17
+ /**
18
+ * Print required class name
19
+ *
20
+ * @param array $attr
21
+ * @return string
22
+ */
23
+ function required_class( $attr ) {
24
+ return;
25
+ if ( $attr['required'] == 'yes' ) {
26
+ echo ' required';
27
+ }
28
+ }
29
+
30
+
31
+ /**
32
+ * Prints required field asterisk
33
+ *
34
+ * @param array $attr
35
+ * @return string
36
+ */
37
+ function required_mark( $attr ) {
38
+ if ( isset( $attr['required'] ) && $attr['required'] == 'yes' ) {
39
+ return ' <span class="required">*</span>';
40
+ }
41
+ }
42
+ }
includes/free/admin/form-builder/class-wpuf-form-builder-field-settings-free.php CHANGED
@@ -6,272 +6,5 @@
6
  */
7
  class WPUF_Form_Builder_Field_Settings_Free extends WPUF_Form_Builder_Field_Settings {
8
 
9
- /**
10
- * Pro field settings
11
- *
12
- * @since 2.5
13
- *
14
- * @return array
15
- */
16
- public static function get_field_settings() {
17
- return array(
18
- 'repeat_field' => self::repeat_field(),
19
- 'date_field' => self::date_field(),
20
- 'file_upload' => self::file_upload(),
21
- 'country_list_field' => self::country_list_field(),
22
- 'numeric_text_field' => self::numeric_text_field(),
23
- 'address_field' => self::address_field(),
24
- 'step_start' => self::step_start(),
25
- 'google_map' => self::google_map(),
26
- 'shortcode' => self::shortcode(),
27
- 'really_simple_captcha' => self::really_simple_captcha(),
28
- 'action_hook' => self::action_hook(),
29
- 'toc' => self::toc(),
30
- 'ratings' => self::ratings(),
31
- 'embed' => self::embed(),
32
- );
33
- }
34
-
35
- /**
36
- * wpuf_cond option field settings
37
- *
38
- * This is for sidebar panel, not in builder stage
39
- *
40
- * @since 2.5
41
- *
42
- * @return array
43
- */
44
- public static function get_field_wpuf_cond() {
45
- return array(
46
- 'name' => 'wpuf_cond',
47
- 'title' => __( 'Conditional Logic', 'wp-user-frontend' ),
48
- 'type' => 'option-pro-feature-alert',
49
- 'section' => 'advanced',
50
- 'priority' => 30,
51
- 'help_text' => '',
52
- 'is_pro_feature' => true
53
- );
54
- }
55
-
56
- /**
57
- * Repeatable field settings
58
- *
59
- * @since 2.5
60
- *
61
- * @return array
62
- */
63
- public static function repeat_field() {
64
- return array(
65
- 'template' => 'repeat_field',
66
- 'title' => __( 'Repeat Field', 'wp-user-frontend' ),
67
- 'icon' => 'clone',
68
- 'pro_feature' => true,
69
- );
70
- }
71
-
72
- /**
73
- * Date Field settings
74
- *
75
- * @since 2.5
76
- *
77
- * @return array
78
- */
79
- public static function date_field() {
80
- return array(
81
- 'template' => 'date_field',
82
- 'title' => __( 'Date / Time', 'wp-user-frontend' ),
83
- 'icon' => 'calendar-o',
84
- 'pro_feature' => true
85
- );
86
- }
87
-
88
- /**
89
- * File upload field settings
90
- *
91
- * @since 2.5
92
- *
93
- * @return array
94
- */
95
- public static function file_upload() {
96
- return array(
97
- 'template' => 'file_upload',
98
- 'title' => __( 'File Upload', 'wp-user-frontend' ),
99
- 'icon' => 'upload',
100
- 'pro_feature' => true
101
- );
102
- }
103
-
104
- /**
105
- * Country list field settings
106
- *
107
- * @since 2.5
108
- *
109
- * @return array
110
- */
111
- public static function country_list_field() {
112
- return array(
113
- 'template' => 'country_list_field',
114
- 'title' => __( 'Country List', 'wp-user-frontend' ),
115
- 'icon' => 'globe',
116
- 'pro_feature' => true
117
- );
118
- }
119
-
120
- /**
121
- * Numeric text field settings
122
- *
123
- * @since 2.5
124
- *
125
- * @return array
126
- */
127
- public static function numeric_text_field() {
128
- return array(
129
- 'template' => 'numeric_text_field',
130
- 'title' => __( 'Numeric Field', 'wp-user-frontend' ),
131
- 'icon' => 'hashtag',
132
- 'pro_feature' => true
133
- );
134
- }
135
-
136
- /**
137
- * Address field settings
138
- *
139
- * @since 2.5
140
- *
141
- * @return array
142
- */
143
- public static function address_field() {
144
- return array(
145
- 'template' => 'address_field',
146
- 'title' => __( 'Address Field', 'wp-user-frontend' ),
147
- 'icon' => 'address-card-o',
148
- 'pro_feature' => true,
149
- );
150
- }
151
-
152
- /**
153
- * Step Start field settings
154
- *
155
- * @since 2.5
156
- *
157
- * @return array
158
- */
159
- public static function step_start() {
160
- return array(
161
- 'template' => 'step_start',
162
- 'title' => __( 'Step Start', 'wp-user-frontend' ),
163
- 'icon' => 'step-forward',
164
- 'pro_feature' => true,
165
- 'is_full_width' => true,
166
- );
167
- }
168
-
169
-
170
- /**
171
- * Google Map
172
- *
173
- * @since 2.5
174
- *
175
- * @return array
176
- */
177
- public static function google_map() {
178
- return array(
179
- 'template' => 'google_map',
180
- 'title' => __( 'Google Map', 'wp-user-frontend' ),
181
- 'icon' => 'map-marker',
182
- 'pro_feature' => true,
183
- );
184
- }
185
-
186
- /**
187
- * Shortcode
188
- *
189
- * @since 2.5.4
190
- *
191
- * @return array
192
- */
193
- public static function shortcode() {
194
- return array(
195
- 'template' => 'shortcode',
196
- 'title' => __( 'Shortcode', 'wp-user-frontend' ),
197
- 'pro_feature' => true,
198
- );
199
- }
200
-
201
- /**
202
- * Really Simple Captcha
203
- *
204
- * @since 2.5
205
- *
206
- * @return array
207
- */
208
- public static function really_simple_captcha() {
209
- return array(
210
- 'template' => 'really_simple_captcha',
211
- 'title' => __( 'Really Simple Captcha', 'wp-user-frontend' ),
212
- 'pro_feature' => true,
213
- );
214
- }
215
-
216
- /**
217
- * Action Hook
218
- *
219
- * @since 2.5
220
- *
221
- * @return array
222
- */
223
- public static function action_hook() {
224
- return array(
225
- 'template' => 'action_hook',
226
- 'title' => __( 'Action Hook', 'wp-user-frontend' ),
227
- 'pro_feature' => true,
228
- );
229
- }
230
-
231
- /**
232
- * Term & Conditions
233
- *
234
- * @since 2.5
235
- *
236
- * @return array
237
- */
238
- public static function toc() {
239
- return array(
240
- 'template' => 'toc',
241
- 'title' => __( 'Term & Conditions', 'wp-user-frontend' ),
242
- 'pro_feature' => true,
243
- );
244
- }
245
-
246
- /**
247
- * Ratings
248
- *
249
- * @since 2.5
250
- *
251
- * @return array
252
- */
253
- public static function ratings() {
254
- return array(
255
- 'template' => 'ratings',
256
- 'title' => __( 'Ratings', 'wp-user-frontend' ),
257
- 'pro_feature' => true,
258
- );
259
- }
260
-
261
- /**
262
- * Ratings
263
- *
264
- * @since 2.5
265
- *
266
- * @return array
267
- */
268
- public static function embed() {
269
- return array(
270
- 'template' => 'embed',
271
- 'title' => __( 'Embed', 'wp-user-frontend' ),
272
- 'icon' => 'play-circle',
273
- 'pro_feature' => true,
274
- );
275
- }
276
 
277
  }
6
  */
7
  class WPUF_Form_Builder_Field_Settings_Free extends WPUF_Form_Builder_Field_Settings {
8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
 
10
  }
includes/free/admin/form-builder/class-wpuf-form-builder-free.php CHANGED
@@ -12,70 +12,7 @@ class WPUF_Admin_Form_Builder_Free {
12
  * @return void
13
  */
14
  public function __construct() {
15
- add_filter( 'wpuf-form-builder-field-settings', array( $this, 'add_field_settings' ) );
16
- add_filter( 'wpuf-form-builder-fields-common-properties', array( $this, 'add_fields_common_properties' ) );
17
- add_filter( 'wpuf-form-builder-fields-custom-fields', array( $this, 'add_custom_fields' ) );
18
- add_filter( 'wpuf-form-builder-fields-others-fields', array( $this, 'add_others_fields' ) );
19
- }
20
-
21
- /**
22
- * Field settings hook
23
- *
24
- * @since 2.5
25
- *
26
- * @param array $settings
27
- *
28
- * @return array
29
- */
30
- public function add_field_settings( $settings ) {
31
- require_once WPUF_ROOT . '/includes/free/admin/form-builder/class-wpuf-form-builder-field-settings-free.php';
32
-
33
- return array_merge( $settings, WPUF_Form_Builder_Field_Settings_Free::get_field_settings() );
34
- }
35
-
36
- /**
37
- * Add common properties
38
- *
39
- * @since 2.5
40
- *
41
- * @param array $common_properties
42
- */
43
- public function add_fields_common_properties( $common_properties ) {
44
- require_once WPUF_ROOT . '/includes/free/admin/form-builder/class-wpuf-form-builder-field-settings-free.php';
45
-
46
- array_push( $common_properties, WPUF_Form_Builder_Field_Settings_Free::get_field_wpuf_cond() );
47
- return $common_properties;
48
- }
49
-
50
- /**
51
- * Add fields in Custom Fields
52
- *
53
- * @since 2.5
54
- *
55
- * @param array $fields
56
- *
57
- * @return void
58
- */
59
- public function add_custom_fields( $fields ) {
60
- return array_merge( $fields, array(
61
- 'repeat_field', 'date_field', 'file_upload', 'country_list_field',
62
- 'numeric_text_field', 'address_field', 'step_start', 'google_map', 'embed'
63
- ) );
64
- }
65
-
66
- /**
67
- * Add fields in Others Fields
68
- *
69
- * @since 2.5
70
- *
71
- * @param array $fields
72
- *
73
- * @return void
74
- */
75
- public function add_others_fields( $fields ) {
76
- return array_merge( $fields, array(
77
- 'shortcode', 'really_simple_captcha', 'action_hook', 'toc', 'ratings'
78
- ) );
79
  }
80
 
81
  }
12
  * @return void
13
  */
14
  public function __construct() {
15
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  }
17
 
18
  }
includes/free/class-login.php CHANGED
@@ -740,8 +740,10 @@ class WPUF_Simple_Login {
740
  return;
741
  }
742
 
743
- $user_id = intval( $_GET['id'] );
744
- $user = new WPUF_User( $user_id );
 
 
745
 
746
  if ( !$user ) {
747
  wpuf()->login->add_error( 'Invalid User activation url' );
@@ -763,15 +765,13 @@ class WPUF_Simple_Login {
763
  $user->mark_verified();
764
  $user->remove_activation_key();
765
 
766
- $register_link_override = wpuf_get_option( 'register_link_override', 'wpuf_profile', false );
767
 
768
- if ( $register_link_override == 'on' ) {
769
- wp_clear_auth_cookie();
770
- wp_set_current_user( $user_id );
771
- wp_set_auth_cookie( $user_id );
772
  }
773
 
774
- wpuf()->login->add_message( __( 'Your account has been activated' , 'wp-user-frontend') );
775
 
776
  // show activation message
777
  add_filter( 'wp_login_errors', array( $this, 'user_activation_message' ) );
@@ -824,7 +824,7 @@ class WPUF_Simple_Login {
824
 
825
  wp_mail( $user_email, $subject, $message );
826
  }
827
-
828
  do_action( 'wpuf_user_activated', $user_id );
829
  }
830
 
740
  return;
741
  }
742
 
743
+ $user_id = intval( $_GET['id'] );
744
+ $user = new WPUF_User( $user_id );
745
+ $wpuf_user_active = get_user_meta( $user_id, '_wpuf_user_active', true );
746
+ $wpuf_user_status = get_user_meta( $user_id, 'wpuf_user_status', true );
747
 
748
  if ( !$user ) {
749
  wpuf()->login->add_error( 'Invalid User activation url' );
765
  $user->mark_verified();
766
  $user->remove_activation_key();
767
 
768
+ $message = __( "Your account has been activated", "wp-user-frontend" );
769
 
770
+ if ( $wpuf_user_status != "approved" ) {
771
+ $message = __( "Your account has been verified , but you can't login until manually approved your account by an administrator.", "wp-user-frontend" );
 
 
772
  }
773
 
774
+ wpuf()->login->add_message( $message );
775
 
776
  // show activation message
777
  add_filter( 'wp_login_errors', array( $this, 'user_activation_message' ) );
824
 
825
  wp_mail( $user_email, $subject, $message );
826
  }
827
+ add_filter('redirect_canonical', '__return_false');
828
  do_action( 'wpuf_user_activated', $user_id );
829
  }
830
 
includes/free/class-registration.php CHANGED
@@ -258,6 +258,39 @@ class WPUF_Registration {
258
  }
259
 
260
  $user = wp_insert_user( $userdata );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
261
  $autologin_after_registration = wpuf_get_option( 'autologin_after_registration', 'wpuf_profile', 'on' );
262
 
263
  if ( $autologin_after_registration == 'on' ) {
258
  }
259
 
260
  $user = wp_insert_user( $userdata );
261
+
262
+ if ( is_wp_error( $user ) ) {
263
+ $this->registration_errors[] = $user->get_error_message();
264
+ return;
265
+ } else {
266
+
267
+ $wpuf_user = new WP_User( $user );
268
+ $user_login = stripslashes( $wpuf_user->user_login );
269
+ $user_email = stripslashes( $wpuf_user->user_email );
270
+ $blogname = wp_specialchars_decode( get_option('blogname'), ENT_QUOTES );
271
+
272
+ $message = sprintf(__('New user registration on your site %s:', 'wp-user-frontend'), get_option('blogname')) . "\r\n\r\n";
273
+ $message .= sprintf(__('Username: %s', 'wp-user-frontend'), $user_login) . "\r\n\r\n";
274
+ $message .= sprintf(__('E-mail: %s', 'wp-user-frontend'), $user_email) . "\r\n";
275
+ $subject = "New User Registration";
276
+
277
+ $subject = apply_filters( 'wpuf_default_reg_admin_mail_subject', $subject );
278
+ $message = apply_filters( 'wpuf_default_reg_admin_mail_body', $message );
279
+
280
+ wp_mail(get_option('admin_email'), sprintf(__('[%s] %s', 'wp-user-frontend'), $blogname, $subject ), $message);
281
+
282
+ $message = sprintf(__('Hi, %s', 'wp-user-frontend'), $user_login) . "\r\n";
283
+ $message .= "Congrats! You are Successfully registered to ". $blogname ."\r\n\r\n";
284
+ $message .= "Thanks";
285
+ $subject = "Thank you for registering";
286
+
287
+ $subject = apply_filters( 'wpuf_default_reg_mail_subject', $subject );
288
+ $message = apply_filters( 'wpuf_default_reg_mail_body', $message );
289
+
290
+ wp_mail( $user_email, sprintf(__('[%s] %s', 'wp-user-frontend'), $blogname, $subject ), $message );
291
+
292
+ }
293
+
294
  $autologin_after_registration = wpuf_get_option( 'autologin_after_registration', 'wpuf_profile', 'on' );
295
 
296
  if ( $autologin_after_registration == 'on' ) {
includes/free/edit-profile.php CHANGED
@@ -241,9 +241,12 @@ class WPUF_Edit_Profile {
241
  $wpuf_subscription = $current_user->subscription();
242
  $post_locked = $current_user->post_locked();
243
  $lock_reason = $current_user->lock_reason();
 
 
244
 
245
  if ( is_admin() && current_user_can( 'edit_users' ) ) {
246
- $select = ( $post_locked == true ) ? 'yes' : 'no';
 
247
  ?>
248
  <div class="wpuf-user-post-lock">
249
  <h3><?php _e( 'WPUF Post Lock', 'wp-user-frontend' ); ?></h3>
@@ -258,13 +261,29 @@ class WPUF_Edit_Profile {
258
  <span class="description"><?php _e( 'Lock user from creating new post.', 'wp-user-frontend' ); ?></span></em>
259
  </td>
260
  </tr>
261
-
262
  <tr>
263
  <th><label for="post-lock"><?php _e( 'Lock Reason:', 'wp-user-frontend' ); ?> </label></th>
264
  <td>
265
  <input type="text" name="wpuf_lock_cause" id="wpuf_lock_cause" class="regular-text" value="<?php echo esc_attr( $lock_reason ); ?>" />
266
  </td>
267
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
268
  </table>
269
  </div>
270
  <?php
@@ -280,6 +299,8 @@ class WPUF_Edit_Profile {
280
  if ( is_admin() && current_user_can( 'edit_users' ) ) {
281
  update_user_meta( $user_id, 'wpuf_postlock', $_POST['wpuf_postlock'] );
282
  update_user_meta( $user_id, 'wpuf_lock_cause', $_POST['wpuf_lock_cause'] );
 
 
283
  }
284
  }
285
 
241
  $wpuf_subscription = $current_user->subscription();
242
  $post_locked = $current_user->post_locked();
243
  $lock_reason = $current_user->lock_reason();
244
+ $edit_post_locked = $current_user->edit_post_locked();
245
+ $edit_lock_reason = $current_user->edit_post_lock_reason();
246
 
247
  if ( is_admin() && current_user_can( 'edit_users' ) ) {
248
+ $select = ( $post_locked == true ) ? 'yes' : 'no';
249
+ $edit_post_select = ( $edit_post_locked == true ) ? 'yes' : 'no';
250
  ?>
251
  <div class="wpuf-user-post-lock">
252
  <h3><?php _e( 'WPUF Post Lock', 'wp-user-frontend' ); ?></h3>
261
  <span class="description"><?php _e( 'Lock user from creating new post.', 'wp-user-frontend' ); ?></span></em>
262
  </td>
263
  </tr>
 
264
  <tr>
265
  <th><label for="post-lock"><?php _e( 'Lock Reason:', 'wp-user-frontend' ); ?> </label></th>
266
  <td>
267
  <input type="text" name="wpuf_lock_cause" id="wpuf_lock_cause" class="regular-text" value="<?php echo esc_attr( $lock_reason ); ?>" />
268
  </td>
269
  </tr>
270
+
271
+ <tr>
272
+ <th><label for="post-lock"><?php _e( 'Lock Edit Post:', 'wp-user-frontend' ); ?> </label></th>
273
+ <td>
274
+ <select name="wpuf_edit_postlock" id="edit-post-lock">
275
+ <option value="no"<?php selected( $edit_post_select, 'no' ); ?>>No</option>
276
+ <option value="yes"<?php selected( $edit_post_select, 'yes' ); ?>>Yes</option>
277
+ </select>
278
+ <span class="description"><?php _e( 'Lock user from editing post.', 'wp-user-frontend' ); ?></span></em>
279
+ </td>
280
+ </tr>
281
+ <tr>
282
+ <th><label for="post-lock"><?php _e( 'Edit Post Lock Reason:', 'wp-user-frontend' ); ?> </label></th>
283
+ <td>
284
+ <input type="text" name="wpuf_edit_post_lock_cause" id="wpuf_edit_post_lock_cause" class="regular-text" value="<?php echo esc_attr( $edit_lock_reason ); ?>" />
285
+ </td>
286
+ </tr>
287
  </table>
288
  </div>
289
  <?php
299
  if ( is_admin() && current_user_can( 'edit_users' ) ) {
300
  update_user_meta( $user_id, 'wpuf_postlock', $_POST['wpuf_postlock'] );
301
  update_user_meta( $user_id, 'wpuf_lock_cause', $_POST['wpuf_lock_cause'] );
302
+ update_user_meta( $user_id, 'wpuf_edit_postlock', $_POST['wpuf_edit_postlock'] );
303
+ update_user_meta( $user_id, 'wpuf_edit_post_lock_cause', $_POST['wpuf_edit_post_lock_cause'] );
304
  }
305
  }
306
 
includes/free/post-form-templates/woocommerce.php CHANGED
@@ -309,8 +309,9 @@ Edit URL: %editlink%',
309
  */
310
  public function update_gallery_images( $post_id ) {
311
  $images = get_post_meta( $post_id, '_product_image' );
 
312
  if ( !empty( $images ) ) {
313
- if ( is_array( $images ) ) {
314
  $images = maybe_unserialize( $images[0] );
315
  }
316
  update_post_meta( $post_id, '_product_image_gallery', implode( ',', $images ) );
309
  */
310
  public function update_gallery_images( $post_id ) {
311
  $images = get_post_meta( $post_id, '_product_image' );
312
+
313
  if ( !empty( $images ) ) {
314
+ if ( is_serialized( $images[0] ) ) {
315
  $images = maybe_unserialize( $images[0] );
316
  }
317
  update_post_meta( $post_id, '_product_image_gallery', implode( ',', $images ) );
languages/readme.txt CHANGED
File without changes
languages/wp-user-frontend.pot CHANGED
@@ -1,14 +1,14 @@
1
- # Copyright (C) 2018 Tareq Hasan
2
  # This file is distributed under the GPL2 or later.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: WP User Frontend 3.0.1\n"
6
  "Report-Msgid-Bugs-To: https://wedevs.com/contact/\n"
7
- "POT-Creation-Date: 2018-12-05 07:27:48+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
- "PO-Revision-Date: 2018-MO-DA HO:MI+ZONE\n"
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <EMAIL@ADDRESS>\n"
14
  "X-Generator: grunt-wp-i18n 0.5.4\n"
@@ -83,6 +83,10 @@ msgstr ""
83
  msgid "Number of items per page:"
84
  msgstr ""
85
 
 
 
 
 
86
  #: admin/class-admin-subscription.php:60
87
  msgid "Pack Description"
88
  msgstr ""
@@ -139,35 +143,37 @@ msgstr ""
139
  #: admin/class-admin-subscription.php:216
140
  #: admin/class-admin-subscription.php:570 class/frontend-account.php:244
141
  #: class/subscription.php:866 includes/class-user-subscription.php:307
142
- #: templates/subscriptions/pack-details.php:26
143
  msgid "Free"
144
  msgstr ""
145
 
146
  #: admin/class-admin-subscription.php:234
147
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:66
148
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:140
149
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:154
150
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:544
151
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:603
152
- #: admin/form.php:805 admin/html/form-settings-display.php:41
153
- #: admin/post-forms-list-table.php:344 admin/settings-options.php:112
154
- #: admin/settings-options.php:123 admin/settings-options.php:215
155
- #: admin/settings-options.php:226 admin/template.php:70
156
- #: class/asset-loader.php:49 includes/free/form-element.php:477 wpuf.php:534
 
157
  msgid "Yes"
158
  msgstr ""
159
 
160
  #: admin/class-admin-subscription.php:236
161
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:67
162
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:141
163
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:155
164
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:545
165
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:604
166
- #: admin/form.php:806 admin/html/form-settings-display.php:40
167
- #: admin/post-forms-list-table.php:345 admin/settings-options.php:113
168
- #: admin/settings-options.php:124 admin/settings-options.php:216
169
- #: admin/settings-options.php:227 admin/template.php:71
170
- #: class/asset-loader.php:50 includes/free/form-element.php:478 wpuf.php:535
 
171
  msgid "No"
172
  msgstr ""
173
 
@@ -297,7 +303,7 @@ msgid "Assign Package"
297
  msgstr ""
298
 
299
  #: admin/class-admin-subscription.php:754
300
- #: admin/form-builder/class-wpuf-admin-form-builder.php:329
301
  #: class/payment.php:199 class/subscription.php:779
302
  #: includes/class-list-table-subscribers.php:128
303
  #: lib/class-wedevs-insights.php:667 templates/dashboard/subscription.php:61
@@ -334,7 +340,7 @@ msgstr ""
334
 
335
  #: admin/class-tools.php:39 admin/class-tools.php:95
336
  #: admin/post-forms-list-table.php:43 class/transactions-list-table.php:86
337
- #: includes/class-list-table-subscribers.php:126 wpuf-functions.php:2608
338
  msgid "All"
339
  msgstr ""
340
 
@@ -514,14 +520,15 @@ msgstr ""
514
 
515
  #: admin/form-builder/assets/js/components/form-featured_image/template.php:6
516
  #: admin/form-builder/assets/js/components/form-image_upload/template.php:6
517
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:802
518
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:836
519
- #: admin/form.php:688 admin/form.php:714 class/render-form.php:1680
 
520
  msgid "Select Image"
521
  msgstr ""
522
 
523
  #: admin/form-builder/assets/js/components/form-post_content/template.php:4
524
- #: class/render-form.php:1049
525
  msgid "Insert Photo"
526
  msgstr ""
527
 
@@ -537,521 +544,81 @@ msgstr ""
537
  msgid "Invalid form id"
538
  msgstr ""
539
 
540
- #: admin/form-builder/class-wpuf-admin-form-builder.php:287
541
- msgid "Custom Fields"
542
- msgstr ""
543
-
544
- #: admin/form-builder/class-wpuf-admin-form-builder.php:308
545
- msgid "Others"
546
- msgstr ""
547
-
548
- #: admin/form-builder/class-wpuf-admin-form-builder.php:324
549
  msgid "Advanced Options"
550
  msgstr ""
551
 
552
- #: admin/form-builder/class-wpuf-admin-form-builder.php:325
553
  msgid "Are you sure you want to delete this field?"
554
  msgstr ""
555
 
556
- #: admin/form-builder/class-wpuf-admin-form-builder.php:326
557
- #: admin/posting.php:69 class/asset-loader.php:55 wpuf.php:544
558
  msgid "Yes, delete it"
559
  msgstr ""
560
 
561
- #: admin/form-builder/class-wpuf-admin-form-builder.php:327
562
- #: admin/posting.php:70 class/asset-loader.php:56 wpuf.php:545
563
  msgid "No, cancel it"
564
  msgstr ""
565
 
566
- #: admin/form-builder/class-wpuf-admin-form-builder.php:328
567
  msgid "OK"
568
  msgstr ""
569
 
570
- #: admin/form-builder/class-wpuf-admin-form-builder.php:330
571
  #: includes/free/admin/shortcode-builder.php:69
572
  msgid "Close"
573
  msgstr ""
574
 
575
- #: admin/form-builder/class-wpuf-admin-form-builder.php:331
576
- msgid "This field must contain at least one choice"
577
- msgstr ""
578
-
579
- #: admin/form-builder/class-wpuf-admin-form-builder.php:332
580
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:470
581
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:514
582
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:574
583
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:633
584
- msgid "Option"
585
- msgstr ""
586
-
587
- #: admin/form-builder/class-wpuf-admin-form-builder.php:333
588
- msgid "Column"
589
- msgstr ""
590
-
591
- #: admin/form-builder/class-wpuf-admin-form-builder.php:334
592
- msgid "This field must contain at least one column"
593
- msgstr ""
594
-
595
- #: admin/form-builder/class-wpuf-admin-form-builder.php:335
596
- msgid "is available in Pro version"
597
- msgstr ""
598
-
599
- #: admin/form-builder/class-wpuf-admin-form-builder.php:336
600
- msgid "Please upgrade to the Pro version to unlock all these awesome features"
601
- msgstr ""
602
-
603
- #: admin/form-builder/class-wpuf-admin-form-builder.php:337
604
- msgid "Get the Pro version"
605
- msgstr ""
606
-
607
- #: admin/form-builder/class-wpuf-admin-form-builder.php:338 admin/form.php:780
608
- msgid "Select"
609
- msgstr ""
610
-
611
- #: admin/form-builder/class-wpuf-admin-form-builder.php:339
612
- msgid "Saved form data"
613
- msgstr ""
614
-
615
- #: admin/form-builder/class-wpuf-admin-form-builder.php:340
616
- msgid "You have unsaved changes."
617
- msgstr ""
618
-
619
- #: admin/form-builder/class-wpuf-admin-form-builder.php:341
620
- #: admin/form-builder/views/form-builder.php:49
621
- msgid "Click to copy shortcode"
622
- msgstr ""
623
-
624
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:45
625
- #: admin/template.php:76
626
- msgid "Field Label"
627
- msgstr ""
628
-
629
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:49
630
- #: admin/template.php:77
631
- msgid "Enter a title of this field"
632
- msgstr ""
633
-
634
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:54
635
- #: admin/template.php:94
636
- msgid "Help text"
637
- msgstr ""
638
-
639
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:58
640
- #: admin/template.php:95
641
- msgid "Give the user some information about this field"
642
- msgstr ""
643
-
644
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:63
645
- #: admin/template.php:67 includes/class-customizer.php:107
646
- msgid "Required"
647
- msgstr ""
648
-
649
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:73
650
- msgid ""
651
- "Check this option to mark the field required. A form will not submit unless "
652
- "all required fields are provided."
653
- msgstr ""
654
-
655
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:78
656
- msgid "Field Size"
657
- msgstr ""
658
-
659
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:81
660
- msgid "Small"
661
- msgstr ""
662
-
663
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:82
664
- msgid "Medium"
665
- msgstr ""
666
-
667
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:83
668
- msgid "Large"
669
- msgstr ""
670
-
671
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:93
672
- #: admin/template.php:99
673
- msgid "CSS Class Name"
674
- msgstr ""
675
-
676
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:97
677
- msgid ""
678
- "Provide a container class name for this field. Available classes: "
679
- "wpuf-col-half, wpuf-col-half-last, wpuf-col-one-third, "
680
- "wpuf-col-one-third-last"
681
- msgstr ""
682
-
683
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:105
684
- #: admin/template-post.php:210
685
- msgid "Visibility"
686
- msgstr ""
687
-
688
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:109
689
- msgid "Everyone"
690
- msgstr ""
691
-
692
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:110
693
- #: admin/html/form-settings-display.php:19 includes/class-customizer.php:105
694
- msgid "Hidden"
695
- msgstr ""
696
-
697
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:111
698
- msgid "Logged in users only"
699
- msgstr ""
700
-
701
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:112
702
- msgid "Subscription users only"
703
- msgstr ""
704
-
705
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:116
706
- msgid "Select option"
707
- msgstr ""
708
-
709
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:125
710
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:748
711
- #: admin/template.php:82 admin/template.php:575
712
- msgid "Meta Key"
713
- msgstr ""
714
-
715
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:129
716
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:752
717
- #: admin/template.php:83 admin/template.php:576
718
- msgid "Name of the meta key this field will save to"
719
- msgstr ""
720
-
721
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:137
722
- msgid "Show Data in Post"
723
- msgstr ""
724
-
725
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:147
726
- msgid "Select Yes if you want to show the field data in single post."
727
- msgstr ""
728
-
729
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:151
730
- msgid "Hide Field Label in Post"
731
- msgstr ""
732
-
733
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:161
734
- msgid "Select Yes if you want to hide the field label in single post."
735
- msgstr ""
736
-
737
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:181
738
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:251
739
- #: admin/template.php:126 admin/template.php:186
740
- msgid "Placeholder text"
741
- msgstr ""
742
-
743
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:185
744
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:255
745
- #: admin/template.php:127
746
- msgid "Text for HTML5 placeholder attribute"
747
- msgstr ""
748
-
749
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:190
750
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:263
751
- #: admin/template.php:131 admin/template.php:191
752
- msgid "Default value"
753
- msgstr ""
754
-
755
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:194
756
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:267
757
- #: admin/template.php:132
758
- msgid "The default value this field will have"
759
- msgstr ""
760
-
761
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:199
762
- #: admin/template.php:136
763
- msgid "Size"
764
- msgstr ""
765
-
766
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:204
767
- #: admin/template.php:137
768
- msgid "Size of this input field"
769
- msgstr ""
770
-
771
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:211
772
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:286
773
- #: admin/template.php:141 admin/template.php:206
774
- msgid "Word Restriction"
775
- msgstr ""
776
-
777
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:215
778
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:290
779
- #: admin/template.php:145 admin/template.php:210
780
- msgid "Numebr of words the author to be restricted in"
781
- msgstr ""
782
-
783
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:233
784
- #: admin/template.php:176
785
- msgid "Rows"
786
- msgstr ""
787
-
788
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:237
789
- msgid "Number of rows in textarea"
790
- msgstr ""
791
-
792
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:242
793
- #: admin/template.php:181
794
- msgid "Columns"
795
- msgstr ""
796
-
797
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:246
798
- msgid "Number of columns in textarea"
799
- msgstr ""
800
-
801
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:272
802
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:379
803
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:386
804
- #: admin/template.php:196
805
- msgid "Textarea"
806
- msgstr ""
807
-
808
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:275
809
- #: admin/template.php:199
810
- msgid "Normal"
811
- msgstr ""
812
-
813
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:276
814
- #: admin/template.php:200
815
- msgid "Rich textarea"
816
- msgstr ""
817
-
818
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:277
819
- #: admin/template.php:201
820
- msgid "Teeny Rich textarea"
821
- msgstr ""
822
-
823
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:321
824
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:471
825
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:515
826
- #: admin/form.php:910
827
- msgid "- select -"
828
- msgstr ""
829
-
830
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:339
831
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:346
832
- msgid "Text"
833
- msgstr ""
834
-
835
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:420
836
- #: admin/template.php:398 admin/template.php:422 admin/template.php:454
837
- #: admin/template.php:486 templates/dashboard/posts.php:85
838
- #: templates/dashboard.php:124
839
- msgid "Options"
840
- msgstr ""
841
-
842
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:425
843
- msgid "Add options for the form field"
844
- msgstr ""
845
-
846
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:444
847
- #: admin/form.php:793 admin/template.php:449 admin/template.php:481
848
- msgid "Select Text"
849
- msgstr ""
850
-
851
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:448
852
- #: admin/form.php:797 admin/template.php:438 admin/template.php:470
853
- msgid ""
854
- "First element of the select dropdown. Leave this empty if you don't want to "
855
- "show this field"
856
- msgstr ""
857
-
858
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:456
859
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:463
860
- #: admin/template-post.php:156
861
- msgid "Dropdown"
862
- msgstr ""
863
-
864
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:500
865
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:507
866
- #: admin/form.php:781 admin/template-post.php:157
867
- msgid "Multi Select"
868
- msgstr ""
869
-
870
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:541
871
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:600
872
- #: admin/form.php:802
873
- msgid "Show in inline list"
874
- msgstr ""
875
-
876
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:551
877
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:610
878
- #: admin/form.php:812
879
- msgid "Show this option in an inline list"
880
- msgstr ""
881
-
882
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:559
883
- msgid "Radio"
884
- msgstr ""
885
-
886
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:566
887
- msgid "Radio Field"
888
- msgstr ""
889
-
890
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:618
891
- #: admin/form.php:782 admin/template-post.php:158
892
- msgid "Checkbox"
893
- msgstr ""
894
-
895
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:625
896
- msgid "Checkbox Field"
897
- msgstr ""
898
-
899
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:656
900
- msgid "Open in : "
901
- msgstr ""
902
-
903
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:659
904
- msgid "Same Window"
905
- msgstr ""
906
-
907
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:660
908
- msgid "New Window"
909
- msgstr ""
910
-
911
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:666
912
- msgid "Choose whether the link will open in new tab or same window"
913
- msgstr ""
914
-
915
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:671
916
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:678
917
- msgid "URL"
918
- msgstr ""
919
-
920
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:711
921
- msgid "Email Address"
922
- msgstr ""
923
-
924
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:718
925
- #: admin/html/form-submission-restriction.php:12 admin/html/support.php:224
926
- #: class/transactions-list-table.php:49 includes/class-privacy.php:371
927
- #: includes/free/edit-user.php:153 templates/registration-form.php:44
928
- msgid "Email"
929
- msgstr ""
930
-
931
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:757
932
- #: admin/template.php:582
933
- msgid "Meta Value"
934
- msgstr ""
935
-
936
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:761
937
- #: admin/template.php:583
938
- msgid "Enter the meta value"
939
- msgstr ""
940
-
941
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:767
942
- msgid "Hidden Field"
943
- msgstr ""
944
-
945
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:800
946
- #: admin/form.php:686
947
- msgid "Button Label"
948
- msgstr ""
949
-
950
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:805
951
- #: admin/form.php:691
952
- msgid "Enter a label for the Select button"
953
- msgstr ""
954
-
955
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:809
956
- #: admin/form.php:695 admin/template-post.php:105 admin/template.php:646
957
- msgid "Max. file size"
958
- msgstr ""
959
-
960
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:813
961
- #: admin/form.php:699 admin/template-post.php:93 admin/template.php:634
962
- msgid "Enter maximum upload size limit in KB"
963
- msgstr ""
964
-
965
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:817
966
- #: admin/template.php:651
967
- msgid "Max. files"
968
- msgstr ""
969
-
970
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:821
971
- #: admin/template.php:635
972
- msgid "Number of images can be uploaded"
973
- msgstr ""
974
-
975
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:827
976
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:834
977
- #: includes/free/form-element.php:8
978
- msgid "Image Upload"
979
- msgstr ""
980
-
981
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:864
982
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:951
983
- #: admin/template.php:544 admin/template.php:604 admin/template.php:683
984
- #: class/upload.php:168 templates/dashboard/posts.php:76
985
- #: templates/dashboard.php:86 wpuf-functions.php:795
986
- msgid "Title"
987
- msgstr ""
988
-
989
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:868
990
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:955
991
- msgid "Title of the section"
992
- msgstr ""
993
-
994
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:873
995
- #: admin/template.php:609 class/upload.php:170 wpuf-functions.php:801
996
- msgid "Description"
997
- msgstr ""
998
-
999
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:877
1000
- msgid "Some details text about the section"
1001
- msgstr ""
1002
-
1003
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:883
1004
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:890
1005
- msgid "Section Break"
1006
  msgstr ""
1007
 
1008
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:891
1009
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:931
1010
- msgid "Some description about this section"
 
 
 
1011
  msgstr ""
1012
 
1013
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:913
1014
- #: admin/template.php:549
1015
- msgid "HTML Codes"
1016
  msgstr ""
1017
 
1018
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:917
1019
- msgid "Paste your HTML codes, WordPress shortcodes will also work here"
1020
  msgstr ""
1021
 
1022
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:923
1023
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:930
1024
- msgid "Custom HTML"
1025
  msgstr ""
1026
 
1027
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:963
1028
- #: admin/template.php:703
1029
- msgid "Enable noCaptcha"
1030
  msgstr ""
1031
 
1032
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:964
1033
- #: admin/template.php:699
1034
- msgid "Enable Invisible reCaptcha"
1035
  msgstr ""
1036
 
1037
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:969
1038
- msgid "Select reCaptcha type"
 
1039
  msgstr ""
1040
 
1041
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:975
1042
- #: includes/free/form-element.php:31
1043
- msgid "reCaptcha"
1044
  msgstr ""
1045
 
1046
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:980
1047
- msgid "Site key and Secret key"
1048
  msgstr ""
1049
 
1050
- #: admin/form-builder/class-wpuf-form-builder-field-settings.php:982
1051
- msgid ""
1052
- "You need to set Site key and Secret key in <a href=\"%s\" "
1053
- "target=\"_blank\">Settings</a> in order to use \"Recaptcha\" field. <a "
1054
- "href=\"%s\" target=\"_blank\">Click here to get the these key</a>."
1055
  msgstr ""
1056
 
1057
  #: admin/form-builder/views/form-builder.php:5
@@ -1225,130 +792,11 @@ msgid "Taxonomies"
1225
  msgstr ""
1226
 
1227
  #: admin/form.php:440 admin/html/form-settings-post.php:22
1228
- #: class/render-form.php:753
1229
  msgid "Save Draft"
1230
  msgstr ""
1231
 
1232
- #: admin/form.php:550 admin/form.php:557 class/post-form-templates/post.php:20
1233
- #: includes/class-privacy.php:429
1234
- msgid "Post Title"
1235
- msgstr ""
1236
-
1237
- #: admin/form.php:589 admin/template-post.php:41
1238
- msgid "Enable Image Insertion"
1239
- msgstr ""
1240
-
1241
- #: admin/form.php:591 admin/template-post.php:47
1242
- msgid "Enable image upload in post area"
1243
- msgstr ""
1244
-
1245
- #: admin/form.php:600 admin/form.php:607
1246
- msgid "Post Body"
1247
- msgstr ""
1248
-
1249
- #: admin/form.php:646 admin/form.php:653 class/post-form-templates/post.php:85
1250
- #: includes/free/post-form-templates/the_events_calendar.php:138
1251
- #: templates/dashboard.php:112
1252
- msgid "Excerpt"
1253
- msgstr ""
1254
-
1255
- #: admin/form.php:705 admin/form.php:712 class/post-form-templates/post.php:72
1256
- #: class/post-form-templates/post.php:73
1257
- #: includes/free/post-form-templates/the_events_calendar.php:125
1258
- #: includes/free/post-form-templates/the_events_calendar.php:126
1259
- #: templates/dashboard/posts.php:73 templates/dashboard.php:83
1260
- msgid "Featured Image"
1261
- msgstr ""
1262
-
1263
- #: admin/form.php:741 admin/form.php:747 class/post-form-templates/post.php:101
1264
- msgid "Tags"
1265
- msgstr ""
1266
-
1267
- #: admin/form.php:777 admin/template-post.php:154
1268
- msgid "Type"
1269
- msgstr ""
1270
-
1271
- #: admin/form.php:783 admin/template-post.php:159
1272
- msgid "Text Input"
1273
- msgstr ""
1274
-
1275
- #: admin/form.php:784 admin/template-post.php:160
1276
- msgid "Ajax"
1277
- msgstr ""
1278
-
1279
- #: admin/form.php:817 admin/template-post.php:165
1280
- msgid "Order By"
1281
- msgstr ""
1282
-
1283
- #: admin/form.php:820 admin/html/form-submission-restriction.php:11
1284
- #: admin/template-post.php:167 includes/free/edit-profile.php:97
1285
- #: templates/registration-form.php:27
1286
- msgid "Name"
1287
- msgstr ""
1288
-
1289
- #: admin/form.php:821 admin/template-post.php:168
1290
- msgid "Term ID"
1291
- msgstr ""
1292
-
1293
- #: admin/form.php:822 admin/template-post.php:169
1294
- msgid "Slug"
1295
- msgstr ""
1296
-
1297
- #: admin/form.php:823 admin/template-post.php:170
1298
- msgid "Count"
1299
- msgstr ""
1300
-
1301
- #: admin/form.php:824 admin/template-post.php:171
1302
- msgid "Term Group"
1303
- msgstr ""
1304
-
1305
- #: admin/form.php:833 admin/template-post.php:176
1306
- msgid "Order"
1307
- msgstr ""
1308
-
1309
- #: admin/form.php:837 admin/template-post.php:178
1310
- msgid "ASC"
1311
- msgstr ""
1312
-
1313
- #: admin/form.php:838 admin/template-post.php:179
1314
- msgid "DESC"
1315
- msgstr ""
1316
-
1317
- #: admin/form.php:847 admin/template-post.php:184
1318
- msgid "Selection Type"
1319
- msgstr ""
1320
-
1321
- #: admin/form.php:850 admin/template-post.php:186
1322
- msgid "Exclude"
1323
- msgstr ""
1324
-
1325
- #: admin/form.php:851 admin/template-post.php:187
1326
- msgid "Include"
1327
- msgstr ""
1328
-
1329
- #: admin/form.php:852 admin/template-post.php:188
1330
- msgid "Child of"
1331
- msgstr ""
1332
-
1333
- #: admin/form.php:861
1334
- msgid "Selection Terms"
1335
- msgstr ""
1336
-
1337
- #: admin/form.php:865 admin/template-post.php:194
1338
- msgid ""
1339
- "Enter the term IDs as comma separated (without space) to exclude/include in "
1340
- "the form."
1341
- msgstr ""
1342
-
1343
- #: admin/form.php:874 admin/template-post.php:204
1344
- msgid "This taxonomy is a WooCommerce attribute"
1345
- msgstr ""
1346
-
1347
- #: admin/form.php:885 admin/template-post.php:216
1348
- msgid "Visible on product page"
1349
- msgstr ""
1350
-
1351
- #: admin/form.php:937
1352
  msgid "Post Forms must have either Post Title, Post Body or Excerpt field"
1353
  msgstr ""
1354
 
@@ -1368,6 +816,11 @@ msgstr ""
1368
  msgid "Right of Element"
1369
  msgstr ""
1370
 
 
 
 
 
 
1371
  #: admin/html/form-settings-display.php:29
1372
  msgid "Where the labels of the form should display"
1373
  msgstr ""
@@ -1462,67 +915,79 @@ msgstr ""
1462
  msgid "Update"
1463
  msgstr ""
1464
 
1465
- #: admin/html/form-settings-post-edit.php:13
1466
  msgid "Set Post Status to"
1467
  msgstr ""
1468
 
1469
- #: admin/html/form-settings-post-edit.php:23
1470
  msgid "No Change"
1471
  msgstr ""
1472
 
1473
- #: admin/html/form-settings-post-edit.php:30
1474
  #: admin/html/form-settings-post.php:132 includes/free/form-element.php:376
1475
  msgid "Redirect To"
1476
  msgstr ""
1477
 
1478
- #: admin/html/form-settings-post-edit.php:35
1479
  #: admin/html/form-settings-post.php:137
1480
  msgid "Newly created post"
1481
  msgstr ""
1482
 
1483
- #: admin/html/form-settings-post-edit.php:36
1484
  #: admin/html/form-settings-post.php:138 includes/free/form-element.php:381
1485
  msgid "Same Page"
1486
  msgstr ""
1487
 
1488
- #: admin/html/form-settings-post-edit.php:37
1489
  #: admin/html/form-settings-post.php:139 includes/free/form-element.php:382
1490
  msgid "To a page"
1491
  msgstr ""
1492
 
1493
- #: admin/html/form-settings-post-edit.php:38
1494
  #: admin/html/form-settings-post.php:140 includes/free/form-element.php:383
1495
  msgid "To a custom URL"
1496
  msgstr ""
1497
 
1498
- #: admin/html/form-settings-post-edit.php:47
1499
  #: admin/html/form-settings-post.php:149 includes/free/form-element.php:392
1500
  msgid "After successfull submit, where the page will redirect to"
1501
  msgstr ""
1502
 
1503
- #: admin/html/form-settings-post-edit.php:53
1504
  msgid "Post Update Message"
1505
  msgstr ""
1506
 
1507
- #: admin/html/form-settings-post-edit.php:60
1508
  #: admin/html/form-settings-post.php:162 includes/free/form-element.php:412
1509
  msgid "Page"
1510
  msgstr ""
1511
 
1512
- #: admin/html/form-settings-post-edit.php:75
1513
  #: admin/html/form-settings-post.php:177 includes/free/form-element.php:427
1514
  msgid "Custom URL"
1515
  msgstr ""
1516
 
1517
- #: admin/html/form-settings-post-edit.php:82
1518
  msgid "Subscription Title"
1519
  msgstr ""
1520
 
1521
- #: admin/html/form-settings-post-edit.php:91
1522
  msgid "Update Post Button text"
1523
  msgstr ""
1524
 
1525
- #: admin/html/form-settings-post.php:7 class/post-form-templates/post.php:118
 
 
 
 
 
 
 
 
 
 
 
 
1526
  #: includes/free/post-form-templates/the_events_calendar.php:171
1527
  msgid "This page is restricted. Please Log in / Register to view this page."
1528
  msgstr ""
@@ -1597,6 +1062,18 @@ msgstr ""
1597
  msgid "It will show a button to save as draft"
1598
  msgstr ""
1599
 
 
 
 
 
 
 
 
 
 
 
 
 
1600
  #: admin/html/form-submission-restriction.php:29
1601
  #: admin/post-forms-list-table.php:298
1602
  msgid "Guest Post"
@@ -1899,31 +1376,97 @@ msgid "Contact Support"
1899
  msgstr ""
1900
 
1901
  #: admin/html/whats-new.php:8
1902
- msgid "WooCommerce gallery images not getting saved"
1903
  msgstr ""
1904
 
1905
  #: admin/html/whats-new.php:10
1906
  msgid ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1907
  "After releasing version 2.9.3, WooCommerce gallery image field stopped "
1908
  "working. You will get it fixed in this version."
1909
  msgstr ""
1910
 
1911
- #: admin/html/whats-new.php:19
1912
  msgid "The Events Calendar Integration Form"
1913
  msgstr ""
1914
 
1915
- #: admin/html/whats-new.php:21
1916
  msgid ""
1917
  "Now admin can allow users to create event from the frontend. Currently WPUF "
1918
  "has a one click pre-build event form that has been integrated with The "
1919
  "Events Calendar plugin"
1920
  msgstr ""
1921
 
1922
- #: admin/html/whats-new.php:24
1923
  msgid "Post Submission Facility From Account Page"
1924
  msgstr ""
1925
 
1926
- #: admin/html/whats-new.php:26
1927
  msgid ""
1928
  "On the frontend account page, added a new menu item named <b>Submit "
1929
  "Post</b>. Now admin can allow users to submit post from their default "
@@ -1932,504 +1475,504 @@ msgid ""
1932
  "you can assign any post form that will use to submit posts."
1933
  msgstr ""
1934
 
1935
- #: admin/html/whats-new.php:29
1936
  msgid "Login/Lost Password Link Under Registration Form"
1937
  msgstr ""
1938
 
1939
- #: admin/html/whats-new.php:31
1940
  msgid "Added Login/Lost Password link under registration form"
1941
  msgstr ""
1942
 
1943
- #: admin/html/whats-new.php:40
1944
  msgid "Added drag and drop image ordering on image upload"
1945
  msgstr ""
1946
 
1947
- #: admin/html/whats-new.php:42
1948
  msgid ""
1949
  "Now frontend users can drag & drop the images/files to change the order "
1950
  "while uploading."
1951
  msgstr ""
1952
 
1953
- #: admin/html/whats-new.php:45
1954
  msgid "Added reCAPTCHA field in login form"
1955
  msgstr ""
1956
 
1957
- #: admin/html/whats-new.php:47
1958
  msgid ""
1959
  "Admin has the option to show reCAPTCHA field in login form. Check the "
1960
  "related settings from <strong>User Frontend > Settings > "
1961
  "Login/Registration</strong>"
1962
  msgstr ""
1963
 
1964
- #: admin/html/whats-new.php:50
1965
  msgid "Added preview option in forms"
1966
  msgstr ""
1967
 
1968
- #: admin/html/whats-new.php:52
1969
  msgid ""
1970
  "You can see a nice <strong>Preview</strong> button with <strong>Save "
1971
  "Form</strong> button, admin can take a quick look of the form without using "
1972
  "shortcode"
1973
  msgstr ""
1974
 
1975
- #: admin/html/whats-new.php:55
1976
  msgid "Fixed hiding “Select Image” button while uploading multiple images."
1977
  msgstr ""
1978
 
1979
- #: admin/html/whats-new.php:57
1980
  msgid ""
1981
  "The upload button will not be hidden until the user selects max number of "
1982
  "files "
1983
  msgstr ""
1984
 
1985
- #: admin/html/whats-new.php:60
1986
  msgid "Added form limit notice before form submission"
1987
  msgstr ""
1988
 
1989
- #: admin/html/whats-new.php:62
1990
  msgid ""
1991
  "Limit notice message was showing after submission, now it is showing when "
1992
  "rendering the form"
1993
  msgstr ""
1994
 
1995
- #: admin/html/whats-new.php:65
1996
  msgid "Fixed: default post category not saving"
1997
  msgstr ""
1998
 
1999
- #: admin/html/whats-new.php:67
2000
  msgid ""
2001
  "From the form <strong>Settings > Post Settings</strong>, default post "
2002
  "category options were not saving. Now, it's fixed."
2003
  msgstr ""
2004
 
2005
- #: admin/html/whats-new.php:70
2006
  msgid ""
2007
  "WPUF dashboard shortcode with form_id attribute was not showing posts "
2008
  "properly"
2009
  msgstr ""
2010
 
2011
- #: admin/html/whats-new.php:72
2012
  msgid ""
2013
  "Now you can list posts on the frontend by using <strong>form_id<strong/> "
2014
  "attribute with <strong>[wpuf_dashboard]</strong> shortcode"
2015
  msgstr ""
2016
 
2017
- #: admin/html/whats-new.php:81
2018
  msgid "Changed text domain to `wp-user-frontend` from `wpuf` "
2019
  msgstr ""
2020
 
2021
- #: admin/html/whats-new.php:83
2022
  msgid ""
2023
  "If you are using other language than English. Please <b>rename</b> your "
2024
  "<i>.po and .mo </i> files to `wp-user-frontend_` from `wpuf_` <br> This "
2025
  "change was made to support translations from translate.wordpress.org"
2026
  msgstr ""
2027
 
2028
- #: admin/html/whats-new.php:86
2029
  msgid "Added WP User Frontend Data export and erase functionality."
2030
  msgstr ""
2031
 
2032
- #: admin/html/whats-new.php:88
2033
  msgid "Added functionality to export WP User Frontend Data to comply with GDPR."
2034
  msgstr ""
2035
 
2036
- #: admin/html/whats-new.php:91
2037
  msgid "Added billing address customizer."
2038
  msgstr ""
2039
 
2040
- #: admin/html/whats-new.php:93
2041
  msgid "Added customizer options for billing address in payment page."
2042
  msgstr ""
2043
 
2044
- #: admin/html/whats-new.php:96
2045
  msgid "Make the payment page responsive."
2046
  msgstr ""
2047
 
2048
- #: admin/html/whats-new.php:98
2049
  msgid "Some css adjustments are made in payment page to make it responsive."
2050
  msgstr ""
2051
 
2052
- #: admin/html/whats-new.php:101
2053
  msgid "Fixed image upload issue in Safari."
2054
  msgstr ""
2055
 
2056
- #: admin/html/whats-new.php:103
2057
  msgid "Images were not showing after upload in safari, it is fixed now."
2058
  msgstr ""
2059
 
2060
- #: admin/html/whats-new.php:106
2061
  msgid "Post update issue after updating or removing post images."
2062
  msgstr ""
2063
 
2064
- #: admin/html/whats-new.php:108
2065
  msgid ""
2066
  "Posts cannot be updated after updating or removing post images, it is fixed "
2067
  "now."
2068
  msgstr ""
2069
 
2070
- #: admin/html/whats-new.php:117
2071
  msgid "Allow overriding form input styles using theme styling."
2072
  msgstr ""
2073
 
2074
- #: admin/html/whats-new.php:119
2075
  msgid "Overriding form input styles using theme style is now possible."
2076
  msgstr ""
2077
 
2078
- #: admin/html/whats-new.php:122
2079
  msgid "Fixed Auto Login after registration."
2080
  msgstr ""
2081
 
2082
- #: admin/html/whats-new.php:124
2083
  msgid "Auto Login after registration was not working is fixed now."
2084
  msgstr ""
2085
 
2086
- #: admin/html/whats-new.php:127
2087
  msgid "Fixed fallback cost calculation"
2088
  msgstr ""
2089
 
2090
- #: admin/html/whats-new.php:129
2091
  msgid "Fallback cost calculation was inaccurate for some cases, it is fixed now."
2092
  msgstr ""
2093
 
2094
- #: admin/html/whats-new.php:132
2095
  msgid "Removal of subscription from User Profile gets reverted if updated"
2096
  msgstr ""
2097
 
2098
- #: admin/html/whats-new.php:134
2099
  msgid "User subscription deletion gets reverted if updated is fixed."
2100
  msgstr ""
2101
 
2102
- #: admin/html/whats-new.php:137
2103
  msgid "Show Free pack users in subscribers list."
2104
  msgstr ""
2105
 
2106
- #: admin/html/whats-new.php:139
2107
  msgid "Free pack users were not showing in subscribers list, now they will."
2108
  msgstr ""
2109
 
2110
- #: admin/html/whats-new.php:148
2111
  msgid "WP User Frontend Guten Block is added"
2112
  msgstr ""
2113
 
2114
- #: admin/html/whats-new.php:150
2115
  msgid ""
2116
  "WPUF Form Block is now available to be used within gutenberg editor with "
2117
  "preview of the form. "
2118
  msgstr ""
2119
 
2120
- #: admin/html/whats-new.php:153
2121
  msgid "Advanced Custom Fields plugin compatibility"
2122
  msgstr ""
2123
 
2124
- #: admin/html/whats-new.php:155
2125
  msgid "Now all your ACF fields can be used within WPUF Post forms. "
2126
  msgstr ""
2127
 
2128
- #: admin/html/whats-new.php:158
2129
  msgid "Taxonomy Terms not showing for custom post types"
2130
  msgstr ""
2131
 
2132
- #: admin/html/whats-new.php:160
2133
  msgid ""
2134
  "Fixed an issue with taxonomy terms not appearing for Custom Post types "
2135
  "within Form Settings and Dashboard Post Listing"
2136
  msgstr ""
2137
 
2138
- #: admin/html/whats-new.php:163
2139
  msgid "Various other code optimizations"
2140
  msgstr ""
2141
 
2142
- #: admin/html/whats-new.php:165 admin/html/whats-new.php:222
2143
  msgid "Code structure organization and optimization for better performance"
2144
  msgstr ""
2145
 
2146
- #: admin/html/whats-new.php:174
2147
  msgid "WoooCommerce billing address Sync"
2148
  msgstr ""
2149
 
2150
- #: admin/html/whats-new.php:176
2151
  msgid ""
2152
  "If an existing customer has previously set his billing address, that will "
2153
  "be imported into WPUF Billing address "
2154
  msgstr ""
2155
 
2156
- #: admin/html/whats-new.php:179
2157
  msgid "Trial subscription message not showing properly"
2158
  msgstr ""
2159
 
2160
- #: admin/html/whats-new.php:181
2161
  msgid "Subscriptions with Trial now shows trial notices"
2162
  msgstr ""
2163
 
2164
- #: admin/html/whats-new.php:184
2165
  msgid "Reset email Key not working"
2166
  msgstr ""
2167
 
2168
- #: admin/html/whats-new.php:186
2169
  msgid "Reset Email key was not working in some cases"
2170
  msgstr ""
2171
 
2172
- #: admin/html/whats-new.php:189
2173
  msgid "Post count not showing on the frontend dashboard"
2174
  msgstr ""
2175
 
2176
- #: admin/html/whats-new.php:191
2177
  msgid ""
2178
  "Dashboard with multiple post type was not showing post counts properly, is "
2179
  "now fixed and shows count for each post type"
2180
  msgstr ""
2181
 
2182
- #: admin/html/whats-new.php:194
2183
  msgid "Login Redirect showing blank page is fixed"
2184
  msgstr ""
2185
 
2186
- #: admin/html/whats-new.php:196
2187
  msgid ""
2188
  "If \"Previous Page\" was set for redirection, login redirect was "
2189
  "redirecting to blank page for users who hit login page directly"
2190
  msgstr ""
2191
 
2192
- #: admin/html/whats-new.php:205
2193
  msgid "Enhanced Login Redirect to redirect users to previous page"
2194
  msgstr ""
2195
 
2196
- #: admin/html/whats-new.php:207
2197
  msgid ""
2198
  "You can choose Previous Page as Login Redirect page settings now to "
2199
  "redirect users to the page from which they went for Login. "
2200
  msgstr ""
2201
 
2202
- #: admin/html/whats-new.php:210
2203
  msgid "Email HTML links not Rendreing properly issue is fixed"
2204
  msgstr ""
2205
 
2206
- #: admin/html/whats-new.php:212
2207
  msgid ""
2208
  "For some clients emails were not rendering the HTML links properly, this is "
2209
  "now fixed"
2210
  msgstr ""
2211
 
2212
- #: admin/html/whats-new.php:215
2213
  msgid "Form Builder : Form Field's Help text styles not showing properly"
2214
  msgstr ""
2215
 
2216
- #: admin/html/whats-new.php:217
2217
  msgid "Help texts styling is now fixed and much easier to read and understand"
2218
  msgstr ""
2219
 
2220
- #: admin/html/whats-new.php:220
2221
  msgid "Various other code improvements"
2222
  msgstr ""
2223
 
2224
- #: admin/html/whats-new.php:231
2225
  msgid "Dashboard Post Listing now supports multiple post types"
2226
  msgstr ""
2227
 
2228
- #: admin/html/whats-new.php:233
2229
  msgid ""
2230
  "Now you can show multiple post type in user dashboard using shortcode like "
2231
  "this : <br><b>[wpuf_dashboard post_type=\"post,page,custom_type\"]</b> "
2232
  msgstr ""
2233
 
2234
- #: admin/html/whats-new.php:236
2235
  msgid "Added Login Redirect Settings"
2236
  msgstr ""
2237
 
2238
- #: admin/html/whats-new.php:238
2239
  msgid ""
2240
  "You can now set a page from <i>WPUF Settings > Login/Registration > "
2241
  "Redirect after Login</i>. When login redirection is active the user will be "
2242
  "redirected to this page after login."
2243
  msgstr ""
2244
 
2245
- #: admin/html/whats-new.php:241
2246
  msgid "Image Upload field button text can be changed"
2247
  msgstr ""
2248
 
2249
- #: admin/html/whats-new.php:243
2250
  msgid ""
2251
  "The upload button text can now be changed for image upload fields which "
2252
  "defaults to \"Select Image\" if not set. "
2253
  msgstr ""
2254
 
2255
- #: admin/html/whats-new.php:246
2256
  msgid "Multi Step Form styles made compatible with more themes"
2257
  msgstr ""
2258
 
2259
- #: admin/html/whats-new.php:248
2260
  msgid "Multi Step form can now be styled more easily with other themes "
2261
  msgstr ""
2262
 
2263
- #: admin/html/whats-new.php:251
2264
  msgid "Required field condition for google map not working is fixed"
2265
  msgstr ""
2266
 
2267
- #: admin/html/whats-new.php:253
2268
  msgid ""
2269
  "If Google Map field was set as required users were able to submit form "
2270
  "without changing the default value."
2271
  msgstr ""
2272
 
2273
- #: admin/html/whats-new.php:262
2274
  msgid "Admin form builder is now fully responsive."
2275
  msgstr ""
2276
 
2277
- #: admin/html/whats-new.php:264
2278
  msgid ""
2279
  "Now you can edit forms from your mobile devices directly. Our improved "
2280
  "responsive layouts of form builder makes it easy for you to build forms on "
2281
  "the go."
2282
  msgstr ""
2283
 
2284
- #: admin/html/whats-new.php:267
2285
  msgid "Added color schemes for creating attractive form layouts."
2286
  msgstr ""
2287
 
2288
- #: admin/html/whats-new.php:269
2289
  msgid ""
2290
  "We have added 3 new color schemes for the form layouts which you can choose "
2291
  "from each form's new display settings."
2292
  msgstr ""
2293
 
2294
- #: admin/html/whats-new.php:272
2295
  msgid "Restrict Free subscription pack to be enabled multiple times "
2296
  msgstr ""
2297
 
2298
- #: admin/html/whats-new.php:274
2299
  msgid ""
2300
  "Free subscription packs now can only be purchased once and the limit "
2301
  "applies properly"
2302
  msgstr ""
2303
 
2304
- #: admin/html/whats-new.php:277
2305
  msgid "Various other bug fixes and improvements were made "
2306
  msgstr ""
2307
 
2308
- #: admin/html/whats-new.php:279
2309
  msgid "Please see the change log to see full details."
2310
  msgstr ""
2311
 
2312
- #: admin/html/whats-new.php:288
2313
  msgid "Added upgrade function for default category"
2314
  msgstr ""
2315
 
2316
- #: admin/html/whats-new.php:290
2317
  msgid "Upgrader added to upgrade previously set default post category."
2318
  msgstr ""
2319
 
2320
- #: admin/html/whats-new.php:293
2321
  msgid "Subscription pack cannot be canceled"
2322
  msgstr ""
2323
 
2324
- #: admin/html/whats-new.php:295
2325
  msgid ""
2326
  "Fixed recurring subscription pack cannot be canceled from my account page "
2327
  "in subscription details section."
2328
  msgstr ""
2329
 
2330
- #: admin/html/whats-new.php:298
2331
  msgid "page installer admin notice logic issue"
2332
  msgstr ""
2333
 
2334
- #: admin/html/whats-new.php:300
2335
  msgid ""
2336
  "Fixed page installer admin notice logic problem due to new payment settings "
2337
  "default value not set."
2338
  msgstr ""
2339
 
2340
- #: admin/html/whats-new.php:310
2341
  msgid "Setup Wizard"
2342
  msgstr ""
2343
 
2344
- #: admin/html/whats-new.php:312
2345
  msgid "Setup Wizard added to turn off payment options and install pages."
2346
  msgstr ""
2347
 
2348
- #: admin/html/whats-new.php:316
2349
  msgid "Multi-select Category"
2350
  msgstr ""
2351
 
2352
- #: admin/html/whats-new.php:318
2353
  msgid "Add multi-select to default category in post form settings."
2354
  msgstr ""
2355
 
2356
- #: admin/html/whats-new.php:322
2357
  msgid "Select Text option for Taxonomy"
2358
  msgstr ""
2359
 
2360
- #: admin/html/whats-new.php:324
2361
  msgid ""
2362
  "Add Select Text option for taxonomy fields. Now you can add default text "
2363
  "with empty value as first option for Taxonomy dropdown."
2364
  msgstr ""
2365
 
2366
- #: admin/html/whats-new.php:327
2367
  msgid "Taxonomy Checkbox Inline"
2368
  msgstr ""
2369
 
2370
- #: admin/html/whats-new.php:329
2371
  msgid ""
2372
  "Added checkbox inline option to taxonomy checkbox. You can now display "
2373
  "Taxonomy checkbox fields inline."
2374
  msgstr ""
2375
 
2376
- #: admin/html/whats-new.php:339
2377
  msgid "Manage schedule for form submission"
2378
  msgstr ""
2379
 
2380
- #: admin/html/whats-new.php:341
2381
  msgid ""
2382
  "Do not accept form submission if the current date is not between the date "
2383
  "range of the schedule."
2384
  msgstr ""
2385
 
2386
- #: admin/html/whats-new.php:345
2387
  msgid "Restrict form submission based on the user roles"
2388
  msgstr ""
2389
 
2390
- #: admin/html/whats-new.php:347
2391
  msgid ""
2392
  "Restrict form submission based on the user roles. Now you can manage user "
2393
  "role base permission on form submission."
2394
  msgstr ""
2395
 
2396
- #: admin/html/whats-new.php:351
2397
  msgid "Limit how many entries a form will accept"
2398
  msgstr ""
2399
 
2400
- #: admin/html/whats-new.php:353
2401
  msgid ""
2402
  "Limit how many entries a form will accept and display a custom message when "
2403
  "that limit is reached."
2404
  msgstr ""
2405
 
2406
- #: admin/html/whats-new.php:357
2407
  msgid "Show/hide Admin Bar"
2408
  msgstr ""
2409
 
2410
- #: admin/html/whats-new.php:359
2411
  msgid "Control the admin bar visibility based on user roles."
2412
  msgstr ""
2413
 
2414
- #: admin/html/whats-new.php:363
2415
  msgid "Ajax Login widget"
2416
  msgstr ""
2417
 
2418
- #: admin/html/whats-new.php:365
2419
  msgid ""
2420
  "Login user is more simple now with Ajax Login Widget. The simple ajax login "
2421
  "form do not required page loading for login."
2422
  msgstr ""
2423
 
2424
- #: admin/html/whats-new.php:369
2425
  msgid "Form submission with Captcha field"
2426
  msgstr ""
2427
 
2428
- #: admin/html/whats-new.php:371
2429
  msgid "Form field validation process updated if form submits with captcha field."
2430
  msgstr ""
2431
 
2432
- #: admin/html/whats-new.php:385
2433
  msgid "What's New in WPUF?"
2434
  msgstr ""
2435
 
@@ -2458,7 +2001,7 @@ msgid ""
2458
  msgstr ""
2459
 
2460
  #: admin/installer.php:77 admin/settings-options.php:23
2461
- #: includes/free/admin/shortcode-button.php:82 wpuf-functions.php:1621
2462
  msgid "Dashboard"
2463
  msgstr ""
2464
 
@@ -2474,7 +2017,7 @@ msgstr ""
2474
  #: admin/installer.php:88 class/subscription.php:356 class/subscription.php:376
2475
  #: class/subscription.php:377 class/subscription.php:378
2476
  #: includes/free/admin/shortcode-button.php:102
2477
- #: templates/dashboard/dashboard.php:18 wpuf-functions.php:1624
2478
  msgid "Subscription"
2479
  msgstr ""
2480
 
@@ -2556,7 +2099,7 @@ msgid "Form Name"
2556
  msgstr ""
2557
 
2558
  #: admin/post-forms-list-table.php:299 admin/premium.php:39
2559
- #: includes/free/admin/form-builder/class-wpuf-form-builder-field-settings-free.php:196
2560
  #: includes/free/form-element.php:30
2561
  msgid "Shortcode"
2562
  msgstr ""
@@ -2569,40 +2112,59 @@ msgstr ""
2569
  msgid "Draft"
2570
  msgstr ""
2571
 
2572
- #: admin/posting.php:68 class/asset-loader.php:54 class/render-form.php:1698
2573
- #: wpuf.php:543
2574
  msgid "Are you sure?"
2575
  msgstr ""
2576
 
2577
- #: admin/posting.php:76 class/asset-loader.php:62 wpuf.php:553
2578
  msgid "Allowed Files"
2579
  msgstr ""
2580
 
2581
- #: admin/posting.php:79 class/asset-loader.php:65 wpuf.php:559
2582
  msgid "Maximum number of files reached!"
2583
  msgstr ""
2584
 
2585
- #: admin/posting.php:80 class/asset-loader.php:66 wpuf.php:560
2586
  msgid "The file you have uploaded exceeds the file size limit. Please try again."
2587
  msgstr ""
2588
 
2589
- #: admin/posting.php:81 class/asset-loader.php:67 wpuf.php:561
2590
  msgid "You have uploaded an incorrect file type. Please try again."
2591
  msgstr ""
2592
 
2593
- #: admin/posting.php:100
2594
  msgid "WPUF Form"
2595
  msgstr ""
2596
 
2597
  #: admin/posting.php:130
2598
- msgid "Purpose of this metabox"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2599
  msgstr ""
2600
 
2601
- #: admin/posting.php:174
2602
  msgid "WPUF Custom Fields"
2603
  msgstr ""
2604
 
2605
- #: admin/posting.php:225
2606
  msgid "No custom fields found."
2607
  msgstr ""
2608
 
@@ -2642,8 +2204,7 @@ msgstr ""
2642
  msgid "Advanced Fields"
2643
  msgstr ""
2644
 
2645
- #: admin/premium.php:33
2646
- #: includes/free/admin/form-builder/class-wpuf-form-builder-field-settings-free.php:114
2647
  #: includes/free/form-element.php:15
2648
  msgid "Country List"
2649
  msgstr ""
@@ -2656,13 +2217,11 @@ msgstr ""
2656
  msgid "Date Field"
2657
  msgstr ""
2658
 
2659
- #: admin/premium.php:36
2660
- #: includes/free/admin/form-builder/class-wpuf-form-builder-field-settings-free.php:180
2661
  msgid "Google Map"
2662
  msgstr ""
2663
 
2664
- #: admin/premium.php:37
2665
- #: includes/free/admin/form-builder/class-wpuf-form-builder-field-settings-free.php:226
2666
  #: includes/free/form-element.php:33
2667
  msgid "Action Hook"
2668
  msgstr ""
@@ -2679,8 +2238,7 @@ msgstr ""
2679
  msgid "Repeater"
2680
  msgstr ""
2681
 
2682
- #: admin/premium.php:42
2683
- #: includes/free/admin/form-builder/class-wpuf-form-builder-field-settings-free.php:98
2684
  #: includes/free/form-element.php:13
2685
  msgid "File Upload"
2686
  msgstr ""
@@ -2713,8 +2271,7 @@ msgid ""
2713
  "subscriptions only with just a shortcode."
2714
  msgstr ""
2715
 
2716
- #: admin/premium.php:71 admin/premium.php:74
2717
- #: includes/free/admin/form-builder/class-wpuf-form-builder-field-settings-free.php:47
2718
  #: includes/free/form-element.php:474
2719
  msgid "Conditional Logic"
2720
  msgstr ""
@@ -2862,11 +2419,7 @@ msgstr ""
2862
  msgid "WP User Frontend Pro is the most powerful solution for your frontend needs."
2863
  msgstr ""
2864
 
2865
- #: admin/premium.php:231
2866
- msgid "Upgrade Now"
2867
- msgstr ""
2868
-
2869
- #: admin/promotion.php:41
2870
  msgid ""
2871
  "<p>\n"
2872
  " <strong class=\"highlight-text\" "
@@ -2880,10 +2433,34 @@ msgid ""
2880
  " </p>"
2881
  msgstr ""
2882
 
2883
- #: admin/promotion.php:64
2884
  msgid "Get the Offer"
2885
  msgstr ""
2886
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2887
  #: admin/settings-options.php:13
2888
  msgid "General Options"
2889
  msgstr ""
@@ -3374,14 +2951,128 @@ msgstr ""
3374
  msgid "Number of subscribers per page:"
3375
  msgstr ""
3376
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3377
  #: admin/template-post.php:193
3378
  msgid "Selection terms"
3379
  msgstr ""
3380
 
 
 
 
 
 
 
3381
  #: admin/template-post.php:198
3382
  msgid "WooCommerce Attribute"
3383
  msgstr ""
3384
 
 
 
 
 
 
 
 
 
 
 
 
 
3385
  #: admin/template-post.php:257
3386
  msgid "all"
3387
  msgstr ""
@@ -3426,14 +3117,174 @@ msgstr ""
3426
  msgid "Toggle"
3427
  msgstr ""
3428
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3429
  #: admin/template.php:100
3430
  msgid "Add a CSS class name for this field"
3431
  msgstr ""
3432
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3433
  #: admin/template.php:304
3434
  msgid "show values"
3435
  msgstr ""
3436
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3437
  #: admin/template.php:689
3438
  msgid ""
3439
  "Insert your public key and private key in <a href='%s'>plugin settings</a>. "
@@ -3444,6 +3295,14 @@ msgstr ""
3444
  msgid "reCaptcha type"
3445
  msgstr ""
3446
 
 
 
 
 
 
 
 
 
3447
  #: admin/weforms.php:4
3448
  msgid "The Easiest &amp; Fastest Contact Form Plugin on WordPress"
3449
  msgstr ""
@@ -3459,27 +3318,27 @@ msgstr ""
3459
  msgid "Install Now"
3460
  msgstr ""
3461
 
3462
- #: class/asset-loader.php:31 wpuf.php:451
3463
  msgid "is required"
3464
  msgstr ""
3465
 
3466
- #: class/asset-loader.php:32 wpuf.php:452
3467
  msgid "does not match"
3468
  msgstr ""
3469
 
3470
- #: class/asset-loader.php:33 wpuf.php:453
3471
  msgid "is not valid"
3472
  msgstr ""
3473
 
3474
- #: class/asset-loader.php:45 wpuf.php:530
3475
  msgid "Please fix the errors to proceed"
3476
  msgstr ""
3477
 
3478
- #: class/asset-loader.php:47 wpuf.php:532
3479
  msgid "Word limit reached"
3480
  msgstr ""
3481
 
3482
- #: class/asset-loader.php:48 wpuf.php:533
3483
  msgid "Are you sure you want to cancel your current subscription ?"
3484
  msgstr ""
3485
 
@@ -3563,60 +3422,76 @@ msgstr ""
3563
  msgid "Your current password is incorrect."
3564
  msgstr ""
3565
 
3566
- #: class/frontend-dashboard.php:65 templates/dashboard/posts.php:36
3567
  msgid "Post Deleted"
3568
  msgstr ""
3569
 
3570
- #: class/frontend-dashboard.php:123
3571
  msgid "Author Info"
3572
  msgstr ""
3573
 
3574
- #: class/frontend-dashboard.php:127 includes/free/edit-user.php:98
3575
  msgid "%s"
3576
  msgstr ""
3577
 
3578
- #: class/frontend-dashboard.php:162 templates/dashboard/posts.php:30
3579
  msgid "You are not the post author. Cheeting huh!"
3580
  msgstr ""
3581
 
3582
  #: class/frontend-form-post.php:82 class/frontend-form-post.php:121
3583
- #: class/frontend-form-post.php:128
 
3584
  msgid "Payment type not selected for this form. Please contact admin."
3585
  msgstr ""
3586
 
3587
- #: class/frontend-form-post.php:171
3588
  msgid "You are not logged in"
3589
  msgstr ""
3590
 
3591
- #: class/frontend-form-post.php:179 class/frontend-form-post.php:190
 
 
3592
  msgid "Invalid post"
3593
  msgstr ""
3594
 
3595
- #: class/frontend-form-post.php:184
 
 
 
 
 
 
 
 
 
 
 
 
3596
  msgid "Post Editing is disabled"
3597
  msgstr ""
3598
 
3599
- #: class/frontend-form-post.php:195
3600
  msgid "You are not allowed to edit"
3601
  msgstr ""
3602
 
3603
- #: class/frontend-form-post.php:207
3604
  msgid "I don't know how to edit this post, I don't have the form ID"
3605
  msgstr ""
3606
 
3607
- #: class/frontend-form-post.php:213
3608
  msgid "You can't edit a post while in pending mode."
3609
  msgstr ""
3610
 
3611
- #: class/frontend-form-post.php:286 includes/free/class-login.php:394
 
3612
  msgid "Empty reCaptcha Field"
3613
  msgstr ""
3614
 
3615
- #: class/frontend-form-post.php:317
3616
  msgid "Invalid email address."
3617
  msgstr ""
3618
 
3619
- #: class/frontend-form-post.php:326
3620
  msgid ""
3621
  "You already have an account in our site. Please login to continue.\n"
3622
  "\n"
@@ -3625,21 +3500,23 @@ msgid ""
3625
  "Click 'Cancel' to stay at this page."
3626
  msgstr ""
3627
 
3628
- #: class/frontend-form-post.php:375
3629
  msgid "You do not have sufficient permissions to access this form."
3630
  msgstr ""
3631
 
3632
- #: class/frontend-form-post.php:691 class/frontend-form-post.php:698
 
 
3633
  msgid ""
3634
  "Thank you for posting on our site. We have sent you an confirmation email. "
3635
  "Please check your inbox!"
3636
  msgstr ""
3637
 
3638
- #: class/frontend-form-post.php:751
3639
  msgid "Something went wrong"
3640
  msgstr ""
3641
 
3642
- #: class/frontend-form-post.php:1129
3643
  msgid "Email successfully verified. Please Login."
3644
  msgstr ""
3645
 
@@ -3664,7 +3541,7 @@ msgid "You already have activated a free package previously."
3664
  msgstr ""
3665
 
3666
  #: class/payment.php:139 includes/class-customizer.php:59
3667
- #: wpuf-functions.php:1625
3668
  msgid "Billing Address"
3669
  msgstr ""
3670
 
@@ -3729,74 +3606,107 @@ msgstr ""
3729
  msgid "Form for creating a blog post."
3730
  msgstr ""
3731
 
 
 
 
 
 
3732
  #: class/post-form-templates/post.php:25
3733
  msgid "Please enter your post name"
3734
  msgstr ""
3735
 
3736
- #: class/post-form-templates/post.php:34 templates/dashboard.php:90
3737
  msgid "Category"
3738
  msgstr ""
3739
 
3740
- #: class/post-form-templates/post.php:37
3741
  msgid "Select a category for your post"
3742
  msgstr ""
3743
 
3744
- #: class/post-form-templates/post.php:53
3745
- msgid "Post description"
 
 
 
 
3746
  msgstr ""
3747
 
3748
  #: class/post-form-templates/post.php:56
 
 
 
 
3749
  msgid "Write the full description of your Post"
3750
  msgstr ""
3751
 
3752
- #: class/post-form-templates/post.php:76
 
 
 
 
 
 
 
 
 
3753
  msgid "Upload the main image of your post"
3754
  msgstr ""
3755
 
3756
- #: class/post-form-templates/post.php:88
 
 
 
 
 
 
3757
  msgid "Provide a short description of this post (optional)"
3758
  msgstr ""
3759
 
3760
- #: class/post-form-templates/post.php:104
 
 
 
 
 
3761
  #: includes/free/post-form-templates/the_events_calendar.php:157
3762
  msgid "Separate tags with commas."
3763
  msgstr ""
3764
 
3765
- #: class/post-form-templates/post.php:121
3766
  msgid "Create Post"
3767
  msgstr ""
3768
 
3769
- #: class/post-form-templates/post.php:124
3770
  msgid ""
3771
  "Post has been updated successfully. <a target=\"_blank\" "
3772
  "href=\"%link%\">View post</a>"
3773
  msgstr ""
3774
 
3775
- #: class/post-form-templates/post.php:126
3776
  msgid "Update Post"
3777
  msgstr ""
3778
 
3779
- #: class/render-form.php:76
3780
  msgid "Really Simple Captcha validation failed"
3781
  msgstr ""
3782
 
3783
- #: class/render-form.php:109
3784
  msgid "noCaptcha reCAPTCHA validation failed"
3785
  msgstr ""
3786
 
3787
- #: class/render-form.php:120
3788
  msgid "reCAPTCHA validation failed"
3789
  msgstr ""
3790
 
3791
- #: class/render-form.php:132
3792
  msgid "Invisible reCAPTCHA validation failed"
3793
  msgstr ""
3794
 
3795
- #: class/render-form.php:357
3796
  msgid "Your selected form is no longer available."
3797
  msgstr ""
3798
 
3799
- #: class/render-form.php:362
3800
  msgid "Please make sure you've published your form."
3801
  msgstr ""
3802
 
@@ -3810,11 +3720,11 @@ msgstr ""
3810
  msgid "Strength indicator"
3811
  msgstr ""
3812
 
3813
- #: class/render-form.php:1420
3814
  msgid "-- Select --"
3815
  msgstr ""
3816
 
3817
- #: class/render-form.php:1485
3818
  msgid "This field is no longer available."
3819
  msgstr ""
3820
 
@@ -4024,7 +3934,7 @@ msgstr ""
4024
  msgid "No transactions found."
4025
  msgstr ""
4026
 
4027
- #: class/upload.php:169 wpuf-functions.php:798
4028
  msgid "Caption"
4029
  msgstr ""
4030
 
@@ -4142,7 +4052,7 @@ msgstr ""
4142
 
4143
  #: includes/class-dokan-integration.php:37
4144
  #: includes/class-wc-vendors-integration.php:109
4145
- #: templates/dashboard/dashboard.php:14 wpuf-functions.php:1622
4146
  msgid "Posts"
4147
  msgstr ""
4148
 
@@ -4168,6 +4078,14 @@ msgstr ""
4168
  msgid "Select a post form that will show on the vendor dashboard."
4169
  msgstr ""
4170
 
 
 
 
 
 
 
 
 
4171
  #: includes/class-form-preview.php:85
4172
  msgid "You must be logged in to preview this form."
4173
  msgstr ""
@@ -4176,10 +4094,6 @@ msgstr ""
4176
  msgid "Sorry, you are not eligible to preview this form."
4177
  msgstr ""
4178
 
4179
- #: includes/class-gutenblock.php:44
4180
- msgid "-- Select a Form --"
4181
- msgstr ""
4182
-
4183
  #: includes/class-list-table-subscribers.php:30
4184
  msgid "No subscribers found"
4185
  msgstr ""
@@ -4254,7 +4168,7 @@ msgid "Someone has requested a password reset for the following account:"
4254
  msgstr ""
4255
 
4256
  #: includes/class-login-widget.php:137 includes/free/class-login.php:803
4257
- #: includes/free/class-login.php:884
4258
  msgid "Username: %s"
4259
  msgstr ""
4260
 
@@ -4575,203 +4489,433 @@ msgid ""
4575
  "own platform which falls in their own data policy. "
4576
  msgstr ""
4577
 
4578
- #: includes/class-privacy.php:85
4579
- msgid ""
4580
- "As an example while using MailChimp for your marketing email automation "
4581
- "service by integrating it with WP User Frontend, some of your data will be "
4582
- "passed to MailChimp, including information required to process or support "
4583
- "the email marketing services, such as name, email address and any other "
4584
- "information that you intend to pass or collect including all collected "
4585
- "information through subscription. "
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4586
  msgstr ""
4587
 
4588
- #: includes/class-privacy.php:86
4589
- msgid ""
4590
- "Please see the <a href=\"https://mailchimp.com/legal/privacy/\">MailChimp "
4591
- "Privacy Policy</a> for more details."
4592
  msgstr ""
4593
 
4594
- #: includes/class-privacy.php:100 includes/class-privacy.php:131
4595
- #: includes/class-privacy.php:170
4596
- msgid "WPUF User Data"
4597
  msgstr ""
4598
 
4599
- #: includes/class-privacy.php:105 includes/class-privacy.php:300
4600
- msgid "WPUF Subscription Data"
 
4601
  msgstr ""
4602
 
4603
- #: includes/class-privacy.php:110 includes/class-privacy.php:331
4604
- msgid "WPUF Transaction Data"
4605
  msgstr ""
4606
 
4607
- #: includes/class-privacy.php:115 includes/class-privacy.php:421
4608
- msgid "WPUF Post Data"
4609
  msgstr ""
4610
 
4611
- #: includes/class-privacy.php:255
4612
- msgid "Billing Address 1"
4613
  msgstr ""
4614
 
4615
- #: includes/class-privacy.php:259
4616
- msgid "Billing Address 2"
4617
  msgstr ""
4618
 
4619
- #: includes/class-privacy.php:267
4620
- msgid "State"
4621
  msgstr ""
4622
 
4623
- #: includes/class-privacy.php:271
4624
- msgid "Zip"
4625
  msgstr ""
4626
 
4627
- #: includes/class-privacy.php:339
4628
- msgid "Payment Status"
 
 
4629
  msgstr ""
4630
 
4631
- #: includes/class-privacy.php:343
4632
- msgid "Subtotal"
4633
  msgstr ""
4634
 
4635
- #: includes/class-privacy.php:367 includes/free/edit-profile.php:110
4636
- msgid "Last Name"
4637
  msgstr ""
4638
 
4639
- #: includes/class-privacy.php:375
4640
- msgid "Payment Type"
4641
  msgstr ""
4642
 
4643
- #: includes/class-privacy.php:379
4644
- msgid "payer_address"
 
4645
  msgstr ""
4646
 
4647
- #: includes/class-privacy.php:387
4648
- msgid "Transaction Date"
4649
  msgstr ""
4650
 
4651
- #: includes/class-privacy.php:433
4652
- msgid "Post URL"
4653
  msgstr ""
4654
 
4655
- #: includes/class-privacy.php:437
4656
- msgid "Post Date"
 
 
 
4657
  msgstr ""
4658
 
4659
- #: includes/class-privacy.php:484
4660
- msgid "Pack Title"
 
4661
  msgstr ""
4662
 
4663
- #: includes/class-privacy.php:488
4664
- msgid "Expiry"
4665
  msgstr ""
4666
 
4667
- #: includes/class-user-subscription.php:58
4668
- msgid "You must <a href=\"%s\">purchase a subscription package</a> before posting"
4669
  msgstr ""
4670
 
4671
- #: includes/class-user-subscription.php:63
4672
- msgid "The subscription pack has expired. Please buy a pack."
4673
  msgstr ""
4674
 
4675
- #: includes/class-user-subscription.php:318
4676
- #: templates/dashboard/subscription.php:3
4677
- msgid "Subscription Details"
4678
  msgstr ""
4679
 
4680
- #: includes/class-user-subscription.php:320
4681
- #: templates/dashboard/subscription.php:5
4682
- msgid "Subcription Name: "
4683
  msgstr ""
4684
 
4685
- #: includes/class-user-subscription.php:322
4686
- #: templates/dashboard/subscription.php:7
4687
- msgid "Package & billing details: "
4688
  msgstr ""
4689
 
4690
- #: includes/class-user-subscription.php:333
4691
- #: templates/dashboard/subscription.php:11
4692
- msgid "Remaining post: "
4693
  msgstr ""
4694
 
4695
- #: includes/class-user-subscription.php:346
4696
- #: templates/dashboard/subscription.php:25
4697
- msgid "Unlimited"
4698
  msgstr ""
4699
 
4700
- #: includes/class-wc-vendors-integration.php:38
4701
- #: includes/class-wcmp-integration.php:41
4702
- msgid "If checked, vendor can submit post from dashboard area."
4703
  msgstr ""
4704
 
4705
- #: includes/class-wcmp-integration.php:86
4706
- msgid "Vendor Submit Post"
4707
  msgstr ""
4708
 
4709
- #: includes/class-wcmp-integration.php:91
4710
- msgid "Set endpoint for vendor submit post page"
4711
  msgstr ""
4712
 
4713
- #: includes/class-whats-new.php:67
4714
- msgid "Whats New"
4715
  msgstr ""
4716
 
4717
- #: includes/class-whats-new.php:100
4718
- msgid "WP User Frontend - Version %s"
4719
  msgstr ""
4720
 
4721
- #: includes/class-whats-new.php:101
4722
- msgid ""
4723
- "Welcome to the new version of WP User Frontend. See what's been changed in "
4724
- "the <strong>%s</strong> version."
4725
  msgstr ""
4726
 
4727
- #: includes/class-whats-new.php:105
4728
- msgid "What's New?"
4729
  msgstr ""
4730
 
4731
- #: includes/class-whats-new.php:106 lib/class-weforms-upsell.php:80
4732
- #: lib/class-weforms-upsell.php:81
4733
- msgid "Dismiss this notice."
4734
  msgstr ""
4735
 
4736
- #: includes/free/admin/form-builder/class-wpuf-form-builder-field-settings-free.php:66
4737
- #: includes/free/form-element.php:11
4738
- msgid "Repeat Field"
4739
  msgstr ""
4740
 
4741
- #: includes/free/admin/form-builder/class-wpuf-form-builder-field-settings-free.php:82
4742
- msgid "Date / Time"
4743
  msgstr ""
4744
 
4745
- #: includes/free/admin/form-builder/class-wpuf-form-builder-field-settings-free.php:130
4746
- #: includes/free/form-element.php:16
4747
- msgid "Numeric Field"
4748
  msgstr ""
4749
 
4750
- #: includes/free/admin/form-builder/class-wpuf-form-builder-field-settings-free.php:146
4751
- #: includes/free/form-element.php:17
4752
- msgid "Address Field"
4753
  msgstr ""
4754
 
4755
- #: includes/free/admin/form-builder/class-wpuf-form-builder-field-settings-free.php:162
4756
- #: includes/free/form-element.php:18
4757
- msgid "Step Start"
4758
  msgstr ""
4759
 
4760
- #: includes/free/admin/form-builder/class-wpuf-form-builder-field-settings-free.php:211
4761
  #: includes/free/form-element.php:32
4762
  msgid "Really Simple Captcha"
4763
  msgstr ""
4764
 
4765
- #: includes/free/admin/form-builder/class-wpuf-form-builder-field-settings-free.php:241
4766
- msgid "Term & Conditions"
4767
- msgstr ""
4768
-
4769
- #: includes/free/admin/form-builder/class-wpuf-form-builder-field-settings-free.php:256
4770
- msgid "Ratings"
4771
  msgstr ""
4772
 
4773
- #: includes/free/admin/form-builder/class-wpuf-form-builder-field-settings-free.php:271
4774
- msgid "Embed"
4775
  msgstr ""
4776
 
4777
  #: includes/free/admin/shortcode-builder.php:5
@@ -4888,10 +5032,16 @@ msgid ""
4888
  "link"
4889
  msgstr ""
4890
 
4891
- #: includes/free/class-login.php:774 includes/free/class-login.php:838
4892
  msgid "Your account has been activated"
4893
  msgstr ""
4894
 
 
 
 
 
 
 
4895
  #: includes/free/class-login.php:801
4896
  msgid "[%s] Your username and password info"
4897
  msgstr ""
@@ -4952,6 +5102,23 @@ msgstr ""
4952
  msgid "A user with same username already exists."
4953
  msgstr ""
4954
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4955
  #: includes/free/edit-profile.php:32 includes/free/edit-user.php:37
4956
  #: templates/unauthorized.php:3
4957
  msgid "This page is restricted. Please %s to view this page."
@@ -5020,22 +5187,34 @@ msgstr ""
5020
  msgid "Update Profile"
5021
  msgstr ""
5022
 
5023
- #: includes/free/edit-profile.php:249
5024
  msgid "WPUF Post Lock"
5025
  msgstr ""
5026
 
5027
- #: includes/free/edit-profile.php:252
5028
  msgid "Lock Post:"
5029
  msgstr ""
5030
 
5031
- #: includes/free/edit-profile.php:258
5032
  msgid "Lock user from creating new post."
5033
  msgstr ""
5034
 
5035
- #: includes/free/edit-profile.php:263
5036
  msgid "Lock Reason:"
5037
  msgstr ""
5038
 
 
 
 
 
 
 
 
 
 
 
 
 
5039
  #: includes/free/edit-user.php:23
5040
  msgid "User doesn't exists"
5041
  msgstr ""
@@ -5514,11 +5693,11 @@ msgstr ""
5514
  msgid "Hello %1$s, (not %1$s? <a href=\"%2$s\">Sign out</a>)"
5515
  msgstr ""
5516
 
5517
- #: templates/dashboard/dashboard.php:22
5518
  msgid "edit your password and profile"
5519
  msgstr ""
5520
 
5521
- #: templates/dashboard/dashboard.php:46
5522
  msgid "From your account dashboard you can view your dashboard, manage your %s"
5523
  msgstr ""
5524
 
@@ -5724,239 +5903,264 @@ msgstr ""
5724
  msgid "CSV"
5725
  msgstr ""
5726
 
5727
- #: wpuf-functions.php:1623
 
 
 
 
5728
  msgid "Edit Profile"
5729
  msgstr ""
5730
 
5731
- #: wpuf-functions.php:1730
5732
  msgid "United Arab Emirates Dirham"
5733
  msgstr ""
5734
 
5735
- #: wpuf-functions.php:1731
5736
  msgid "Australian Dollars"
5737
  msgstr ""
5738
 
5739
- #: wpuf-functions.php:1732
5740
  msgid "Argentine Peso"
5741
  msgstr ""
5742
 
5743
- #: wpuf-functions.php:1733
5744
  msgid "Bangladeshi Taka"
5745
  msgstr ""
5746
 
5747
- #: wpuf-functions.php:1734
5748
  msgid "Brazilian Real"
5749
  msgstr ""
5750
 
5751
- #: wpuf-functions.php:1735
5752
  msgid "Bulgarian Lev"
5753
  msgstr ""
5754
 
5755
- #: wpuf-functions.php:1736
5756
  msgid "Canadian Dollars"
5757
  msgstr ""
5758
 
5759
- #: wpuf-functions.php:1737
5760
  msgid "Chilean Peso"
5761
  msgstr ""
5762
 
5763
- #: wpuf-functions.php:1738
5764
  msgid "Chinese Yuan"
5765
  msgstr ""
5766
 
5767
- #: wpuf-functions.php:1739
5768
  msgid "Colombian Peso"
5769
  msgstr ""
5770
 
5771
- #: wpuf-functions.php:1740
5772
  msgid "Czech Koruna"
5773
  msgstr ""
5774
 
5775
- #: wpuf-functions.php:1741
5776
  msgid "Danish Krone"
5777
  msgstr ""
5778
 
5779
- #: wpuf-functions.php:1742
5780
  msgid "Dominican Peso"
5781
  msgstr ""
5782
 
5783
- #: wpuf-functions.php:1743
5784
  msgid "Algerian Dinar"
5785
  msgstr ""
5786
 
5787
- #: wpuf-functions.php:1744
5788
  msgid "Euros"
5789
  msgstr ""
5790
 
5791
- #: wpuf-functions.php:1745
5792
  msgid "Hong Kong Dollar"
5793
  msgstr ""
5794
 
5795
- #: wpuf-functions.php:1746
5796
  msgid "Croatia kuna"
5797
  msgstr ""
5798
 
5799
- #: wpuf-functions.php:1747
5800
  msgid "Hungarian Forint"
5801
  msgstr ""
5802
 
5803
- #: wpuf-functions.php:1748
5804
  msgid "Icelandic krona"
5805
  msgstr ""
5806
 
5807
- #: wpuf-functions.php:1749
5808
  msgid "Indonesia Rupiah"
5809
  msgstr ""
5810
 
5811
- #: wpuf-functions.php:1750
5812
  msgid "Indian Rupee"
5813
  msgstr ""
5814
 
5815
- #: wpuf-functions.php:1751
5816
  msgid "Nepali Rupee"
5817
  msgstr ""
5818
 
5819
- #: wpuf-functions.php:1752
5820
  msgid "Israeli Shekel"
5821
  msgstr ""
5822
 
5823
- #: wpuf-functions.php:1753
5824
  msgid "Japanese Yen"
5825
  msgstr ""
5826
 
5827
- #: wpuf-functions.php:1754
5828
  msgid "Lao Kip"
5829
  msgstr ""
5830
 
5831
- #: wpuf-functions.php:1755
5832
  msgid "South Korean Won"
5833
  msgstr ""
5834
 
5835
- #: wpuf-functions.php:1756
5836
  msgid "Malaysian Ringgits"
5837
  msgstr ""
5838
 
5839
- #: wpuf-functions.php:1757
5840
  msgid "Mexican Peso"
5841
  msgstr ""
5842
 
5843
- #: wpuf-functions.php:1758
5844
  msgid "Nigerian Naira"
5845
  msgstr ""
5846
 
5847
- #: wpuf-functions.php:1759
5848
  msgid "Norwegian Krone"
5849
  msgstr ""
5850
 
5851
- #: wpuf-functions.php:1760
5852
  msgid "New Zealand Dollar"
5853
  msgstr ""
5854
 
5855
- #: wpuf-functions.php:1761
5856
  msgid "Omani Rial"
5857
  msgstr ""
5858
 
5859
- #: wpuf-functions.php:1762
5860
  msgid "Iranian Rial"
5861
  msgstr ""
5862
 
5863
- #: wpuf-functions.php:1763
5864
  msgid "Pakistani Rupee"
5865
  msgstr ""
5866
 
5867
- #: wpuf-functions.php:1764
5868
  msgid "Paraguayan Guaraní"
5869
  msgstr ""
5870
 
5871
- #: wpuf-functions.php:1765
5872
  msgid "Philippine Pesos"
5873
  msgstr ""
5874
 
5875
- #: wpuf-functions.php:1766
5876
  msgid "Polish Zloty"
5877
  msgstr ""
5878
 
5879
- #: wpuf-functions.php:1767
5880
  msgid "Pounds Sterling"
5881
  msgstr ""
5882
 
5883
- #: wpuf-functions.php:1768
5884
  msgid "Romanian Leu"
5885
  msgstr ""
5886
 
5887
- #: wpuf-functions.php:1769
5888
  msgid "Russian Ruble"
5889
  msgstr ""
5890
 
5891
- #: wpuf-functions.php:1770
5892
  msgid "Saudi Riyal"
5893
  msgstr ""
5894
 
5895
- #: wpuf-functions.php:1771
5896
  msgid "Singapore Dollar"
5897
  msgstr ""
5898
 
5899
- #: wpuf-functions.php:1772
5900
  msgid "South African rand"
5901
  msgstr ""
5902
 
5903
- #: wpuf-functions.php:1773
5904
  msgid "Swedish Krona"
5905
  msgstr ""
5906
 
5907
- #: wpuf-functions.php:1774
5908
  msgid "Swiss Franc"
5909
  msgstr ""
5910
 
5911
- #: wpuf-functions.php:1775
5912
  msgid "Taiwan New Dollars"
5913
  msgstr ""
5914
 
5915
- #: wpuf-functions.php:1776
5916
  msgid "Thai Baht"
5917
  msgstr ""
5918
 
5919
- #: wpuf-functions.php:1777
5920
  msgid "Turkish Lira"
5921
  msgstr ""
5922
 
5923
- #: wpuf-functions.php:1778
5924
  msgid "US Dollar"
5925
  msgstr ""
5926
 
5927
- #: wpuf-functions.php:1779
5928
  msgid "Vietnamese Dong"
5929
  msgstr ""
5930
 
5931
- #: wpuf-functions.php:1780
5932
  msgid "Egyptian Pound"
5933
  msgstr ""
5934
 
5935
- #: wpuf-functions.php:2609
5936
  msgid "None"
5937
  msgstr ""
5938
 
5939
- #: wpuf.php:104
5940
  msgid "Your installed PHP Version is: "
5941
  msgstr ""
5942
 
5943
- #: wpuf.php:105
5944
  msgid "The <strong>WP User Frontend</strong> plugin requires PHP version <strong>"
5945
  msgstr ""
5946
 
5947
- #: wpuf.php:105
5948
  msgid "</strong> or greater."
5949
  msgstr ""
5950
 
5951
- #: wpuf.php:189
5952
  msgid "Your Post Has Been Expired"
5953
  msgstr ""
5954
 
5955
- #: wpuf.php:539
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5956
  msgid "Please Cancel Your Currently Active Pack first!"
5957
  msgstr ""
5958
 
5959
- #: wpuf.php:698
5960
  msgid "Error: Nonce verification failed"
5961
  msgstr ""
5962
 
@@ -6038,7 +6242,7 @@ msgctxt "enhanced select"
6038
  msgid "Searching&hellip;"
6039
  msgstr ""
6040
 
6041
- #: wpuf-functions.php:1234
6042
  msgctxt "tag delimiter"
6043
  msgid ","
6044
  msgstr ""
1
+ # Copyright (C) 2019 Tareq Hasan
2
  # This file is distributed under the GPL2 or later.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: WP User Frontend 3.1.0\n"
6
  "Report-Msgid-Bugs-To: https://wedevs.com/contact/\n"
7
+ "POT-Creation-Date: 2019-01-31 11:48:06+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
+ "PO-Revision-Date: 2019-MO-DA HO:MI+ZONE\n"
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <EMAIL@ADDRESS>\n"
14
  "X-Generator: grunt-wp-i18n 0.5.4\n"
83
  msgid "Number of items per page:"
84
  msgstr ""
85
 
86
+ #: admin/class-admin-settings.php:408
87
+ msgid "Schedule lock has been cleared"
88
+ msgstr ""
89
+
90
  #: admin/class-admin-subscription.php:60
91
  msgid "Pack Description"
92
  msgstr ""
143
  #: admin/class-admin-subscription.php:216
144
  #: admin/class-admin-subscription.php:570 class/frontend-account.php:244
145
  #: class/subscription.php:866 includes/class-user-subscription.php:307
146
+ #: templates/subscriptions/pack-details.php:25
147
  msgid "Free"
148
  msgstr ""
149
 
150
  #: admin/class-admin-subscription.php:234
151
+ #: admin/html/form-settings-display.php:41 admin/post-forms-list-table.php:344
152
+ #: admin/settings-options.php:112 admin/settings-options.php:123
153
+ #: admin/settings-options.php:215 admin/settings-options.php:226
154
+ #: admin/template.php:70 class/asset-loader.php:49
155
+ #: includes/fields/class-abstract-fields.php:260
156
+ #: includes/fields/class-abstract-fields.php:344
157
+ #: includes/fields/class-abstract-fields.php:358
158
+ #: includes/fields/class-abstract-fields.php:426
159
+ #: includes/fields/class-field-checkbox.php:81
160
+ #: includes/fields/class-field-radio.php:86 includes/free/form-element.php:477
161
+ #: wpuf.php:706
162
  msgid "Yes"
163
  msgstr ""
164
 
165
  #: admin/class-admin-subscription.php:236
166
+ #: admin/html/form-settings-display.php:40 admin/post-forms-list-table.php:345
167
+ #: admin/settings-options.php:113 admin/settings-options.php:124
168
+ #: admin/settings-options.php:216 admin/settings-options.php:227
169
+ #: admin/template.php:71 class/asset-loader.php:50
170
+ #: includes/fields/class-abstract-fields.php:261
171
+ #: includes/fields/class-abstract-fields.php:345
172
+ #: includes/fields/class-abstract-fields.php:359
173
+ #: includes/fields/class-abstract-fields.php:427
174
+ #: includes/fields/class-field-checkbox.php:82
175
+ #: includes/fields/class-field-radio.php:87 includes/free/form-element.php:478
176
+ #: wpuf.php:707
177
  msgid "No"
178
  msgstr ""
179
 
303
  msgstr ""
304
 
305
  #: admin/class-admin-subscription.php:754
306
+ #: admin/form-builder/class-wpuf-admin-form-builder.php:265
307
  #: class/payment.php:199 class/subscription.php:779
308
  #: includes/class-list-table-subscribers.php:128
309
  #: lib/class-wedevs-insights.php:667 templates/dashboard/subscription.php:61
340
 
341
  #: admin/class-tools.php:39 admin/class-tools.php:95
342
  #: admin/post-forms-list-table.php:43 class/transactions-list-table.php:86
343
+ #: includes/class-list-table-subscribers.php:126 wpuf-functions.php:2615
344
  msgid "All"
345
  msgstr ""
346
 
520
 
521
  #: admin/form-builder/assets/js/components/form-featured_image/template.php:6
522
  #: admin/form-builder/assets/js/components/form-image_upload/template.php:6
523
+ #: class/render-form.php:1680
524
+ #: includes/fields/class-field-featured-image.php:103
525
+ #: includes/fields/class-field-image.php:122
526
+ #: includes/fields/class-field-image.php:143
527
  msgid "Select Image"
528
  msgstr ""
529
 
530
  #: admin/form-builder/assets/js/components/form-post_content/template.php:4
531
+ #: class/render-form.php:1049 includes/fields/class-field-post-content.php:47
532
  msgid "Insert Photo"
533
  msgstr ""
534
 
544
  msgid "Invalid form id"
545
  msgstr ""
546
 
547
+ #: admin/form-builder/class-wpuf-admin-form-builder.php:260
 
 
 
 
 
 
 
 
548
  msgid "Advanced Options"
549
  msgstr ""
550
 
551
+ #: admin/form-builder/class-wpuf-admin-form-builder.php:261
552
  msgid "Are you sure you want to delete this field?"
553
  msgstr ""
554
 
555
+ #: admin/form-builder/class-wpuf-admin-form-builder.php:262
556
+ #: admin/posting.php:70 class/asset-loader.php:55 wpuf.php:716
557
  msgid "Yes, delete it"
558
  msgstr ""
559
 
560
+ #: admin/form-builder/class-wpuf-admin-form-builder.php:263
561
+ #: admin/posting.php:71 class/asset-loader.php:56 wpuf.php:717
562
  msgid "No, cancel it"
563
  msgstr ""
564
 
565
+ #: admin/form-builder/class-wpuf-admin-form-builder.php:264
566
  msgid "OK"
567
  msgstr ""
568
 
569
+ #: admin/form-builder/class-wpuf-admin-form-builder.php:266
570
  #: includes/free/admin/shortcode-builder.php:69
571
  msgid "Close"
572
  msgstr ""
573
 
574
+ #: admin/form-builder/class-wpuf-admin-form-builder.php:267
575
+ msgid "This field must contain at least one choice"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
576
  msgstr ""
577
 
578
+ #: admin/form-builder/class-wpuf-admin-form-builder.php:268
579
+ #: includes/fields/class-field-checkbox.php:110
580
+ #: includes/fields/class-field-dropdown.php:101
581
+ #: includes/fields/class-field-multidropdown.php:93
582
+ #: includes/fields/class-field-radio.php:114
583
+ msgid "Option"
584
  msgstr ""
585
 
586
+ #: admin/form-builder/class-wpuf-admin-form-builder.php:269
587
+ msgid "Column"
 
588
  msgstr ""
589
 
590
+ #: admin/form-builder/class-wpuf-admin-form-builder.php:270
591
+ msgid "This field must contain at least one column"
592
  msgstr ""
593
 
594
+ #: admin/form-builder/class-wpuf-admin-form-builder.php:271
595
+ msgid "is available in Pro version"
 
596
  msgstr ""
597
 
598
+ #: admin/form-builder/class-wpuf-admin-form-builder.php:272
599
+ msgid "Please upgrade to the Pro version to unlock all these awesome features"
 
600
  msgstr ""
601
 
602
+ #: admin/form-builder/class-wpuf-admin-form-builder.php:273
603
+ msgid "Get the Pro version"
 
604
  msgstr ""
605
 
606
+ #: admin/form-builder/class-wpuf-admin-form-builder.php:274
607
+ #: includes/fields/class-abstract-fields.php:401
608
+ msgid "Select"
609
  msgstr ""
610
 
611
+ #: admin/form-builder/class-wpuf-admin-form-builder.php:275
612
+ msgid "Saved form data"
 
613
  msgstr ""
614
 
615
+ #: admin/form-builder/class-wpuf-admin-form-builder.php:276
616
+ msgid "You have unsaved changes."
617
  msgstr ""
618
 
619
+ #: admin/form-builder/class-wpuf-admin-form-builder.php:277
620
+ #: admin/form-builder/views/form-builder.php:49
621
+ msgid "Click to copy shortcode"
 
 
622
  msgstr ""
623
 
624
  #: admin/form-builder/views/form-builder.php:5
792
  msgstr ""
793
 
794
  #: admin/form.php:440 admin/html/form-settings-post.php:22
795
+ #: class/render-form.php:753 includes/class-frontend-render-form.php:162
796
  msgid "Save Draft"
797
  msgstr ""
798
 
799
+ #: admin/form.php:560
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
800
  msgid "Post Forms must have either Post Title, Post Body or Excerpt field"
801
  msgstr ""
802
 
816
  msgid "Right of Element"
817
  msgstr ""
818
 
819
+ #: admin/html/form-settings-display.php:19 includes/class-customizer.php:105
820
+ #: includes/fields/class-abstract-fields.php:314
821
+ msgid "Hidden"
822
+ msgstr ""
823
+
824
  #: admin/html/form-settings-display.php:29
825
  msgid "Where the labels of the form should display"
826
  msgstr ""
915
  msgid "Update"
916
  msgstr ""
917
 
918
+ #: admin/html/form-settings-post-edit.php:14
919
  msgid "Set Post Status to"
920
  msgstr ""
921
 
922
+ #: admin/html/form-settings-post-edit.php:24
923
  msgid "No Change"
924
  msgstr ""
925
 
926
+ #: admin/html/form-settings-post-edit.php:31
927
  #: admin/html/form-settings-post.php:132 includes/free/form-element.php:376
928
  msgid "Redirect To"
929
  msgstr ""
930
 
931
+ #: admin/html/form-settings-post-edit.php:36
932
  #: admin/html/form-settings-post.php:137
933
  msgid "Newly created post"
934
  msgstr ""
935
 
936
+ #: admin/html/form-settings-post-edit.php:37
937
  #: admin/html/form-settings-post.php:138 includes/free/form-element.php:381
938
  msgid "Same Page"
939
  msgstr ""
940
 
941
+ #: admin/html/form-settings-post-edit.php:38
942
  #: admin/html/form-settings-post.php:139 includes/free/form-element.php:382
943
  msgid "To a page"
944
  msgstr ""
945
 
946
+ #: admin/html/form-settings-post-edit.php:39
947
  #: admin/html/form-settings-post.php:140 includes/free/form-element.php:383
948
  msgid "To a custom URL"
949
  msgstr ""
950
 
951
+ #: admin/html/form-settings-post-edit.php:48
952
  #: admin/html/form-settings-post.php:149 includes/free/form-element.php:392
953
  msgid "After successfull submit, where the page will redirect to"
954
  msgstr ""
955
 
956
+ #: admin/html/form-settings-post-edit.php:54
957
  msgid "Post Update Message"
958
  msgstr ""
959
 
960
+ #: admin/html/form-settings-post-edit.php:61
961
  #: admin/html/form-settings-post.php:162 includes/free/form-element.php:412
962
  msgid "Page"
963
  msgstr ""
964
 
965
+ #: admin/html/form-settings-post-edit.php:76
966
  #: admin/html/form-settings-post.php:177 includes/free/form-element.php:427
967
  msgid "Custom URL"
968
  msgstr ""
969
 
970
+ #: admin/html/form-settings-post-edit.php:83
971
  msgid "Subscription Title"
972
  msgstr ""
973
 
974
+ #: admin/html/form-settings-post-edit.php:92
975
  msgid "Update Post Button text"
976
  msgstr ""
977
 
978
+ #: admin/html/form-settings-post-edit.php:99
979
+ msgid "Lock User From Editing After"
980
+ msgstr ""
981
+
982
+ #: admin/html/form-settings-post-edit.php:102
983
+ msgid "hours"
984
+ msgstr ""
985
+
986
+ #: admin/html/form-settings-post-edit.php:104
987
+ msgid "After how many hours user will be locked from editing the submitted post."
988
+ msgstr ""
989
+
990
+ #: admin/html/form-settings-post.php:7 class/post-form-templates/post.php:125
991
  #: includes/free/post-form-templates/the_events_calendar.php:171
992
  msgid "This page is restricted. Please Log in / Register to view this page."
993
  msgstr ""
1062
  msgid "It will show a button to save as draft"
1063
  msgstr ""
1064
 
1065
+ #: admin/html/form-submission-restriction.php:11 admin/template-post.php:167
1066
+ #: includes/fields/class-abstract-fields.php:441
1067
+ #: includes/free/edit-profile.php:97 templates/registration-form.php:27
1068
+ msgid "Name"
1069
+ msgstr ""
1070
+
1071
+ #: admin/html/form-submission-restriction.php:12 admin/html/support.php:224
1072
+ #: class/transactions-list-table.php:49 includes/class-privacy.php:371
1073
+ #: includes/free/edit-user.php:153 templates/registration-form.php:44
1074
+ msgid "Email"
1075
+ msgstr ""
1076
+
1077
  #: admin/html/form-submission-restriction.php:29
1078
  #: admin/post-forms-list-table.php:298
1079
  msgid "Guest Post"
1376
  msgstr ""
1377
 
1378
  #: admin/html/whats-new.php:8
1379
+ msgid "Unable to send new user registration email"
1380
  msgstr ""
1381
 
1382
  #: admin/html/whats-new.php:10
1383
  msgid ""
1384
+ "WP User Frontend default registration form `[wpuf-registration]` was unable "
1385
+ "to send the new user registration email."
1386
+ msgstr ""
1387
+
1388
+ #: admin/html/whats-new.php:13
1389
+ msgid "WPUF forms block compatibility issue with the latest WP version"
1390
+ msgstr ""
1391
+
1392
+ #: admin/html/whats-new.php:15
1393
+ msgid ""
1394
+ "With the latest version of WordPress the gutenberg block of WP User "
1395
+ "Frontend were not working. In this version, you will get it fixed."
1396
+ msgstr ""
1397
+
1398
+ #: admin/html/whats-new.php:18
1399
+ msgid "Page not update where `[wpuf_dashboard]` shortcode exist"
1400
+ msgstr ""
1401
+
1402
+ #: admin/html/whats-new.php:20
1403
+ msgid ""
1404
+ "While using Gutenberg, the page were not being updated with WPUF shortcode "
1405
+ "[wpuf dashboard]"
1406
+ msgstr ""
1407
+
1408
+ #: admin/html/whats-new.php:23
1409
+ msgid "Retain default when determining whether to display the admin bar"
1410
+ msgstr ""
1411
+
1412
+ #: admin/html/whats-new.php:25
1413
+ msgid ""
1414
+ "From the User Frontend Settings, set that Administrator, Editor, Vendor can "
1415
+ "see the admin bar. Now, the super admin want, one specific user ( who has "
1416
+ "the user role from the above ) can't see the admin bar and disabled it from "
1417
+ "the Toolbar form that specific user profile. And this configuration ( "
1418
+ "Toolbar ) from the specific user profile were unable to impact on the "
1419
+ "frontend."
1420
+ msgstr ""
1421
+
1422
+ #: admin/html/whats-new.php:28
1423
+ msgid "Fatal error when use PHP lower version (5.4 or lower)"
1424
+ msgstr ""
1425
+
1426
+ #: admin/html/whats-new.php:30
1427
+ msgid ""
1428
+ "It was unable to install WP User Frontend with PHP 5.4 or lower version. "
1429
+ "Here is the error details: <br><br><strong>Fatal error: Can't use method "
1430
+ "return value in write context in "
1431
+ "/wp-user-frontend/class/frontend-form-post.php on line 194</strong>"
1432
+ msgstr ""
1433
+
1434
+ #: admin/html/whats-new.php:33
1435
+ msgid "Product form was unable to show the single gallery image"
1436
+ msgstr ""
1437
+
1438
+ #: admin/html/whats-new.php:35
1439
+ msgid ""
1440
+ "When user upload single image for product gallery using WPUF WooCommerce "
1441
+ "product form, that image were not showing on the frontend."
1442
+ msgstr ""
1443
+
1444
+ #: admin/html/whats-new.php:44
1445
+ msgid "WooCommerce gallery images not getting saved"
1446
+ msgstr ""
1447
+
1448
+ #: admin/html/whats-new.php:46
1449
+ msgid ""
1450
  "After releasing version 2.9.3, WooCommerce gallery image field stopped "
1451
  "working. You will get it fixed in this version."
1452
  msgstr ""
1453
 
1454
+ #: admin/html/whats-new.php:55
1455
  msgid "The Events Calendar Integration Form"
1456
  msgstr ""
1457
 
1458
+ #: admin/html/whats-new.php:57
1459
  msgid ""
1460
  "Now admin can allow users to create event from the frontend. Currently WPUF "
1461
  "has a one click pre-build event form that has been integrated with The "
1462
  "Events Calendar plugin"
1463
  msgstr ""
1464
 
1465
+ #: admin/html/whats-new.php:60
1466
  msgid "Post Submission Facility From Account Page"
1467
  msgstr ""
1468
 
1469
+ #: admin/html/whats-new.php:62
1470
  msgid ""
1471
  "On the frontend account page, added a new menu item named <b>Submit "
1472
  "Post</b>. Now admin can allow users to submit post from their default "
1475
  "you can assign any post form that will use to submit posts."
1476
  msgstr ""
1477
 
1478
+ #: admin/html/whats-new.php:65
1479
  msgid "Login/Lost Password Link Under Registration Form"
1480
  msgstr ""
1481
 
1482
+ #: admin/html/whats-new.php:67
1483
  msgid "Added Login/Lost Password link under registration form"
1484
  msgstr ""
1485
 
1486
+ #: admin/html/whats-new.php:76
1487
  msgid "Added drag and drop image ordering on image upload"
1488
  msgstr ""
1489
 
1490
+ #: admin/html/whats-new.php:78
1491
  msgid ""
1492
  "Now frontend users can drag & drop the images/files to change the order "
1493
  "while uploading."
1494
  msgstr ""
1495
 
1496
+ #: admin/html/whats-new.php:81
1497
  msgid "Added reCAPTCHA field in login form"
1498
  msgstr ""
1499
 
1500
+ #: admin/html/whats-new.php:83
1501
  msgid ""
1502
  "Admin has the option to show reCAPTCHA field in login form. Check the "
1503
  "related settings from <strong>User Frontend > Settings > "
1504
  "Login/Registration</strong>"
1505
  msgstr ""
1506
 
1507
+ #: admin/html/whats-new.php:86
1508
  msgid "Added preview option in forms"
1509
  msgstr ""
1510
 
1511
+ #: admin/html/whats-new.php:88
1512
  msgid ""
1513
  "You can see a nice <strong>Preview</strong> button with <strong>Save "
1514
  "Form</strong> button, admin can take a quick look of the form without using "
1515
  "shortcode"
1516
  msgstr ""
1517
 
1518
+ #: admin/html/whats-new.php:91
1519
  msgid "Fixed hiding “Select Image” button while uploading multiple images."
1520
  msgstr ""
1521
 
1522
+ #: admin/html/whats-new.php:93
1523
  msgid ""
1524
  "The upload button will not be hidden until the user selects max number of "
1525
  "files "
1526
  msgstr ""
1527
 
1528
+ #: admin/html/whats-new.php:96
1529
  msgid "Added form limit notice before form submission"
1530
  msgstr ""
1531
 
1532
+ #: admin/html/whats-new.php:98
1533
  msgid ""
1534
  "Limit notice message was showing after submission, now it is showing when "
1535
  "rendering the form"
1536
  msgstr ""
1537
 
1538
+ #: admin/html/whats-new.php:101
1539
  msgid "Fixed: default post category not saving"
1540
  msgstr ""
1541
 
1542
+ #: admin/html/whats-new.php:103
1543
  msgid ""
1544
  "From the form <strong>Settings > Post Settings</strong>, default post "
1545
  "category options were not saving. Now, it's fixed."
1546
  msgstr ""
1547
 
1548
+ #: admin/html/whats-new.php:106
1549
  msgid ""
1550
  "WPUF dashboard shortcode with form_id attribute was not showing posts "
1551
  "properly"
1552
  msgstr ""
1553
 
1554
+ #: admin/html/whats-new.php:108
1555
  msgid ""
1556
  "Now you can list posts on the frontend by using <strong>form_id<strong/> "
1557
  "attribute with <strong>[wpuf_dashboard]</strong> shortcode"
1558
  msgstr ""
1559
 
1560
+ #: admin/html/whats-new.php:117
1561
  msgid "Changed text domain to `wp-user-frontend` from `wpuf` "
1562
  msgstr ""
1563
 
1564
+ #: admin/html/whats-new.php:119
1565
  msgid ""
1566
  "If you are using other language than English. Please <b>rename</b> your "
1567
  "<i>.po and .mo </i> files to `wp-user-frontend_` from `wpuf_` <br> This "
1568
  "change was made to support translations from translate.wordpress.org"
1569
  msgstr ""
1570
 
1571
+ #: admin/html/whats-new.php:122
1572
  msgid "Added WP User Frontend Data export and erase functionality."
1573
  msgstr ""
1574
 
1575
+ #: admin/html/whats-new.php:124
1576
  msgid "Added functionality to export WP User Frontend Data to comply with GDPR."
1577
  msgstr ""
1578
 
1579
+ #: admin/html/whats-new.php:127
1580
  msgid "Added billing address customizer."
1581
  msgstr ""
1582
 
1583
+ #: admin/html/whats-new.php:129
1584
  msgid "Added customizer options for billing address in payment page."
1585
  msgstr ""
1586
 
1587
+ #: admin/html/whats-new.php:132
1588
  msgid "Make the payment page responsive."
1589
  msgstr ""
1590
 
1591
+ #: admin/html/whats-new.php:134
1592
  msgid "Some css adjustments are made in payment page to make it responsive."
1593
  msgstr ""
1594
 
1595
+ #: admin/html/whats-new.php:137
1596
  msgid "Fixed image upload issue in Safari."
1597
  msgstr ""
1598
 
1599
+ #: admin/html/whats-new.php:139
1600
  msgid "Images were not showing after upload in safari, it is fixed now."
1601
  msgstr ""
1602
 
1603
+ #: admin/html/whats-new.php:142
1604
  msgid "Post update issue after updating or removing post images."
1605
  msgstr ""
1606
 
1607
+ #: admin/html/whats-new.php:144
1608
  msgid ""
1609
  "Posts cannot be updated after updating or removing post images, it is fixed "
1610
  "now."
1611
  msgstr ""
1612
 
1613
+ #: admin/html/whats-new.php:153
1614
  msgid "Allow overriding form input styles using theme styling."
1615
  msgstr ""
1616
 
1617
+ #: admin/html/whats-new.php:155
1618
  msgid "Overriding form input styles using theme style is now possible."
1619
  msgstr ""
1620
 
1621
+ #: admin/html/whats-new.php:158
1622
  msgid "Fixed Auto Login after registration."
1623
  msgstr ""
1624
 
1625
+ #: admin/html/whats-new.php:160
1626
  msgid "Auto Login after registration was not working is fixed now."
1627
  msgstr ""
1628
 
1629
+ #: admin/html/whats-new.php:163
1630
  msgid "Fixed fallback cost calculation"
1631
  msgstr ""
1632
 
1633
+ #: admin/html/whats-new.php:165
1634
  msgid "Fallback cost calculation was inaccurate for some cases, it is fixed now."
1635
  msgstr ""
1636
 
1637
+ #: admin/html/whats-new.php:168
1638
  msgid "Removal of subscription from User Profile gets reverted if updated"
1639
  msgstr ""
1640
 
1641
+ #: admin/html/whats-new.php:170
1642
  msgid "User subscription deletion gets reverted if updated is fixed."
1643
  msgstr ""
1644
 
1645
+ #: admin/html/whats-new.php:173
1646
  msgid "Show Free pack users in subscribers list."
1647
  msgstr ""
1648
 
1649
+ #: admin/html/whats-new.php:175
1650
  msgid "Free pack users were not showing in subscribers list, now they will."
1651
  msgstr ""
1652
 
1653
+ #: admin/html/whats-new.php:184
1654
  msgid "WP User Frontend Guten Block is added"
1655
  msgstr ""
1656
 
1657
+ #: admin/html/whats-new.php:186
1658
  msgid ""
1659
  "WPUF Form Block is now available to be used within gutenberg editor with "
1660
  "preview of the form. "
1661
  msgstr ""
1662
 
1663
+ #: admin/html/whats-new.php:189
1664
  msgid "Advanced Custom Fields plugin compatibility"
1665
  msgstr ""
1666
 
1667
+ #: admin/html/whats-new.php:191
1668
  msgid "Now all your ACF fields can be used within WPUF Post forms. "
1669
  msgstr ""
1670
 
1671
+ #: admin/html/whats-new.php:194
1672
  msgid "Taxonomy Terms not showing for custom post types"
1673
  msgstr ""
1674
 
1675
+ #: admin/html/whats-new.php:196
1676
  msgid ""
1677
  "Fixed an issue with taxonomy terms not appearing for Custom Post types "
1678
  "within Form Settings and Dashboard Post Listing"
1679
  msgstr ""
1680
 
1681
+ #: admin/html/whats-new.php:199
1682
  msgid "Various other code optimizations"
1683
  msgstr ""
1684
 
1685
+ #: admin/html/whats-new.php:201 admin/html/whats-new.php:258
1686
  msgid "Code structure organization and optimization for better performance"
1687
  msgstr ""
1688
 
1689
+ #: admin/html/whats-new.php:210
1690
  msgid "WoooCommerce billing address Sync"
1691
  msgstr ""
1692
 
1693
+ #: admin/html/whats-new.php:212
1694
  msgid ""
1695
  "If an existing customer has previously set his billing address, that will "
1696
  "be imported into WPUF Billing address "
1697
  msgstr ""
1698
 
1699
+ #: admin/html/whats-new.php:215
1700
  msgid "Trial subscription message not showing properly"
1701
  msgstr ""
1702
 
1703
+ #: admin/html/whats-new.php:217
1704
  msgid "Subscriptions with Trial now shows trial notices"
1705
  msgstr ""
1706
 
1707
+ #: admin/html/whats-new.php:220
1708
  msgid "Reset email Key not working"
1709
  msgstr ""
1710
 
1711
+ #: admin/html/whats-new.php:222
1712
  msgid "Reset Email key was not working in some cases"
1713
  msgstr ""
1714
 
1715
+ #: admin/html/whats-new.php:225
1716
  msgid "Post count not showing on the frontend dashboard"
1717
  msgstr ""
1718
 
1719
+ #: admin/html/whats-new.php:227
1720
  msgid ""
1721
  "Dashboard with multiple post type was not showing post counts properly, is "
1722
  "now fixed and shows count for each post type"
1723
  msgstr ""
1724
 
1725
+ #: admin/html/whats-new.php:230
1726
  msgid "Login Redirect showing blank page is fixed"
1727
  msgstr ""
1728
 
1729
+ #: admin/html/whats-new.php:232
1730
  msgid ""
1731
  "If \"Previous Page\" was set for redirection, login redirect was "
1732
  "redirecting to blank page for users who hit login page directly"
1733
  msgstr ""
1734
 
1735
+ #: admin/html/whats-new.php:241
1736
  msgid "Enhanced Login Redirect to redirect users to previous page"
1737
  msgstr ""
1738
 
1739
+ #: admin/html/whats-new.php:243
1740
  msgid ""
1741
  "You can choose Previous Page as Login Redirect page settings now to "
1742
  "redirect users to the page from which they went for Login. "
1743
  msgstr ""
1744
 
1745
+ #: admin/html/whats-new.php:246
1746
  msgid "Email HTML links not Rendreing properly issue is fixed"
1747
  msgstr ""
1748
 
1749
+ #: admin/html/whats-new.php:248
1750
  msgid ""
1751
  "For some clients emails were not rendering the HTML links properly, this is "
1752
  "now fixed"
1753
  msgstr ""
1754
 
1755
+ #: admin/html/whats-new.php:251
1756
  msgid "Form Builder : Form Field's Help text styles not showing properly"
1757
  msgstr ""
1758
 
1759
+ #: admin/html/whats-new.php:253
1760
  msgid "Help texts styling is now fixed and much easier to read and understand"
1761
  msgstr ""
1762
 
1763
+ #: admin/html/whats-new.php:256
1764
  msgid "Various other code improvements"
1765
  msgstr ""
1766
 
1767
+ #: admin/html/whats-new.php:267
1768
  msgid "Dashboard Post Listing now supports multiple post types"
1769
  msgstr ""
1770
 
1771
+ #: admin/html/whats-new.php:269
1772
  msgid ""
1773
  "Now you can show multiple post type in user dashboard using shortcode like "
1774
  "this : <br><b>[wpuf_dashboard post_type=\"post,page,custom_type\"]</b> "
1775
  msgstr ""
1776
 
1777
+ #: admin/html/whats-new.php:272
1778
  msgid "Added Login Redirect Settings"
1779
  msgstr ""
1780
 
1781
+ #: admin/html/whats-new.php:274
1782
  msgid ""
1783
  "You can now set a page from <i>WPUF Settings > Login/Registration > "
1784
  "Redirect after Login</i>. When login redirection is active the user will be "
1785
  "redirected to this page after login."
1786
  msgstr ""
1787
 
1788
+ #: admin/html/whats-new.php:277
1789
  msgid "Image Upload field button text can be changed"
1790
  msgstr ""
1791
 
1792
+ #: admin/html/whats-new.php:279
1793
  msgid ""
1794
  "The upload button text can now be changed for image upload fields which "
1795
  "defaults to \"Select Image\" if not set. "
1796
  msgstr ""
1797
 
1798
+ #: admin/html/whats-new.php:282
1799
  msgid "Multi Step Form styles made compatible with more themes"
1800
  msgstr ""
1801
 
1802
+ #: admin/html/whats-new.php:284
1803
  msgid "Multi Step form can now be styled more easily with other themes "
1804
  msgstr ""
1805
 
1806
+ #: admin/html/whats-new.php:287
1807
  msgid "Required field condition for google map not working is fixed"
1808
  msgstr ""
1809
 
1810
+ #: admin/html/whats-new.php:289
1811
  msgid ""
1812
  "If Google Map field was set as required users were able to submit form "
1813
  "without changing the default value."
1814
  msgstr ""
1815
 
1816
+ #: admin/html/whats-new.php:298
1817
  msgid "Admin form builder is now fully responsive."
1818
  msgstr ""
1819
 
1820
+ #: admin/html/whats-new.php:300
1821
  msgid ""
1822
  "Now you can edit forms from your mobile devices directly. Our improved "
1823
  "responsive layouts of form builder makes it easy for you to build forms on "
1824
  "the go."
1825
  msgstr ""
1826
 
1827
+ #: admin/html/whats-new.php:303
1828
  msgid "Added color schemes for creating attractive form layouts."
1829
  msgstr ""
1830
 
1831
+ #: admin/html/whats-new.php:305
1832
  msgid ""
1833
  "We have added 3 new color schemes for the form layouts which you can choose "
1834
  "from each form's new display settings."
1835
  msgstr ""
1836
 
1837
+ #: admin/html/whats-new.php:308
1838
  msgid "Restrict Free subscription pack to be enabled multiple times "
1839
  msgstr ""
1840
 
1841
+ #: admin/html/whats-new.php:310
1842
  msgid ""
1843
  "Free subscription packs now can only be purchased once and the limit "
1844
  "applies properly"
1845
  msgstr ""
1846
 
1847
+ #: admin/html/whats-new.php:313
1848
  msgid "Various other bug fixes and improvements were made "
1849
  msgstr ""
1850
 
1851
+ #: admin/html/whats-new.php:315
1852
  msgid "Please see the change log to see full details."
1853
  msgstr ""
1854
 
1855
+ #: admin/html/whats-new.php:324
1856
  msgid "Added upgrade function for default category"
1857
  msgstr ""
1858
 
1859
+ #: admin/html/whats-new.php:326
1860
  msgid "Upgrader added to upgrade previously set default post category."
1861
  msgstr ""
1862
 
1863
+ #: admin/html/whats-new.php:329
1864
  msgid "Subscription pack cannot be canceled"
1865
  msgstr ""
1866
 
1867
+ #: admin/html/whats-new.php:331
1868
  msgid ""
1869
  "Fixed recurring subscription pack cannot be canceled from my account page "
1870
  "in subscription details section."
1871
  msgstr ""
1872
 
1873
+ #: admin/html/whats-new.php:334
1874
  msgid "page installer admin notice logic issue"
1875
  msgstr ""
1876
 
1877
+ #: admin/html/whats-new.php:336
1878
  msgid ""
1879
  "Fixed page installer admin notice logic problem due to new payment settings "
1880
  "default value not set."
1881
  msgstr ""
1882
 
1883
+ #: admin/html/whats-new.php:346
1884
  msgid "Setup Wizard"
1885
  msgstr ""
1886
 
1887
+ #: admin/html/whats-new.php:348
1888
  msgid "Setup Wizard added to turn off payment options and install pages."
1889
  msgstr ""
1890
 
1891
+ #: admin/html/whats-new.php:352
1892
  msgid "Multi-select Category"
1893
  msgstr ""
1894
 
1895
+ #: admin/html/whats-new.php:354
1896
  msgid "Add multi-select to default category in post form settings."
1897
  msgstr ""
1898
 
1899
+ #: admin/html/whats-new.php:358
1900
  msgid "Select Text option for Taxonomy"
1901
  msgstr ""
1902
 
1903
+ #: admin/html/whats-new.php:360
1904
  msgid ""
1905
  "Add Select Text option for taxonomy fields. Now you can add default text "
1906
  "with empty value as first option for Taxonomy dropdown."
1907
  msgstr ""
1908
 
1909
+ #: admin/html/whats-new.php:363
1910
  msgid "Taxonomy Checkbox Inline"
1911
  msgstr ""
1912
 
1913
+ #: admin/html/whats-new.php:365
1914
  msgid ""
1915
  "Added checkbox inline option to taxonomy checkbox. You can now display "
1916
  "Taxonomy checkbox fields inline."
1917
  msgstr ""
1918
 
1919
+ #: admin/html/whats-new.php:375
1920
  msgid "Manage schedule for form submission"
1921
  msgstr ""
1922
 
1923
+ #: admin/html/whats-new.php:377
1924
  msgid ""
1925
  "Do not accept form submission if the current date is not between the date "
1926
  "range of the schedule."
1927
  msgstr ""
1928
 
1929
+ #: admin/html/whats-new.php:381
1930
  msgid "Restrict form submission based on the user roles"
1931
  msgstr ""
1932
 
1933
+ #: admin/html/whats-new.php:383
1934
  msgid ""
1935
  "Restrict form submission based on the user roles. Now you can manage user "
1936
  "role base permission on form submission."
1937
  msgstr ""
1938
 
1939
+ #: admin/html/whats-new.php:387
1940
  msgid "Limit how many entries a form will accept"
1941
  msgstr ""
1942
 
1943
+ #: admin/html/whats-new.php:389
1944
  msgid ""
1945
  "Limit how many entries a form will accept and display a custom message when "
1946
  "that limit is reached."
1947
  msgstr ""
1948
 
1949
+ #: admin/html/whats-new.php:393
1950
  msgid "Show/hide Admin Bar"
1951
  msgstr ""
1952
 
1953
+ #: admin/html/whats-new.php:395
1954
  msgid "Control the admin bar visibility based on user roles."
1955
  msgstr ""
1956
 
1957
+ #: admin/html/whats-new.php:399
1958
  msgid "Ajax Login widget"
1959
  msgstr ""
1960
 
1961
+ #: admin/html/whats-new.php:401
1962
  msgid ""
1963
  "Login user is more simple now with Ajax Login Widget. The simple ajax login "
1964
  "form do not required page loading for login."
1965
  msgstr ""
1966
 
1967
+ #: admin/html/whats-new.php:405
1968
  msgid "Form submission with Captcha field"
1969
  msgstr ""
1970
 
1971
+ #: admin/html/whats-new.php:407
1972
  msgid "Form field validation process updated if form submits with captcha field."
1973
  msgstr ""
1974
 
1975
+ #: admin/html/whats-new.php:421
1976
  msgid "What's New in WPUF?"
1977
  msgstr ""
1978
 
2001
  msgstr ""
2002
 
2003
  #: admin/installer.php:77 admin/settings-options.php:23
2004
+ #: includes/free/admin/shortcode-button.php:82 wpuf-functions.php:1628
2005
  msgid "Dashboard"
2006
  msgstr ""
2007
 
2017
  #: admin/installer.php:88 class/subscription.php:356 class/subscription.php:376
2018
  #: class/subscription.php:377 class/subscription.php:378
2019
  #: includes/free/admin/shortcode-button.php:102
2020
+ #: templates/dashboard/dashboard.php:19 wpuf-functions.php:1631
2021
  msgid "Subscription"
2022
  msgstr ""
2023
 
2099
  msgstr ""
2100
 
2101
  #: admin/post-forms-list-table.php:299 admin/premium.php:39
2102
+ #: includes/fields/class-pro-upgrade-fields.php:181
2103
  #: includes/free/form-element.php:30
2104
  msgid "Shortcode"
2105
  msgstr ""
2112
  msgid "Draft"
2113
  msgstr ""
2114
 
2115
+ #: admin/posting.php:69 class/asset-loader.php:54 class/render-form.php:1698
2116
+ #: wpuf.php:715
2117
  msgid "Are you sure?"
2118
  msgstr ""
2119
 
2120
+ #: admin/posting.php:77 class/asset-loader.php:62 wpuf.php:725
2121
  msgid "Allowed Files"
2122
  msgstr ""
2123
 
2124
+ #: admin/posting.php:80 class/asset-loader.php:65 wpuf.php:731
2125
  msgid "Maximum number of files reached!"
2126
  msgstr ""
2127
 
2128
+ #: admin/posting.php:81 class/asset-loader.php:66 wpuf.php:732
2129
  msgid "The file you have uploaded exceeds the file size limit. Please try again."
2130
  msgstr ""
2131
 
2132
+ #: admin/posting.php:82 class/asset-loader.php:67 wpuf.php:733
2133
  msgid "You have uploaded an incorrect file type. Please try again."
2134
  msgstr ""
2135
 
2136
+ #: admin/posting.php:101
2137
  msgid "WPUF Form"
2138
  msgstr ""
2139
 
2140
  #: admin/posting.php:130
2141
+ msgid "Learn more"
2142
+ msgstr ""
2143
+
2144
+ #: admin/posting.php:175
2145
+ msgid "WPUF Lock User"
2146
+ msgstr ""
2147
+
2148
+ #: admin/posting.php:198
2149
+ msgid ""
2150
+ "Frontend edit access for this post will be automatically locked after %s, "
2151
+ "<a id=\"wpuf_clear_schedule_lock\" data=\"%s\" href=\"#\">Clear Schedule "
2152
+ "Lock</a> Or,"
2153
+ msgstr ""
2154
+
2155
+ #: admin/posting.php:210
2156
+ msgid "Lock Post"
2157
+ msgstr ""
2158
+
2159
+ #: admin/posting.php:212
2160
+ msgid "Lock user from editing this post from the frontend dashboard"
2161
  msgstr ""
2162
 
2163
+ #: admin/posting.php:257
2164
  msgid "WPUF Custom Fields"
2165
  msgstr ""
2166
 
2167
+ #: admin/posting.php:308
2168
  msgid "No custom fields found."
2169
  msgstr ""
2170
 
2204
  msgid "Advanced Fields"
2205
  msgstr ""
2206
 
2207
+ #: admin/premium.php:33 includes/fields/class-pro-upgrade-fields.php:21
 
2208
  #: includes/free/form-element.php:15
2209
  msgid "Country List"
2210
  msgstr ""
2217
  msgid "Date Field"
2218
  msgstr ""
2219
 
2220
+ #: admin/premium.php:36 includes/fields/class-pro-upgrade-fields.php:69
 
2221
  msgid "Google Map"
2222
  msgstr ""
2223
 
2224
+ #: admin/premium.php:37 includes/fields/class-pro-upgrade-fields.php:81
 
2225
  #: includes/free/form-element.php:33
2226
  msgid "Action Hook"
2227
  msgstr ""
2238
  msgid "Repeater"
2239
  msgstr ""
2240
 
2241
+ #: admin/premium.php:42 includes/fields/class-pro-upgrade-fields.php:57
 
2242
  #: includes/free/form-element.php:13
2243
  msgid "File Upload"
2244
  msgstr ""
2271
  "subscriptions only with just a shortcode."
2272
  msgstr ""
2273
 
2274
+ #: admin/premium.php:71 admin/premium.php:74 includes/class-pro-upgrades.php:99
 
2275
  #: includes/free/form-element.php:474
2276
  msgid "Conditional Logic"
2277
  msgstr ""
2419
  msgid "WP User Frontend Pro is the most powerful solution for your frontend needs."
2420
  msgstr ""
2421
 
2422
+ #: admin/promotion.php:43
 
 
 
 
2423
  msgid ""
2424
  "<p>\n"
2425
  " <strong class=\"highlight-text\" "
2433
  " </p>"
2434
  msgstr ""
2435
 
2436
+ #: admin/promotion.php:66
2437
  msgid "Get the Offer"
2438
  msgstr ""
2439
 
2440
+ #: admin/promotion.php:218
2441
+ msgid "Enjoying <strong>WP User Frontend</strong>?"
2442
+ msgstr ""
2443
+
2444
+ #: admin/promotion.php:219
2445
+ msgid ""
2446
+ "Hope that you had a neat and snappy experience with the tool. Would you "
2447
+ "please show us a little love by rating us in the <a "
2448
+ "href=\"https://wordpress.org/support/plugin/wp-user-frontend/reviews/#new-"
2449
+ "post\" target=\"_blank\"><strong>WordPress.org</strong></a>?"
2450
+ msgstr ""
2451
+
2452
+ #: admin/promotion.php:222
2453
+ msgid "Sure! I'd love to!"
2454
+ msgstr ""
2455
+
2456
+ #: admin/promotion.php:223
2457
+ msgid "I've already left a review"
2458
+ msgstr ""
2459
+
2460
+ #: admin/promotion.php:224
2461
+ msgid "Never show again"
2462
+ msgstr ""
2463
+
2464
  #: admin/settings-options.php:13
2465
  msgid "General Options"
2466
  msgstr ""
2951
  msgid "Number of subscribers per page:"
2952
  msgstr ""
2953
 
2954
+ #: admin/template-post.php:41 includes/fields/class-field-post-content.php:132
2955
+ msgid "Enable Image Insertion"
2956
+ msgstr ""
2957
+
2958
+ #: admin/template-post.php:47 includes/fields/class-field-post-content.php:134
2959
+ msgid "Enable image upload in post area"
2960
+ msgstr ""
2961
+
2962
+ #: admin/template-post.php:93 admin/template.php:634
2963
+ #: includes/fields/class-field-featured-image.php:97
2964
+ #: includes/fields/class-field-image.php:107
2965
+ msgid "Enter maximum upload size limit in KB"
2966
+ msgstr ""
2967
+
2968
+ #: admin/template-post.php:105 admin/template.php:646
2969
+ #: includes/fields/class-field-featured-image.php:93
2970
+ #: includes/fields/class-field-image.php:103
2971
+ msgid "Max. file size"
2972
+ msgstr ""
2973
+
2974
+ #: admin/template-post.php:154 includes/fields/class-abstract-fields.php:398
2975
+ msgid "Type"
2976
+ msgstr ""
2977
+
2978
+ #: admin/template-post.php:156 includes/fields/class-field-dropdown.php:9
2979
+ #: includes/fields/class-field-dropdown.php:99
2980
+ msgid "Dropdown"
2981
+ msgstr ""
2982
+
2983
+ #: admin/template-post.php:157 includes/fields/class-abstract-fields.php:402
2984
+ #: includes/fields/class-field-multidropdown.php:9
2985
+ #: includes/fields/class-field-multidropdown.php:90
2986
+ msgid "Multi Select"
2987
+ msgstr ""
2988
+
2989
+ #: admin/template-post.php:158 includes/fields/class-abstract-fields.php:403
2990
+ #: includes/fields/class-field-checkbox.php:9
2991
+ msgid "Checkbox"
2992
+ msgstr ""
2993
+
2994
+ #: admin/template-post.php:159 includes/fields/class-abstract-fields.php:404
2995
+ msgid "Text Input"
2996
+ msgstr ""
2997
+
2998
+ #: admin/template-post.php:160 includes/fields/class-abstract-fields.php:405
2999
+ msgid "Ajax"
3000
+ msgstr ""
3001
+
3002
+ #: admin/template-post.php:165 includes/fields/class-abstract-fields.php:438
3003
+ msgid "Order By"
3004
+ msgstr ""
3005
+
3006
+ #: admin/template-post.php:168 includes/fields/class-abstract-fields.php:442
3007
+ msgid "Term ID"
3008
+ msgstr ""
3009
+
3010
+ #: admin/template-post.php:169 includes/fields/class-abstract-fields.php:443
3011
+ msgid "Slug"
3012
+ msgstr ""
3013
+
3014
+ #: admin/template-post.php:170 includes/fields/class-abstract-fields.php:444
3015
+ msgid "Count"
3016
+ msgstr ""
3017
+
3018
+ #: admin/template-post.php:171 includes/fields/class-abstract-fields.php:445
3019
+ msgid "Term Group"
3020
+ msgstr ""
3021
+
3022
+ #: admin/template-post.php:176 includes/fields/class-abstract-fields.php:454
3023
+ msgid "Order"
3024
+ msgstr ""
3025
+
3026
+ #: admin/template-post.php:178 includes/fields/class-abstract-fields.php:458
3027
+ msgid "ASC"
3028
+ msgstr ""
3029
+
3030
+ #: admin/template-post.php:179 includes/fields/class-abstract-fields.php:459
3031
+ msgid "DESC"
3032
+ msgstr ""
3033
+
3034
+ #: admin/template-post.php:184 includes/fields/class-abstract-fields.php:468
3035
+ msgid "Selection Type"
3036
+ msgstr ""
3037
+
3038
+ #: admin/template-post.php:186 includes/fields/class-abstract-fields.php:471
3039
+ msgid "Exclude"
3040
+ msgstr ""
3041
+
3042
+ #: admin/template-post.php:187 includes/fields/class-abstract-fields.php:472
3043
+ msgid "Include"
3044
+ msgstr ""
3045
+
3046
+ #: admin/template-post.php:188 includes/fields/class-abstract-fields.php:473
3047
+ msgid "Child of"
3048
+ msgstr ""
3049
+
3050
  #: admin/template-post.php:193
3051
  msgid "Selection terms"
3052
  msgstr ""
3053
 
3054
+ #: admin/template-post.php:194 includes/fields/class-abstract-fields.php:486
3055
+ msgid ""
3056
+ "Enter the term IDs as comma separated (without space) to exclude/include in "
3057
+ "the form."
3058
+ msgstr ""
3059
+
3060
  #: admin/template-post.php:198
3061
  msgid "WooCommerce Attribute"
3062
  msgstr ""
3063
 
3064
+ #: admin/template-post.php:204 includes/fields/class-abstract-fields.php:495
3065
+ msgid "This taxonomy is a WooCommerce attribute"
3066
+ msgstr ""
3067
+
3068
+ #: admin/template-post.php:210 includes/fields/class-abstract-fields.php:309
3069
+ msgid "Visibility"
3070
+ msgstr ""
3071
+
3072
+ #: admin/template-post.php:216 includes/fields/class-abstract-fields.php:506
3073
+ msgid "Visible on product page"
3074
+ msgstr ""
3075
+
3076
  #: admin/template-post.php:257
3077
  msgid "all"
3078
  msgstr ""
3117
  msgid "Toggle"
3118
  msgstr ""
3119
 
3120
+ #: admin/template.php:67 includes/class-customizer.php:107
3121
+ #: includes/fields/class-abstract-fields.php:257
3122
+ msgid "Required"
3123
+ msgstr ""
3124
+
3125
+ #: admin/template.php:76 includes/fields/class-abstract-fields.php:239
3126
+ msgid "Field Label"
3127
+ msgstr ""
3128
+
3129
+ #: admin/template.php:77 includes/fields/class-abstract-fields.php:243
3130
+ msgid "Enter a title of this field"
3131
+ msgstr ""
3132
+
3133
+ #: admin/template.php:82 admin/template.php:575
3134
+ #: includes/fields/class-abstract-fields.php:329
3135
+ #: includes/fields/class-field-hidden.php:41
3136
+ msgid "Meta Key"
3137
+ msgstr ""
3138
+
3139
+ #: admin/template.php:83 admin/template.php:576
3140
+ #: includes/fields/class-abstract-fields.php:333
3141
+ #: includes/fields/class-field-hidden.php:45
3142
+ msgid "Name of the meta key this field will save to"
3143
+ msgstr ""
3144
+
3145
+ #: admin/template.php:94 includes/fields/class-abstract-fields.php:248
3146
+ msgid "Help text"
3147
+ msgstr ""
3148
+
3149
+ #: admin/template.php:95 includes/fields/class-abstract-fields.php:252
3150
+ msgid "Give the user some information about this field"
3151
+ msgstr ""
3152
+
3153
+ #: admin/template.php:99 includes/fields/class-abstract-fields.php:287
3154
+ msgid "CSS Class Name"
3155
+ msgstr ""
3156
+
3157
  #: admin/template.php:100
3158
  msgid "Add a CSS class name for this field"
3159
  msgstr ""
3160
 
3161
+ #: admin/template.php:126 admin/template.php:186
3162
+ #: includes/fields/class-abstract-fields.php:541
3163
+ #: includes/fields/class-abstract-fields.php:632
3164
+ msgid "Placeholder text"
3165
+ msgstr ""
3166
+
3167
+ #: admin/template.php:127 includes/fields/class-abstract-fields.php:547
3168
+ #: includes/fields/class-abstract-fields.php:636
3169
+ msgid "Text for HTML5 placeholder attribute"
3170
+ msgstr ""
3171
+
3172
+ #: admin/template.php:131 admin/template.php:191
3173
+ #: includes/fields/class-abstract-fields.php:552
3174
+ #: includes/fields/class-abstract-fields.php:644
3175
+ msgid "Default value"
3176
+ msgstr ""
3177
+
3178
+ #: admin/template.php:132 includes/fields/class-abstract-fields.php:558
3179
+ #: includes/fields/class-abstract-fields.php:648
3180
+ msgid "The default value this field will have"
3181
+ msgstr ""
3182
+
3183
+ #: admin/template.php:136 includes/fields/class-abstract-fields.php:563
3184
+ msgid "Size"
3185
+ msgstr ""
3186
+
3187
+ #: admin/template.php:137 includes/fields/class-abstract-fields.php:568
3188
+ msgid "Size of this input field"
3189
+ msgstr ""
3190
+
3191
+ #: admin/template.php:141 admin/template.php:206
3192
+ #: includes/fields/class-abstract-fields.php:519
3193
+ #: includes/fields/class-abstract-fields.php:575
3194
+ #: includes/fields/class-abstract-fields.php:667
3195
+ msgid "Word Restriction"
3196
+ msgstr ""
3197
+
3198
+ #: admin/template.php:145 admin/template.php:210
3199
+ #: includes/fields/class-abstract-fields.php:523
3200
+ #: includes/fields/class-abstract-fields.php:579
3201
+ #: includes/fields/class-abstract-fields.php:671
3202
+ msgid "Numebr of words the author to be restricted in"
3203
+ msgstr ""
3204
+
3205
+ #: admin/template.php:176 includes/fields/class-abstract-fields.php:614
3206
+ msgid "Rows"
3207
+ msgstr ""
3208
+
3209
+ #: admin/template.php:181 includes/fields/class-abstract-fields.php:623
3210
+ msgid "Columns"
3211
+ msgstr ""
3212
+
3213
+ #: admin/template.php:196 includes/fields/class-abstract-fields.php:653
3214
+ #: includes/fields/class-field-textarea.php:9
3215
+ #: includes/fields/class-field-textarea.php:129
3216
+ msgid "Textarea"
3217
+ msgstr ""
3218
+
3219
+ #: admin/template.php:199 includes/fields/class-abstract-fields.php:656
3220
+ msgid "Normal"
3221
+ msgstr ""
3222
+
3223
+ #: admin/template.php:200 includes/fields/class-abstract-fields.php:657
3224
+ msgid "Rich textarea"
3225
+ msgstr ""
3226
+
3227
+ #: admin/template.php:201 includes/fields/class-abstract-fields.php:658
3228
+ msgid "Teeny Rich textarea"
3229
+ msgstr ""
3230
+
3231
  #: admin/template.php:304
3232
  msgid "show values"
3233
  msgstr ""
3234
 
3235
+ #: admin/template.php:398 admin/template.php:422 admin/template.php:454
3236
+ #: admin/template.php:486 includes/fields/class-abstract-fields.php:596
3237
+ #: templates/dashboard/posts.php:85 templates/dashboard.php:124
3238
+ msgid "Options"
3239
+ msgstr ""
3240
+
3241
+ #: admin/template.php:438 admin/template.php:470
3242
+ #: includes/fields/class-abstract-fields.php:418
3243
+ #: includes/fields/class-field-dropdown.php:83
3244
+ msgid ""
3245
+ "First element of the select dropdown. Leave this empty if you don't want to "
3246
+ "show this field"
3247
+ msgstr ""
3248
+
3249
+ #: admin/template.php:449 admin/template.php:481
3250
+ #: includes/fields/class-abstract-fields.php:414
3251
+ #: includes/fields/class-field-dropdown.php:79
3252
+ msgid "Select Text"
3253
+ msgstr ""
3254
+
3255
+ #: admin/template.php:544 admin/template.php:604 admin/template.php:683
3256
+ #: class/upload.php:168 includes/fields/class-field-recaptcha.php:156
3257
+ #: includes/fields/class-field-sectionbreak.php:56
3258
+ #: templates/dashboard/posts.php:76 templates/dashboard.php:86
3259
+ #: wpuf-functions.php:791
3260
+ msgid "Title"
3261
+ msgstr ""
3262
+
3263
+ #: admin/template.php:549
3264
+ msgid "HTML Codes"
3265
+ msgstr ""
3266
+
3267
+ #: admin/template.php:582 includes/fields/class-field-hidden.php:50
3268
+ msgid "Meta Value"
3269
+ msgstr ""
3270
+
3271
+ #: admin/template.php:583 includes/fields/class-field-hidden.php:54
3272
+ msgid "Enter the meta value"
3273
+ msgstr ""
3274
+
3275
+ #: admin/template.php:609 class/upload.php:170
3276
+ #: includes/fields/class-field-sectionbreak.php:64 wpuf-functions.php:797
3277
+ msgid "Description"
3278
+ msgstr ""
3279
+
3280
+ #: admin/template.php:635 includes/fields/class-field-image.php:116
3281
+ msgid "Number of images can be uploaded"
3282
+ msgstr ""
3283
+
3284
+ #: admin/template.php:651 includes/fields/class-field-image.php:112
3285
+ msgid "Max. files"
3286
+ msgstr ""
3287
+
3288
  #: admin/template.php:689
3289
  msgid ""
3290
  "Insert your public key and private key in <a href='%s'>plugin settings</a>. "
3295
  msgid "reCaptcha type"
3296
  msgstr ""
3297
 
3298
+ #: admin/template.php:699 includes/fields/class-field-recaptcha.php:169
3299
+ msgid "Enable Invisible reCaptcha"
3300
+ msgstr ""
3301
+
3302
+ #: admin/template.php:703 includes/fields/class-field-recaptcha.php:168
3303
+ msgid "Enable noCaptcha"
3304
+ msgstr ""
3305
+
3306
  #: admin/weforms.php:4
3307
  msgid "The Easiest &amp; Fastest Contact Form Plugin on WordPress"
3308
  msgstr ""
3318
  msgid "Install Now"
3319
  msgstr ""
3320
 
3321
+ #: class/asset-loader.php:31 wpuf.php:623
3322
  msgid "is required"
3323
  msgstr ""
3324
 
3325
+ #: class/asset-loader.php:32 wpuf.php:624
3326
  msgid "does not match"
3327
  msgstr ""
3328
 
3329
+ #: class/asset-loader.php:33 wpuf.php:625
3330
  msgid "is not valid"
3331
  msgstr ""
3332
 
3333
+ #: class/asset-loader.php:45 wpuf.php:702
3334
  msgid "Please fix the errors to proceed"
3335
  msgstr ""
3336
 
3337
+ #: class/asset-loader.php:47 wpuf.php:704
3338
  msgid "Word limit reached"
3339
  msgstr ""
3340
 
3341
+ #: class/asset-loader.php:48 wpuf.php:705
3342
  msgid "Are you sure you want to cancel your current subscription ?"
3343
  msgstr ""
3344
 
3422
  msgid "Your current password is incorrect."
3423
  msgstr ""
3424
 
3425
+ #: class/frontend-dashboard.php:59 templates/dashboard/posts.php:36
3426
  msgid "Post Deleted"
3427
  msgstr ""
3428
 
3429
+ #: class/frontend-dashboard.php:117
3430
  msgid "Author Info"
3431
  msgstr ""
3432
 
3433
+ #: class/frontend-dashboard.php:121 includes/free/edit-user.php:98
3434
  msgid "%s"
3435
  msgstr ""
3436
 
3437
+ #: class/frontend-dashboard.php:156 templates/dashboard/posts.php:30
3438
  msgid "You are not the post author. Cheeting huh!"
3439
  msgstr ""
3440
 
3441
  #: class/frontend-form-post.php:82 class/frontend-form-post.php:121
3442
+ #: class/frontend-form-post.php:128 includes/class-form.php:214
3443
+ #: includes/class-form.php:251 includes/class-form.php:258
3444
  msgid "Payment type not selected for this form. Please contact admin."
3445
  msgstr ""
3446
 
3447
+ #: class/frontend-form-post.php:171 includes/class-frontend-form-post.php:41
3448
  msgid "You are not logged in"
3449
  msgstr ""
3450
 
3451
+ #: class/frontend-form-post.php:179 class/frontend-form-post.php:208
3452
+ #: includes/class-frontend-form-post.php:47
3453
+ #: includes/class-frontend-form-post.php:76
3454
  msgid "Invalid post"
3455
  msgstr ""
3456
 
3457
+ #: class/frontend-form-post.php:186 includes/class-frontend-form-post.php:54
3458
+ msgid "Your edit access for this post has been locked by an administrator."
3459
+ msgstr ""
3460
+
3461
+ #: class/frontend-form-post.php:190 includes/class-frontend-form-post.php:58
3462
+ msgid "Your allocated time for editing this post has been expired."
3463
+ msgstr ""
3464
+
3465
+ #: class/frontend-form-post.php:197 includes/class-frontend-form-post.php:65
3466
+ msgid "Your post edit access has been locked by an administrator."
3467
+ msgstr ""
3468
+
3469
+ #: class/frontend-form-post.php:202 includes/class-frontend-form-post.php:70
3470
  msgid "Post Editing is disabled"
3471
  msgstr ""
3472
 
3473
+ #: class/frontend-form-post.php:213 includes/class-frontend-form-post.php:81
3474
  msgid "You are not allowed to edit"
3475
  msgstr ""
3476
 
3477
+ #: class/frontend-form-post.php:225 includes/class-frontend-form-post.php:92
3478
  msgid "I don't know how to edit this post, I don't have the form ID"
3479
  msgstr ""
3480
 
3481
+ #: class/frontend-form-post.php:231 includes/class-frontend-form-post.php:104
3482
  msgid "You can't edit a post while in pending mode."
3483
  msgstr ""
3484
 
3485
+ #: class/frontend-form-post.php:304 includes/class-frontend-render-form.php:735
3486
+ #: includes/free/class-login.php:394
3487
  msgid "Empty reCaptcha Field"
3488
  msgstr ""
3489
 
3490
+ #: class/frontend-form-post.php:335 includes/class-frontend-form-post.php:467
3491
  msgid "Invalid email address."
3492
  msgstr ""
3493
 
3494
+ #: class/frontend-form-post.php:344 includes/class-frontend-form-post.php:477
3495
  msgid ""
3496
  "You already have an account in our site. Please login to continue.\n"
3497
  "\n"
3500
  "Click 'Cancel' to stay at this page."
3501
  msgstr ""
3502
 
3503
+ #: class/frontend-form-post.php:393 includes/class-frontend-form-post.php:533
3504
  msgid "You do not have sufficient permissions to access this form."
3505
  msgstr ""
3506
 
3507
+ #: class/frontend-form-post.php:732 class/frontend-form-post.php:739
3508
+ #: includes/class-frontend-form-post.php:889
3509
+ #: includes/class-frontend-form-post.php:895
3510
  msgid ""
3511
  "Thank you for posting on our site. We have sent you an confirmation email. "
3512
  "Please check your inbox!"
3513
  msgstr ""
3514
 
3515
+ #: class/frontend-form-post.php:792 includes/class-frontend-form-post.php:451
3516
  msgid "Something went wrong"
3517
  msgstr ""
3518
 
3519
+ #: class/frontend-form-post.php:1170 includes/class-frontend-form-post.php:783
3520
  msgid "Email successfully verified. Please Login."
3521
  msgstr ""
3522
 
3541
  msgstr ""
3542
 
3543
  #: class/payment.php:139 includes/class-customizer.php:59
3544
+ #: wpuf-functions.php:1632
3545
  msgid "Billing Address"
3546
  msgstr ""
3547
 
3606
  msgid "Form for creating a blog post."
3607
  msgstr ""
3608
 
3609
+ #: class/post-form-templates/post.php:20 includes/class-privacy.php:429
3610
+ #: includes/fields/class-field-post-title.php:6
3611
+ msgid "Post Title"
3612
+ msgstr ""
3613
+
3614
  #: class/post-form-templates/post.php:25
3615
  msgid "Please enter your post name"
3616
  msgstr ""
3617
 
3618
+ #: class/post-form-templates/post.php:35 templates/dashboard.php:90
3619
  msgid "Category"
3620
  msgstr ""
3621
 
3622
+ #: class/post-form-templates/post.php:38
3623
  msgid "Select a category for your post"
3624
  msgstr ""
3625
 
3626
+ #: class/post-form-templates/post.php:39
3627
+ #: includes/fields/class-abstract-fields.php:196
3628
+ #: includes/fields/class-field-dropdown.php:102
3629
+ #: includes/fields/class-field-multidropdown.php:94
3630
+ #: includes/fields/class-field-post-taxonomy.php:317
3631
+ msgid "- select -"
3632
  msgstr ""
3633
 
3634
  #: class/post-form-templates/post.php:56
3635
+ msgid "Post description"
3636
+ msgstr ""
3637
+
3638
+ #: class/post-form-templates/post.php:59
3639
  msgid "Write the full description of your Post"
3640
  msgstr ""
3641
 
3642
+ #: class/post-form-templates/post.php:76 class/post-form-templates/post.php:77
3643
+ #: includes/fields/class-field-featured-image.php:9
3644
+ #: includes/fields/class-field-featured-image.php:123
3645
+ #: includes/free/post-form-templates/the_events_calendar.php:125
3646
+ #: includes/free/post-form-templates/the_events_calendar.php:126
3647
+ #: templates/dashboard/posts.php:73 templates/dashboard.php:83
3648
+ msgid "Featured Image"
3649
+ msgstr ""
3650
+
3651
+ #: class/post-form-templates/post.php:80
3652
  msgid "Upload the main image of your post"
3653
  msgstr ""
3654
 
3655
+ #: class/post-form-templates/post.php:90
3656
+ #: includes/free/post-form-templates/the_events_calendar.php:138
3657
+ #: templates/dashboard.php:112
3658
+ msgid "Excerpt"
3659
+ msgstr ""
3660
+
3661
+ #: class/post-form-templates/post.php:93
3662
  msgid "Provide a short description of this post (optional)"
3663
  msgstr ""
3664
 
3665
+ #: class/post-form-templates/post.php:107
3666
+ #: includes/fields/class-field-post-tags.php:6
3667
+ msgid "Tags"
3668
+ msgstr ""
3669
+
3670
+ #: class/post-form-templates/post.php:110
3671
  #: includes/free/post-form-templates/the_events_calendar.php:157
3672
  msgid "Separate tags with commas."
3673
  msgstr ""
3674
 
3675
+ #: class/post-form-templates/post.php:128
3676
  msgid "Create Post"
3677
  msgstr ""
3678
 
3679
+ #: class/post-form-templates/post.php:131
3680
  msgid ""
3681
  "Post has been updated successfully. <a target=\"_blank\" "
3682
  "href=\"%link%\">View post</a>"
3683
  msgstr ""
3684
 
3685
+ #: class/post-form-templates/post.php:133
3686
  msgid "Update Post"
3687
  msgstr ""
3688
 
3689
+ #: class/render-form.php:76 includes/class-frontend-render-form.php:67
3690
  msgid "Really Simple Captcha validation failed"
3691
  msgstr ""
3692
 
3693
+ #: class/render-form.php:109 includes/class-frontend-render-form.php:100
3694
  msgid "noCaptcha reCAPTCHA validation failed"
3695
  msgstr ""
3696
 
3697
+ #: class/render-form.php:120 includes/class-frontend-render-form.php:111
3698
  msgid "reCAPTCHA validation failed"
3699
  msgstr ""
3700
 
3701
+ #: class/render-form.php:132 includes/class-frontend-render-form.php:123
3702
  msgid "Invisible reCAPTCHA validation failed"
3703
  msgstr ""
3704
 
3705
+ #: class/render-form.php:357 includes/class-frontend-render-form.php:264
3706
  msgid "Your selected form is no longer available."
3707
  msgstr ""
3708
 
3709
+ #: class/render-form.php:362 includes/class-frontend-render-form.php:269
3710
  msgid "Please make sure you've published your form."
3711
  msgstr ""
3712
 
3720
  msgid "Strength indicator"
3721
  msgstr ""
3722
 
3723
+ #: class/render-form.php:1420 includes/fields/class-field-post-taxonomy.php:124
3724
  msgid "-- Select --"
3725
  msgstr ""
3726
 
3727
+ #: class/render-form.php:1485 includes/fields/class-field-post-taxonomy.php:72
3728
  msgid "This field is no longer available."
3729
  msgstr ""
3730
 
3934
  msgid "No transactions found."
3935
  msgstr ""
3936
 
3937
+ #: class/upload.php:169 wpuf-functions.php:794
3938
  msgid "Caption"
3939
  msgstr ""
3940
 
4052
 
4053
  #: includes/class-dokan-integration.php:37
4054
  #: includes/class-wc-vendors-integration.php:109
4055
+ #: templates/dashboard/dashboard.php:15 wpuf-functions.php:1629
4056
  msgid "Posts"
4057
  msgstr ""
4058
 
4078
  msgid "Select a post form that will show on the vendor dashboard."
4079
  msgstr ""
4080
 
4081
+ #: includes/class-field-manager.php:183
4082
+ msgid "Custom Fields"
4083
+ msgstr ""
4084
+
4085
+ #: includes/class-field-manager.php:205
4086
+ msgid "Others"
4087
+ msgstr ""
4088
+
4089
  #: includes/class-form-preview.php:85
4090
  msgid "You must be logged in to preview this form."
4091
  msgstr ""
4094
  msgid "Sorry, you are not eligible to preview this form."
4095
  msgstr ""
4096
 
 
 
 
 
4097
  #: includes/class-list-table-subscribers.php:30
4098
  msgid "No subscribers found"
4099
  msgstr ""
4168
  msgstr ""
4169
 
4170
  #: includes/class-login-widget.php:137 includes/free/class-login.php:803
4171
+ #: includes/free/class-login.php:884 includes/free/class-registration.php:273
4172
  msgid "Username: %s"
4173
  msgstr ""
4174
 
4489
  "own platform which falls in their own data policy. "
4490
  msgstr ""
4491
 
4492
+ #: includes/class-privacy.php:85
4493
+ msgid ""
4494
+ "As an example while using MailChimp for your marketing email automation "
4495
+ "service by integrating it with WP User Frontend, some of your data will be "
4496
+ "passed to MailChimp, including information required to process or support "
4497
+ "the email marketing services, such as name, email address and any other "
4498
+ "information that you intend to pass or collect including all collected "
4499
+ "information through subscription. "
4500
+ msgstr ""
4501
+
4502
+ #: includes/class-privacy.php:86
4503
+ msgid ""
4504
+ "Please see the <a href=\"https://mailchimp.com/legal/privacy/\">MailChimp "
4505
+ "Privacy Policy</a> for more details."
4506
+ msgstr ""
4507
+
4508
+ #: includes/class-privacy.php:100 includes/class-privacy.php:131
4509
+ #: includes/class-privacy.php:170
4510
+ msgid "WPUF User Data"
4511
+ msgstr ""
4512
+
4513
+ #: includes/class-privacy.php:105 includes/class-privacy.php:300
4514
+ msgid "WPUF Subscription Data"
4515
+ msgstr ""
4516
+
4517
+ #: includes/class-privacy.php:110 includes/class-privacy.php:331
4518
+ msgid "WPUF Transaction Data"
4519
+ msgstr ""
4520
+
4521
+ #: includes/class-privacy.php:115 includes/class-privacy.php:421
4522
+ msgid "WPUF Post Data"
4523
+ msgstr ""
4524
+
4525
+ #: includes/class-privacy.php:255
4526
+ msgid "Billing Address 1"
4527
+ msgstr ""
4528
+
4529
+ #: includes/class-privacy.php:259
4530
+ msgid "Billing Address 2"
4531
+ msgstr ""
4532
+
4533
+ #: includes/class-privacy.php:267
4534
+ msgid "State"
4535
+ msgstr ""
4536
+
4537
+ #: includes/class-privacy.php:271
4538
+ msgid "Zip"
4539
+ msgstr ""
4540
+
4541
+ #: includes/class-privacy.php:339
4542
+ msgid "Payment Status"
4543
+ msgstr ""
4544
+
4545
+ #: includes/class-privacy.php:343
4546
+ msgid "Subtotal"
4547
+ msgstr ""
4548
+
4549
+ #: includes/class-privacy.php:367 includes/free/edit-profile.php:110
4550
+ msgid "Last Name"
4551
+ msgstr ""
4552
+
4553
+ #: includes/class-privacy.php:375
4554
+ msgid "Payment Type"
4555
+ msgstr ""
4556
+
4557
+ #: includes/class-privacy.php:379
4558
+ msgid "payer_address"
4559
+ msgstr ""
4560
+
4561
+ #: includes/class-privacy.php:387
4562
+ msgid "Transaction Date"
4563
+ msgstr ""
4564
+
4565
+ #: includes/class-privacy.php:433
4566
+ msgid "Post URL"
4567
+ msgstr ""
4568
+
4569
+ #: includes/class-privacy.php:437
4570
+ msgid "Post Date"
4571
+ msgstr ""
4572
+
4573
+ #: includes/class-privacy.php:484
4574
+ msgid "Pack Title"
4575
+ msgstr ""
4576
+
4577
+ #: includes/class-privacy.php:488
4578
+ msgid "Expiry"
4579
+ msgstr ""
4580
+
4581
+ #: includes/class-user-subscription.php:58
4582
+ msgid "You must <a href=\"%s\">purchase a subscription package</a> before posting"
4583
+ msgstr ""
4584
+
4585
+ #: includes/class-user-subscription.php:63
4586
+ msgid "The subscription pack has expired. Please buy a pack."
4587
+ msgstr ""
4588
+
4589
+ #: includes/class-user-subscription.php:318
4590
+ #: templates/dashboard/subscription.php:3
4591
+ msgid "Subscription Details"
4592
+ msgstr ""
4593
+
4594
+ #: includes/class-user-subscription.php:320
4595
+ #: templates/dashboard/subscription.php:5
4596
+ msgid "Subcription Name: "
4597
+ msgstr ""
4598
+
4599
+ #: includes/class-user-subscription.php:322
4600
+ #: templates/dashboard/subscription.php:7
4601
+ msgid "Package & billing details: "
4602
+ msgstr ""
4603
+
4604
+ #: includes/class-user-subscription.php:333
4605
+ #: templates/dashboard/subscription.php:11
4606
+ msgid "Remaining post: "
4607
+ msgstr ""
4608
+
4609
+ #: includes/class-user-subscription.php:346
4610
+ #: templates/dashboard/subscription.php:25
4611
+ msgid "Unlimited"
4612
+ msgstr ""
4613
+
4614
+ #: includes/class-wc-vendors-integration.php:38
4615
+ #: includes/class-wcmp-integration.php:41
4616
+ msgid "If checked, vendor can submit post from dashboard area."
4617
+ msgstr ""
4618
+
4619
+ #: includes/class-wcmp-integration.php:86
4620
+ msgid "Vendor Submit Post"
4621
+ msgstr ""
4622
+
4623
+ #: includes/class-wcmp-integration.php:91
4624
+ msgid "Set endpoint for vendor submit post page"
4625
+ msgstr ""
4626
+
4627
+ #: includes/class-whats-new.php:67
4628
+ msgid "Whats New"
4629
+ msgstr ""
4630
+
4631
+ #: includes/class-whats-new.php:100
4632
+ msgid "WP User Frontend - Version %s"
4633
+ msgstr ""
4634
+
4635
+ #: includes/class-whats-new.php:101
4636
+ msgid ""
4637
+ "Welcome to the new version of WP User Frontend. See what's been changed in "
4638
+ "the <strong>%s</strong> version."
4639
+ msgstr ""
4640
+
4641
+ #: includes/class-whats-new.php:105
4642
+ msgid "What's New?"
4643
+ msgstr ""
4644
+
4645
+ #: includes/class-whats-new.php:106 lib/class-weforms-upsell.php:80
4646
+ #: lib/class-weforms-upsell.php:81
4647
+ msgid "Dismiss this notice."
4648
+ msgstr ""
4649
+
4650
+ #: includes/fields/class-abstract-fields.php:267
4651
+ msgid ""
4652
+ "Check this option to mark the field required. A form will not submit unless "
4653
+ "all required fields are provided."
4654
+ msgstr ""
4655
+
4656
+ #: includes/fields/class-abstract-fields.php:272
4657
+ msgid "Field Size"
4658
+ msgstr ""
4659
+
4660
+ #: includes/fields/class-abstract-fields.php:275
4661
+ msgid "Small"
4662
+ msgstr ""
4663
+
4664
+ #: includes/fields/class-abstract-fields.php:276
4665
+ msgid "Medium"
4666
+ msgstr ""
4667
+
4668
+ #: includes/fields/class-abstract-fields.php:277
4669
+ msgid "Large"
4670
+ msgstr ""
4671
+
4672
+ #: includes/fields/class-abstract-fields.php:291
4673
+ msgid ""
4674
+ "Provide a container class name for this field. Available classes: "
4675
+ "wpuf-col-half, wpuf-col-half-last, wpuf-col-one-third, "
4676
+ "wpuf-col-one-third-last"
4677
+ msgstr ""
4678
+
4679
+ #: includes/fields/class-abstract-fields.php:313
4680
+ msgid "Everyone"
4681
+ msgstr ""
4682
+
4683
+ #: includes/fields/class-abstract-fields.php:315
4684
+ msgid "Logged in users only"
4685
+ msgstr ""
4686
+
4687
+ #: includes/fields/class-abstract-fields.php:316
4688
+ msgid "Subscription users only"
4689
+ msgstr ""
4690
+
4691
+ #: includes/fields/class-abstract-fields.php:320
4692
+ msgid "Select option"
4693
+ msgstr ""
4694
+
4695
+ #: includes/fields/class-abstract-fields.php:341
4696
+ msgid "Show Data in Post"
4697
+ msgstr ""
4698
+
4699
+ #: includes/fields/class-abstract-fields.php:351
4700
+ msgid "Select Yes if you want to show the field data in single post."
4701
+ msgstr ""
4702
+
4703
+ #: includes/fields/class-abstract-fields.php:355
4704
+ msgid "Hide Field Label in Post"
4705
+ msgstr ""
4706
+
4707
+ #: includes/fields/class-abstract-fields.php:365
4708
+ msgid "Select Yes if you want to hide the field label in single post."
4709
+ msgstr ""
4710
+
4711
+ #: includes/fields/class-abstract-fields.php:423
4712
+ #: includes/fields/class-field-checkbox.php:78
4713
+ #: includes/fields/class-field-radio.php:83
4714
+ msgid "Show in inline list"
4715
+ msgstr ""
4716
+
4717
+ #: includes/fields/class-abstract-fields.php:433
4718
+ #: includes/fields/class-field-checkbox.php:88
4719
+ #: includes/fields/class-field-radio.php:93
4720
+ msgid "Show this option in an inline list"
4721
+ msgstr ""
4722
+
4723
+ #: includes/fields/class-abstract-fields.php:482
4724
+ msgid "Selection Terms"
4725
+ msgstr ""
4726
+
4727
+ #: includes/fields/class-abstract-fields.php:601
4728
+ msgid "Add options for the form field"
4729
+ msgstr ""
4730
+
4731
+ #: includes/fields/class-abstract-fields.php:618
4732
+ msgid "Number of rows in textarea"
4733
+ msgstr ""
4734
+
4735
+ #: includes/fields/class-abstract-fields.php:627
4736
+ msgid "Number of columns in textarea"
4737
  msgstr ""
4738
 
4739
+ #: includes/fields/class-field-email.php:9
4740
+ msgid "Email Address"
 
 
4741
  msgstr ""
4742
 
4743
+ #: includes/fields/class-field-featured-image.php:101
4744
+ #: includes/fields/class-field-image.php:120
4745
+ msgid "Button Label"
4746
  msgstr ""
4747
 
4748
+ #: includes/fields/class-field-featured-image.php:106
4749
+ #: includes/fields/class-field-image.php:125
4750
+ msgid "Enter a label for the Select button"
4751
  msgstr ""
4752
 
4753
+ #: includes/fields/class-field-hidden.php:9
4754
+ msgid "Hidden Field"
4755
  msgstr ""
4756
 
4757
+ #: includes/fields/class-field-html.php:9
4758
+ msgid "Custom HTML"
4759
  msgstr ""
4760
 
4761
+ #: includes/fields/class-field-html.php:56
4762
+ msgid "Html Codes"
4763
  msgstr ""
4764
 
4765
+ #: includes/fields/class-field-html.php:60
4766
+ msgid "Paste your HTML codes, WordPress shortcodes will also work here"
4767
  msgstr ""
4768
 
4769
+ #: includes/fields/class-field-html.php:77
4770
+ msgid "HTML Section"
4771
  msgstr ""
4772
 
4773
+ #: includes/fields/class-field-image.php:9 includes/free/form-element.php:8
4774
+ msgid "Image Upload"
4775
  msgstr ""
4776
 
4777
+ #: includes/fields/class-field-numeric.php:6
4778
+ #: includes/fields/class-pro-upgrade-fields.php:93
4779
+ #: includes/free/form-element.php:16
4780
+ msgid "Numeric Field"
4781
  msgstr ""
4782
 
4783
+ #: includes/fields/class-field-post-content.php:6
4784
+ msgid "Post Content"
4785
  msgstr ""
4786
 
4787
+ #: includes/fields/class-field-post-excerpt.php:6
4788
+ msgid "Post Excerpt"
4789
  msgstr ""
4790
 
4791
+ #: includes/fields/class-field-radio.php:9
4792
+ msgid "Radio"
4793
  msgstr ""
4794
 
4795
+ #: includes/fields/class-field-recaptcha.php:9
4796
+ #: includes/free/form-element.php:31
4797
+ msgid "reCaptcha"
4798
  msgstr ""
4799
 
4800
+ #: includes/fields/class-field-recaptcha.php:54
4801
+ msgid "reCaptcha API key is missing."
4802
  msgstr ""
4803
 
4804
+ #: includes/fields/class-field-recaptcha.php:134
4805
+ msgid "Site key and Secret key"
4806
  msgstr ""
4807
 
4808
+ #: includes/fields/class-field-recaptcha.php:136
4809
+ msgid ""
4810
+ "You need to set Site key and Secret key in <a href=\"%s\" "
4811
+ "target=\"_blank\">Settings</a> in order to use \"Recaptcha\" field. <a "
4812
+ "href=\"%s\" target=\"_blank\">Click here to get the these key</a>."
4813
  msgstr ""
4814
 
4815
+ #: includes/fields/class-field-recaptcha.php:160
4816
+ #: includes/fields/class-field-sectionbreak.php:60
4817
+ msgid "Title of the section"
4818
  msgstr ""
4819
 
4820
+ #: includes/fields/class-field-recaptcha.php:174
4821
+ msgid "Select reCaptcha type"
4822
  msgstr ""
4823
 
4824
+ #: includes/fields/class-field-recaptcha.php:182
4825
+ msgid "Light"
4826
  msgstr ""
4827
 
4828
+ #: includes/fields/class-field-recaptcha.php:183
4829
+ msgid "Dark"
4830
  msgstr ""
4831
 
4832
+ #: includes/fields/class-field-recaptcha.php:188
4833
+ msgid "Select reCaptcha Theme"
 
4834
  msgstr ""
4835
 
4836
+ #: includes/fields/class-field-sectionbreak.php:9
4837
+ msgid "Section Break"
 
4838
  msgstr ""
4839
 
4840
+ #: includes/fields/class-field-sectionbreak.php:68
4841
+ msgid "Some details text about the section"
 
4842
  msgstr ""
4843
 
4844
+ #: includes/fields/class-field-sectionbreak.php:85
4845
+ msgid "Some description about this section"
 
4846
  msgstr ""
4847
 
4848
+ #: includes/fields/class-field-text.php:9
4849
+ #: includes/fields/class-field-text.php:133
4850
+ msgid "Text"
4851
  msgstr ""
4852
 
4853
+ #: includes/fields/class-field-url.php:9
4854
+ msgid "Website URL"
 
4855
  msgstr ""
4856
 
4857
+ #: includes/fields/class-field-url.php:68
4858
+ msgid "Open in : "
4859
  msgstr ""
4860
 
4861
+ #: includes/fields/class-field-url.php:71
4862
+ msgid "Same Window"
4863
  msgstr ""
4864
 
4865
+ #: includes/fields/class-field-url.php:72
4866
+ msgid "New Window"
4867
  msgstr ""
4868
 
4869
+ #: includes/fields/class-field-url.php:78
4870
+ msgid "Choose whether the link will open in new tab or same window"
4871
  msgstr ""
4872
 
4873
+ #: includes/fields/class-pro-upgrade-fields.php:9
4874
+ #: includes/free/form-element.php:17
4875
+ msgid "Address Field"
 
4876
  msgstr ""
4877
 
4878
+ #: includes/fields/class-pro-upgrade-fields.php:34
4879
+ msgid "Date / Time"
4880
  msgstr ""
4881
 
4882
+ #: includes/fields/class-pro-upgrade-fields.php:44
4883
+ msgid "Embed"
 
4884
  msgstr ""
4885
 
4886
+ #: includes/fields/class-pro-upgrade-fields.php:105
4887
+ msgid "Ratings"
 
4888
  msgstr ""
4889
 
4890
+ #: includes/fields/class-pro-upgrade-fields.php:117
4891
+ msgid "Linear Scale"
4892
  msgstr ""
4893
 
4894
+ #: includes/fields/class-pro-upgrade-fields.php:129
4895
+ msgid "Checkbox Grid"
 
4896
  msgstr ""
4897
 
4898
+ #: includes/fields/class-pro-upgrade-fields.php:141
4899
+ msgid "Multiple Choice Grid"
 
4900
  msgstr ""
4901
 
4902
+ #: includes/fields/class-pro-upgrade-fields.php:153
4903
+ #: includes/free/form-element.php:11
4904
+ msgid "Repeat Field"
4905
  msgstr ""
4906
 
4907
+ #: includes/fields/class-pro-upgrade-fields.php:167
4908
  #: includes/free/form-element.php:32
4909
  msgid "Really Simple Captcha"
4910
  msgstr ""
4911
 
4912
+ #: includes/fields/class-pro-upgrade-fields.php:193
4913
+ #: includes/free/form-element.php:18
4914
+ msgid "Step Start"
 
 
 
4915
  msgstr ""
4916
 
4917
+ #: includes/fields/class-pro-upgrade-fields.php:205
4918
+ msgid "Terms & Conditions"
4919
  msgstr ""
4920
 
4921
  #: includes/free/admin/shortcode-builder.php:5
5032
  "link"
5033
  msgstr ""
5034
 
5035
+ #: includes/free/class-login.php:768 includes/free/class-login.php:838
5036
  msgid "Your account has been activated"
5037
  msgstr ""
5038
 
5039
+ #: includes/free/class-login.php:771
5040
+ msgid ""
5041
+ "Your account has been verified , but you can't login until manually "
5042
+ "approved your account by an administrator."
5043
+ msgstr ""
5044
+
5045
  #: includes/free/class-login.php:801
5046
  msgid "[%s] Your username and password info"
5047
  msgstr ""
5102
  msgid "A user with same username already exists."
5103
  msgstr ""
5104
 
5105
+ #: includes/free/class-registration.php:272
5106
+ msgid "New user registration on your site %s:"
5107
+ msgstr ""
5108
+
5109
+ #: includes/free/class-registration.php:274
5110
+ msgid "E-mail: %s"
5111
+ msgstr ""
5112
+
5113
+ #: includes/free/class-registration.php:280
5114
+ #: includes/free/class-registration.php:290
5115
+ msgid "[%s] %s"
5116
+ msgstr ""
5117
+
5118
+ #: includes/free/class-registration.php:282
5119
+ msgid "Hi, %s"
5120
+ msgstr ""
5121
+
5122
  #: includes/free/edit-profile.php:32 includes/free/edit-user.php:37
5123
  #: templates/unauthorized.php:3
5124
  msgid "This page is restricted. Please %s to view this page."
5187
  msgid "Update Profile"
5188
  msgstr ""
5189
 
5190
+ #: includes/free/edit-profile.php:252
5191
  msgid "WPUF Post Lock"
5192
  msgstr ""
5193
 
5194
+ #: includes/free/edit-profile.php:255
5195
  msgid "Lock Post:"
5196
  msgstr ""
5197
 
5198
+ #: includes/free/edit-profile.php:261
5199
  msgid "Lock user from creating new post."
5200
  msgstr ""
5201
 
5202
+ #: includes/free/edit-profile.php:265
5203
  msgid "Lock Reason:"
5204
  msgstr ""
5205
 
5206
+ #: includes/free/edit-profile.php:272
5207
+ msgid "Lock Edit Post:"
5208
+ msgstr ""
5209
+
5210
+ #: includes/free/edit-profile.php:278
5211
+ msgid "Lock user from editing post."
5212
+ msgstr ""
5213
+
5214
+ #: includes/free/edit-profile.php:282
5215
+ msgid "Edit Post Lock Reason:"
5216
+ msgstr ""
5217
+
5218
  #: includes/free/edit-user.php:23
5219
  msgid "User doesn't exists"
5220
  msgstr ""
5693
  msgid "Hello %1$s, (not %1$s? <a href=\"%2$s\">Sign out</a>)"
5694
  msgstr ""
5695
 
5696
+ #: templates/dashboard/dashboard.php:23
5697
  msgid "edit your password and profile"
5698
  msgstr ""
5699
 
5700
+ #: templates/dashboard/dashboard.php:48
5701
  msgid "From your account dashboard you can view your dashboard, manage your %s"
5702
  msgstr ""
5703
 
5903
  msgid "CSV"
5904
  msgstr ""
5905
 
5906
+ #: wpuf-functions.php:817
5907
+ msgid "Directions »"
5908
+ msgstr ""
5909
+
5910
+ #: wpuf-functions.php:1630
5911
  msgid "Edit Profile"
5912
  msgstr ""
5913
 
5914
+ #: wpuf-functions.php:1737
5915
  msgid "United Arab Emirates Dirham"
5916
  msgstr ""
5917
 
5918
+ #: wpuf-functions.php:1738
5919
  msgid "Australian Dollars"
5920
  msgstr ""
5921
 
5922
+ #: wpuf-functions.php:1739
5923
  msgid "Argentine Peso"
5924
  msgstr ""
5925
 
5926
+ #: wpuf-functions.php:1740
5927
  msgid "Bangladeshi Taka"
5928
  msgstr ""
5929
 
5930
+ #: wpuf-functions.php:1741
5931
  msgid "Brazilian Real"
5932
  msgstr ""
5933
 
5934
+ #: wpuf-functions.php:1742
5935
  msgid "Bulgarian Lev"
5936
  msgstr ""
5937
 
5938
+ #: wpuf-functions.php:1743
5939
  msgid "Canadian Dollars"
5940
  msgstr ""
5941
 
5942
+ #: wpuf-functions.php:1744
5943
  msgid "Chilean Peso"
5944
  msgstr ""
5945
 
5946
+ #: wpuf-functions.php:1745
5947
  msgid "Chinese Yuan"
5948
  msgstr ""
5949
 
5950
+ #: wpuf-functions.php:1746
5951
  msgid "Colombian Peso"
5952
  msgstr ""
5953
 
5954
+ #: wpuf-functions.php:1747
5955
  msgid "Czech Koruna"
5956
  msgstr ""
5957
 
5958
+ #: wpuf-functions.php:1748
5959
  msgid "Danish Krone"
5960
  msgstr ""
5961
 
5962
+ #: wpuf-functions.php:1749
5963
  msgid "Dominican Peso"
5964
  msgstr ""
5965
 
5966
+ #: wpuf-functions.php:1750
5967
  msgid "Algerian Dinar"
5968
  msgstr ""
5969
 
5970
+ #: wpuf-functions.php:1751
5971
  msgid "Euros"
5972
  msgstr ""
5973
 
5974
+ #: wpuf-functions.php:1752
5975
  msgid "Hong Kong Dollar"
5976
  msgstr ""
5977
 
5978
+ #: wpuf-functions.php:1753
5979
  msgid "Croatia kuna"
5980
  msgstr ""
5981
 
5982
+ #: wpuf-functions.php:1754
5983
  msgid "Hungarian Forint"
5984
  msgstr ""
5985
 
5986
+ #: wpuf-functions.php:1755
5987
  msgid "Icelandic krona"
5988
  msgstr ""
5989
 
5990
+ #: wpuf-functions.php:1756
5991
  msgid "Indonesia Rupiah"
5992
  msgstr ""
5993
 
5994
+ #: wpuf-functions.php:1757
5995
  msgid "Indian Rupee"
5996
  msgstr ""
5997
 
5998
+ #: wpuf-functions.php:1758
5999
  msgid "Nepali Rupee"
6000
  msgstr ""
6001
 
6002
+ #: wpuf-functions.php:1759
6003
  msgid "Israeli Shekel"
6004
  msgstr ""
6005
 
6006
+ #: wpuf-functions.php:1760
6007
  msgid "Japanese Yen"
6008
  msgstr ""
6009
 
6010
+ #: wpuf-functions.php:1761
6011
  msgid "Lao Kip"
6012
  msgstr ""
6013
 
6014
+ #: wpuf-functions.php:1762
6015
  msgid "South Korean Won"
6016
  msgstr ""
6017
 
6018
+ #: wpuf-functions.php:1763
6019
  msgid "Malaysian Ringgits"
6020
  msgstr ""
6021
 
6022
+ #: wpuf-functions.php:1764
6023
  msgid "Mexican Peso"
6024
  msgstr ""
6025
 
6026
+ #: wpuf-functions.php:1765
6027
  msgid "Nigerian Naira"
6028
  msgstr ""
6029
 
6030
+ #: wpuf-functions.php:1766
6031
  msgid "Norwegian Krone"
6032
  msgstr ""
6033
 
6034
+ #: wpuf-functions.php:1767
6035
  msgid "New Zealand Dollar"
6036
  msgstr ""
6037
 
6038
+ #: wpuf-functions.php:1768
6039
  msgid "Omani Rial"
6040
  msgstr ""
6041
 
6042
+ #: wpuf-functions.php:1769
6043
  msgid "Iranian Rial"
6044
  msgstr ""
6045
 
6046
+ #: wpuf-functions.php:1770
6047
  msgid "Pakistani Rupee"
6048
  msgstr ""
6049
 
6050
+ #: wpuf-functions.php:1771
6051
  msgid "Paraguayan Guaraní"
6052
  msgstr ""
6053
 
6054
+ #: wpuf-functions.php:1772
6055
  msgid "Philippine Pesos"
6056
  msgstr ""
6057
 
6058
+ #: wpuf-functions.php:1773
6059
  msgid "Polish Zloty"
6060
  msgstr ""
6061
 
6062
+ #: wpuf-functions.php:1774
6063
  msgid "Pounds Sterling"
6064
  msgstr ""
6065
 
6066
+ #: wpuf-functions.php:1775
6067
  msgid "Romanian Leu"
6068
  msgstr ""
6069
 
6070
+ #: wpuf-functions.php:1776
6071
  msgid "Russian Ruble"
6072
  msgstr ""
6073
 
6074
+ #: wpuf-functions.php:1777
6075
  msgid "Saudi Riyal"
6076
  msgstr ""
6077
 
6078
+ #: wpuf-functions.php:1778
6079
  msgid "Singapore Dollar"
6080
  msgstr ""
6081
 
6082
+ #: wpuf-functions.php:1779
6083
  msgid "South African rand"
6084
  msgstr ""
6085
 
6086
+ #: wpuf-functions.php:1780
6087
  msgid "Swedish Krona"
6088
  msgstr ""
6089
 
6090
+ #: wpuf-functions.php:1781
6091
  msgid "Swiss Franc"
6092
  msgstr ""
6093
 
6094
+ #: wpuf-functions.php:1782
6095
  msgid "Taiwan New Dollars"
6096
  msgstr ""
6097
 
6098
+ #: wpuf-functions.php:1783
6099
  msgid "Thai Baht"
6100
  msgstr ""
6101
 
6102
+ #: wpuf-functions.php:1784
6103
  msgid "Turkish Lira"
6104
  msgstr ""
6105
 
6106
+ #: wpuf-functions.php:1785
6107
  msgid "US Dollar"
6108
  msgstr ""
6109
 
6110
+ #: wpuf-functions.php:1786
6111
  msgid "Vietnamese Dong"
6112
  msgstr ""
6113
 
6114
+ #: wpuf-functions.php:1787
6115
  msgid "Egyptian Pound"
6116
  msgstr ""
6117
 
6118
+ #: wpuf-functions.php:2616
6119
  msgid "None"
6120
  msgstr ""
6121
 
6122
+ #: wpuf.php:111
6123
  msgid "Your installed PHP Version is: "
6124
  msgstr ""
6125
 
6126
+ #: wpuf.php:112
6127
  msgid "The <strong>WP User Frontend</strong> plugin requires PHP version <strong>"
6128
  msgstr ""
6129
 
6130
+ #: wpuf.php:112
6131
  msgid "</strong> or greater."
6132
  msgstr ""
6133
 
6134
+ #: wpuf.php:196
6135
  msgid "Your Post Has Been Expired"
6136
  msgstr ""
6137
 
6138
+ #: wpuf.php:444
6139
+ msgid ""
6140
+ "<p style=\"font-size: 13px\">\n"
6141
+ " <strong class=\"highlight-text\" "
6142
+ "style=\"font-size: 18px; display:block; margin-bottom:8px\"> UPDATE "
6143
+ "REQUIRED </strong>\n"
6144
+ " WP User Frontend Pro is not working because you "
6145
+ "are using an old version of WP User Frontend Pro. Please update "
6146
+ "<strong>WPUF Pro</strong> to >= <strong>v3.1.0</strong> to work with the "
6147
+ "latest version of WP User Frontend\n"
6148
+ " </p>"
6149
+ msgstr ""
6150
+
6151
+ #: wpuf.php:460
6152
+ msgid "Update WP User Frontend Pro Now"
6153
+ msgstr ""
6154
+
6155
+ #: wpuf.php:464
6156
+ msgid "Update WP User Frontend Pro NOW"
6157
+ msgstr ""
6158
+
6159
+ #: wpuf.php:711
6160
  msgid "Please Cancel Your Currently Active Pack first!"
6161
  msgstr ""
6162
 
6163
+ #: wpuf.php:875
6164
  msgid "Error: Nonce verification failed"
6165
  msgstr ""
6166
 
6242
  msgid "Searching&hellip;"
6243
  msgstr ""
6244
 
6245
+ #: wpuf-functions.php:1241
6246
  msgctxt "tag delimiter"
6247
  msgid ","
6248
  msgstr ""
lib/class.settings-api.php CHANGED
File without changes
lib/gateway/bank.php CHANGED
File without changes
lib/recaptchalib.php CHANGED
File without changes
readme.txt CHANGED
@@ -3,9 +3,9 @@ Contributors: tareq1988, sk.shaikat, rabbii, rafsuntaskin, itowhid06, wedevs
3
  Donate link: https://tareq.co/donate/
4
  Tags: Forms, registration, profile-builder, login, membership
5
  Requires at least: 4.0
6
- Tested up to: 4.9.8
7
  Requires PHP: 5.4
8
- Stable tag: trunk
9
  License: GPLv2
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -152,6 +152,29 @@ Try an <a href="https://wedevs.com/in/wpuf/demo">Online Demo</a> of the FREE & P
152
  * Tax in payments
153
  * Vendor registration template for Dokan, WC Marketplace, WC Vendors
154
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
155
  Check out the <a href="https://wedevs.com/wp-user-frontend-pro/pricing/">full feature list and pricing plans here.</a> of the Pro version.
156
 
157
  = Checkout Our Other Products =
@@ -230,6 +253,22 @@ redirected to the edit page with that post id. Then you'll see the edit post for
230
 
231
  == Changelog ==
232
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
233
  = v3.0.1 (5 December, 2018) =
234
 
235
  * **Fix:** Image is duplicating
3
  Donate link: https://tareq.co/donate/
4
  Tags: Forms, registration, profile-builder, login, membership
5
  Requires at least: 4.0
6
+ Tested up to: 5.0.3
7
  Requires PHP: 5.4
8
+ Stable tag: 3.1.0
9
  License: GPLv2
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
 
152
  * Tax in payments
153
  * Vendor registration template for Dokan, WC Marketplace, WC Vendors
154
 
155
+ <strong>Premium Modules</strong>
156
+
157
+ * [BuddyPress Profile](https://wedevs.com/wp-user-frontend-pro/modules/buddypress/)
158
+ * [Campaign Monitor](https://wedevs.com/wp-user-frontend-pro/modules/campaign-monitor/)
159
+ * [Comments Manager](https://wedevs.com/wp-user-frontend-pro/modules/comments-manager/)
160
+ * [ConvertKit](https://wedevs.com/wp-user-frontend-pro/modules/convertkit/)
161
+ * [GetResponse](https://wedevs.com/wp-user-frontend-pro/modules/getresponse/)
162
+ * [HTML Email Templates](https://wedevs.com/wp-user-frontend-pro/modules/html-email-templates/)
163
+ * [MailChimp](https://wedevs.com/wp-user-frontend-pro/modules/mailchimp/)
164
+ * [MailPoet](https://wedevs.com/wp-user-frontend-pro/modules/mailpoet/)
165
+ * [MailPoet 3](https://wedevs.com/wp-user-frontend-pro/modules/mailpoet-3/)
166
+ * [Paid Memberships Pro](https://wedevs.com/wp-user-frontend-pro/modules/paid-membership-pro-integration/)
167
+ * [Private Messaging](https://wedevs.com/wp-user-frontend-pro/modules/private-messaging/)
168
+ * [QR Code Generator](https://wedevs.com/wp-user-frontend-pro/modules/qr-code-generator/)
169
+ * [Reports](https://wedevs.com/wp-user-frontend-pro/modules/reports/)
170
+ * [SMS Notification](https://wedevs.com/wp-user-frontend-pro/modules/sms-notification/)
171
+ * [Social Login & Registration](https://wedevs.com/wp-user-frontend-pro/modules/social-login/)
172
+ * [Stripe Payment](https://wedevs.com/products/plugins/wp-user-frontend-pro/stripe-gateway/)
173
+ * [User Analytics](https://wedevs.com/wp-user-frontend-pro/modules/user-analytics/)
174
+ * [User Directory](https://wedevs.com/wp-user-frontend-pro/modules/user-directory/)
175
+ * [User Activity](https://wedevs.com/wp-user-frontend-pro/modules/user-activity/)
176
+ * [Zapier](https://wedevs.com/wp-user-frontend-pro/modules/zapier/)
177
+
178
  Check out the <a href="https://wedevs.com/wp-user-frontend-pro/pricing/">full feature list and pricing plans here.</a> of the Pro version.
179
 
180
  = Checkout Our Other Products =
253
 
254
  == Changelog ==
255
 
256
+ = v3.1.0 (31 January, 2019) =
257
+
258
+ * **Fix:** The Default registration form `[wpuf-registration]` was unable to send the new user registration email.
259
+ * **Fix:** With the latest version of WordPress the Gutenberg block of WP User Frontend were not working. Fixed in this version.
260
+ * **Fix:** While using Gutenberg editor, the pages were not being updated with WPUF shortcode consisting`[wpuf dashboard]`
261
+ * **Fix:** From the User Frontend Settings, you had the capability to set if the Administrator, Editor, Vendor etc can see the admin bar. Now, the super admin want one specific user ( who has the user role from the above ) can't see the admin bar and disabled it from the Toolbar form that specific user profile. And this configuration ( Toolbar ) from the specific user profile were unable to impact on the frontend.
262
+ * **Fix:** WP User Frontend was unable to install with PHP 5.4 or lower version.
263
+ * **Fix:** When a user uploaded single image for product gallery using WPUF WooCommerce product form, that image was not showing on the frontend.
264
+
265
+ = v3.0.2 (1 January, 2019) =
266
+
267
+ * **Feature:** Added post lock feature based on posts and user
268
+ * **Fix:** 'show directions' link doesn't show with the google map on submitted post
269
+ * **Fix:** Subscription pack price not formatting according to the settings
270
+ * **Fix:** Post date is not updating when enable time input option for date field
271
+
272
  = v3.0.1 (5 December, 2018) =
273
 
274
  * **Fix:** Image is duplicating
templates/dashboard.php CHANGED
File without changes
templates/dashboard/dashboard.php CHANGED
@@ -9,19 +9,21 @@
9
  ?></p>
10
 
11
  <p><?php
12
- $tabs = array(
13
- 'posts' => array(
14
- 'label' => __( 'Posts', 'wp-user-frontend' ),
15
- 'url' => esc_url( add_query_arg( array( 'section' => 'posts' ), get_permalink() ) ),
16
- ),
17
- 'subscription' => array(
18
- 'label' => __( 'Subscription', 'wp-user-frontend' ),
19
- 'url' => esc_url( add_query_arg( array( 'section' => 'subscription' ), get_permalink() ) ),
20
- ),
21
- 'edit-profile' => array(
22
- 'label' => __( 'edit your password and profile', 'wp-user-frontend' ),
23
- 'url' => esc_url( add_query_arg( array( 'section' => 'edit-profile' ), get_permalink() ) ),
24
- ),
 
 
25
  );
26
 
27
  if( 'off' == wpuf_get_option( 'show_subscriptions', 'wpuf_my_account', 'on' ) ) {
9
  ?></p>
10
 
11
  <p><?php
12
+
13
+ $tabs = apply_filters( 'wpuf_my_account_tab_links', array(
14
+ 'posts' => array(
15
+ 'label' => __( 'Posts', 'wp-user-frontend' ),
16
+ 'url' => esc_url( add_query_arg( array( 'section' => 'posts' ), get_permalink() ) ),
17
+ ),
18
+ 'subscription' => array(
19
+ 'label' => __( 'Subscription', 'wp-user-frontend' ),
20
+ 'url' => esc_url( add_query_arg( array( 'section' => 'subscription' ), get_permalink() ) ),
21
+ ),
22
+ 'edit-profile' => array(
23
+ 'label' => __( 'edit your password and profile', 'wp-user-frontend' ),
24
+ 'url' => esc_url( add_query_arg( array( 'section' => 'edit-profile' ), get_permalink() ) ),
25
+ ),
26
+ )
27
  );
28
 
29
  if( 'off' == wpuf_get_option( 'show_subscriptions', 'wpuf_my_account', 'on' ) ) {
templates/logged-in.php CHANGED
File without changes
templates/login-form.php CHANGED
File without changes
templates/lost-pass-form.php CHANGED
File without changes
templates/reset-pass-form.php CHANGED
File without changes
templates/subscriptions/pack-details.php CHANGED
@@ -20,8 +20,7 @@
20
  <div class="wpuf-sub-amount">
21
 
22
  <?php if ( $billing_amount != '0.00' ) { ?>
23
- <sup class="wpuf-sub-symbol"><?php echo $details_meta['symbol']; ?></sup>
24
- <span class="wpuf-sub-cost"><?php echo $billing_amount; ?></span>
25
  <?php } else { ?>
26
  <span class="wpuf-sub-cost"><?php _e( 'Free', 'wp-user-frontend' ); ?></span>
27
  <?php } ?>
20
  <div class="wpuf-sub-amount">
21
 
22
  <?php if ( $billing_amount != '0.00' ) { ?>
23
+ <span class="wpuf-sub-cost"><?php echo wpuf_format_price( $billing_amount ); ?></span>
 
24
  <?php } else { ?>
25
  <span class="wpuf-sub-cost"><?php _e( 'Free', 'wp-user-frontend' ); ?></span>
26
  <?php } ?>
wpuf-functions.php CHANGED
@@ -700,11 +700,7 @@ function wpuf_show_custom_fields( $content ) {
700
  if ( isset( $attr['wpuf_cond']['cond_option'][$field_key] ) ) {
701
 
702
  if ( is_array( $cond_field_value ) ) {
703
-
704
- if ( !in_array( $attr['wpuf_cond']['cond_option'][$field_key], $cond_field_value ) ) {
705
- $return_for_no_cond = 1;
706
- }
707
-
708
  } else {
709
 
710
  if ( $attr['wpuf_cond']['cond_option'][$field_key] != $cond_field_value ) {
@@ -811,6 +807,17 @@ function wpuf_show_custom_fields( $content ) {
811
  case 'map':
812
  ob_start();
813
  wpuf_shortcode_map_post($attr['name'], $post->ID);
 
 
 
 
 
 
 
 
 
 
 
814
  $html .= ob_get_clean();
815
  break;
816
 
@@ -2980,6 +2987,10 @@ function wpuf_show_form_schedule_message( $form_id ) {
2980
  $end_time = !empty( $form_settings['schedule_end'] ) ? strtotime( $form_settings['schedule_end'] ) : 0;
2981
  $current_time = current_time( 'timestamp' );
2982
 
 
 
 
 
2983
  // too early?
2984
  if ( $current_time < $start_time ) {
2985
  echo '<div class="wpuf-message">' . $form_settings['form_pending_message'] . '</div>';
@@ -2987,11 +2998,11 @@ function wpuf_show_form_schedule_message( $form_id ) {
2987
  echo '<div class="wpuf-message">' . $form_settings['form_expired_message'] . '</div>';
2988
  }
2989
  ?>
2990
- <script>
2991
- jQuery( function($) {
2992
- $(".wpuf-submit-button").attr("disabled", "disabled");
2993
- });
2994
- </script>
2995
  <?php
2996
  return;
2997
  }
@@ -3035,4 +3046,19 @@ function wpuf_show_form_limit_message( $form_id ){
3035
  }
3036
  add_action( 'wpuf_before_form_render', 'wpuf_show_form_limit_message' );
3037
 
 
 
 
 
 
 
 
 
 
 
 
 
3038
 
 
 
 
700
  if ( isset( $attr['wpuf_cond']['cond_option'][$field_key] ) ) {
701
 
702
  if ( is_array( $cond_field_value ) ) {
703
+ continue;
 
 
 
 
704
  } else {
705
 
706
  if ( $attr['wpuf_cond']['cond_option'][$field_key] != $cond_field_value ) {
807
  case 'map':
808
  ob_start();
809
  wpuf_shortcode_map_post($attr['name'], $post->ID);
810
+
811
+ if ( isset( $attr['directions'] ) && $attr['directions'] ) {
812
+ $location = get_post_meta( $post->ID, $attr['name'] , true );
813
+ $def_lat = isset( $location['lat'] ) ? $location['lat'] : 40.7143528;
814
+ $def_long = isset( $location['lng'] ) ? $location['lng'] : -74.0059731;
815
+ ?>
816
+ <div>
817
+ <a class="btn btn-brand btn-sm" href="https://www.google.com/maps/dir/?api=1&amp;destination=<?php echo $def_lat; ?>,<?php echo $def_long; ?>" target="_blank" rel="nofollow external"><?php _e( 'Directions »', 'wp-user-frontend' ); ?></a>
818
+ </div>
819
+ <?php }
820
+
821
  $html .= ob_get_clean();
822
  break;
823
 
2987
  $end_time = !empty( $form_settings['schedule_end'] ) ? strtotime( $form_settings['schedule_end'] ) : 0;
2988
  $current_time = current_time( 'timestamp' );
2989
 
2990
+ if ( $current_time >= $start_time && $current_time <= $end_time) {
2991
+ return ;
2992
+ }
2993
+
2994
  // too early?
2995
  if ( $current_time < $start_time ) {
2996
  echo '<div class="wpuf-message">' . $form_settings['form_pending_message'] . '</div>';
2998
  echo '<div class="wpuf-message">' . $form_settings['form_expired_message'] . '</div>';
2999
  }
3000
  ?>
3001
+ <script>
3002
+ jQuery( function($) {
3003
+ $(".wpuf-submit-button").attr("disabled", "disabled");
3004
+ });
3005
+ </script>
3006
  <?php
3007
  return;
3008
  }
3046
  }
3047
  add_action( 'wpuf_before_form_render', 'wpuf_show_form_limit_message' );
3048
 
3049
+ /**
3050
+ * save frontend post revision
3051
+ *
3052
+ * @param int $post_id
3053
+ * @param array $form_settings
3054
+ * @return void
3055
+ */
3056
+ function wpuf_frontend_post_revision( $post_id, $form_settings ) {
3057
+ $post = get_post( $post_id );
3058
+ if ( post_type_supports( $form_settings['post_type'], 'revisions' ) ) {
3059
+ $revisions = wp_get_post_revisions( $post_id, array( 'order' => 'ASC', 'posts_per_page' => 1 ) );
3060
+ $revision = current( $revisions );
3061
 
3062
+ _wp_upgrade_revisions_of_post( $post, wp_get_post_revisions( $post_id ) );
3063
+ }
3064
+ }
wpuf.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: WP User Frontend
4
  Plugin URI: https://wordpress.org/plugins/wp-user-frontend/
5
  Description: Create, edit, delete, manages your post, pages or custom post types from frontend. Create registration forms, frontend profile and more...
6
  Author: Tareq Hasan
7
- Version: 3.0.1
8
  Author URI: https://tareq.co
9
  License: GPL2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -12,7 +12,7 @@ Text Domain: wp-user-frontend
12
  Domain Path: /languages
13
  */
14
 
15
- define( 'WPUF_VERSION', '3.0.1' );
16
  define( 'WPUF_FILE', __FILE__ );
17
  define( 'WPUF_ROOT', dirname( __FILE__ ) );
18
  define( 'WPUF_ROOT_URI', plugins_url( '', __FILE__ ) );
@@ -34,6 +34,13 @@ final class WP_User_Frontend {
34
  */
35
  private $container = array();
36
 
 
 
 
 
 
 
 
37
  /**
38
  * The singleton instance
39
  *
@@ -232,6 +239,9 @@ final class WP_User_Frontend {
232
  require_once dirname( __FILE__ ) . '/lib/gateway/bank.php';
233
  require_once dirname( __FILE__ ) . '/lib/class-wedevs-insights.php';
234
 
 
 
 
235
  // global classes/functions
236
  require_once WPUF_ROOT . '/class/upload.php';
237
  require_once WPUF_ROOT . '/admin/form-template.php';
@@ -297,6 +307,11 @@ final class WP_User_Frontend {
297
  require_once dirname( __FILE__ ) . '/lib/recaptchalib.php';
298
  require_once dirname( __FILE__ ) . '/lib/invisible_recaptcha.php';
299
  }
 
 
 
 
 
300
  }
301
 
302
  /**
@@ -353,6 +368,9 @@ final class WP_User_Frontend {
353
  $this->container['login'] = WPUF_Simple_Login::init();
354
  $this->container['registration'] = WPUF_Registration::init();
355
  }
 
 
 
356
  }
357
 
358
  /**
@@ -404,6 +422,7 @@ final class WP_User_Frontend {
404
 
405
  if ( $has_pro ) {
406
  $this->is_pro = true;
 
407
  } else {
408
 
409
  include dirname( __FILE__ ) . '/includes/free/loader.php';
@@ -412,6 +431,159 @@ final class WP_User_Frontend {
412
  }
413
  }
414
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
415
  /**
416
  * Manage task on plugin deactivation
417
  *
@@ -592,7 +764,7 @@ final class WP_User_Frontend {
592
  * @since 2.2.3
593
  * @return void
594
  */
595
- function show_admin_bar() {
596
 
597
  if ( !is_user_logged_in() ) {
598
  return false;
@@ -601,11 +773,16 @@ final class WP_User_Frontend {
601
  $roles = wpuf_get_option( 'show_admin_bar', 'wpuf_general', array( 'administrator', 'editor', 'author', 'contributor', 'subscriber' ) );
602
  $roles = $roles ? $roles : array();
603
  $current_user = wp_get_current_user();
 
 
 
 
 
604
  if ( !in_array( $current_user->roles[0], $roles ) ) {
605
  return false;
606
  }
607
 
608
- return true;
609
  }
610
 
611
  /**
4
  Plugin URI: https://wordpress.org/plugins/wp-user-frontend/
5
  Description: Create, edit, delete, manages your post, pages or custom post types from frontend. Create registration forms, frontend profile and more...
6
  Author: Tareq Hasan
7
+ Version: 3.1.0
8
  Author URI: https://tareq.co
9
  License: GPL2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
12
  Domain Path: /languages
13
  */
14
 
15
+ define( 'WPUF_VERSION', '3.1.0' );
16
  define( 'WPUF_FILE', __FILE__ );
17
  define( 'WPUF_ROOT', dirname( __FILE__ ) );
18
  define( 'WPUF_ROOT_URI', plugins_url( '', __FILE__ ) );
34
  */
35
  private $container = array();
36
 
37
+ /**
38
+ * Form field value seperator
39
+ *
40
+ * @var string
41
+ */
42
+ static $field_separator = '| ';
43
+
44
  /**
45
  * The singleton instance
46
  *
239
  require_once dirname( __FILE__ ) . '/lib/gateway/bank.php';
240
  require_once dirname( __FILE__ ) . '/lib/class-wedevs-insights.php';
241
 
242
+ require_once WPUF_ROOT . '/includes/class-frontend-render-form.php';
243
+ require_once WPUF_ROOT . '/admin/form-builder/class-wpuf-form-builder-field-settings.php';
244
+
245
  // global classes/functions
246
  require_once WPUF_ROOT . '/class/upload.php';
247
  require_once WPUF_ROOT . '/admin/form-template.php';
307
  require_once dirname( __FILE__ ) . '/lib/recaptchalib.php';
308
  require_once dirname( __FILE__ ) . '/lib/invisible_recaptcha.php';
309
  }
310
+
311
+ require_once WPUF_ROOT . '/includes/class-frontend-form-post.php';
312
+ require_once WPUF_ROOT . '/includes/class-field-manager.php';
313
+ require_once WPUF_ROOT . '/includes/class-pro-upgrades.php';
314
+ require_once WPUF_ROOT . '/includes/fields/field-trait.php';
315
  }
316
 
317
  /**
368
  $this->container['login'] = WPUF_Simple_Login::init();
369
  $this->container['registration'] = WPUF_Registration::init();
370
  }
371
+ $this->container['fields'] = new WPUF_Field_Manager();
372
+ $this->container['frontend_form'] = WPUF_Frontend_Form::init();
373
+ $this->container['pro_upgrades'] = new WPUF_Pro_Upgrades();
374
  }
375
 
376
  /**
422
 
423
  if ( $has_pro ) {
424
  $this->is_pro = true;
425
+ add_action( 'admin_notices', array( $this,'wpuf_latest_pro_activation_notice') );
426
  } else {
427
 
428
  include dirname( __FILE__ ) . '/includes/free/loader.php';
431
  }
432
  }
433
 
434
+ /**
435
+ * Latest Pro Activation Message
436
+ *
437
+ * @return void
438
+ */
439
+ function wpuf_latest_pro_activation_notice() {
440
+ if ( ! version_compare(WPUF_PRO_VERSION, '3.1.0', '<' ) ) {
441
+ return;
442
+ }
443
+
444
+ $offer_msg = __( '<p style="font-size: 13px">
445
+ <strong class="highlight-text" style="font-size: 18px; display:block; margin-bottom:8px"> UPDATE REQUIRED </strong>
446
+ WP User Frontend Pro is not working because you are using an old version of WP User Frontend Pro. Please update <strong>WPUF Pro</strong> to >= <strong>v3.1.0</strong> to work with the latest version of WP User Frontend
447
+ </p>', 'wp-user-frontend' );
448
+
449
+ ?>
450
+ <div class="notice is-dismissible" id="wpuf-update-offer-notice">
451
+ <table>
452
+ <tbody>
453
+ <tr>
454
+ <td class="image-container">
455
+ <img src="https://ps.w.org/wp-user-frontend/assets/icon-256x256.png" alt="">
456
+ </td>
457
+ <td class="message-container">
458
+ <?php echo $offer_msg; ?>
459
+ </td>
460
+ <td><a href="https://wedevs.com/account/downloads/" class="button button-primary promo-btn" target="_blank"><?php _e( 'Update WP User Frontend Pro Now', 'wp-user-frontend' ); ?></a></td>
461
+ </tr>
462
+ </tbody>
463
+ </table>
464
+ <!-- <a href="https://wedevs.com/account/downloads/" class="button button-primary promo-btn" target="_blank"><?php _e( 'Update WP User Frontend Pro NOW', 'wp-user-frontend' ); ?></a> -->
465
+ </div><!-- #wpuf-update-offer-notice -->
466
+
467
+ <style>
468
+ #wpuf-update-offer-notice {
469
+ background-size: cover;
470
+ border: 0px;
471
+ padding: 10px;
472
+ opacity: 0;
473
+ border-left: 3px solid red;
474
+ }
475
+
476
+ .wrap > #wpuf-update-offer-notice {
477
+ opacity: 1;
478
+ }
479
+
480
+ #wpuf-update-offer-notice table {
481
+ border-collapse: collapse;
482
+ width: 70%;
483
+ }
484
+
485
+ #wpuf-update-offer-notice table td {
486
+ padding: 0;
487
+ }
488
+
489
+ #wpuf-update-offer-notice table td.image-container {
490
+ background-color: #fff;
491
+ vertical-align: middle;
492
+ width: 95px;
493
+ }
494
+
495
+
496
+ #wpuf-update-offer-notice img {
497
+ max-width: 100%;
498
+ max-height: 100px;
499
+ vertical-align: middle;
500
+ border-radius: 100%;
501
+ }
502
+
503
+ #wpuf-update-offer-notice table td.message-container {
504
+ padding: 0 10px;
505
+ }
506
+
507
+ #wpuf-update-offer-notice h2{
508
+ color: #000;
509
+ margin-bottom: 10px;
510
+ font-weight: normal;
511
+ margin: 16px 0 14px;
512
+ -webkit-text-shadow: 0.1px 0.1px 0px rgba(250, 250, 250, 0.24);
513
+ -moz-text-shadow: 0.1px 0.1px 0px rgba(250, 250, 250, 0.24);
514
+ -o-text-shadow: 0.1px 0.1px 0px rgba(250, 250, 250, 0.24);
515
+ text-shadow: 0.1px 0.1px 0px rgba(250, 250, 250, 0.24);
516
+ }
517
+
518
+
519
+ #wpuf-update-offer-notice h2 span {
520
+ position: relative;
521
+ top: 0;
522
+ }
523
+
524
+ #wpuf-update-offer-notice p{
525
+ color: #000;
526
+ font-size: 14px;
527
+ margin-bottom: 10px;
528
+ -webkit-text-shadow: 0.1px 0.1px 0px rgba(250, 250, 250, 0.24);
529
+ -moz-text-shadow: 0.1px 0.1px 0px rgba(250, 250, 250, 0.24);
530
+ -o-text-shadow: 0.1px 0.1px 0px rgba(250, 250, 250, 0.24);
531
+ text-shadow: 0.1px 0.1px 0px rgba(250, 250, 250, 0.24);
532
+ }
533
+
534
+ #wpuf-update-offer-notice p strong.highlight-text{
535
+ color: #000;
536
+ }
537
+
538
+ #wpuf-update-offer-notice p a {
539
+ color: #000;
540
+ }
541
+
542
+ #wpuf-update-offer-notice .notice-dismiss:before {
543
+ color: #000;
544
+ }
545
+
546
+ #wpuf-update-offer-notice span.dashicons-megaphone {
547
+ position: absolute;
548
+ bottom: 46px;
549
+ right: 248px;
550
+ color: rgba(253, 253, 253, 0.29);
551
+ font-size: 96px;
552
+ transform: rotate(-21deg);
553
+ }
554
+
555
+ #wpuf-update-offer-notice a.promo-btn{
556
+ background: #0073aa;
557
+ /*border-color: #fafafa #fafafa #fafafa;*/
558
+ box-shadow: 0 1px 0 #fafafa;
559
+ color: #fff;
560
+ text-decoration: none;
561
+ text-shadow: none;
562
+ position: absolute;
563
+ top: 40px;
564
+ right: 26px;
565
+ height: 40px;
566
+ line-height: 40px;
567
+ width: 300px;
568
+ text-align: center;
569
+ font-weight: 600;
570
+ }
571
+
572
+ </style>
573
+ <script type='text/javascript'>
574
+ jQuery('body').on('click', '#wpuf-update-offer-notice .notice-dismiss', function(e) {
575
+ e.preventDefault();
576
+
577
+ wp.ajax.post('wpuf-dismiss-update-offer-notice', {
578
+ dismissed: true
579
+ });
580
+ });
581
+ </script>
582
+
583
+ <?php
584
+ }
585
+
586
+
587
  /**
588
  * Manage task on plugin deactivation
589
  *
764
  * @since 2.2.3
765
  * @return void
766
  */
767
+ function show_admin_bar($val) {
768
 
769
  if ( !is_user_logged_in() ) {
770
  return false;
773
  $roles = wpuf_get_option( 'show_admin_bar', 'wpuf_general', array( 'administrator', 'editor', 'author', 'contributor', 'subscriber' ) );
774
  $roles = $roles ? $roles : array();
775
  $current_user = wp_get_current_user();
776
+
777
+ if ( get_user_meta( $current_user->ID, 'show_admin_bar_front', true ) == "true" ) {
778
+ return true;
779
+ }
780
+
781
  if ( !in_array( $current_user->roles[0], $roles ) ) {
782
  return false;
783
  }
784
 
785
+ return $val;
786
  }
787
 
788
  /**