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

Version Description

Download this release

Release Info

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

Code changes from version 3.5.3 to 3.5.4

admin/form-builder/assets/js/components/field-option-data/template.php CHANGED
@@ -7,7 +7,7 @@
7
  <input
8
  type="checkbox"
9
  v-model="show_value"
10
- /><?php _e( 'Show values', 'wp-user-frontend' ); ?>
11
  </label>
12
  </li>
13
  <li>
@@ -15,9 +15,9 @@
15
  <input
16
  type="checkbox"
17
  v-model="sync_value"
18
- /><?php _e( 'Sync values', 'wp-user-frontend' ); ?>
19
  </label>
20
- <help-text placement="left" text="<?php _e( 'When enabled, option values will update according to their labels.', 'wp-user-frontend' ); ?>" />
21
  </li>
22
  </ul>
23
  </div>
@@ -29,11 +29,12 @@
29
  <div class="sort-handler">&nbsp;</div>
30
 
31
  <div class="label">
32
- <?php _e( 'Label', 'wp-user-frontend' ); ?>
 
33
  </div>
34
 
35
  <div v-if="show_value" class="value">
36
- <?php _e( 'Value', 'wp-user-frontend' ); ?>
37
  </div>
38
 
39
  <div class="action-buttons">&nbsp;</div>
@@ -81,5 +82,5 @@
81
  </li>
82
  </ul>
83
 
84
- <a v-if="!option_field.is_multiple && selected" href="#clear" @click.prevent="clear_selection"><?php _e( 'Clear Selection', 'wp-user-frontend' ); ?></a>
85
  </div>
7
  <input
8
  type="checkbox"
9
  v-model="show_value"
10
+ /><?php esc_attr_e( 'Show values', 'wp-user-frontend' ); ?>
11
  </label>
12
  </li>
13
  <li>
15
  <input
16
  type="checkbox"
17
  v-model="sync_value"
18
+ /><?php esc_attr_e( 'Sync values', 'wp-user-frontend' ); ?>
19
  </label>
20
+ <help-text placement="left" text="<?php esc_attr_e( 'When enabled, option values will update according to their labels.', 'wp-user-frontend' ); ?>" />
21
  </li>
22
  </ul>
23
  </div>
29
  <div class="sort-handler">&nbsp;</div>
30
 
31
  <div class="label">
32
+ <?php esc_attr_e( 'Label', 'wp-user-frontend' ); ?>
33
+ <help-text placement="left" text="<?php esc_attr_e( 'Do not use & or other special character for option label', 'wp-user-frontend' ); ?>" />
34
  </div>
35
 
36
  <div v-if="show_value" class="value">
37
+ <?php esc_attr_e( 'Value', 'wp-user-frontend' ); ?>
38
  </div>
39
 
40
  <div class="action-buttons">&nbsp;</div>
82
  </li>
83
  </ul>
84
 
85
+ <a v-if="!option_field.is_multiple && selected" href="#clear" @click.prevent="clear_selection"><?php esc_attr_e( 'Clear Selection', 'wp-user-frontend' ); ?></a>
86
  </div>
admin/html/whats-new.php CHANGED
@@ -1,5 +1,52 @@
1
  <?php
2
  $changelog = [
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  [
4
  'version' => 'Version 3.5.2',
5
  'released' => '2020-09-22',
1
  <?php
2
  $changelog = [
3
+ [
4
+ 'version' => 'Version 3.5.4',
5
+ 'released' => '2020-11-11',
6
+ 'changes' => [
7
+
8
+ [
9
+ 'title' => __( 'Get appropriate user id when role based conditions are present', 'wp-user-frontend' ),
10
+ 'type' => 'Fix',
11
+ ],
12
+ [
13
+ 'title' => __( 'Show Invalid subscription message if wrong pack id passed', 'wp-user-frontend' ),
14
+ 'type' => 'Fix',
15
+ ],
16
+ [
17
+ 'title' => __( 'URL field new window not working', 'wp-user-frontend' ),
18
+ 'type' => 'Fix',
19
+ ],
20
+ [
21
+ 'title' => __( 'Option label not working when & use', 'wp-user-frontend' ),
22
+ 'type' => 'Fix',
23
+ ],
24
+ [
25
+ 'title' => __( 'Ajax type category not showing on edit', 'wp-user-frontend' ),
26
+ 'type' => 'Fix'
27
+ ],
28
+ [
29
+ 'title' => __( 'Multiple file image can\'t select', 'wp-user-frontend' ),
30
+ 'type' => 'Fix',
31
+ ],
32
+ [
33
+ 'title' => __( 'Subscription pack PayPal Checkout gets "Error: Access Denied"', 'wp-user-frontend' ),
34
+ 'type' => 'Fix'
35
+ ],
36
+ [
37
+ 'title' => __( 'Conflict image field with acf image field', 'wp-user-frontend' ),
38
+ 'type' => 'Fix',
39
+ ],
40
+ [
41
+ 'title' => __( 'Missing Auckland State for New Zealand country', 'wp-user-frontend' ),
42
+ 'type' => 'Enhancement',
43
+ ],
44
+ [
45
+ 'title' => __( 'Added support for WooCommerce product category value replacemen', 'wp-user-frontend' ),
46
+ 'type' => 'Enhancement',
47
+ ],
48
+ ],
49
+ ],
50
  [
51
  'version' => 'Version 3.5.2',
52
  'released' => '2020-09-22',
assets/js-templates/form-components.php CHANGED
@@ -127,7 +127,7 @@
127
  <input
128
  type="checkbox"
129
  v-model="show_value"
130
- /><?php _e( 'Show values', 'wp-user-frontend' ); ?>
131
  </label>
132
  </li>
133
  <li>
@@ -135,9 +135,9 @@
135
  <input
136
  type="checkbox"
137
  v-model="sync_value"
138
- /><?php _e( 'Sync values', 'wp-user-frontend' ); ?>
139
  </label>
140
- <help-text placement="left" text="<?php _e( 'When enabled, option values will update according to their labels.', 'wp-user-frontend' ); ?>" />
141
  </li>
142
  </ul>
143
  </div>
@@ -149,11 +149,12 @@
149
  <div class="sort-handler">&nbsp;</div>
150
 
151
  <div class="label">
152
- <?php _e( 'Label', 'wp-user-frontend' ); ?>
 
153
  </div>
154
 
155
  <div v-if="show_value" class="value">
156
- <?php _e( 'Value', 'wp-user-frontend' ); ?>
157
  </div>
158
 
159
  <div class="action-buttons">&nbsp;</div>
@@ -201,7 +202,7 @@
201
  </li>
202
  </ul>
203
 
204
- <a v-if="!option_field.is_multiple && selected" href="#clear" @click.prevent="clear_selection"><?php _e( 'Clear Selection', 'wp-user-frontend' ); ?></a>
205
  </div>
206
  </script>
207
 
127
  <input
128
  type="checkbox"
129
  v-model="show_value"
130
+ /><?php esc_attr_e( 'Show values', 'wp-user-frontend' ); ?>
131
  </label>
132
  </li>
133
  <li>
135
  <input
136
  type="checkbox"
137
  v-model="sync_value"
138
+ /><?php esc_attr_e( 'Sync values', 'wp-user-frontend' ); ?>
139
  </label>
140
+ <help-text placement="left" text="<?php esc_attr_e( 'When enabled, option values will update according to their labels.', 'wp-user-frontend' ); ?>" />
141
  </li>
142
  </ul>
143
  </div>
149
  <div class="sort-handler">&nbsp;</div>
150
 
151
  <div class="label">
152
+ <?php esc_attr_e( 'Label', 'wp-user-frontend' ); ?>
153
+ <help-text placement="left" text="<?php esc_attr_e( 'Do not use & or other special character for option label', 'wp-user-frontend' ); ?>" />
154
  </div>
155
 
156
  <div v-if="show_value" class="value">
157
+ <?php esc_attr_e( 'Value', 'wp-user-frontend' ); ?>
158
  </div>
159
 
160
  <div class="action-buttons">&nbsp;</div>
202
  </li>
203
  </ul>
204
 
205
+ <a v-if="!option_field.is_multiple && selected" href="#clear" @click.prevent="clear_selection"><?php esc_attr_e( 'Clear Selection', 'wp-user-frontend' ); ?></a>
206
  </div>
207
  </script>
208
 
assets/js/billing-address.js CHANGED
@@ -81,8 +81,8 @@ jQuery(function($){
81
  function wpuf_calculate_tax() {
82
 
83
  var $wpuf_cc_address = jQuery('#wpuf-address-country-state');
84
- var $payment_form = jQuery('#wpuf-payment-gateway');
85
- var form = jQuery('#wpuf-ajax-address-form');
86
 
87
  var postData = {
88
  action: 'wpuf_update_billing_address',
@@ -94,7 +94,7 @@ jQuery(function($){
94
  billing_zip: $wpuf_cc_address.find('#wpuf_biiling_zip_code').val(),
95
  type: $payment_form.find('#wpuf_type').html(),
96
  id: $payment_form.find('#wpuf_id').html(),
97
- _wpnonce: form.find('#_wpnonce').val()
98
  };
99
 
100
  var current_ajax_count = ++ajax_tax_count;
81
  function wpuf_calculate_tax() {
82
 
83
  var $wpuf_cc_address = jQuery('#wpuf-address-country-state');
84
+ var $payment_form = jQuery('#wpuf-payment-gateway');
85
+ var $address_form = jQuery('#wpuf-ajax-address-form');
86
 
87
  var postData = {
88
  action: 'wpuf_update_billing_address',
94
  billing_zip: $wpuf_cc_address.find('#wpuf_biiling_zip_code').val(),
95
  type: $payment_form.find('#wpuf_type').html(),
96
  id: $payment_form.find('#wpuf_id').html(),
97
+ _wpnonce: $address_form.find('#_wpnonce').val(),
98
  };
99
 
100
  var current_ajax_count = ++ajax_tax_count;
assets/js/upload.js CHANGED
@@ -38,7 +38,6 @@
38
  action: 'wpuf_upload_file',
39
  form_id: $( '#' + browse_button ).data('form_id')
40
  },
41
- multi_selection: false,
42
  urlstream_upload: true,
43
  file_data_name: 'wpuf_file',
44
  max_file_size: max_file_size + 'kb',
38
  action: 'wpuf_upload_file',
39
  form_id: $( '#' + browse_button ).data('form_id')
40
  },
 
41
  urlstream_upload: true,
42
  file_data_name: 'wpuf_file',
43
  max_file_size: max_file_size + 'kb',
assets/js/upload.min.js CHANGED
@@ -1 +1 @@
1
- !function(a){window.WPUF_Uploader=function(b,c,d,e,f,g){if(this.removed_files=[],this.container=c,this.browse_button=b,this.max=d||1,this.count=a("#"+c).find(".wpuf-attachment-list > li").length,this.perFileCount=0,this.UploadedFiles=0,a("#"+b).length)return a("ul.wpuf-attachment-list").sortable({placeholder:"highlight"}),a("ul.wpuf-attachment-list").disableSelection(),this.uploader=new plupload.Uploader({runtimes:"html5,html4",browse_button:b,container:c,multipart:!0,multipart_params:{action:"wpuf_upload_file",form_id:a("#"+b).data("form_id")},multi_selection:!1,urlstream_upload:!0,file_data_name:"wpuf_file",max_file_size:g+"kb",url:wpuf_frontend_upload.plupload.url+"&type="+e,flash_swf_url:wpuf_frontend_upload.flash_swf_url,filters:[{title:"Allowed Files",extensions:f}]}),this.uploader.bind("Init",a.proxy(this,"init")),this.uploader.bind("FilesAdded",a.proxy(this,"added")),this.uploader.bind("QueueChanged",a.proxy(this,"upload")),this.uploader.bind("UploadProgress",a.proxy(this,"progress")),this.uploader.bind("Error",a.proxy(this,"error")),this.uploader.bind("FileUploaded",a.proxy(this,"uploaded")),this.uploader.init(),a("#"+c).on("click","a.attachment-delete",a.proxy(this.removeAttachment,this)),this.uploader},WPUF_Uploader.prototype={init:function(b,c){this.showHide(),a("#"+this.container).prepend('<div class="wpuf-file-warning"></div>')},showHide:function(){if(this.count>=this.max)return this.count,this.max,a("#"+this.container+" .wpuf-file-warning").html(wpuf_frontend_upload.warning),void a("#"+this.container).find(".file-selector").hide();a("#"+this.container+" .wpuf-file-warning").html(""),a("#"+this.container).find(".file-selector").show()},added:function(b,c){var d=a("#"+this.container).find(".wpuf-attachment-upload-filelist");this.showHide(),a.each(c,function(b,c){a(".wpuf-submit-button").attr("disabled","disabled"),d.append('<div class="upload-item" id="'+c.id+'"><div class="progress progress-striped active"><div class="bar"></div></div><div class="filename original">'+c.name+" ("+plupload.formatSize(c.size)+") <b></b></div></div>")}),b.refresh(),b.start()},upload:function(a){this.count=a.files.length-this.removed_files.length,this.showHide()},progress:function(b,c){var d=a("#"+c.id);a(".bar",d).css({width:c.percent+"%"}),a(".percent",d).html(c.percent+"%")},error:function(b,c){a("#"+this.container).find("#"+c.file.id).remove();var d="";switch(c.code){case-600:d=wpuf_frontend_upload.plupload.size_error;break;case-601:d=wpuf_frontend_upload.plupload.type_error;break;default:d="Error #"+c.code+": "+c.message}alert(d),this.count-=1,this.showHide(),this.uploader.refresh()},uploaded:function(b,c,d){var e=this;if(a("#"+c.id+" b").html("100%"),a("#"+c.id).remove(),"error"!==d.response){this.perFileCount++,this.UploadedFiles++;var f=a("#"+this.container).find(".wpuf-attachment-list");if(f.append(d.response),this.perFileCount>this.max){var g=a(".wpuf-image-wrap:last a.attachment-delete",f).data("attach-id");e.removeExtraAttachment(g),a(".wpuf-image-wrap",f).last().remove(),this.perFileCount--}}else alert(d.error),this.count-=1,this.showHide();var h=this.UploadedFiles,i=b.files.length;if(this.count>=this.max&&a("#"+this.container).find(".file-selector").hide(),i===h){if("undefined"!=typeof grecaptcha&&!grecaptcha.getResponse().length)return;a(".wpuf-submit-button").removeAttr("disabled")}},removeAttachment:function(b){b.preventDefault();var c=this,d=a(b.currentTarget);swal({text:wpuf_frontend_upload.confirmMsg,type:"warning",showCancelButton:!0,confirmButtonColor:"#d54e21",confirmButtonText:wpuf_frontend_upload.delete_it,cancelButtonText:wpuf_frontend_upload.cancel_it,confirmButtonClass:"btn btn-success",cancelButtonClass:"btn btn-danger"}).then(function(){var a={attach_id:d.data("attach-id"),nonce:wpuf_frontend_upload.nonce,action:"wpuf_file_del"};c.removed_files.push(a),jQuery("#del_attach").val(d.data("attach-id")),jQuery.post(wpuf_frontend_upload.ajaxurl,a,function(){c.perFileCount--,d.parent().parent().remove(),c.count-=1,c.showHide(),c.uploader.refresh()})})},removeExtraAttachment:function(a){var b=this,c={attach_id:a,nonce:wpuf_frontend_upload.nonce,action:"wpuf_file_del"};this.removed_files.push(c),jQuery.post(wpuf_frontend_upload.ajaxurl,c,function(){b.count-=1,b.showHide(),b.uploader.refresh()})}}}(jQuery);
1
+ !function(a){window.WPUF_Uploader=function(b,c,d,e,f,g){if(this.removed_files=[],this.container=c,this.browse_button=b,this.max=d||1,this.count=a("#"+c).find(".wpuf-attachment-list > li").length,this.perFileCount=0,this.UploadedFiles=0,a("#"+b).length)return a("ul.wpuf-attachment-list").sortable({placeholder:"highlight"}),a("ul.wpuf-attachment-list").disableSelection(),this.uploader=new plupload.Uploader({runtimes:"html5,html4",browse_button:b,container:c,multipart:!0,multipart_params:{action:"wpuf_upload_file",form_id:a("#"+b).data("form_id")},urlstream_upload:!0,file_data_name:"wpuf_file",max_file_size:g+"kb",url:wpuf_frontend_upload.plupload.url+"&type="+e,flash_swf_url:wpuf_frontend_upload.flash_swf_url,filters:[{title:"Allowed Files",extensions:f}]}),this.uploader.bind("Init",a.proxy(this,"init")),this.uploader.bind("FilesAdded",a.proxy(this,"added")),this.uploader.bind("QueueChanged",a.proxy(this,"upload")),this.uploader.bind("UploadProgress",a.proxy(this,"progress")),this.uploader.bind("Error",a.proxy(this,"error")),this.uploader.bind("FileUploaded",a.proxy(this,"uploaded")),this.uploader.init(),a("#"+c).on("click","a.attachment-delete",a.proxy(this.removeAttachment,this)),this.uploader},WPUF_Uploader.prototype={init:function(b,c){this.showHide(),a("#"+this.container).prepend('<div class="wpuf-file-warning"></div>')},showHide:function(){if(this.count>=this.max)return this.count,this.max,a("#"+this.container+" .wpuf-file-warning").html(wpuf_frontend_upload.warning),void a("#"+this.container).find(".file-selector").hide();a("#"+this.container+" .wpuf-file-warning").html(""),a("#"+this.container).find(".file-selector").show()},added:function(b,c){var d=a("#"+this.container).find(".wpuf-attachment-upload-filelist");this.showHide(),a.each(c,function(b,c){a(".wpuf-submit-button").attr("disabled","disabled"),d.append('<div class="upload-item" id="'+c.id+'"><div class="progress progress-striped active"><div class="bar"></div></div><div class="filename original">'+c.name+" ("+plupload.formatSize(c.size)+") <b></b></div></div>")}),b.refresh(),b.start()},upload:function(a){this.count=a.files.length-this.removed_files.length,this.showHide()},progress:function(b,c){var d=a("#"+c.id);a(".bar",d).css({width:c.percent+"%"}),a(".percent",d).html(c.percent+"%")},error:function(b,c){a("#"+this.container).find("#"+c.file.id).remove();var d="";switch(c.code){case-600:d=wpuf_frontend_upload.plupload.size_error;break;case-601:d=wpuf_frontend_upload.plupload.type_error;break;default:d="Error #"+c.code+": "+c.message}alert(d),this.count-=1,this.showHide(),this.uploader.refresh()},uploaded:function(b,c,d){var e=this;if(a("#"+c.id+" b").html("100%"),a("#"+c.id).remove(),"error"!==d.response){this.perFileCount++,this.UploadedFiles++;var f=a("#"+this.container).find(".wpuf-attachment-list");if(f.append(d.response),this.perFileCount>this.max){var g=a(".wpuf-image-wrap:last a.attachment-delete",f).data("attach-id");e.removeExtraAttachment(g),a(".wpuf-image-wrap",f).last().remove(),this.perFileCount--}}else alert(d.error),this.count-=1,this.showHide();var h=this.UploadedFiles,i=b.files.length;if(this.count>=this.max&&a("#"+this.container).find(".file-selector").hide(),i===h){if("undefined"!=typeof grecaptcha&&!grecaptcha.getResponse().length)return;a(".wpuf-submit-button").removeAttr("disabled")}},removeAttachment:function(b){b.preventDefault();var c=this,d=a(b.currentTarget);swal({text:wpuf_frontend_upload.confirmMsg,type:"warning",showCancelButton:!0,confirmButtonColor:"#d54e21",confirmButtonText:wpuf_frontend_upload.delete_it,cancelButtonText:wpuf_frontend_upload.cancel_it,confirmButtonClass:"btn btn-success",cancelButtonClass:"btn btn-danger"}).then(function(){var a={attach_id:d.data("attach-id"),nonce:wpuf_frontend_upload.nonce,action:"wpuf_file_del"};c.removed_files.push(a),jQuery("#del_attach").val(d.data("attach-id")),jQuery.post(wpuf_frontend_upload.ajaxurl,a,function(){c.perFileCount--,d.parent().parent().remove(),c.count-=1,c.showHide(),c.uploader.refresh()})})},removeExtraAttachment:function(a){var b=this,c={attach_id:a,nonce:wpuf_frontend_upload.nonce,action:"wpuf_file_del"};this.removed_files.push(c),jQuery.post(wpuf_frontend_upload.ajaxurl,c,function(){b.count-=1,b.showHide(),b.uploader.refresh()})}}}(jQuery);
changelog.txt CHANGED
@@ -1,3 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
  = v3.5.3 (21 October, 2020) =
2
  * Fix - Default post form is not showing on the frontend account
3
  * Fix - Missing featured image field when previewing a post form
1
+ = v3.5.4 (11 November, 2020) =
2
+ * Fix - Get appropriate user id when role based conditions are present
3
+ * Fix - Show Invalid subscription message if wrong pack id passed
4
+ * Fix - URL field new window not working
5
+ * Fix - Option label not working when & use
6
+ * Fix - Ajax type category not showing on edit
7
+ * Fix - Multiple file image can't select
8
+ * Fix - Subscription pack PayPal Checkout gets "Error: Access Denied"
9
+ * Fix - Conflict image field with acf image field
10
+ * Enhancement - Missing Auckland State for New Zealand country.
11
+ * Enhancement - Added support for WooCommerce product category value replacemen
12
+
13
  = v3.5.3 (21 October, 2020) =
14
  * Fix - Default post form is not showing on the frontend account
15
  * Fix - Missing featured image field when previewing a post form
class/payment.php CHANGED
@@ -22,7 +22,7 @@ class WPUF_Payment {
22
  'admin_label' => __( 'PayPal', 'wp-user-frontend' ),
23
  'checkout_label' => __( 'PayPal', 'wp-user-frontend' ),
24
  'icon' => apply_filters( 'wpuf_paypal_checkout_icon', WPUF_ASSET_URI . '/images/paypal.png' ),
25
- ],
26
  'bank' => [
27
  'admin_label' => __( 'Bank Payment', 'wp-user-frontend' ),
28
  'checkout_label' => __( 'Bank Payment', 'wp-user-frontend' ),
@@ -47,7 +47,7 @@ class WPUF_Payment {
47
 
48
  foreach ( $all_gateways as $id => $label ) {
49
  if ( array_key_exists( $id, $active_gateways ) ) {
50
- $gateways[$id] = $label;
51
  }
52
  }
53
 
@@ -68,25 +68,30 @@ class WPUF_Payment {
68
  $billing_amount = 0;
69
  $action = isset( $_REQUEST['action'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['action'] ) ) : '';
70
 
71
- if ( $action == 'wpuf_pay' && $pay_page == 0 ) {
72
  esc_html_e( 'Please select your payment page from admin panel', 'wp-user-frontend' );
73
 
74
  return;
75
  }
76
 
77
- if ( $post->ID == $pay_page && $action == 'wpuf_pay' ) {
78
- if ( !is_user_logged_in() ) {
79
- //return __( 'You are not logged in', 'wpuf' );
80
- }
81
  $get_type = isset( $_REQUEST['type'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['type'] ) ) : '';
82
- $type = ( $get_type == 'post' ) ? 'post' : 'pack';
83
  $post_id = isset( $_REQUEST['post_id'] ) ? intval( wp_unslash( $_REQUEST['post_id'] ) ) : 0;
84
  $pack_id = isset( $_REQUEST['pack_id'] ) ? intval( wp_unslash( $_REQUEST['pack_id'] ) ) : 0;
85
  $is_free = false;
86
 
87
  if ( $pack_id ) {
88
- $pack_detail = WPUF_Subscription::get_subscription( $pack_id );
89
- $recurring_pay = isset( $pack_detail->meta_value['recurring_pay'] ) ? $pack_detail->meta_value['recurring_pay'] : 'no';
 
 
 
 
 
 
 
 
90
 
91
  if ( empty( $pack_detail->meta_value['billing_amount'] ) || $pack_detail->meta_value['billing_amount'] <= 0 ) {
92
  $is_free = true;
@@ -114,51 +119,57 @@ class WPUF_Payment {
114
  $wpuf_subscription = WPUF_Subscription::init();
115
  $wpuf_user = new WPUF_User( $current_user->ID );
116
 
117
- if ( !$wpuf_user->subscription()->used_free_pack( $pack_id ) ) {
118
  wpuf_get_user( $current_user->ID )->subscription()->add_pack( $pack_id, null, false, 'free' );
119
  $wpuf_user->subscription()->add_free_pack( $current_user->ID, $pack_id );
120
 
121
  $message = apply_filters( 'wpuf_fp_activated_msg', __( 'Your free package has been activated. Enjoy!', 'wp-user-frontend' ) );
122
  } else {
123
  $message = apply_filters( 'wpuf_fp_activated_error', __( 'You already have activated a free package previously.', 'wp-user-frontend' ) );
124
- } ?>
 
125
  <div class="wpuf-info"><?php echo esc_html( $message ); ?></div>
126
  <?php
127
  } else {
128
  ?>
129
- <?php if ( count( $gateways ) ) {
 
130
  ?>
131
  <div class="wpuf-payment-page-wrap wpuf-pay-row">
132
- <?php
133
- $pay_page_style = ''; ?>
134
  <div class="wpuf-bill-addr-wrap wpuf-pay-col">
135
- <?php if ( wpuf_get_option( 'show_address', 'wpuf_address_options', false ) ) {
136
- $pay_page_style = 'vertical-align:top; margin-left: 20px; display: inline-block;'; ?>
137
- <div class="wpuf-bill-addr-info">
138
- <h3> <?php esc_html_e( 'Billing Address', 'wp-user-frontend' ); ?> </h3>
139
- <div class="wpuf-bill_addr-inner">
140
- <?php
141
- $add_form = new WPUF_Ajax_Address_Form();
142
- $add_form->wpuf_ajax_address_form();
143
- ?>
144
- </div>
 
145
  </div>
 
146
  <?php
147
- } ?>
 
148
  </div>
149
  <div class="wpuf-payment-gateway-wrap" style="<?php echo esc_attr( $pay_page_style ); ?>">
150
  <form id="wpuf-payment-gateway" action="" method="POST">
151
 
152
- <?php if ( $pack_id ) {
153
- $pack = WPUF_Subscription::init()->get_subscription( $pack_id );
154
- $details_meta = WPUF_Subscription::init()->get_details_meta_value();
155
- $currency = wpuf_get_currency( 'symbol' );
156
-
157
- if ( is_user_logged_in() ) {
 
 
 
 
 
158
  ?>
159
- <input type="hidden" name="user_id" value="<?php echo esc_attr( $current_user->ID ); ?>">
160
- <?php
161
- } ?>
162
 
163
  <div class="wpuf-coupon-info-wrap wpuf-pay-col">
164
  <div class="wpuf-coupon-info">
@@ -190,7 +201,8 @@ class WPUF_Payment {
190
 
191
  <div><?php esc_html_e( 'Total', 'wp-user-frontend' ); ?>: <strong><span id="wpuf_pay_page_total"><?php echo esc_attr( wpuf_format_price( $billing_amount ) ); ?></strong></span></div>
192
  <?php
193
- } ?>
 
194
  </div>
195
  </div>
196
  </div>
@@ -207,39 +219,41 @@ class WPUF_Payment {
207
  </div>
208
  <a href="#" class="wpuf-copon-show"><?php esc_html_e( 'Have a discount code?', 'wp-user-frontend' ); ?></a>
209
 
210
- <?php } // coupon?>
211
  </div>
212
 
213
- <?php
214
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
215
 
216
- if ( $post_id ) {
217
- $form = new WPUF_Form( get_post_meta( $post_id, '_wpuf_form_id', true ) );
218
- $force_pack = $form->is_enabled_force_pack();
219
- $pay_per_post = $form->is_enabled_pay_per_post();
220
- $fallback_enabled = $form->is_enabled_fallback_cost();
221
- $fallback_cost = (float) $form->get_subs_fallback_cost();
222
- $pay_per_post_cost = (float) $form->get_pay_per_post_cost();
223
- $current_user = wpuf_get_user();
224
-
225
- $current_pack = $current_user->subscription()->current_pack();
226
-
227
- if ( $force_pack && !is_wp_error( $current_pack ) && $fallback_enabled ) {
228
- $post_cost = $fallback_cost;
229
- $billing_amount = apply_filters( 'wpuf_payment_amount', $fallback_cost );
230
- } else {
231
- $post_cost = $pay_per_post_cost;
232
- $billing_amount = apply_filters( 'wpuf_payment_amount', $pay_per_post_cost );
233
- } ?>
234
- <div id="wpuf_type" style="display: none"><?php echo 'post'; ?></div>
235
- <div id="wpuf_id" style="display: none"><?php echo esc_attr( $post_id ); ?></div>
236
- <div><?php esc_html_e( 'Post cost', 'wp-user-frontend' ); ?>: <strong><span id="wpuf_pay_page_cost"><?php echo esc_attr( wpuf_format_price( $post_cost ) ); ?></strong></span></div>
237
-
238
- <?php do_action( 'wpuf_before_pack_payment_total' ); ?>
239
-
240
- <div><?php esc_html_e( 'Total', 'wp-user-frontend' ); ?>: <strong><span id="wpuf_pay_page_total"><?php echo esc_html( wpuf_format_price( $billing_amount ) ); ?></strong></span></div>
241
- <?php
242
- } ?>
243
  <?php wp_nonce_field( 'wpuf_payment_gateway' ); ?>
244
 
245
  <?php do_action( 'wpuf_before_payment_gateway' ); ?>
@@ -255,7 +269,7 @@ class WPUF_Payment {
255
  <?php
256
  echo esc_html( $gateway['label'] );
257
 
258
- if ( !empty( $gateway['icon'] ) ) {
259
  printf( ' <img src="%s" alt="image">', wp_kses_post( $gateway['icon'] ) );
260
  }
261
  ?>
@@ -287,8 +301,9 @@ class WPUF_Payment {
287
  </form>
288
  </div>
289
  </div>
290
- <?php
291
- } else { ?>
 
292
  <?php esc_html_e( 'No Payment gateway found', 'wp-user-frontend' ); ?>
293
  <?php } ?>
294
 
@@ -315,7 +330,7 @@ class WPUF_Payment {
315
  $action = isset( $_POST['action'] ) ? sanitize_text_field( wp_unslash( $_POST['action'] ) ) : '';
316
  $nonce = isset( $_POST['_wpnonce'] ) ? sanitize_key( wp_unslash( $_POST['_wpnonce'] ) ) : '';
317
 
318
- if ( $action == 'wpuf_pay' && isset( $nonce ) && wp_verify_nonce( $nonce, 'wpuf_payment_gateway' ) ) {
319
  $post_id = isset( $_REQUEST['post_id'] ) ? intval( wp_unslash( $_REQUEST['post_id'] ) ) : 0;
320
  $pack_id = isset( $_REQUEST['pack_id'] ) ? intval( wp_unslash( $_REQUEST['pack_id'] ) ) : 0;
321
  $gateway = isset( $_POST['wpuf_payment_method'] ) ? sanitize_text_field( wp_unslash( $_POST['wpuf_payment_method'] ) ) : '';
@@ -331,7 +346,7 @@ class WPUF_Payment {
331
 
332
  if ( $user_id ) {
333
  $userdata = get_userdata( $user_id );
334
- } elseif ( $type == 'post' && !is_user_logged_in() ) {
335
  $post = get_post( $post_id );
336
  $user_id = $post->post_author;
337
  $userdata = get_userdata( $user_id );
@@ -354,10 +369,10 @@ class WPUF_Payment {
354
  $fallback_on = $form->is_enabled_fallback_cost();
355
  $post_count = $current_user->subscription()->has_post_count( $form_settings['post_type'] );
356
 
357
- if ( $force_pack && $fallback_on && !is_wp_error( $current_pack ) && !$post_count ) {
358
- $amount = $form->get_subs_fallback_cost();
359
  } else {
360
- $amount = $form->get_pay_per_post_cost();
361
  }
362
  $item_number = $post->ID;
363
  $item_name = $post->post_title;
@@ -385,14 +400,13 @@ class WPUF_Payment {
385
  'first_name' => $userdata->first_name,
386
  'last_name' => $userdata->last_name,
387
  ],
388
- 'date' => date( 'Y-m-d H:i:s' ),
389
  'post_data' => $_POST,
390
  'custom' => isset( $custom ) ? $custom : '',
391
  ];
392
 
393
  if ( isset( $_POST['billing_address'] ) ) {
394
- $billing_address = wp_unslash( $_POST['billing_address'] );
395
- $address_fields = array_map( 'sanitize_text_field', $billing_address );
396
  } else {
397
  $address_fields = wpuf_get_user_address();
398
  }
@@ -426,13 +440,15 @@ class WPUF_Payment {
426
  $user_id = get_current_user_id();
427
 
428
  //check if it's already there
429
- $sql = $wpdb->prepare( 'SELECT transaction_id
430
- FROM ' . $wpdb->prefix . 'wpuf_transaction
431
- WHERE transaction_id = %s LIMIT 1', $transaction_id );
 
 
432
 
433
  $result = $wpdb->get_row( $sql );
434
 
435
- if ( $recurring != false ) {
436
  $profile_id = $data['profile_id'];
437
  }
438
 
@@ -456,16 +472,16 @@ class WPUF_Payment {
456
  $data['profile_id'] = $profile_id;
457
  }
458
 
459
- if ( !$result ) {
460
  $wpdb->insert( $wpdb->prefix . 'wpuf_transaction', $data );
461
 
462
  do_action( 'wpuf_payment_received', $data, $recurring );
463
  } else {
464
- $wpdb->update( $wpdb->prefix . 'wpuf_transaction', $data, ['transaction_id' => $transaction_id] );
465
  }
466
 
467
  //workaround for subscriptions can't be assigned from user profile regression
468
- if ( !did_action( 'wpuf_payment_received' ) ) {
469
  do_action( 'wpuf_payment_received', $data, $recurring );
470
  }
471
  }
@@ -477,7 +493,9 @@ class WPUF_Payment {
477
  */
478
  public function payment_notify_admin( $info ) {
479
  $headers = 'From: ' . get_bloginfo( 'name' ) . ' <' . get_bloginfo( 'admin_email' ) . '>' . "\r\n\\";
 
480
  $subject = sprintf( __( '[%s] Payment Received', 'wp-user-frontend' ), get_bloginfo( 'name' ) );
 
481
  $msg = sprintf( __( 'New payment received at %s', 'wp-user-frontend' ), get_bloginfo( 'name' ) );
482
 
483
  $receiver = get_bloginfo( 'admin_email' );
@@ -495,11 +513,11 @@ class WPUF_Payment {
495
  $nonce = isset( $_POST['wpuf_payment_cancel'] ) ? sanitize_text_field( wp_unslash( $_POST['wpuf_payment_cancel'] ) ) : '';
496
  $action = isset( $_POST['action'] ) ? sanitize_text_field( wp_unslash( $_POST['action'] ) ) : '';
497
 
498
- if ( !isset( $_POST['wpuf_payment_cancel_submit'] ) || $action != 'wpuf_cancel_pay' || !wp_verify_nonce( $nonce, '_wpnonce' ) ) {
499
  return;
500
  }
501
 
502
- $gateway = isset( $_POST['gateway'] ) ? sanitize_text_field( wp_unslash( $_POST['gateway'] ) ) : '';
503
 
504
  do_action( "wpuf_cancel_payment_{$gateway}", $_POST );
505
  }
22
  'admin_label' => __( 'PayPal', 'wp-user-frontend' ),
23
  'checkout_label' => __( 'PayPal', 'wp-user-frontend' ),
24
  'icon' => apply_filters( 'wpuf_paypal_checkout_icon', WPUF_ASSET_URI . '/images/paypal.png' ),
25
+ ],
26
  'bank' => [
27
  'admin_label' => __( 'Bank Payment', 'wp-user-frontend' ),
28
  'checkout_label' => __( 'Bank Payment', 'wp-user-frontend' ),
47
 
48
  foreach ( $all_gateways as $id => $label ) {
49
  if ( array_key_exists( $id, $active_gateways ) ) {
50
+ $gateways [ $id ] = $label;
51
  }
52
  }
53
 
68
  $billing_amount = 0;
69
  $action = isset( $_REQUEST['action'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['action'] ) ) : '';
70
 
71
+ if ( $action === 'wpuf_pay' && $pay_page === 0 ) {
72
  esc_html_e( 'Please select your payment page from admin panel', 'wp-user-frontend' );
73
 
74
  return;
75
  }
76
 
77
+ if ( $post->ID === $pay_page && $action === 'wpuf_pay' ) {
 
 
 
78
  $get_type = isset( $_REQUEST['type'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['type'] ) ) : '';
79
+ $type = ( $get_type === 'post' ) ? 'post' : 'pack';
80
  $post_id = isset( $_REQUEST['post_id'] ) ? intval( wp_unslash( $_REQUEST['post_id'] ) ) : 0;
81
  $pack_id = isset( $_REQUEST['pack_id'] ) ? intval( wp_unslash( $_REQUEST['pack_id'] ) ) : 0;
82
  $is_free = false;
83
 
84
  if ( $pack_id ) {
85
+ $pack_detail = WPUF_Subscription::get_subscription( $pack_id );
86
+
87
+ if ( ! $pack_detail ) {
88
+ ?>
89
+ <div class="wpuf-info"><?php esc_html_e( 'No subscription pack found.', 'wp-user-frontend' ); ?></div>
90
+ <?php
91
+ return;
92
+ }
93
+
94
+ $recurring_pay = isset( $pack_detail->meta_value['recurring_pay'] ) ? $pack_detail->meta_value['recurring_pay'] : 'no';
95
 
96
  if ( empty( $pack_detail->meta_value['billing_amount'] ) || $pack_detail->meta_value['billing_amount'] <= 0 ) {
97
  $is_free = true;
119
  $wpuf_subscription = WPUF_Subscription::init();
120
  $wpuf_user = new WPUF_User( $current_user->ID );
121
 
122
+ if ( ! $wpuf_user->subscription()->used_free_pack( $pack_id ) ) {
123
  wpuf_get_user( $current_user->ID )->subscription()->add_pack( $pack_id, null, false, 'free' );
124
  $wpuf_user->subscription()->add_free_pack( $current_user->ID, $pack_id );
125
 
126
  $message = apply_filters( 'wpuf_fp_activated_msg', __( 'Your free package has been activated. Enjoy!', 'wp-user-frontend' ) );
127
  } else {
128
  $message = apply_filters( 'wpuf_fp_activated_error', __( 'You already have activated a free package previously.', 'wp-user-frontend' ) );
129
+ }
130
+ ?>
131
  <div class="wpuf-info"><?php echo esc_html( $message ); ?></div>
132
  <?php
133
  } else {
134
  ?>
135
+ <?php
136
+ if ( count( $gateways ) ) {
137
  ?>
138
  <div class="wpuf-payment-page-wrap wpuf-pay-row">
139
+ <?php $pay_page_style = ''; ?>
 
140
  <div class="wpuf-bill-addr-wrap wpuf-pay-col">
141
+ <?php
142
+ if ( wpuf_get_option( 'show_address', 'wpuf_address_options', false ) ) {
143
+ $pay_page_style = 'vertical-align:top; margin-left: 20px; display: inline-block;';
144
+ ?>
145
+ <div class="wpuf-bill-addr-info">
146
+ <h3> <?php esc_html_e( 'Billing Address', 'wp-user-frontend' ); ?> </h3>
147
+ <div class="wpuf-bill_addr-inner">
148
+ <?php
149
+ $add_form = new WPUF_Ajax_Address_Form();
150
+ $add_form->wpuf_ajax_address_form();
151
+ ?>
152
  </div>
153
+ </div>
154
  <?php
155
+ }
156
+ ?>
157
  </div>
158
  <div class="wpuf-payment-gateway-wrap" style="<?php echo esc_attr( $pay_page_style ); ?>">
159
  <form id="wpuf-payment-gateway" action="" method="POST">
160
 
161
+ <?php
162
+ if ( $pack_id ) {
163
+ $pack = WPUF_Subscription::init()->get_subscription( $pack_id );
164
+ $details_meta = WPUF_Subscription::init()->get_details_meta_value();
165
+ $currency = wpuf_get_currency( 'symbol' );
166
+
167
+ if ( is_user_logged_in() ) {
168
+ ?>
169
+ <input type="hidden" name="user_id" value="<?php echo esc_attr( $current_user->ID ); ?>">
170
+ <?php
171
+ }
172
  ?>
 
 
 
173
 
174
  <div class="wpuf-coupon-info-wrap wpuf-pay-col">
175
  <div class="wpuf-coupon-info">
201
 
202
  <div><?php esc_html_e( 'Total', 'wp-user-frontend' ); ?>: <strong><span id="wpuf_pay_page_total"><?php echo esc_attr( wpuf_format_price( $billing_amount ) ); ?></strong></span></div>
203
  <?php
204
+ }
205
+ ?>
206
  </div>
207
  </div>
208
  </div>
219
  </div>
220
  <a href="#" class="wpuf-copon-show"><?php esc_html_e( 'Have a discount code?', 'wp-user-frontend' ); ?></a>
221
 
222
+ <?php } ?>
223
  </div>
224
 
225
+ <?php
226
+ }
227
+
228
+ if ( $post_id ) {
229
+ $form = new WPUF_Form( get_post_meta( $post_id, '_wpuf_form_id', true ) );
230
+ $force_pack = $form->is_enabled_force_pack();
231
+ $pay_per_post = $form->is_enabled_pay_per_post();
232
+ $fallback_enabled = $form->is_enabled_fallback_cost();
233
+ $fallback_cost = (float) $form->get_subs_fallback_cost();
234
+ $pay_per_post_cost = (float) $form->get_pay_per_post_cost();
235
+ $current_user = wpuf_get_user();
236
+
237
+ $current_pack = $current_user->subscription()->current_pack();
238
+
239
+ if ( $force_pack && ! is_wp_error( $current_pack ) && $fallback_enabled ) {
240
+ $post_cost = $fallback_cost;
241
+ $billing_amount = apply_filters( 'wpuf_payment_amount', $fallback_cost );
242
+ } else {
243
+ $post_cost = $pay_per_post_cost;
244
+ $billing_amount = apply_filters( 'wpuf_payment_amount', $pay_per_post_cost );
245
+ }
246
+ ?>
247
+ <div id="wpuf_type" style="display: none"><?php echo 'post'; ?></div>
248
+ <div id="wpuf_id" style="display: none"><?php echo esc_attr( $post_id ); ?></div>
249
+ <div><?php esc_html_e( 'Post cost', 'wp-user-frontend' ); ?>: <strong><span id="wpuf_pay_page_cost"><?php echo esc_attr( wpuf_format_price( $post_cost ) ); ?></strong></span></div>
250
 
251
+ <?php do_action( 'wpuf_before_pack_payment_total' ); ?>
252
+
253
+ <div><?php esc_html_e( 'Total', 'wp-user-frontend' ); ?>: <strong><span id="wpuf_pay_page_total"><?php echo esc_html( wpuf_format_price( $billing_amount ) ); ?></strong></span></div>
254
+ <?php
255
+ }
256
+ ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
257
  <?php wp_nonce_field( 'wpuf_payment_gateway' ); ?>
258
 
259
  <?php do_action( 'wpuf_before_payment_gateway' ); ?>
269
  <?php
270
  echo esc_html( $gateway['label'] );
271
 
272
+ if ( ! empty( $gateway['icon'] ) ) {
273
  printf( ' <img src="%s" alt="image">', wp_kses_post( $gateway['icon'] ) );
274
  }
275
  ?>
301
  </form>
302
  </div>
303
  </div>
304
+ <?php
305
+ } else {
306
+ ?>
307
  <?php esc_html_e( 'No Payment gateway found', 'wp-user-frontend' ); ?>
308
  <?php } ?>
309
 
330
  $action = isset( $_POST['action'] ) ? sanitize_text_field( wp_unslash( $_POST['action'] ) ) : '';
331
  $nonce = isset( $_POST['_wpnonce'] ) ? sanitize_key( wp_unslash( $_POST['_wpnonce'] ) ) : '';
332
 
333
+ if ( $action === 'wpuf_pay' && isset( $nonce ) && wp_verify_nonce( $nonce, 'wpuf_payment_gateway' ) ) {
334
  $post_id = isset( $_REQUEST['post_id'] ) ? intval( wp_unslash( $_REQUEST['post_id'] ) ) : 0;
335
  $pack_id = isset( $_REQUEST['pack_id'] ) ? intval( wp_unslash( $_REQUEST['pack_id'] ) ) : 0;
336
  $gateway = isset( $_POST['wpuf_payment_method'] ) ? sanitize_text_field( wp_unslash( $_POST['wpuf_payment_method'] ) ) : '';
346
 
347
  if ( $user_id ) {
348
  $userdata = get_userdata( $user_id );
349
+ } elseif ( $type === 'post' && ! is_user_logged_in() ) {
350
  $post = get_post( $post_id );
351
  $user_id = $post->post_author;
352
  $userdata = get_userdata( $user_id );
369
  $fallback_on = $form->is_enabled_fallback_cost();
370
  $post_count = $current_user->subscription()->has_post_count( $form_settings['post_type'] );
371
 
372
+ if ( $force_pack && $fallback_on && ! is_wp_error( $current_pack ) && ! $post_count ) {
373
+ $amount = $form->get_subs_fallback_cost();
374
  } else {
375
+ $amount = $form->get_pay_per_post_cost();
376
  }
377
  $item_number = $post->ID;
378
  $item_name = $post->post_title;
400
  'first_name' => $userdata->first_name,
401
  'last_name' => $userdata->last_name,
402
  ],
403
+ 'date' => gmdate( 'Y-m-d H:i:s' ),
404
  'post_data' => $_POST,
405
  'custom' => isset( $custom ) ? $custom : '',
406
  ];
407
 
408
  if ( isset( $_POST['billing_address'] ) ) {
409
+ $address_fields = array_map( 'sanitize_text_field', wp_unslash( $_POST['billing_address'] ) );
 
410
  } else {
411
  $address_fields = wpuf_get_user_address();
412
  }
440
  $user_id = get_current_user_id();
441
 
442
  //check if it's already there
443
+ $sql = $wpdb->prepare(
444
+ 'SELECT transaction_id
445
+ FROM ' . $wpdb->prefix . 'wpuf_transaction
446
+ WHERE transaction_id = %s LIMIT 1', $transaction_id
447
+ );
448
 
449
  $result = $wpdb->get_row( $sql );
450
 
451
+ if ( $recurring !== false ) {
452
  $profile_id = $data['profile_id'];
453
  }
454
 
472
  $data['profile_id'] = $profile_id;
473
  }
474
 
475
+ if ( ! $result ) {
476
  $wpdb->insert( $wpdb->prefix . 'wpuf_transaction', $data );
477
 
478
  do_action( 'wpuf_payment_received', $data, $recurring );
479
  } else {
480
+ $wpdb->update( $wpdb->prefix . 'wpuf_transaction', $data, [ 'transaction_id' => $transaction_id ] );
481
  }
482
 
483
  //workaround for subscriptions can't be assigned from user profile regression
484
+ if ( ! did_action( 'wpuf_payment_received' ) ) {
485
  do_action( 'wpuf_payment_received', $data, $recurring );
486
  }
487
  }
493
  */
494
  public function payment_notify_admin( $info ) {
495
  $headers = 'From: ' . get_bloginfo( 'name' ) . ' <' . get_bloginfo( 'admin_email' ) . '>' . "\r\n\\";
496
+ // translators: %s is site title name
497
  $subject = sprintf( __( '[%s] Payment Received', 'wp-user-frontend' ), get_bloginfo( 'name' ) );
498
+ // translators: %s is site title name
499
  $msg = sprintf( __( 'New payment received at %s', 'wp-user-frontend' ), get_bloginfo( 'name' ) );
500
 
501
  $receiver = get_bloginfo( 'admin_email' );
513
  $nonce = isset( $_POST['wpuf_payment_cancel'] ) ? sanitize_text_field( wp_unslash( $_POST['wpuf_payment_cancel'] ) ) : '';
514
  $action = isset( $_POST['action'] ) ? sanitize_text_field( wp_unslash( $_POST['action'] ) ) : '';
515
 
516
+ if ( ! isset( $_POST['wpuf_payment_cancel_submit'] ) || $action !== 'wpuf_cancel_pay' || ! wp_verify_nonce( $nonce, '_wpnonce' ) ) {
517
  return;
518
  }
519
 
520
+ $gateway = isset( $_POST['gateway'] ) ? sanitize_text_field( wp_unslash( $_POST['gateway'] ) ) : '';
521
 
522
  do_action( "wpuf_cancel_payment_{$gateway}", $_POST );
523
  }
includes/class-frontend-form-post.php CHANGED
@@ -3,14 +3,14 @@
3
  class WPUF_Frontend_Form extends WPUF_Frontend_Render_Form {
4
  private static $_instance;
5
 
6
- private $post_expiration_date = 'wpuf-post_expiration_date';
7
 
8
- private $expired_post_status = 'wpuf-expired_post_status';
9
 
10
  private $post_expiration_message = 'wpuf-post_expiration_message';
11
 
12
  public function __construct() {
13
- add_shortcode( 'wpuf_form', [ $this, 'add_post_shortcode'] );
14
  add_shortcode( 'wpuf_edit', [ $this, 'edit_post_shortcode' ] );
15
  // ajax requests
16
  add_action( 'wp_ajax_wpuf_form_preview', [ $this, 'preview_form' ] );
@@ -42,9 +42,11 @@ class WPUF_Frontend_Form extends WPUF_Frontend_Render_Form {
42
  * @return
43
  **/
44
  public function edit_post_shortcode( $atts ) {
45
- add_filter( 'wpuf-form-fields', [ $this, 'add_field_settings'] );
46
-
47
  extract( shortcode_atts( [ 'id' => 0 ], $atts ) );
 
 
48
  ob_start();
49
 
50
  global $userdata;
@@ -61,18 +63,18 @@ class WPUF_Frontend_Form extends WPUF_Frontend_Render_Form {
61
 
62
  $post_id = isset( $_GET['pid'] ) ? intval( wp_unslash( $_GET['pid'] ) ) : 0;
63
 
64
- if ( !$post_id ) {
65
  return '<div class="wpuf-info">' . __( 'Invalid post', 'wp-user-frontend' ) . '</div>';
66
  }
67
 
68
  $edit_post_lock = get_post_meta( $post_id, '_wpuf_lock_editing_post', true );
69
  $edit_post_lock_time = get_post_meta( $post_id, '_wpuf_lock_user_editing_post_time', true );
70
 
71
- if ( $edit_post_lock == 'yes' ) {
72
  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>';
73
  }
74
 
75
- if ( !empty( $edit_post_lock_time ) && $edit_post_lock_time < time() ) {
76
  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>';
77
  }
78
 
@@ -85,47 +87,47 @@ class WPUF_Frontend_Form extends WPUF_Frontend_Render_Form {
85
  }
86
 
87
  //is editing enabled?
88
- if ( wpuf_get_option( 'enable_post_edit', 'wpuf_dashboard', 'yes' ) != 'yes' ) {
89
  return '<div class="wpuf-info">' . __( 'Post Editing is disabled', 'wp-user-frontend' ) . '</div>';
90
  }
91
 
92
  $curpost = get_post( $post_id );
93
 
94
- if ( !$curpost ) {
95
  return '<div class="wpuf-info">' . __( 'Invalid post', 'wp-user-frontend' );
96
  }
97
 
98
  // has permission?
99
- if ( !current_user_can( 'delete_others_posts' ) && ( $userdata->ID != $curpost->post_author ) ) {
100
  return '<div class="wpuf-info">' . __( 'You are not allowed to edit', 'wp-user-frontend' ) . '</div>';
101
  }
102
 
103
- $form_id = get_post_meta( $post_id, self::$config_id, true );
104
 
105
  // fallback to default form
106
- if ( !$form_id ) {
107
  $form_id = wpuf_get_option( 'default_post_form', 'wpuf_frontend_posting' );
108
  }
109
 
110
- if ( !$form_id ) {
111
  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>';
112
  }
113
 
114
  $form = new WPUF_Form( $form_id );
115
 
116
- $this->form_fields = $form->get_fields();
117
  // $form_settings = wpuf_get_form_settings( $form_id );
118
- $this->form_settings = $form->get_settings();
119
 
120
  $disable_pending_edit = wpuf_get_option( 'disable_pending_edit', 'wpuf_dashboard', 'on' );
121
 
122
- if ( $curpost->post_status == 'pending' && $disable_pending_edit == 'on' ) {
123
  return '<div class="wpuf-info">' . __( 'You can\'t edit a post while in pending mode.', 'wp-user-frontend' );
124
  }
125
 
126
  $msg = isset( $_GET['msg'] ) ? sanitize_text_field( wp_unslash( $_GET['msg'] ) ) : '';
127
 
128
- if ( $msg == 'post_updated' ) {
129
  echo wp_kses_post( '<div class="wpuf-success">' );
130
  echo wp_kses_post( str_replace( '%link%', get_permalink( $post_id ), $this->form_settings['update_message'] ) );
131
  echo wp_kses_post( '</div>' );
@@ -141,7 +143,7 @@ class WPUF_Frontend_Form extends WPUF_Frontend_Render_Form {
141
  }
142
 
143
  public static function init() {
144
- if ( !self::$_instance ) {
145
  self::$_instance = new self();
146
  }
147
 
@@ -149,18 +151,19 @@ class WPUF_Frontend_Form extends WPUF_Frontend_Render_Form {
149
  }
150
 
151
  /**
152
- * this will embed media to the editor
153
  */
154
  public function make_media_embed_code() {
155
  $nonce = isset( $_GET['nonce'] ) ? sanitize_key( wp_unslash( $_GET['nonce'] ) ) : '';
156
 
157
- if ( isset( $nonce ) && !wp_verify_nonce( $nonce, 'wpuf-upload-nonce' ) ) {
158
- return ;
159
  }
160
 
161
  $content = isset( $_POST['content'] ) ? sanitize_text_field( wp_unslash( $_POST['content'] ) ) : '';
 
162
 
163
- if ( $embed_code = wp_oembed_get( $content ) ) {
164
  echo esc_html( $embed_code );
165
  } else {
166
  echo '';
@@ -173,7 +176,7 @@ class WPUF_Frontend_Form extends WPUF_Frontend_Render_Form {
173
  */
174
  public function draft_post() {
175
  check_ajax_referer( 'wpuf_form_add' );
176
- add_filter( 'wpuf-form-fields', [ $this, 'add_field_settings'] );
177
  @header( 'Content-Type: application/json; charset=' . get_option( 'blog_charset' ) );
178
 
179
  $form_id = isset( $_POST['form_id'] ) ? intval( wp_unslash( $_POST['form_id'] ) ) : 0;
@@ -182,11 +185,11 @@ class WPUF_Frontend_Form extends WPUF_Frontend_Render_Form {
182
  $this->form_fields = $form->get_fields();
183
  $pay_per_post = $form->is_enabled_pay_per_post();
184
 
185
- list( $post_vars, $taxonomy_vars, $meta_vars ) =$this->get_input_fields( $this->form_fields );
186
 
187
  $entry_fields = $form->prepare_entries();
188
  $allowed_tags = wp_kses_allowed_html( 'post' );
189
- $post_content = isset( $_POST[ 'post_content' ] ) ? wp_kses( wp_unslash( $_POST[ 'post_content' ] ), $allowed_tags ) : '';
190
  $postarr = [
191
  'post_type' => $this->form_settings['post_type'],
192
  'post_status' => wpuf_get_draft_post_status( $this->form_settings ),
@@ -198,7 +201,7 @@ class WPUF_Frontend_Form extends WPUF_Frontend_Render_Form {
198
 
199
  if ( ! empty( $this->form_fields ) ) {
200
  foreach ( $this->form_fields as $field ) {
201
- if ( $field['template'] == 'taxonomy' ) {
202
  $category_name = $field['name'];
203
 
204
  if ( isset( $_POST[ $category_name ] ) && is_array( $_POST[ $category_name ] ) ) { // WPCS: sanitization ok.
@@ -207,7 +210,7 @@ class WPUF_Frontend_Form extends WPUF_Frontend_Render_Form {
207
  $category = isset( $_POST[ $category_name ] ) ? sanitize_text_field( wp_unslash( $_POST[ $category_name ] ) ) : '';
208
  }
209
 
210
- if ( $category != '' && $category != '0' && $category[0] != '-1' ) {
211
  if ( ! is_array( $category ) && is_string( $category ) ) {
212
  $category_strings = explode( ',', $category );
213
  $cat_ids = [];
@@ -225,7 +228,7 @@ class WPUF_Frontend_Form extends WPUF_Frontend_Render_Form {
225
  }
226
 
227
  // set default post category if it's not been set yet and if post type supports
228
- if ( !isset( $postarr['post_category'] ) && isset( $this->form_settings['default_cat'] ) && is_object_in_taxonomy( $this->form_settings['post_type'], 'category' ) ) {
229
  if ( is_array( $this->form_settings['default_cat'] ) ) {
230
  $postarr['post_category'] = $this->form_settings['default_cat'];
231
  } else {
@@ -256,7 +259,7 @@ class WPUF_Frontend_Form extends WPUF_Frontend_Render_Form {
256
  update_post_meta( $post_id, self::$config_id, $form_id );
257
 
258
  // save post formats if have any
259
- if ( isset( $this->form_settings['post_format'] ) && $this->form_settings['post_format'] != '0' ) {
260
  if ( post_type_supports( $this->form_settings['post_type'], 'post-formats' ) ) {
261
  set_post_format( $post_id, $this->form_settings['post_format'] );
262
  }
@@ -267,7 +270,7 @@ class WPUF_Frontend_Form extends WPUF_Frontend_Render_Form {
267
  update_post_meta( $post_id, '_wpuf_payment_status', 'pending' );
268
  }
269
 
270
- if ( !empty( $taxonomy_vars ) ) {
271
  $this->set_custom_taxonomy( $post_id, $taxonomy_vars );
272
  } else {
273
  $this->set_default_taxonomy( $post_id );
@@ -280,13 +283,13 @@ class WPUF_Frontend_Form extends WPUF_Frontend_Render_Form {
280
  wpuf_clear_buffer();
281
 
282
  echo json_encode( [
283
- 'post_id' => $post_id,
284
- 'action' => isset( $_POST['action'] ) ? sanitize_text_field( wp_unslash( $_POST['action'] ) ) : '',
285
- 'date' => current_time( 'mysql' ),
286
- 'post_author' => get_current_user_id(),
287
- 'comment_status' => get_option( 'default_comment_status' ),
288
- 'url' => add_query_arg( 'preview', 'true', get_permalink( $post_id ) ),
289
- ] );
290
 
291
  exit;
292
  }
@@ -298,7 +301,7 @@ class WPUF_Frontend_Form extends WPUF_Frontend_Render_Form {
298
  */
299
  public function submit_post() {
300
  check_ajax_referer( 'wpuf_form_add' );
301
- add_filter( 'wpuf-form-fields', [ $this, 'add_field_settings'] );
302
  @header( 'Content-Type: application/json; charset=' . get_option( 'blog_charset' ) );
303
 
304
  $form_id = isset( $_POST['form_id'] ) ? intval( wp_unslash( $_POST['form_id'] ) ) : 0;
@@ -313,13 +316,13 @@ class WPUF_Frontend_Form extends WPUF_Frontend_Render_Form {
313
  wp_delete_attachment( $attach_id, true );
314
  }
315
 
316
- list( $post_vars, $taxonomy_vars, $meta_vars ) =$this->get_input_fields( $this->form_fields );
317
 
318
- if ( !isset( $_POST['post_id'] ) ) {
319
- $has_limit = ( isset( $this->form_settings['limit_entries'] ) && $this->form_settings['limit_entries'] == 'true' ) ? true : false;
320
 
321
  if ( $has_limit ) {
322
- $limit = (int) !empty( $this->form_settings['limit_number'] ) ? $this->form_settings['limit_number'] : 0;
323
  $form_entries = wpuf_form_posts_count( $form_id );
324
 
325
  if ( $limit && $limit <= $form_entries ) {
@@ -341,7 +344,7 @@ class WPUF_Frontend_Form extends WPUF_Frontend_Render_Form {
341
  'post_author' => $post_author,
342
  'post_title' => isset( $_POST['post_title'] ) ? sanitize_text_field( wp_unslash( $_POST['post_title'] ) ) : '',
343
  'post_content' => isset( $_POST['post_content'] ) ? wp_kses( wp_unslash( $_POST['post_content'] ), $allowed_tags ) : '',
344
- 'post_excerpt' => isset( $_POST['post_excerpt'] ) ? wp_kses( wp_unslash( $_POST['post_excerpt'] ),$allowed_tags ) : '',
345
  ];
346
 
347
  // $charging_enabled = wpuf_get_option( 'charge_posting', 'wpuf_payment' );
@@ -351,33 +354,33 @@ class WPUF_Frontend_Form extends WPUF_Frontend_Render_Form {
351
  $ppp_cost_enabled = $form->is_enabled_pay_per_post();
352
  $current_user = wpuf_get_user();
353
 
354
- if ( !$payment_options ) {
355
  $charging_enabled = 'no';
356
  } else {
357
  $charging_enabled = 'yes';
358
  }
359
 
360
- if ( $guest_mode == 'true' && $guest_verify == 'true' && !is_user_logged_in() && $charging_enabled == 'yes' ) {
361
  $postarr['post_status'] = wpuf_get_draft_post_status( $this->form_settings );
362
- } elseif ( $guest_mode == 'true' && $guest_verify == 'true' && !is_user_logged_in() ) {
363
  $postarr['post_status'] = 'draft';
364
  }
365
  //if date is set and assigned as publish date
366
  if ( isset( $_POST['wpuf_is_publish_time'] ) ) {
367
- if ( isset( $_POST[$_POST['wpuf_is_publish_time']] ) && !empty( $_POST[$_POST['wpuf_is_publish_time']] ) ) {
368
  // $postarr['post_date'] = date( 'Y-m-d H:i:s', strtotime( str_replace( array( ':', '/' ), '-', $_POST[$_POST['wpuf_is_publish_time']] ) ) );
369
- $date_time = explode( ' ', sanitize_text_field( wp_unslash( ( $_POST[$_POST['wpuf_is_publish_time']] ) ) ) );
370
 
371
- if ( !empty( $date_time[0] ) ) {
372
  $timestamp = strtotime( str_replace( [ '/' ], '-', $date_time[0] ) );
373
  }
374
 
375
- if ( !empty( $date_time[1] ) ) {
376
  $time = explode( ':', $date_time[1] );
377
  $seconds = ( $time[0] * 60 * 60 ) + ( $time[1] * 60 );
378
  $timestamp = $timestamp + $seconds;
379
  }
380
- $postarr['post_date'] = date( 'Y-m-d H:i:s', $timestamp );
381
  }
382
  }
383
 
@@ -387,8 +390,8 @@ class WPUF_Frontend_Form extends WPUF_Frontend_Render_Form {
387
  $category = isset( $_POST['category'] ) ? sanitize_text_field( wp_unslash( $_POST['category'] ) ) : '';
388
  }
389
 
390
- if ( $category != '' && $category != '0' && $category[0] != '-1' ) {
391
- if ( !is_array( $category ) && is_string( $category ) ) {
392
  $category_strings = explode( ',', $category );
393
  $cat_ids = [];
394
 
@@ -397,7 +400,7 @@ class WPUF_Frontend_Form extends WPUF_Frontend_Render_Form {
397
  $postarr['post_category'] = $cat_ids;
398
  }
399
  } else {
400
- $postarr['post_category'] =$category;
401
  }
402
  }
403
 
@@ -417,11 +420,11 @@ class WPUF_Frontend_Form extends WPUF_Frontend_Render_Form {
417
 
418
  $menu_order = get_post_field( 'menu_order', $post_id );
419
 
420
- if ( !empty( $menu_order ) ) {
421
  $postarr['menu_order'] = $menu_order;
422
  }
423
 
424
- if ( $this->form_settings['edit_post_status'] == '_nochange' ) {
425
  $postarr['post_status'] = get_post_field( 'post_status', $post_id );
426
  } else {
427
  $postarr['post_status'] = $this->form_settings['edit_post_status'];
@@ -436,12 +439,12 @@ class WPUF_Frontend_Form extends WPUF_Frontend_Render_Form {
436
  // in that case, it already has the post_id field
437
  // so, WPUF's add post action/filters won't work for new posts
438
  $wpuf_form_status = isset( $_POST['wpuf_form_status'] ) ? sanitize_text_field( wp_unslash( $_POST['wpuf_form_status'] ) ) : '';
439
- if ( $wpuf_form_status == 'new' ) {
440
  $is_update = false;
441
  }
442
 
443
  // set default post category if it's not been set yet and if post type supports
444
- if ( !isset( $postarr['post_category'] ) && isset( $this->form_settings['default_cat'] ) && is_object_in_taxonomy( $this->form_settings['post_type'], 'category' ) ) {
445
  if ( is_array( $this->form_settings['default_cat'] ) ) {
446
  $postarr['post_category'] = $this->form_settings['default_cat'];
447
  } else {
@@ -456,7 +459,7 @@ class WPUF_Frontend_Form extends WPUF_Frontend_Render_Form {
456
  $error = apply_filters( 'wpuf_add_post_validate', '' );
457
  }
458
 
459
- if ( !empty( $error ) ) {
460
  $this->send_error( $error );
461
  }
462
  // ############ It's Time to Save the World ###############
@@ -473,11 +476,11 @@ class WPUF_Frontend_Form extends WPUF_Frontend_Render_Form {
473
 
474
  // add _wpuf_lock_editing_post_time meta to
475
  // lock user from editing the published post after a certain time
476
- if ( !$is_update ) {
477
  $lock_edit_post = isset( $this->form_settings['lock_edit_post'] ) ? floatval( $this->form_settings['lock_edit_post'] ) : 0;
478
 
479
  if ( $post_id && $lock_edit_post > 0 ) {
480
- $lock_edit_post_time = time() + ( $lock_edit_post * 60 * 60 );
481
  update_post_meta( $post_id, '_wpuf_lock_user_editing_post_time', $lock_edit_post_time );
482
  }
483
  }
@@ -492,15 +495,15 @@ class WPUF_Frontend_Form extends WPUF_Frontend_Render_Form {
492
  update_post_meta( $post_id, self::$config_id, $form_id );
493
 
494
  // save post formats if have any
495
- if ( isset( $this->form_settings['post_format'] ) && $this->form_settings['post_format'] != '0' ) {
496
  if ( post_type_supports( $this->form_settings['post_type'], 'post-formats' ) ) {
497
  set_post_format( $post_id, $this->form_settings['post_format'] );
498
  }
499
  }
500
 
501
  // find our if any images in post content and associate them
502
- if ( !empty( $postarr['post_content'] ) ) {
503
- $dom = new DOMDocument();
504
  @$dom->loadHTML( $postarr['post_content'] );
505
  $images = $dom->getElementsByTagName( 'img' );
506
 
@@ -517,7 +520,7 @@ class WPUF_Frontend_Form extends WPUF_Frontend_Render_Form {
517
  }
518
  }
519
 
520
- if ( !empty( $taxonomy_vars ) ) {
521
  $this->set_custom_taxonomy( $post_id, $taxonomy_vars );
522
  } else {
523
  $this->set_default_taxonomy( $post_id );
@@ -533,21 +536,21 @@ class WPUF_Frontend_Form extends WPUF_Frontend_Render_Form {
533
  public function wpuf_get_post_user() {
534
  $nonce = isset( $_REQUEST['_wpnonce'] ) ? sanitize_key( wp_unslash( $_REQUEST['_wpnonce'] ) ) : '';
535
 
536
- if ( isset( $nonce ) && ! wp_verify_nonce( $nonce, 'wpuf_form_add' ) ) {
537
- return ;
538
  }
539
 
540
  $default_post_author = wpuf_get_option( 'default_post_owner', 'wpuf_frontend_posting', 1 );
541
 
542
- if ( !is_user_logged_in() ) {
543
- if ( isset( $this->form_settings['guest_post'] ) && $this->form_settings['guest_post'] == 'true' && $this->form_settings['guest_details'] == 'true' ) {
544
- $guest_name = isset( $_POST['guest_name'] ) ? sanitize_text_field( wp_unslash( $_POST['guest_name'] ) ) : '';
545
 
546
  $guest_email = isset( $_POST['guest_email'] ) ? sanitize_email( wp_unslash( $_POST['guest_email'] ) ) : '';
547
  $page_id = isset( $_POST['page_id'] ) ? sanitize_text_field( wp_unslash( $_POST['page_id'] ) ) : '';
548
 
549
  // is valid email?
550
- if ( !is_email( $guest_email ) ) {
551
  $this->send_error( __( 'Invalid email address.', 'wp-user-frontend' ) );
552
  }
553
 
@@ -561,12 +564,12 @@ class WPUF_Frontend_Form extends WPUF_Frontend_Render_Form {
561
  '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' ),
562
  'type' => 'login',
563
  'redirect_to' => wp_login_url( get_permalink( $page_id ) ),
564
- ] );
565
  } else {
566
 
567
  // user not found, lets register him
568
  // username from email address
569
- $username = $this->guess_username( $guest_email );
570
 
571
  $user_pass = wp_generate_password( 12, false );
572
 
@@ -578,7 +581,7 @@ class WPUF_Frontend_Form extends WPUF_Frontend_Render_Form {
578
 
579
  // if its a success and no errors found
580
 
581
- if ( $user_id && !is_wp_error( $user_id ) ) {
582
  update_user_option( $user_id, 'default_password_nag', true, true ); //Set up the Password change nag.
583
 
584
  if ( class_exists( 'Theme_My_Login_Custom_Email' ) ) {
@@ -588,7 +591,10 @@ class WPUF_Frontend_Form extends WPUF_Frontend_Render_Form {
588
  }
589
 
590
  // update display name to full name
591
- wp_update_user( [ 'ID' => $user_id, 'display_name' => $guest_name ] );
 
 
 
592
 
593
  $post_author = $user_id;
594
  } else {
@@ -598,17 +604,15 @@ class WPUF_Frontend_Form extends WPUF_Frontend_Render_Form {
598
  }
599
 
600
  // guest post is enabled and details are off
601
- } elseif ( isset( $this->form_settings['guest_post'] ) && $this->form_settings['guest_post'] == 'true' && $this->form_settings['guest_details'] == 'false' ) {
602
  $post_author = $default_post_author;
603
- } elseif ( isset( $this->form_settings['guest_post'] ) && $this->form_settings['guest_post'] != 'true' ) {
604
  $this->send_error( $this->form_settings['message_restrict'] );
605
  }
606
 
607
  // the user must be logged in already
608
- } elseif ( isset( $this->form_settings['role_base'] ) && $this->form_settings['role_base'] == 'true' ) {
609
- if ( ! wpuf_user_has_roles( $this->form_settings['roles'] ) ) {
610
  $this->send_error( __( 'You do not have sufficient permissions to access this form.', 'wp-user-frontend' ) );
611
- }
612
  } else {
613
  $post_author = get_current_user_id();
614
  }
@@ -616,7 +620,7 @@ class WPUF_Frontend_Form extends WPUF_Frontend_Render_Form {
616
  return $post_author;
617
  }
618
 
619
- /**w
620
  * Add post shortcode handler
621
  *
622
  * @param array $atts
@@ -624,8 +628,12 @@ class WPUF_Frontend_Form extends WPUF_Frontend_Render_Form {
624
  */
625
 
626
  public function add_post_shortcode( $atts ) {
627
- add_filter( 'wpuf-form-fields', [ $this, 'add_field_settings'] );
 
 
628
  extract( shortcode_atts( [ 'id' => 0 ], $atts ) );
 
 
629
  ob_start();
630
  $form = new WPUF_Form( $id );
631
  $this->form_fields = $form->get_fields();
@@ -634,7 +642,7 @@ class WPUF_Frontend_Form extends WPUF_Frontend_Render_Form {
634
  $info = apply_filters( 'wpuf_addpost_notice', $info, $id, $this->form_settings );
635
  $user_can_post = apply_filters( 'wpuf_can_post', $user_can_post, $id, $this->form_settings );
636
 
637
- if ( $user_can_post == 'yes' ) {
638
  $this->render_form( $id, null, $atts, $form );
639
  } else {
640
  echo wp_kses_post( '<div class="wpuf-info">' . $info . '</div>' );
@@ -650,7 +658,9 @@ class WPUF_Frontend_Form extends WPUF_Frontend_Render_Form {
650
  // prepare the meta vars
651
  list( $meta_key_value, $multi_repeated, $files ) = self::prepare_meta_fields( $meta_vars );
652
  // set featured image if there's any
653
- $wpuf_files = isset( $_POST['wpuf_files'] ) ? wp_unslash( $_POST['wpuf_files'] ) : [];
 
 
654
 
655
  if ( isset( $wpuf_files['featured_image'] ) ) {
656
  $attachment_id = $wpuf_files['featured_image'][0];
@@ -658,8 +668,9 @@ class WPUF_Frontend_Form extends WPUF_Frontend_Render_Form {
658
  wpuf_associate_attachment( $attachment_id, $post_id );
659
  set_post_thumbnail( $post_id, $attachment_id );
660
 
661
- $file_data = isset( $_POST['wpuf_files_data'][$attachment_id] ) ? wp_unslash( $_POST['wpuf_files_data'][$attachment_id] ) : false;
662
 
 
663
  if ( $file_data ) {
664
  $args = [
665
  'ID' => $attachment_id,
@@ -696,15 +707,15 @@ class WPUF_Frontend_Form extends WPUF_Frontend_Render_Form {
696
 
697
  $image_ids = '';
698
 
699
- if ( count( $file_input['value'] ) > 1 ) {
700
  $image_ids = $file_input['value'];
701
  }
702
 
703
- if ( count( $file_input['value'] ) == 1 ) {
704
  $image_ids = $file_input['value'][0];
705
  }
706
 
707
- if ( !empty( $image_ids ) ) {
708
  add_post_meta( $post_id, $file_input['name'], $image_ids );
709
  }
710
 
@@ -723,8 +734,11 @@ class WPUF_Frontend_Form extends WPUF_Frontend_Render_Form {
723
  //add_post_meta( $post_id, $file_input['name'], $attachment_id );
724
 
725
  // file title, caption, desc update
726
- $file_data = isset( $_POST['wpuf_files_data'][$attachment_id] ) ? wp_unslash( $_POST['wpuf_files_data'][$attachment_id] ) : false;
727
 
 
 
 
 
728
  if ( $file_data ) {
729
  $args = [
730
  'ID' => $attachment_id,
@@ -745,8 +759,20 @@ class WPUF_Frontend_Form extends WPUF_Frontend_Render_Form {
745
  $user = get_user_by( 'id', $user_id );
746
  $post = get_post( $post_id );
747
 
748
- $post_field_search = [ '%post_title%', '%post_content%', '%post_excerpt%', '%tags%', '%category%',
749
- '%author%', '%author_email%', '%author_bio%', '%sitename%', '%siteurl%', '%permalink%', '%editlink%', ];
 
 
 
 
 
 
 
 
 
 
 
 
750
 
751
  $home_url = sprintf( '<a href="%s">%s</a>', home_url(), home_url() );
752
  $post_url = sprintf( '<a href="%s">%s</a>', get_permalink( $post_id ), get_permalink( $post_id ) );
@@ -767,6 +793,11 @@ class WPUF_Frontend_Form extends WPUF_Frontend_Render_Form {
767
  $post_edit_link,
768
  ];
769
 
 
 
 
 
 
770
  $content = str_replace( $post_field_search, $post_field_replace, $content );
771
 
772
  // custom fields
@@ -775,11 +806,10 @@ class WPUF_Frontend_Form extends WPUF_Frontend_Render_Form {
775
 
776
  if ( $replace ) {
777
  foreach ( $replace as $index => $meta_key ) {
778
- $value = get_post_meta( $post_id, $meta_key, false );
779
-
780
  if ( isset( $value[0] ) && is_array( $value[0] ) ) {
781
  $new_value = implode( '; ', $value[0] );
782
-
783
  } else {
784
  $new_value = implode( '; ', $value );
785
  }
@@ -788,16 +818,16 @@ class WPUF_Frontend_Form extends WPUF_Frontend_Render_Form {
788
  $meta_val = '';
789
 
790
  if ( count( $value ) > 1 ) {
791
- $isFirst = true;
792
 
793
  foreach ( $value as $val ) {
794
- if ( $isFirst ) {
795
  if ( get_post_mime_type( (int) $val ) ) {
796
  $meta_val = wp_get_attachment_url( $val );
797
  } else {
798
  $meta_val = $val;
799
  }
800
- $isFirst = false;
801
  } else {
802
  if ( get_post_mime_type( (int) $val ) ) {
803
  $meta_val = $meta_val . ', ' . wp_get_attachment_url( $val );
@@ -814,7 +844,7 @@ class WPUF_Frontend_Form extends WPUF_Frontend_Render_Form {
814
  }
815
  $original_value = $original_value . $meta_val;
816
  } else {
817
- if ( 'address_field' == $meta_key ) {
818
  $value = get_post_meta( $post_id, $meta_key, true );
819
  $new_value = implode( ', ', $value );
820
  }
@@ -826,7 +856,7 @@ class WPUF_Frontend_Form extends WPUF_Frontend_Render_Form {
826
  }
827
  }
828
 
829
- $content = str_replace( $search[$index], $original_value, $content );
830
  }
831
  }
832
 
@@ -835,12 +865,12 @@ class WPUF_Frontend_Form extends WPUF_Frontend_Render_Form {
835
 
836
  public function woo_attribute( $taxonomy ) {
837
  check_ajax_referer( 'wpuf_form_add' );
838
- $taxonomy_name = isset( $_POST[$taxonomy['name']] ) ? sanitize_text_field( wp_unslash( $_POST[$taxonomy['name']] ) ) : '';
839
 
840
  return [
841
  'name' => $taxonomy['name'],
842
  'value' => $taxonomy_name,
843
- 'is_visible' => $taxonomy['woo_attr_vis'] == 'yes' ? 1 : 0,
844
  'is_variation' => 0,
845
  'is_taxonomy' => 1,
846
  ];
@@ -856,7 +886,7 @@ class WPUF_Frontend_Form extends WPUF_Frontend_Render_Form {
856
  $pid = isset( $_GET['p_id'] ) ? sanitize_text_field( wp_unslash( $_GET['p_id'] ) ) : '';
857
  $fid = isset( $_GET['f_id'] ) ? sanitize_text_field( wp_unslash( $_GET['f_id'] ) ) : '';
858
 
859
- if ( $post_msg == 'verified' ) {
860
  $response = [];
861
  $post_id = wpuf_decryption( $pid );
862
  $form_id = wpuf_decryption( $fid );
@@ -868,13 +898,16 @@ class WPUF_Frontend_Form extends WPUF_Frontend_Render_Form {
868
  $force_pack = $form->is_enabled_force_pack();
869
 
870
  if ( $form->is_charging_enabled() && $pay_per_post ) {
871
- if ( ( $payment_status->get_payment_status( $post_id ) ) == 'pending' ) {
872
  $response['show_message'] = true;
873
- $response['redirect_to'] = add_query_arg( [
874
- 'action' => 'wpuf_pay',
875
- 'type' => 'post',
876
- 'post_id' => $post_id,
877
- ], get_permalink( wpuf_get_option( 'payment_page', 'wpuf_payment' ) ) );
 
 
 
878
 
879
  wp_redirect( $response['redirect_to'] );
880
  wpuf_clear_buffer();
@@ -885,57 +918,58 @@ class WPUF_Frontend_Form extends WPUF_Frontend_Render_Form {
885
 
886
  if ( $p_status ) {
887
  wp_update_post( [
888
- 'ID' => $post_id,
889
- 'post_status' => isset( $form_settings['post_status'] ) ? $form_settings['post_status'] : 'publish',
890
  ] );
 
891
  echo wp_kses_post( "<div class='wpuf-success' style='text-align:center'>" . __( 'Email successfully verified. Please Login.', 'wp-user-frontend' ) . '</div>' );
892
  }
893
  }
894
  }
895
  }
896
 
897
- public function wpuf_user_subscription_pack( $form_settings, $post_id=null ) {
898
 
899
  // if user has a subscription pack
900
  $user_wpuf_subscription_pack = get_user_meta( get_current_user_id(), '_wpuf_subscription_pack', true );
901
 
902
- if ( !empty( $user_wpuf_subscription_pack ) && isset( $user_wpuf_subscription_pack['_enable_post_expiration'] )
903
  && isset( $user_wpuf_subscription_pack['expire'] ) && strtotime( $user_wpuf_subscription_pack['expire'] ) >= time() ) {
904
- $expire_date = date( 'Y-m-d', strtotime( '+' . $user_wpuf_subscription_pack['_post_expiration_time'] ) );
905
  update_post_meta( $post_id, $this->post_expiration_date, $expire_date );
906
  // save post status after expiration
907
  $expired_post_status = $user_wpuf_subscription_pack['_expired_post_status'];
908
  update_post_meta( $post_id, $this->expired_post_status, $expired_post_status );
909
  // if mail active
910
- if ( isset( $user_wpuf_subscription_pack['_enable_mail_after_expired'] ) && $user_wpuf_subscription_pack['_enable_mail_after_expired'] == 'on' ) {
911
  $wpuf_user = wpuf_get_user();
912
  $user_subscription = new WPUF_User_Subscription( $wpuf_user );
913
  $post_expiration_message = $user_subscription->get_subscription_exp_msg( $user_wpuf_subscription_pack['pack_id'] );
914
  update_post_meta( $post_id, $this->post_expiration_message, $post_expiration_message );
915
  }
916
- } elseif ( !empty( $user_wpuf_subscription_pack ) && isset( $user_wpuf_subscription_pack['expire'] ) && strtotime( $user_wpuf_subscription_pack['expire'] ) <= time() ) {
917
  if ( isset( $form_settings['expiration_settings']['enable_post_expiration'] ) ) {
918
- $expire_date = date( 'Y-m-d', strtotime( '+' . $form_settings['expiration_settings']['expiration_time_value'] . ' ' . $form_settings['expiration_settings']['expiration_time_type'] . '' ) );
919
 
920
  update_post_meta( $post_id, $this->post_expiration_date, $expire_date );
921
  // save post status after expiration
922
  $expired_post_status = $form_settings['expiration_settings']['expired_post_status'];
923
  update_post_meta( $post_id, $this->expired_post_status, $expired_post_status );
924
  // if mail active
925
- if ( isset( $form_settings['expiration_settings']['enable_mail_after_expired'] ) && $form_settings['expiration_settings']['enable_mail_after_expired'] == 'on' ) {
926
  $post_expiration_message = $form_settings['expiration_settings']['post_expiration_message'];
927
  update_post_meta( $post_id, $this->post_expiration_message, $post_expiration_message );
928
  }
929
  }
930
- } elseif ( empty( $user_wpuf_subscription_pack ) || $user_wpuf_subscription_pack == 'Cancel' || $user_wpuf_subscription_pack == 'cancel' ) {
931
  if ( isset( $form_settings['expiration_settings']['enable_post_expiration'] ) ) {
932
- $expire_date = date( 'Y-m-d', strtotime( '+' . $form_settings['expiration_settings']['expiration_time_value'] . ' ' . $form_settings['expiration_settings']['expiration_time_type'] . '' ) );
933
  update_post_meta( $post_id, $this->post_expiration_date, $expire_date );
934
  // save post status after expiration
935
  $expired_post_status = $form_settings['expiration_settings']['expired_post_status'];
936
  update_post_meta( $post_id, $this->expired_post_status, $expired_post_status );
937
  // if mail active
938
- if ( isset( $form_settings['expiration_settings']['enable_mail_after_expired'] ) && $form_settings['expiration_settings']['enable_mail_after_expired'] == 'on' ) {
939
  $post_expiration_message = $form_settings['expiration_settings']['post_expiration_message'];
940
  update_post_meta( $post_id, $this->post_expiration_message, $post_expiration_message );
941
  }
@@ -952,41 +986,46 @@ class WPUF_Frontend_Form extends WPUF_Frontend_Render_Form {
952
  $page_id = isset( $_POST['page_id'] ) ? intval( wp_unslash( $_POST['page_id'] ) ) : '';
953
 
954
  if ( $is_update ) {
955
- if ( $this->form_settings['edit_redirect_to'] == 'page' ) {
956
  $redirect_to = get_permalink( $this->form_settings['edit_page_id'] );
957
- } elseif ( $this->form_settings['edit_redirect_to'] == 'url' ) {
958
  $redirect_to = $this->form_settings['edit_url'];
959
- } elseif ( $this->form_settings['edit_redirect_to'] == 'same' ) {
960
- $redirect_to = add_query_arg( [
961
- 'pid' => $post_id,
962
- '_wpnonce' => wp_create_nonce( 'wpuf_edit' ),
963
- 'msg' => 'post_updated',
964
- ], get_permalink( $page_id ) );
 
 
 
965
  } else {
966
  $redirect_to = get_permalink( $post_id );
967
  }
968
  } else {
969
- if ( $this->form_settings['redirect_to'] == 'page' ) {
970
  $redirect_to = get_permalink( $this->form_settings['page_id'] );
971
- } elseif ( $this->form_settings['redirect_to'] == 'url' ) {
972
  $redirect_to = $this->form_settings['url'];
973
- } elseif ( $this->form_settings['redirect_to'] == 'same' ) {
974
  $show_message = true;
975
  } else {
976
  $redirect_to = get_permalink( $post_id );
977
  }
978
  }
979
 
980
- if (
981
- isset( $this->form_settings['enable_pay_per_post'] )
982
  && wpuf_validate_boolean( $this->form_settings['enable_pay_per_post'] )
983
- && ! $is_update
984
  ) {
985
- $redirect_to = add_query_arg( [
986
- 'action' => 'wpuf_pay',
987
- 'type' => 'post',
988
- 'post_id' => $post_id,
989
- ], get_permalink( wpuf_get_option( 'payment_page', 'wpuf_payment' ) ) );
 
 
 
990
  }
991
 
992
  $response = [
@@ -999,7 +1038,7 @@ class WPUF_Frontend_Form extends WPUF_Frontend_Render_Form {
999
  $guest_mode = isset( $this->form_settings['guest_post'] ) ? $this->form_settings['guest_post'] : '';
1000
  $guest_verify = isset( $this->form_settings['guest_email_verify'] ) ? $this->form_settings['guest_email_verify'] : 'false';
1001
 
1002
- if ( $guest_mode == 'true' && $guest_verify == 'true' && !is_user_logged_in() && $charging_enabled != 'yes' ) {
1003
  $post_id_encoded = wpuf_encryption( $post_id );
1004
  $form_id_encoded = wpuf_encryption( $form_id );
1005
 
@@ -1008,7 +1047,7 @@ class WPUF_Frontend_Form extends WPUF_Frontend_Render_Form {
1008
  $response['show_message'] = true;
1009
  $response['redirect_to'] = add_query_arg( $wp->query_string, '', home_url( $wp->request ) );
1010
  $response['message'] = __( 'Thank you for posting on our site. We have sent you an confirmation email. Please check your inbox!', 'wp-user-frontend' );
1011
- } elseif ( $guest_mode == 'true' && $guest_verify == 'true' && !is_user_logged_in() && $charging_enabled == 'yes' ) {
1012
  $post_id_encoded = wpuf_encryption( $post_id );
1013
  $form_id_encoded = wpuf_encryption( $form_id );
1014
  $response['show_message'] = true;
@@ -1019,14 +1058,14 @@ class WPUF_Frontend_Form extends WPUF_Frontend_Render_Form {
1019
  wpuf_send_mail_to_guest( $post_id_encoded, $form_id_encoded, 'yes', 2 );
1020
  }
1021
 
1022
- if ( $guest_mode == 'true' && $guest_verify == 'true' && !is_user_logged_in() ) {
1023
  $response = apply_filters( 'wpuf_edit_post_redirect', $response, $post_id, $form_id, $this->form_settings );
1024
  } elseif ( $is_update ) {
1025
  //now perform some post related actions
1026
  do_action( 'wpuf_edit_post_after_update', $post_id, $form_id, $this->form_settings, $this->form_fields ); // plugin API to extend the functionality
1027
-
1028
  //send mail notification
1029
- if ( isset( $this->form_settings['notification'] ) && $this->form_settings['notification']['edit'] == 'on' ) {
1030
  $mail_body = $this->prepare_mail_body( $this->form_settings['notification']['edit_body'], $post_author, $post_id );
1031
  $to = $this->prepare_mail_body( $this->form_settings['notification']['edit_to'], $post_author, $post_id );
1032
  $subject = $this->prepare_mail_body( $this->form_settings['notification']['edit_subject'], $post_author, $post_id );
@@ -1041,9 +1080,9 @@ class WPUF_Frontend_Form extends WPUF_Frontend_Render_Form {
1041
  } else {
1042
  //now perform some post related actions
1043
  do_action( 'wpuf_add_post_after_insert', $post_id, $form_id, $this->form_settings, $meta_vars ); // plugin API to extend the functionality
1044
-
1045
  // send mail notification
1046
- if ( isset( $this->form_settings['notification'] ) && $this->form_settings['notification']['new'] == 'on' ) {
1047
  $mail_body = $this->prepare_mail_body( $this->form_settings['notification']['new_body'], $post_author, $post_id );
1048
  $to = $this->prepare_mail_body( $this->form_settings['notification']['new_to'], $post_author, $post_id );
1049
  $subject = $this->prepare_mail_body( $this->form_settings['notification']['new_subject'], $post_author, $post_id );
3
  class WPUF_Frontend_Form extends WPUF_Frontend_Render_Form {
4
  private static $_instance;
5
 
6
+ private $post_expiration_date = 'wpuf-post_expiration_date';
7
 
8
+ private $expired_post_status = 'wpuf-expired_post_status';
9
 
10
  private $post_expiration_message = 'wpuf-post_expiration_message';
11
 
12
  public function __construct() {
13
+ add_shortcode( 'wpuf_form', [ $this, 'add_post_shortcode' ] );
14
  add_shortcode( 'wpuf_edit', [ $this, 'edit_post_shortcode' ] );
15
  // ajax requests
16
  add_action( 'wp_ajax_wpuf_form_preview', [ $this, 'preview_form' ] );
42
  * @return
43
  **/
44
  public function edit_post_shortcode( $atts ) {
45
+ add_filter( 'wpuf-form-fields', [ $this, 'add_field_settings' ] );
46
+ // @codingStandardsIgnoreStart
47
  extract( shortcode_atts( [ 'id' => 0 ], $atts ) );
48
+
49
+ // @codingStandardsIgnoreEnd
50
  ob_start();
51
 
52
  global $userdata;
63
 
64
  $post_id = isset( $_GET['pid'] ) ? intval( wp_unslash( $_GET['pid'] ) ) : 0;
65
 
66
+ if ( ! $post_id ) {
67
  return '<div class="wpuf-info">' . __( 'Invalid post', 'wp-user-frontend' ) . '</div>';
68
  }
69
 
70
  $edit_post_lock = get_post_meta( $post_id, '_wpuf_lock_editing_post', true );
71
  $edit_post_lock_time = get_post_meta( $post_id, '_wpuf_lock_user_editing_post_time', true );
72
 
73
+ if ( $edit_post_lock === 'yes' ) {
74
  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>';
75
  }
76
 
77
+ if ( ! empty( $edit_post_lock_time ) && $edit_post_lock_time < time() ) {
78
  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>';
79
  }
80
 
87
  }
88
 
89
  //is editing enabled?
90
+ if ( wpuf_get_option( 'enable_post_edit', 'wpuf_dashboard', 'yes' ) !== 'yes' ) {
91
  return '<div class="wpuf-info">' . __( 'Post Editing is disabled', 'wp-user-frontend' ) . '</div>';
92
  }
93
 
94
  $curpost = get_post( $post_id );
95
 
96
+ if ( ! $curpost ) {
97
  return '<div class="wpuf-info">' . __( 'Invalid post', 'wp-user-frontend' );
98
  }
99
 
100
  // has permission?
101
+ if ( ! current_user_can( 'delete_others_posts' ) && ( $userdata->ID !== $curpost->post_author ) ) {
102
  return '<div class="wpuf-info">' . __( 'You are not allowed to edit', 'wp-user-frontend' ) . '</div>';
103
  }
104
 
105
+ $form_id = get_post_meta( $post_id, self::$config_id, true );
106
 
107
  // fallback to default form
108
+ if ( ! $form_id ) {
109
  $form_id = wpuf_get_option( 'default_post_form', 'wpuf_frontend_posting' );
110
  }
111
 
112
+ if ( ! $form_id ) {
113
  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>';
114
  }
115
 
116
  $form = new WPUF_Form( $form_id );
117
 
118
+ $this->form_fields = $form->get_fields();
119
  // $form_settings = wpuf_get_form_settings( $form_id );
120
+ $this->form_settings = $form->get_settings();
121
 
122
  $disable_pending_edit = wpuf_get_option( 'disable_pending_edit', 'wpuf_dashboard', 'on' );
123
 
124
+ if ( $curpost->post_status === 'pending' && $disable_pending_edit === 'on' ) {
125
  return '<div class="wpuf-info">' . __( 'You can\'t edit a post while in pending mode.', 'wp-user-frontend' );
126
  }
127
 
128
  $msg = isset( $_GET['msg'] ) ? sanitize_text_field( wp_unslash( $_GET['msg'] ) ) : '';
129
 
130
+ if ( $msg === 'post_updated' ) {
131
  echo wp_kses_post( '<div class="wpuf-success">' );
132
  echo wp_kses_post( str_replace( '%link%', get_permalink( $post_id ), $this->form_settings['update_message'] ) );
133
  echo wp_kses_post( '</div>' );
143
  }
144
 
145
  public static function init() {
146
+ if ( ! self::$_instance ) {
147
  self::$_instance = new self();
148
  }
149
 
151
  }
152
 
153
  /**
154
+ * This will embed media to the editor
155
  */
156
  public function make_media_embed_code() {
157
  $nonce = isset( $_GET['nonce'] ) ? sanitize_key( wp_unslash( $_GET['nonce'] ) ) : '';
158
 
159
+ if ( isset( $nonce ) && ! wp_verify_nonce( $nonce, 'wpuf-upload-nonce' ) ) {
160
+ return;
161
  }
162
 
163
  $content = isset( $_POST['content'] ) ? sanitize_text_field( wp_unslash( $_POST['content'] ) ) : '';
164
+ $embed_code = wp_oembed_get( $content );
165
 
166
+ if ( $embed_code ) {
167
  echo esc_html( $embed_code );
168
  } else {
169
  echo '';
176
  */
177
  public function draft_post() {
178
  check_ajax_referer( 'wpuf_form_add' );
179
+ add_filter( 'wpuf-form-fields', [ $this, 'add_field_settings' ] );
180
  @header( 'Content-Type: application/json; charset=' . get_option( 'blog_charset' ) );
181
 
182
  $form_id = isset( $_POST['form_id'] ) ? intval( wp_unslash( $_POST['form_id'] ) ) : 0;
185
  $this->form_fields = $form->get_fields();
186
  $pay_per_post = $form->is_enabled_pay_per_post();
187
 
188
+ list( $post_vars, $taxonomy_vars, $meta_vars ) = $this->get_input_fields( $this->form_fields );
189
 
190
  $entry_fields = $form->prepare_entries();
191
  $allowed_tags = wp_kses_allowed_html( 'post' );
192
+ $post_content = isset( $_POST['post_content'] ) ? wp_kses( wp_unslash( $_POST['post_content'] ), $allowed_tags ) : '';
193
  $postarr = [
194
  'post_type' => $this->form_settings['post_type'],
195
  'post_status' => wpuf_get_draft_post_status( $this->form_settings ),
201
 
202
  if ( ! empty( $this->form_fields ) ) {
203
  foreach ( $this->form_fields as $field ) {
204
+ if ( $field['template'] === 'taxonomy' ) {
205
  $category_name = $field['name'];
206
 
207
  if ( isset( $_POST[ $category_name ] ) && is_array( $_POST[ $category_name ] ) ) { // WPCS: sanitization ok.
210
  $category = isset( $_POST[ $category_name ] ) ? sanitize_text_field( wp_unslash( $_POST[ $category_name ] ) ) : '';
211
  }
212
 
213
+ if ( $category !== '' && $category !== '0' && $category[0] !== '-1' ) {
214
  if ( ! is_array( $category ) && is_string( $category ) ) {
215
  $category_strings = explode( ',', $category );
216
  $cat_ids = [];
228
  }
229
 
230
  // set default post category if it's not been set yet and if post type supports
231
+ if ( ! isset( $postarr['post_category'] ) && isset( $this->form_settings['default_cat'] ) && is_object_in_taxonomy( $this->form_settings['post_type'], 'category' ) ) {
232
  if ( is_array( $this->form_settings['default_cat'] ) ) {
233
  $postarr['post_category'] = $this->form_settings['default_cat'];
234
  } else {
259
  update_post_meta( $post_id, self::$config_id, $form_id );
260
 
261
  // save post formats if have any
262
+ if ( isset( $this->form_settings['post_format'] ) && $this->form_settings['post_format'] !== '0' ) {
263
  if ( post_type_supports( $this->form_settings['post_type'], 'post-formats' ) ) {
264
  set_post_format( $post_id, $this->form_settings['post_format'] );
265
  }
270
  update_post_meta( $post_id, '_wpuf_payment_status', 'pending' );
271
  }
272
 
273
+ if ( ! empty( $taxonomy_vars ) ) {
274
  $this->set_custom_taxonomy( $post_id, $taxonomy_vars );
275
  } else {
276
  $this->set_default_taxonomy( $post_id );
283
  wpuf_clear_buffer();
284
 
285
  echo json_encode( [
286
+ 'post_id' => $post_id,
287
+ 'action' => isset( $_POST['action'] ) ? sanitize_text_field( wp_unslash( $_POST['action'] ) ) : '',
288
+ 'date' => current_time( 'mysql' ),
289
+ 'post_author' => get_current_user_id(),
290
+ 'comment_status' => get_option( 'default_comment_status' ),
291
+ 'url' => add_query_arg( 'preview', 'true', get_permalink( $post_id ) ),
292
+ ] );
293
 
294
  exit;
295
  }
301
  */
302
  public function submit_post() {
303
  check_ajax_referer( 'wpuf_form_add' );
304
+ add_filter( 'wpuf-form-fields', [ $this, 'add_field_settings' ] );
305
  @header( 'Content-Type: application/json; charset=' . get_option( 'blog_charset' ) );
306
 
307
  $form_id = isset( $_POST['form_id'] ) ? intval( wp_unslash( $_POST['form_id'] ) ) : 0;
316
  wp_delete_attachment( $attach_id, true );
317
  }
318
 
319
+ list( $post_vars, $taxonomy_vars, $meta_vars ) = $this->get_input_fields( $this->form_fields );
320
 
321
+ if ( ! isset( $_POST['post_id'] ) ) {
322
+ $has_limit = ( isset( $this->form_settings['limit_entries'] ) && $this->form_settings['limit_entries'] === 'true' ) ? true : false;
323
 
324
  if ( $has_limit ) {
325
+ $limit = (int) ! empty( $this->form_settings['limit_number'] ) ? $this->form_settings['limit_number'] : 0;
326
  $form_entries = wpuf_form_posts_count( $form_id );
327
 
328
  if ( $limit && $limit <= $form_entries ) {
344
  'post_author' => $post_author,
345
  'post_title' => isset( $_POST['post_title'] ) ? sanitize_text_field( wp_unslash( $_POST['post_title'] ) ) : '',
346
  'post_content' => isset( $_POST['post_content'] ) ? wp_kses( wp_unslash( $_POST['post_content'] ), $allowed_tags ) : '',
347
+ 'post_excerpt' => isset( $_POST['post_excerpt'] ) ? wp_kses( wp_unslash( $_POST['post_excerpt'] ), $allowed_tags ) : '',
348
  ];
349
 
350
  // $charging_enabled = wpuf_get_option( 'charge_posting', 'wpuf_payment' );
354
  $ppp_cost_enabled = $form->is_enabled_pay_per_post();
355
  $current_user = wpuf_get_user();
356
 
357
+ if ( ! $payment_options ) {
358
  $charging_enabled = 'no';
359
  } else {
360
  $charging_enabled = 'yes';
361
  }
362
 
363
+ if ( $guest_mode === 'true' && $guest_verify === 'true' && ! is_user_logged_in() && $charging_enabled === 'yes' ) {
364
  $postarr['post_status'] = wpuf_get_draft_post_status( $this->form_settings );
365
+ } elseif ( $guest_mode === 'true' && $guest_verify === 'true' && ! is_user_logged_in() ) {
366
  $postarr['post_status'] = 'draft';
367
  }
368
  //if date is set and assigned as publish date
369
  if ( isset( $_POST['wpuf_is_publish_time'] ) ) {
370
+ if ( isset( $_POST[ $_POST['wpuf_is_publish_time'] ] ) && ! empty( $_POST[ $_POST['wpuf_is_publish_time'] ] ) ) {
371
  // $postarr['post_date'] = date( 'Y-m-d H:i:s', strtotime( str_replace( array( ':', '/' ), '-', $_POST[$_POST['wpuf_is_publish_time']] ) ) );
372
+ $date_time = explode( ' ', sanitize_text_field( wp_unslash( ( $_POST[ $_POST['wpuf_is_publish_time'] ] ) ) ) );
373
 
374
+ if ( ! empty( $date_time[0] ) ) {
375
  $timestamp = strtotime( str_replace( [ '/' ], '-', $date_time[0] ) );
376
  }
377
 
378
+ if ( ! empty( $date_time[1] ) ) {
379
  $time = explode( ':', $date_time[1] );
380
  $seconds = ( $time[0] * 60 * 60 ) + ( $time[1] * 60 );
381
  $timestamp = $timestamp + $seconds;
382
  }
383
+ $postarr['post_date'] = gmdate( 'Y-m-d H:i:s', $timestamp );
384
  }
385
  }
386
 
390
  $category = isset( $_POST['category'] ) ? sanitize_text_field( wp_unslash( $_POST['category'] ) ) : '';
391
  }
392
 
393
+ if ( $category !== '' && $category !== '0' && $category[0] !== '-1' ) {
394
+ if ( ! is_array( $category ) && is_string( $category ) ) {
395
  $category_strings = explode( ',', $category );
396
  $cat_ids = [];
397
 
400
  $postarr['post_category'] = $cat_ids;
401
  }
402
  } else {
403
+ $postarr['post_category'] = $category;
404
  }
405
  }
406
 
420
 
421
  $menu_order = get_post_field( 'menu_order', $post_id );
422
 
423
+ if ( ! empty( $menu_order ) ) {
424
  $postarr['menu_order'] = $menu_order;
425
  }
426
 
427
+ if ( $this->form_settings['edit_post_status'] === '_nochange' ) {
428
  $postarr['post_status'] = get_post_field( 'post_status', $post_id );
429
  } else {
430
  $postarr['post_status'] = $this->form_settings['edit_post_status'];
439
  // in that case, it already has the post_id field
440
  // so, WPUF's add post action/filters won't work for new posts
441
  $wpuf_form_status = isset( $_POST['wpuf_form_status'] ) ? sanitize_text_field( wp_unslash( $_POST['wpuf_form_status'] ) ) : '';
442
+ if ( $wpuf_form_status === 'new' ) {
443
  $is_update = false;
444
  }
445
 
446
  // set default post category if it's not been set yet and if post type supports
447
+ if ( ! isset( $postarr['post_category'] ) && isset( $this->form_settings['default_cat'] ) && is_object_in_taxonomy( $this->form_settings['post_type'], 'category' ) ) {
448
  if ( is_array( $this->form_settings['default_cat'] ) ) {
449
  $postarr['post_category'] = $this->form_settings['default_cat'];
450
  } else {
459
  $error = apply_filters( 'wpuf_add_post_validate', '' );
460
  }
461
 
462
+ if ( ! empty( $error ) ) {
463
  $this->send_error( $error );
464
  }
465
  // ############ It's Time to Save the World ###############
476
 
477
  // add _wpuf_lock_editing_post_time meta to
478
  // lock user from editing the published post after a certain time
479
+ if ( ! $is_update ) {
480
  $lock_edit_post = isset( $this->form_settings['lock_edit_post'] ) ? floatval( $this->form_settings['lock_edit_post'] ) : 0;
481
 
482
  if ( $post_id && $lock_edit_post > 0 ) {
483
+ $lock_edit_post_time = time() + ( $lock_edit_post * 60 * 60 );
484
  update_post_meta( $post_id, '_wpuf_lock_user_editing_post_time', $lock_edit_post_time );
485
  }
486
  }
495
  update_post_meta( $post_id, self::$config_id, $form_id );
496
 
497
  // save post formats if have any
498
+ if ( isset( $this->form_settings['post_format'] ) && $this->form_settings['post_format'] !== '0' ) {
499
  if ( post_type_supports( $this->form_settings['post_type'], 'post-formats' ) ) {
500
  set_post_format( $post_id, $this->form_settings['post_format'] );
501
  }
502
  }
503
 
504
  // find our if any images in post content and associate them
505
+ if ( ! empty( $postarr['post_content'] ) ) {
506
+ $dom = new DOMDocument();
507
  @$dom->loadHTML( $postarr['post_content'] );
508
  $images = $dom->getElementsByTagName( 'img' );
509
 
520
  }
521
  }
522
 
523
+ if ( ! empty( $taxonomy_vars ) ) {
524
  $this->set_custom_taxonomy( $post_id, $taxonomy_vars );
525
  } else {
526
  $this->set_default_taxonomy( $post_id );
536
  public function wpuf_get_post_user() {
537
  $nonce = isset( $_REQUEST['_wpnonce'] ) ? sanitize_key( wp_unslash( $_REQUEST['_wpnonce'] ) ) : '';
538
 
539
+ if ( isset( $nonce ) && ! wp_verify_nonce( $nonce, 'wpuf_form_add' ) ) {
540
+ return;
541
  }
542
 
543
  $default_post_author = wpuf_get_option( 'default_post_owner', 'wpuf_frontend_posting', 1 );
544
 
545
+ if ( ! is_user_logged_in() ) {
546
+ if ( isset( $this->form_settings['guest_post'] ) && $this->form_settings['guest_post'] === 'true' && $this->form_settings['guest_details'] === 'true' ) {
547
+ $guest_name = isset( $_POST['guest_name'] ) ? sanitize_text_field( wp_unslash( $_POST['guest_name'] ) ) : '';
548
 
549
  $guest_email = isset( $_POST['guest_email'] ) ? sanitize_email( wp_unslash( $_POST['guest_email'] ) ) : '';
550
  $page_id = isset( $_POST['page_id'] ) ? sanitize_text_field( wp_unslash( $_POST['page_id'] ) ) : '';
551
 
552
  // is valid email?
553
+ if ( ! is_email( $guest_email ) ) {
554
  $this->send_error( __( 'Invalid email address.', 'wp-user-frontend' ) );
555
  }
556
 
564
  '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' ),
565
  'type' => 'login',
566
  'redirect_to' => wp_login_url( get_permalink( $page_id ) ),
567
+ ] );
568
  } else {
569
 
570
  // user not found, lets register him
571
  // username from email address
572
+ $username = $this->guess_username( $guest_email );
573
 
574
  $user_pass = wp_generate_password( 12, false );
575
 
581
 
582
  // if its a success and no errors found
583
 
584
+ if ( $user_id && ! is_wp_error( $user_id ) ) {
585
  update_user_option( $user_id, 'default_password_nag', true, true ); //Set up the Password change nag.
586
 
587
  if ( class_exists( 'Theme_My_Login_Custom_Email' ) ) {
591
  }
592
 
593
  // update display name to full name
594
+ wp_update_user( [
595
+ 'ID' => $user_id,
596
+ 'display_name' => $guest_name,
597
+ ] );
598
 
599
  $post_author = $user_id;
600
  } else {
604
  }
605
 
606
  // guest post is enabled and details are off
607
+ } elseif ( isset( $this->form_settings['guest_post'] ) && $this->form_settings['guest_post'] === 'true' && $this->form_settings['guest_details'] === 'false' ) {
608
  $post_author = $default_post_author;
609
+ } elseif ( isset( $this->form_settings['guest_post'] ) && $this->form_settings['guest_post'] !== 'true' ) {
610
  $this->send_error( $this->form_settings['message_restrict'] );
611
  }
612
 
613
  // the user must be logged in already
614
+ } elseif ( isset( $this->form_settings['role_base'] ) && $this->form_settings['role_base'] == 'true' && ! wpuf_user_has_roles( $this->form_settings['roles'] ) ) {
 
615
  $this->send_error( __( 'You do not have sufficient permissions to access this form.', 'wp-user-frontend' ) );
 
616
  } else {
617
  $post_author = get_current_user_id();
618
  }
620
  return $post_author;
621
  }
622
 
623
+ /**
624
  * Add post shortcode handler
625
  *
626
  * @param array $atts
628
  */
629
 
630
  public function add_post_shortcode( $atts ) {
631
+ add_filter( 'wpuf-form-fields', [ $this, 'add_field_settings' ] );
632
+
633
+ // @codingStandardsIgnoreStart
634
  extract( shortcode_atts( [ 'id' => 0 ], $atts ) );
635
+
636
+ // @codingStandardsIgnoreEnd
637
  ob_start();
638
  $form = new WPUF_Form( $id );
639
  $this->form_fields = $form->get_fields();
642
  $info = apply_filters( 'wpuf_addpost_notice', $info, $id, $this->form_settings );
643
  $user_can_post = apply_filters( 'wpuf_can_post', $user_can_post, $id, $this->form_settings );
644
 
645
+ if ( $user_can_post === 'yes' ) {
646
  $this->render_form( $id, null, $atts, $form );
647
  } else {
648
  echo wp_kses_post( '<div class="wpuf-info">' . $info . '</div>' );
658
  // prepare the meta vars
659
  list( $meta_key_value, $multi_repeated, $files ) = self::prepare_meta_fields( $meta_vars );
660
  // set featured image if there's any
661
+
662
+ // @codingStandardsIgnoreStart
663
+ $wpuf_files = isset( $_POST['wpuf_files'] ) ? $_POST['wpuf_files'] : [];
664
 
665
  if ( isset( $wpuf_files['featured_image'] ) ) {
666
  $attachment_id = $wpuf_files['featured_image'][0];
668
  wpuf_associate_attachment( $attachment_id, $post_id );
669
  set_post_thumbnail( $post_id, $attachment_id );
670
 
671
+ $file_data = isset( $_POST['wpuf_files_data'][ $attachment_id ] ) ? $_POST['wpuf_files_data'][ $attachment_id ] : false;
672
 
673
+ // @codingStandardsIgnoreEnd
674
  if ( $file_data ) {
675
  $args = [
676
  'ID' => $attachment_id,
707
 
708
  $image_ids = '';
709
 
710
+ if ( count( $file_input['value'] ) > 1 ) {
711
  $image_ids = $file_input['value'];
712
  }
713
 
714
+ if ( count( $file_input['value'] ) === 1 ) {
715
  $image_ids = $file_input['value'][0];
716
  }
717
 
718
+ if ( ! empty( $image_ids ) ) {
719
  add_post_meta( $post_id, $file_input['name'], $image_ids );
720
  }
721
 
734
  //add_post_meta( $post_id, $file_input['name'], $attachment_id );
735
 
736
  // file title, caption, desc update
 
737
 
738
+ // @codingStandardsIgnoreStart
739
+ $file_data = isset( $_POST['wpuf_files_data'][ $attachment_id ] ) ? wp_unslash( $_POST['wpuf_files_data'][ $attachment_id ] ) : false;
740
+
741
+ // @codingStandardsIgnoreEnd
742
  if ( $file_data ) {
743
  $args = [
744
  'ID' => $attachment_id,
759
  $user = get_user_by( 'id', $user_id );
760
  $post = get_post( $post_id );
761
 
762
+ $post_field_search = [
763
+ '%post_title%',
764
+ '%post_content%',
765
+ '%post_excerpt%',
766
+ '%tags%',
767
+ '%category%',
768
+ '%author%',
769
+ '%author_email%',
770
+ '%author_bio%',
771
+ '%sitename%',
772
+ '%siteurl%',
773
+ '%permalink%',
774
+ '%editlink%',
775
+ ];
776
 
777
  $home_url = sprintf( '<a href="%s">%s</a>', home_url(), home_url() );
778
  $post_url = sprintf( '<a href="%s">%s</a>', get_permalink( $post_id ), get_permalink( $post_id ) );
793
  $post_edit_link,
794
  ];
795
 
796
+ if ( class_exists( 'WooCommerce' ) ) {
797
+ $post_field_search[] = '%product_cat%';
798
+ $post_field_replace[] = get_the_term_list( $post_id, 'product_cat', '', ', ' );
799
+ }
800
+
801
  $content = str_replace( $post_field_search, $post_field_replace, $content );
802
 
803
  // custom fields
806
 
807
  if ( $replace ) {
808
  foreach ( $replace as $index => $meta_key ) {
809
+ $value = get_post_meta( $post_id, $meta_key, false );
810
+
811
  if ( isset( $value[0] ) && is_array( $value[0] ) ) {
812
  $new_value = implode( '; ', $value[0] );
 
813
  } else {
814
  $new_value = implode( '; ', $value );
815
  }
818
  $meta_val = '';
819
 
820
  if ( count( $value ) > 1 ) {
821
+ $is_first = true;
822
 
823
  foreach ( $value as $val ) {
824
+ if ( $is_first ) {
825
  if ( get_post_mime_type( (int) $val ) ) {
826
  $meta_val = wp_get_attachment_url( $val );
827
  } else {
828
  $meta_val = $val;
829
  }
830
+ $is_first = false;
831
  } else {
832
  if ( get_post_mime_type( (int) $val ) ) {
833
  $meta_val = $meta_val . ', ' . wp_get_attachment_url( $val );
844
  }
845
  $original_value = $original_value . $meta_val;
846
  } else {
847
+ if ( 'address_field' === $meta_key ) {
848
  $value = get_post_meta( $post_id, $meta_key, true );
849
  $new_value = implode( ', ', $value );
850
  }
856
  }
857
  }
858
 
859
+ $content = str_replace( $search[ $index ], $original_value, $content );
860
  }
861
  }
862
 
865
 
866
  public function woo_attribute( $taxonomy ) {
867
  check_ajax_referer( 'wpuf_form_add' );
868
+ $taxonomy_name = isset( $_POST[ $taxonomy['name'] ] ) ? sanitize_text_field( wp_unslash( $_POST[ $taxonomy['name'] ] ) ) : '';
869
 
870
  return [
871
  'name' => $taxonomy['name'],
872
  'value' => $taxonomy_name,
873
+ 'is_visible' => $taxonomy['woo_attr_vis'] === 'yes' ? 1 : 0,
874
  'is_variation' => 0,
875
  'is_taxonomy' => 1,
876
  ];
886
  $pid = isset( $_GET['p_id'] ) ? sanitize_text_field( wp_unslash( $_GET['p_id'] ) ) : '';
887
  $fid = isset( $_GET['f_id'] ) ? sanitize_text_field( wp_unslash( $_GET['f_id'] ) ) : '';
888
 
889
+ if ( $post_msg === 'verified' ) {
890
  $response = [];
891
  $post_id = wpuf_decryption( $pid );
892
  $form_id = wpuf_decryption( $fid );
898
  $force_pack = $form->is_enabled_force_pack();
899
 
900
  if ( $form->is_charging_enabled() && $pay_per_post ) {
901
+ if ( ( $payment_status->get_payment_status( $post_id ) ) === 'pending' ) {
902
  $response['show_message'] = true;
903
+ $response['redirect_to'] = add_query_arg(
904
+ [
905
+ 'action' => 'wpuf_pay',
906
+ 'type' => 'post',
907
+ 'post_id' => $post_id,
908
+ ],
909
+ get_permalink( wpuf_get_option( 'payment_page', 'wpuf_payment' ) )
910
+ );
911
 
912
  wp_redirect( $response['redirect_to'] );
913
  wpuf_clear_buffer();
918
 
919
  if ( $p_status ) {
920
  wp_update_post( [
921
+ 'ID' => $post_id,
922
+ 'post_status' => isset( $form_settings['post_status'] ) ? $form_settings['post_status'] : 'publish',
923
  ] );
924
+
925
  echo wp_kses_post( "<div class='wpuf-success' style='text-align:center'>" . __( 'Email successfully verified. Please Login.', 'wp-user-frontend' ) . '</div>' );
926
  }
927
  }
928
  }
929
  }
930
 
931
+ public function wpuf_user_subscription_pack( $form_settings, $post_id = null ) {
932
 
933
  // if user has a subscription pack
934
  $user_wpuf_subscription_pack = get_user_meta( get_current_user_id(), '_wpuf_subscription_pack', true );
935
 
936
+ if ( ! empty( $user_wpuf_subscription_pack ) && isset( $user_wpuf_subscription_pack['_enable_post_expiration'] )
937
  && isset( $user_wpuf_subscription_pack['expire'] ) && strtotime( $user_wpuf_subscription_pack['expire'] ) >= time() ) {
938
+ $expire_date = gmdate( 'Y-m-d', strtotime( '+' . $user_wpuf_subscription_pack['_post_expiration_time'] ) );
939
  update_post_meta( $post_id, $this->post_expiration_date, $expire_date );
940
  // save post status after expiration
941
  $expired_post_status = $user_wpuf_subscription_pack['_expired_post_status'];
942
  update_post_meta( $post_id, $this->expired_post_status, $expired_post_status );
943
  // if mail active
944
+ if ( isset( $user_wpuf_subscription_pack['_enable_mail_after_expired'] ) && $user_wpuf_subscription_pack['_enable_mail_after_expired'] === 'on' ) {
945
  $wpuf_user = wpuf_get_user();
946
  $user_subscription = new WPUF_User_Subscription( $wpuf_user );
947
  $post_expiration_message = $user_subscription->get_subscription_exp_msg( $user_wpuf_subscription_pack['pack_id'] );
948
  update_post_meta( $post_id, $this->post_expiration_message, $post_expiration_message );
949
  }
950
+ } elseif ( ! empty( $user_wpuf_subscription_pack ) && isset( $user_wpuf_subscription_pack['expire'] ) && strtotime( $user_wpuf_subscription_pack['expire'] ) <= time() ) {
951
  if ( isset( $form_settings['expiration_settings']['enable_post_expiration'] ) ) {
952
+ $expire_date = gmdate( 'Y-m-d', strtotime( '+' . $form_settings['expiration_settings']['expiration_time_value'] . ' ' . $form_settings['expiration_settings']['expiration_time_type'] . '' ) );
953
 
954
  update_post_meta( $post_id, $this->post_expiration_date, $expire_date );
955
  // save post status after expiration
956
  $expired_post_status = $form_settings['expiration_settings']['expired_post_status'];
957
  update_post_meta( $post_id, $this->expired_post_status, $expired_post_status );
958
  // if mail active
959
+ if ( isset( $form_settings['expiration_settings']['enable_mail_after_expired'] ) && $form_settings['expiration_settings']['enable_mail_after_expired'] === 'on' ) {
960
  $post_expiration_message = $form_settings['expiration_settings']['post_expiration_message'];
961
  update_post_meta( $post_id, $this->post_expiration_message, $post_expiration_message );
962
  }
963
  }
964
+ } elseif ( empty( $user_wpuf_subscription_pack ) || $user_wpuf_subscription_pack === 'Cancel' || $user_wpuf_subscription_pack === 'cancel' ) {
965
  if ( isset( $form_settings['expiration_settings']['enable_post_expiration'] ) ) {
966
+ $expire_date = gmdate( 'Y-m-d', strtotime( '+' . $form_settings['expiration_settings']['expiration_time_value'] . ' ' . $form_settings['expiration_settings']['expiration_time_type'] . '' ) );
967
  update_post_meta( $post_id, $this->post_expiration_date, $expire_date );
968
  // save post status after expiration
969
  $expired_post_status = $form_settings['expiration_settings']['expired_post_status'];
970
  update_post_meta( $post_id, $this->expired_post_status, $expired_post_status );
971
  // if mail active
972
+ if ( isset( $form_settings['expiration_settings']['enable_mail_after_expired'] ) && $form_settings['expiration_settings']['enable_mail_after_expired'] === 'on' ) {
973
  $post_expiration_message = $form_settings['expiration_settings']['post_expiration_message'];
974
  update_post_meta( $post_id, $this->post_expiration_message, $post_expiration_message );
975
  }
986
  $page_id = isset( $_POST['page_id'] ) ? intval( wp_unslash( $_POST['page_id'] ) ) : '';
987
 
988
  if ( $is_update ) {
989
+ if ( $this->form_settings['edit_redirect_to'] === 'page' ) {
990
  $redirect_to = get_permalink( $this->form_settings['edit_page_id'] );
991
+ } elseif ( $this->form_settings['edit_redirect_to'] === 'url' ) {
992
  $redirect_to = $this->form_settings['edit_url'];
993
+ } elseif ( $this->form_settings['edit_redirect_to'] === 'same' ) {
994
+ $redirect_to = add_query_arg(
995
+ [
996
+ 'pid' => $post_id,
997
+ '_wpnonce' => wp_create_nonce( 'wpuf_edit' ),
998
+ 'msg' => 'post_updated',
999
+ ],
1000
+ get_permalink( $page_id )
1001
+ );
1002
  } else {
1003
  $redirect_to = get_permalink( $post_id );
1004
  }
1005
  } else {
1006
+ if ( $this->form_settings['redirect_to'] === 'page' ) {
1007
  $redirect_to = get_permalink( $this->form_settings['page_id'] );
1008
+ } elseif ( $this->form_settings['redirect_to'] === 'url' ) {
1009
  $redirect_to = $this->form_settings['url'];
1010
+ } elseif ( $this->form_settings['redirect_to'] === 'same' ) {
1011
  $show_message = true;
1012
  } else {
1013
  $redirect_to = get_permalink( $post_id );
1014
  }
1015
  }
1016
 
1017
+ if ( isset( $this->form_settings['enable_pay_per_post'] )
 
1018
  && wpuf_validate_boolean( $this->form_settings['enable_pay_per_post'] )
1019
+ && ! $is_update
1020
  ) {
1021
+ $redirect_to = add_query_arg(
1022
+ [
1023
+ 'action' => 'wpuf_pay',
1024
+ 'type' => 'post',
1025
+ 'post_id' => $post_id,
1026
+ ],
1027
+ get_permalink( wpuf_get_option( 'payment_page', 'wpuf_payment' ) )
1028
+ );
1029
  }
1030
 
1031
  $response = [
1038
  $guest_mode = isset( $this->form_settings['guest_post'] ) ? $this->form_settings['guest_post'] : '';
1039
  $guest_verify = isset( $this->form_settings['guest_email_verify'] ) ? $this->form_settings['guest_email_verify'] : 'false';
1040
 
1041
+ if ( $guest_mode === 'true' && $guest_verify === 'true' && ! is_user_logged_in() && $charging_enabled !== 'yes' ) {
1042
  $post_id_encoded = wpuf_encryption( $post_id );
1043
  $form_id_encoded = wpuf_encryption( $form_id );
1044
 
1047
  $response['show_message'] = true;
1048
  $response['redirect_to'] = add_query_arg( $wp->query_string, '', home_url( $wp->request ) );
1049
  $response['message'] = __( 'Thank you for posting on our site. We have sent you an confirmation email. Please check your inbox!', 'wp-user-frontend' );
1050
+ } elseif ( $guest_mode === 'true' && $guest_verify === 'true' && ! is_user_logged_in() && $charging_enabled === 'yes' ) {
1051
  $post_id_encoded = wpuf_encryption( $post_id );
1052
  $form_id_encoded = wpuf_encryption( $form_id );
1053
  $response['show_message'] = true;
1058
  wpuf_send_mail_to_guest( $post_id_encoded, $form_id_encoded, 'yes', 2 );
1059
  }
1060
 
1061
+ if ( $guest_mode === 'true' && $guest_verify === 'true' && ! is_user_logged_in() ) {
1062
  $response = apply_filters( 'wpuf_edit_post_redirect', $response, $post_id, $form_id, $this->form_settings );
1063
  } elseif ( $is_update ) {
1064
  //now perform some post related actions
1065
  do_action( 'wpuf_edit_post_after_update', $post_id, $form_id, $this->form_settings, $this->form_fields ); // plugin API to extend the functionality
1066
+
1067
  //send mail notification
1068
+ if ( isset( $this->form_settings['notification'] ) && $this->form_settings['notification']['edit'] === 'on' ) {
1069
  $mail_body = $this->prepare_mail_body( $this->form_settings['notification']['edit_body'], $post_author, $post_id );
1070
  $to = $this->prepare_mail_body( $this->form_settings['notification']['edit_to'], $post_author, $post_id );
1071
  $subject = $this->prepare_mail_body( $this->form_settings['notification']['edit_subject'], $post_author, $post_id );
1080
  } else {
1081
  //now perform some post related actions
1082
  do_action( 'wpuf_add_post_after_insert', $post_id, $form_id, $this->form_settings, $meta_vars ); // plugin API to extend the functionality
1083
+
1084
  // send mail notification
1085
+ if ( isset( $this->form_settings['notification'] ) && $this->form_settings['notification']['new'] === 'on' ) {
1086
  $mail_body = $this->prepare_mail_body( $this->form_settings['notification']['new_body'], $post_author, $post_id );
1087
  $to = $this->prepare_mail_body( $this->form_settings['notification']['new_to'], $post_author, $post_id );
1088
  $subject = $this->prepare_mail_body( $this->form_settings['notification']['new_subject'], $post_author, $post_id );
includes/countries-state.php CHANGED
@@ -164,7 +164,7 @@ class CountryState {
164
  ['Nepal', 'NP', 'NPL', '524', 'ISO 3166-2:NP', 'Bagmati|Bheri|Dhawalagiri|Gandaki|Janakpur|Karnali|Kosi|Lumbini|Mahakali|Mechi|Narayani|Rapti|Sagarmatha|Seti', '977'],
165
  ['Netherlands', 'NL', 'NLD', '528', 'ISO 3166-2:NL', 'Drenthe|Flevoland|Friesland|Gelderland|Groningen|Limburg|Noord-Brabant|Noord-Holland|Overijssel|Utrecht|Zeeland|Zuid-Holland', '31'],
166
  ['New Caledonia', 'NC', 'NCL', '540', 'ISO 3166-2:NC', 'Iles Loyaute|Nord|Sud', '687'],
167
- ['New Zealand', 'NZ', 'NZL', '554', 'ISO 3166-2:NZ', "Akaroa|Amuri|Ashburton|Bay of Islands|Bruce|Buller|Chatham Islands|Cheviot|Clifton|Clutha|Cook|Dannevirke|Egmont|Eketahuna|Ellesmere|Eltham|Eyre|Featherston|Franklin|Golden Bay|Great Barrier Island|Grey|Hauraki Plains|Hawera|Hawke's Bay|Heathcote|Hikurangi|Hobson|Hokianga|Horowhenua|Hurunui|Hutt|Inangahua|Inglewood|Kaikoura|Kairanga|Kiwitea|Lake|Mackenzie|Malvern|Manaia|Manawatu|Mangonui|Maniototo|Marlborough|Masterton|Matamata|Mount Herbert|Ohinemuri|Opotiki|Oroua|Otamatea|Otorohanga|Oxford|Pahiatua|Paparua|Patea|Piako|Pohangina|Raglan|Rangiora|Rangitikei|Rodney|Rotorua|Runanga|Saint Kilda|Silverpeaks|Southland|Stewart Island|Stratford|Strathallan|Taranaki|Taumarunui|Taupo|Tauranga|Thames-Coromandel|Tuapeka|Vincent|Waiapu|Waiheke|Waihemo|Waikato|Waikohu|Waimairi|Waimarino|Waimate|Waimate West|Waimea|Waipa|Waipawa|Waipukurau|Wairarapa South|Wairewa|Wairoa|Waitaki|Waitomo|Waitotara|Wallace|Wanganui|Waverley|Westland|Whakatane|Whangarei|Whangaroa|Woodville", '64'],
168
  ['Nicaragua', 'NI', 'NIC', '558', 'ISO 3166-2:NI', 'Atlantico Norte|Atlantico Sur|Boaco|Carazo|Chinandega|Chontales|Esteli|Granada|Jinotega|Leon|Madriz|Managua|Masaya|Matagalpa|Nueva Segovia|Rio San Juan|Rivas', '505'],
169
  ['Niger', 'NE', 'NER', '562', 'ISO 3166-2:NE', 'Agadez|Diffa|Dosso|Maradi|Niamey|Tahoua|Tillaberi|Zinder', '227'],
170
  ['Nigeria', 'NG', 'NGA', '566', 'ISO 3166-2:NG', 'Abia|Abuja Federal Capital Territory|Adamawa|Akwa Ibom|Anambra|Bauchi|Bayelsa|Benue|Borno|Cross River|Delta|Ebonyi|Edo|Ekiti|Enugu|Gombe|Imo|Jigawa|Kaduna|Kano|Katsina|Kebbi|Kogi|Kwara|Lagos|Nassarawa|Niger|Ogun|Ondo|Osun|Oyo|Plateau|Rivers|Sokoto|Taraba|Yobe|Zamfara', '234'],
164
  ['Nepal', 'NP', 'NPL', '524', 'ISO 3166-2:NP', 'Bagmati|Bheri|Dhawalagiri|Gandaki|Janakpur|Karnali|Kosi|Lumbini|Mahakali|Mechi|Narayani|Rapti|Sagarmatha|Seti', '977'],
165
  ['Netherlands', 'NL', 'NLD', '528', 'ISO 3166-2:NL', 'Drenthe|Flevoland|Friesland|Gelderland|Groningen|Limburg|Noord-Brabant|Noord-Holland|Overijssel|Utrecht|Zeeland|Zuid-Holland', '31'],
166
  ['New Caledonia', 'NC', 'NCL', '540', 'ISO 3166-2:NC', 'Iles Loyaute|Nord|Sud', '687'],
167
+ ['New Zealand', 'NZ', 'NZL', '554', 'ISO 3166-2:NZ', "Akaroa|Amuri|Ashburton|Auckland|Bay of Islands|Bruce|Buller|Chatham Islands|Cheviot|Clifton|Clutha|Cook|Dannevirke|Egmont|Eketahuna|Ellesmere|Eltham|Eyre|Featherston|Franklin|Golden Bay|Great Barrier Island|Grey|Hauraki Plains|Hawera|Hawke's Bay|Heathcote|Hikurangi|Hobson|Hokianga|Horowhenua|Hurunui|Hutt|Inangahua|Inglewood|Kaikoura|Kairanga|Kiwitea|Lake|Mackenzie|Malvern|Manaia|Manawatu|Mangonui|Maniototo|Marlborough|Masterton|Matamata|Mount Herbert|Ohinemuri|Opotiki|Oroua|Otamatea|Otorohanga|Oxford|Pahiatua|Paparua|Patea|Piako|Pohangina|Raglan|Rangiora|Rangitikei|Rodney|Rotorua|Runanga|Saint Kilda|Silverpeaks|Southland|Stewart Island|Stratford|Strathallan|Taranaki|Taumarunui|Taupo|Tauranga|Thames-Coromandel|Tuapeka|Vincent|Waiapu|Waiheke|Waihemo|Waikato|Waikohu|Waimairi|Waimarino|Waimate|Waimate West|Waimea|Waipa|Waipawa|Waipukurau|Wairarapa South|Wairewa|Wairoa|Waitaki|Waitomo|Waitotara|Wallace|Wanganui|Waverley|Westland|Whakatane|Whangarei|Whangaroa|Woodville", '64'],
168
  ['Nicaragua', 'NI', 'NIC', '558', 'ISO 3166-2:NI', 'Atlantico Norte|Atlantico Sur|Boaco|Carazo|Chinandega|Chontales|Esteli|Granada|Jinotega|Leon|Madriz|Managua|Masaya|Matagalpa|Nueva Segovia|Rio San Juan|Rivas', '505'],
169
  ['Niger', 'NE', 'NER', '562', 'ISO 3166-2:NE', 'Agadez|Diffa|Dosso|Maradi|Niamey|Tahoua|Tillaberi|Zinder', '227'],
170
  ['Nigeria', 'NG', 'NGA', '566', 'ISO 3166-2:NG', 'Abia|Abuja Federal Capital Territory|Adamawa|Akwa Ibom|Anambra|Bauchi|Bayelsa|Benue|Borno|Cross River|Delta|Ebonyi|Edo|Ekiti|Enugu|Gombe|Imo|Jigawa|Kaduna|Kano|Katsina|Kebbi|Kogi|Kwara|Lagos|Nassarawa|Niger|Ogun|Ondo|Osun|Oyo|Plateau|Rivers|Sokoto|Taraba|Yobe|Zamfara', '234'],
includes/fields/class-field-image.php CHANGED
@@ -22,22 +22,21 @@ class WPUF_Form_Field_Image extends WPUF_Field_Contract {
22
  * @return void
23
  */
24
  public function render( $field_settings, $form_id, $type = 'post', $post_id = null ) {
25
- $has_images = false;
26
 
27
- if ( isset( $post_id ) && $post_id != '0' ) {
28
- if ( $this->is_meta( $field_settings ) ) {
29
- $images = $this->get_meta( $post_id, $field_settings['name'], $type, false );
30
 
31
- if ( $images ) {
32
- if ( is_serialized( $images[0] ) ) {
33
- $images = maybe_unserialize( $images[0] );
34
- }
35
 
36
- if ( is_array( $images[0] ) ) {
37
- $images = $images[0];
38
- }
39
  }
40
- $has_images = true;
 
41
  }
42
  }
43
 
@@ -60,7 +59,8 @@ class WPUF_Form_Field_Image extends WPUF_Field_Contract {
60
  foreach ( $images as $attach_id ) {
61
  echo WPUF_Upload::attach_html( $attach_id, $field_settings['name'] ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
62
  }
63
- } ?>
 
64
  </ul>
65
  </div>
66
  </div><!-- .container -->
@@ -79,7 +79,8 @@ class WPUF_Form_Field_Image extends WPUF_Field_Contract {
79
  </script>
80
 
81
 
82
- <?php $this->after_field_print_label();
 
83
  }
84
 
85
  /**
@@ -88,7 +89,7 @@ class WPUF_Form_Field_Image extends WPUF_Field_Contract {
88
  * @return array
89
  */
90
  public function get_options_settings() {
91
- $default_options = $this->get_default_option_settings( true, ['dynamic', 'width'] ); // exclude dynamic
92
 
93
  $settings = [
94
  [
@@ -156,6 +157,6 @@ class WPUF_Form_Field_Image extends WPUF_Field_Contract {
156
 
157
  $wpuf_files = isset( $_POST['wpuf_files'] ) ? array_map( 'sanitize_text_field', wp_unslash( $_POST['wpuf_files'] ) ) : [];
158
 
159
- return isset( $wpuf_files[$field['name']] ) ? $wpuf_files[$field['name']] : [];
160
  }
161
  }
22
  * @return void
23
  */
24
  public function render( $field_settings, $form_id, $type = 'post', $post_id = null ) {
25
+ $has_images = false;
26
 
27
+ if ( isset( $post_id ) && $post_id !== 0 ) {
28
+ $images = $this->get_meta( $post_id, $field_settings['name'], $type, false );
 
29
 
30
+ if ( $this->is_meta( $field_settings ) && ! empty( $images[0] ) ) {
31
+ if ( is_serialized( $images[0] ) ) {
32
+ $images = maybe_unserialize( $images[0] );
33
+ }
34
 
35
+ if ( is_array( $images[0] ) ) {
36
+ $images = $images[0];
 
37
  }
38
+
39
+ $has_images = true;
40
  }
41
  }
42
 
59
  foreach ( $images as $attach_id ) {
60
  echo WPUF_Upload::attach_html( $attach_id, $field_settings['name'] ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
61
  }
62
+ }
63
+ ?>
64
  </ul>
65
  </div>
66
  </div><!-- .container -->
79
  </script>
80
 
81
 
82
+ <?php
83
+ $this->after_field_print_label();
84
  }
85
 
86
  /**
89
  * @return array
90
  */
91
  public function get_options_settings() {
92
+ $default_options = $this->get_default_option_settings( true, [ 'dynamic', 'width' ] ); // exclude dynamic
93
 
94
  $settings = [
95
  [
157
 
158
  $wpuf_files = isset( $_POST['wpuf_files'] ) ? array_map( 'sanitize_text_field', wp_unslash( $_POST['wpuf_files'] ) ) : [];
159
 
160
+ return isset( $wpuf_files[ $field['name'] ] ) ? $wpuf_files[ $field['name'] ] : [];
161
  }
162
  }
includes/fields/class-field-post-taxonomy.php CHANGED
@@ -16,6 +16,7 @@ class WPUF_Form_Field_Post_Taxonomy extends WPUF_Field_Contract {
16
  protected $form_id;
17
 
18
  public function __construct( $tax_name, $taxonomy, $post_id = null, $user_id = null ) {
 
19
  $this->name = __( $tax_name, 'wp-user-frontend' );
20
  $this->input_type = 'taxonomy';
21
  $this->tax_name = $tax_name;
@@ -46,22 +47,22 @@ class WPUF_Form_Field_Post_Taxonomy extends WPUF_Field_Contract {
46
  $this->exclude_type = isset( $this->field_settings['exclude_type'] ) ? $this->field_settings['exclude_type'] : 'exclude';
47
  $this->exclude = $this->field_settings['exclude'];
48
 
49
- if ( $this->exclude_type == 'child_of' && !empty( $this->exclude ) ) {
50
  $this->exclude = $this->exclude[0];
51
  }
52
 
53
  $this->taxonomy = $this->field_settings['name'];
54
  $this->class = ' wpuf_' . $this->field_settings['name'] . '_' . $form_id;
55
 
56
- $current_user = get_current_user_id();
57
 
58
- if ( $post_id && $this->field_settings['type'] == 'text' ) {
59
- $this->terms = wp_get_post_terms( $post_id, $this->taxonomy, ['fields' => 'names'] );
60
  } elseif ( $post_id ) {
61
- $this->terms = wp_get_post_terms( $post_id, $this->taxonomy, ['fields' => 'ids'] );
62
  }
63
 
64
- if ( !taxonomy_exists( $this->taxonomy ) ) {
65
  echo wp_kses_post( '<br><div class="wpuf-message">' . __( 'This field is no longer available.', 'wp-user-frontend' ) . '</div>' );
66
 
67
  return;
@@ -69,11 +70,13 @@ class WPUF_Form_Field_Post_Taxonomy extends WPUF_Field_Contract {
69
 
70
  $div_class = 'wpuf_' . $this->field_settings['name'] . '_' . $this->field_settings['type'] . '_' . $field_settings['id'] . '_' . $form_id;
71
 
72
- if ( $this->field_settings['type'] == 'checkbox' ) { ?>
 
73
  <div class="wpuf-fields <?php echo wp_kses_post( $div_class ); ?>" data-required="<?php echo esc_attr( $field_settings['required'] ); ?>" data-type="tax-checkbox">
74
  <?php } else { ?>
75
  <div class="wpuf-fields <?php echo esc_attr( $div_class ); ?>">
76
- <?php }
 
77
 
78
  switch ( $this->field_settings['type'] ) {
79
  case 'ajax':
@@ -81,11 +84,13 @@ class WPUF_Form_Field_Post_Taxonomy extends WPUF_Field_Contract {
81
  break;
82
 
83
  case 'select':
84
- $this->tax_select( $post_id=null );
 
85
  break;
86
 
87
  case 'multiselect':
88
- $this->tax_multiselect( $post_id=null );
 
89
  break;
90
 
91
  case 'checkbox':
@@ -93,15 +98,17 @@ class WPUF_Form_Field_Post_Taxonomy extends WPUF_Field_Contract {
93
  break;
94
 
95
  case 'text':
96
- $this->tax_input( $post_id=null );
 
97
  break;
98
  default:
99
  // code...
100
  break;
101
-
102
- } ?>
103
  <span class="wpuf-wordlimit-message wpuf-help"></span>
104
- <?php $this->help_text( $field_settings );
 
105
  }
106
 
107
  public function taxnomy_select( $terms ) {
@@ -112,11 +119,11 @@ class WPUF_Form_Field_Post_Taxonomy extends WPUF_Field_Contract {
112
  'data-required="%s" data-type="select" data-form-id="%d"',
113
  $attr['required'],
114
  trim( $this->form_id )
115
- );
116
 
117
- $exclude = wpuf_get_field_settings_excludes( $this->field_settings, $this->exclude_type );
118
 
119
- $tax_args = [
120
  'show_option_none' => __( '-- Select --', 'wp-user-frontend' ),
121
  'hierarchical' => 1,
122
  'hide_empty' => 0,
@@ -127,7 +134,7 @@ class WPUF_Form_Field_Post_Taxonomy extends WPUF_Field_Contract {
127
  'echo' => 0,
128
  'title_li' => '',
129
  'class' => 'cat-ajax ' . $this->taxonomy . $this->class,
130
- $exclude['type'] => ( $this->exclude_type == 'child_of' ) ? $exclude['childs'] : $this->exclude,
131
  'selected' => $selected,
132
  'child_of' => isset( $attr['parent_cat'] ) ? $attr['parent_cat'] : '',
133
  ];
@@ -135,11 +142,11 @@ class WPUF_Form_Field_Post_Taxonomy extends WPUF_Field_Contract {
135
  $tax_args = apply_filters( 'wpuf_taxonomy_checklist_args', $tax_args );
136
  $select = wp_dropdown_categories( $tax_args );
137
 
138
- echo str_replace( '<select', '<select ' . $dataset, $select ) ; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
139
  $attr = [
140
  'required' => $attr['required'],
141
  'name' => $attr['name'],
142
- 'exclude_type' => isset( $attr['exclude_type'] ) ? $attr['exclude_type'] : 'exclude',
143
  // 'exclude_type' => $attr['exclude_type'],
144
  'exclude' => $attr['exclude'],
145
  'orderby' => $attr['orderby'],
@@ -147,8 +154,9 @@ class WPUF_Form_Field_Post_Taxonomy extends WPUF_Field_Contract {
147
  // 'last_term_id' => isset( $attr['parent_cat'] ) ? $attr['parent_cat'] : '',
148
  //'term_id' => $selected
149
  ];
150
- $attr = apply_filters( 'wpuf_taxonomy_checklist_args', $attr ); ?>
151
- <span data-taxonomy=<?php echo esc_attr( json_encode( $attr ) ); ?>></span>
 
152
  <?php
153
  }
154
 
@@ -156,23 +164,24 @@ class WPUF_Form_Field_Post_Taxonomy extends WPUF_Field_Contract {
156
  $childs = [];
157
 
158
  foreach ( $items as &$item ) {
159
- $childs[$item->parent][] = &$item;
160
  }
161
 
162
  unset( $item );
163
 
164
  foreach ( $items as &$item ) {
165
- if ( isset( $childs[$item->term_id] ) ) {
166
- $item->childs = $childs[$item->term_id];
167
  }
168
  }
169
 
170
- return $childs[0];
171
  }
172
 
173
  public function RecursiveCatWrite( $tree ) {
174
  foreach ( $tree as $vals ) {
175
- $level = 0; ?>
 
176
  <div id="lvl<?php echo esc_attr( $level ); ?>" level="<?php echo esc_attr( $level ); ?>" >
177
  <?php $this->taxnomy_select( $vals->term_id ); ?>
178
  </div>
@@ -182,21 +191,21 @@ class WPUF_Form_Field_Post_Taxonomy extends WPUF_Field_Contract {
182
 
183
  if ( isset( $vals->childs ) ) {
184
  $this->RecursiveCatWrite( $vals->childs );
185
- } else {
186
  }
187
  }
188
  }
189
 
190
  public function tax_ajax( $post_id = null ) {
191
  if ( isset( $post_id ) ) {
192
- $this->terms = wp_get_post_terms( $post_id, $this->taxonomy, ['fields' => 'all'] );
193
- } ?>
 
194
 
195
  <div class="category-wrap <?php echo esc_attr( $this->class ); ?>">
196
 
197
  <?php
198
 
199
- if ( !count( $this->terms ) ) {
200
  ?>
201
  <div id="lvl0" level="0">
202
  <?php $this->taxnomy_select( null ); ?>
@@ -205,10 +214,11 @@ class WPUF_Form_Field_Post_Taxonomy extends WPUF_Field_Contract {
205
  } else {
206
  $tree = $this->catbuildTree( $this->terms );
207
  $this->RecursiveCatWrite( $tree );
208
- } ?>
 
209
  </div>
210
  <span class="loading"></span>
211
- <?php
212
  }
213
 
214
  public function tax_select( $post_id = null ) {
@@ -216,7 +226,7 @@ class WPUF_Form_Field_Post_Taxonomy extends WPUF_Field_Contract {
216
  $selected = $this->terms ? $this->terms[0] : '';
217
  $required = sprintf( 'data-required="%s" data-type="select"', $attr['required'] );
218
 
219
- $exclude = wpuf_get_field_settings_excludes( $this->field_settings, $this->exclude_type );
220
 
221
  $tax_args = [
222
  'show_option_none' => isset( $attr['first'] ) ? $attr['first'] : '--select--',
@@ -229,19 +239,19 @@ class WPUF_Form_Field_Post_Taxonomy extends WPUF_Field_Contract {
229
  'echo' => 0,
230
  'title_li' => '',
231
  'class' => $this->taxonomy . $this->class,
232
- $exclude['type'] => ( $this->exclude_type == 'child_of' ) ? $exclude['childs'] : $this->exclude,
233
  'selected' => $selected,
234
  ];
235
 
236
  $tax_args = apply_filters( 'wpuf_taxonomy_checklist_args', $tax_args );
237
 
238
- $select = wp_dropdown_categories( $tax_args );
239
 
240
  $allowed_html = [
241
- 'option' => [
242
- 'value' => [],
243
- 'selected' => []
244
- ]
245
  ];
246
 
247
  echo str_replace( '<select', '<select ' . $required, $select ); // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
@@ -263,9 +273,9 @@ class WPUF_Form_Field_Post_Taxonomy extends WPUF_Field_Contract {
263
 
264
  $required = sprintf( 'data-required="%s" data-type="multiselect"', $attr['required'] );
265
 
266
- $walker = new WPUF_Walker_Category_Multi();
267
 
268
- $exclude = wpuf_get_field_settings_excludes( $this->field_settings, $this->exclude_type );
269
 
270
  $tax_args = [
271
  // 'show_option_none' => __( '-- Select --', 'wpuf' ),
@@ -279,7 +289,7 @@ class WPUF_Form_Field_Post_Taxonomy extends WPUF_Field_Contract {
279
  'echo' => 0,
280
  'title_li' => '',
281
  'class' => $this->taxonomy . ' multiselect' . $this->class,
282
- $exclude['type'] => ( $this->exclude_type == 'child_of' ) ? $exclude['childs'] : $this->exclude,
283
  'selected' => $selected,
284
  'walker' => $walker,
285
  ];
@@ -287,7 +297,7 @@ class WPUF_Form_Field_Post_Taxonomy extends WPUF_Field_Contract {
287
  $tax_args = apply_filters( 'wpuf_taxonomy_checklist_args', $tax_args );
288
  $select = wp_dropdown_categories( $tax_args );
289
 
290
- echo str_replace( '<select', '<select multiple="multiple" ' . $required , $select ); // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
291
  }
292
 
293
  public function tax_input( $post_id = null ) {
@@ -295,9 +305,9 @@ class WPUF_Form_Field_Post_Taxonomy extends WPUF_Field_Contract {
295
  $query_string = '?action=wpuf-ajax-tag-search&tax=' . $attr['name'];
296
 
297
  if ( 'child_of' === $this->exclude_type ) {
298
- $exclude = wpuf_get_field_settings_excludes( $this->field_settings, $this->exclude_type );
299
 
300
- $query_string .= '&term_ids=' . implode( ',', $exclude['childs'] );
301
  }
302
 
303
  ?>
@@ -307,11 +317,11 @@ class WPUF_Form_Field_Post_Taxonomy extends WPUF_Field_Contract {
307
  <script type="text/javascript">
308
  ;(function($) {
309
  $(document).ready( function(){
310
- $('#<?php echo esc_attr( $attr['name'] ); ?>').suggest( wpuf_frontend.ajaxurl + '<?php echo $query_string ?>', { delay: 500, minchars: 2, multiple: true, multipleSep: ', ' } );
311
  });
312
  })(jQuery);
313
  </script>
314
- <?php
315
  }
316
 
317
  /**
@@ -320,7 +330,7 @@ class WPUF_Form_Field_Post_Taxonomy extends WPUF_Field_Contract {
320
  * @return array
321
  */
322
  public function get_options_settings() {
323
- $default_options = $this->get_default_option_settings( false, ['dynamic'] );
324
  $default_text_options = $this->get_default_taxonomy_option_setttings( false, $this->tax_name );
325
 
326
  return array_merge( $default_options, $default_text_options );
@@ -366,8 +376,8 @@ class WPUF_Form_Field_Post_Taxonomy extends WPUF_Field_Contract {
366
  // return sanitize_text_field($_POST[$field['name']]);
367
  check_ajax_referer( 'wpuf_form_add' );
368
 
369
- $val = isset( $_POST[$field['name']] ) ? sanitize_text_field( wp_unslash( $_POST[$field['name']] ) ) : '';
370
 
371
- return isset( $field['options'][$val] ) ? $field['options'][$val] : '';
372
  }
373
  }
16
  protected $form_id;
17
 
18
  public function __construct( $tax_name, $taxonomy, $post_id = null, $user_id = null ) {
19
+ //phpcs:ignore
20
  $this->name = __( $tax_name, 'wp-user-frontend' );
21
  $this->input_type = 'taxonomy';
22
  $this->tax_name = $tax_name;
47
  $this->exclude_type = isset( $this->field_settings['exclude_type'] ) ? $this->field_settings['exclude_type'] : 'exclude';
48
  $this->exclude = $this->field_settings['exclude'];
49
 
50
+ if ( $this->exclude_type === 'child_of' && ! empty( $this->exclude ) ) {
51
  $this->exclude = $this->exclude[0];
52
  }
53
 
54
  $this->taxonomy = $this->field_settings['name'];
55
  $this->class = ' wpuf_' . $this->field_settings['name'] . '_' . $form_id;
56
 
57
+ $current_user = get_current_user_id();
58
 
59
+ if ( $post_id && $this->field_settings['type'] === 'text' ) {
60
+ $this->terms = wp_get_post_terms( $post_id, $this->taxonomy, [ 'fields' => 'names' ] );
61
  } elseif ( $post_id ) {
62
+ $this->terms = wp_get_post_terms( $post_id, $this->taxonomy, [ 'fields' => 'ids' ] );
63
  }
64
 
65
+ if ( ! taxonomy_exists( $this->taxonomy ) ) {
66
  echo wp_kses_post( '<br><div class="wpuf-message">' . __( 'This field is no longer available.', 'wp-user-frontend' ) . '</div>' );
67
 
68
  return;
70
 
71
  $div_class = 'wpuf_' . $this->field_settings['name'] . '_' . $this->field_settings['type'] . '_' . $field_settings['id'] . '_' . $form_id;
72
 
73
+ if ( $this->field_settings['type'] === 'checkbox' ) {
74
+ ?>
75
  <div class="wpuf-fields <?php echo wp_kses_post( $div_class ); ?>" data-required="<?php echo esc_attr( $field_settings['required'] ); ?>" data-type="tax-checkbox">
76
  <?php } else { ?>
77
  <div class="wpuf-fields <?php echo esc_attr( $div_class ); ?>">
78
+ <?php
79
+ }
80
 
81
  switch ( $this->field_settings['type'] ) {
82
  case 'ajax':
84
  break;
85
 
86
  case 'select':
87
+ $post_id = null;
88
+ $this->tax_select( $post_id );
89
  break;
90
 
91
  case 'multiselect':
92
+ $post_id = null;
93
+ $this->tax_multiselect( $post_id );
94
  break;
95
 
96
  case 'checkbox':
98
  break;
99
 
100
  case 'text':
101
+ $post_id = null;
102
+ $this->tax_input( $post_id );
103
  break;
104
  default:
105
  // code...
106
  break;
107
+ }
108
+ ?>
109
  <span class="wpuf-wordlimit-message wpuf-help"></span>
110
+ <?php
111
+ $this->help_text( $field_settings );
112
  }
113
 
114
  public function taxnomy_select( $terms ) {
119
  'data-required="%s" data-type="select" data-form-id="%d"',
120
  $attr['required'],
121
  trim( $this->form_id )
122
+ );
123
 
124
+ $exclude = wpuf_get_field_settings_excludes( $this->field_settings, $this->exclude_type );
125
 
126
+ $tax_args = [
127
  'show_option_none' => __( '-- Select --', 'wp-user-frontend' ),
128
  'hierarchical' => 1,
129
  'hide_empty' => 0,
134
  'echo' => 0,
135
  'title_li' => '',
136
  'class' => 'cat-ajax ' . $this->taxonomy . $this->class,
137
+ $exclude['type'] => ( $this->exclude_type === 'child_of' ) ? $exclude['childs'] : $this->exclude,
138
  'selected' => $selected,
139
  'child_of' => isset( $attr['parent_cat'] ) ? $attr['parent_cat'] : '',
140
  ];
142
  $tax_args = apply_filters( 'wpuf_taxonomy_checklist_args', $tax_args );
143
  $select = wp_dropdown_categories( $tax_args );
144
 
145
+ echo str_replace( '<select', '<select ' . $dataset, $select ); // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
146
  $attr = [
147
  'required' => $attr['required'],
148
  'name' => $attr['name'],
149
+ 'exclude_type' => isset( $attr['exclude_type'] ) ? $attr['exclude_type'] : 'exclude',
150
  // 'exclude_type' => $attr['exclude_type'],
151
  'exclude' => $attr['exclude'],
152
  'orderby' => $attr['orderby'],
154
  // 'last_term_id' => isset( $attr['parent_cat'] ) ? $attr['parent_cat'] : '',
155
  //'term_id' => $selected
156
  ];
157
+ $attr = apply_filters( 'wpuf_taxonomy_checklist_args', $attr );
158
+ ?>
159
+ <span data-taxonomy=<?php echo esc_attr( json_encode( $attr ) ); ?>></span>
160
  <?php
161
  }
162
 
164
  $childs = [];
165
 
166
  foreach ( $items as &$item ) {
167
+ $childs[ $item->parent ][] = &$item;
168
  }
169
 
170
  unset( $item );
171
 
172
  foreach ( $items as &$item ) {
173
+ if ( isset( $childs[ $item->term_id ] ) ) {
174
+ $item->childs = $childs[ $item->term_id ];
175
  }
176
  }
177
 
178
+ return reset( $childs );
179
  }
180
 
181
  public function RecursiveCatWrite( $tree ) {
182
  foreach ( $tree as $vals ) {
183
+ $level = 0;
184
+ ?>
185
  <div id="lvl<?php echo esc_attr( $level ); ?>" level="<?php echo esc_attr( $level ); ?>" >
186
  <?php $this->taxnomy_select( $vals->term_id ); ?>
187
  </div>
191
 
192
  if ( isset( $vals->childs ) ) {
193
  $this->RecursiveCatWrite( $vals->childs );
 
194
  }
195
  }
196
  }
197
 
198
  public function tax_ajax( $post_id = null ) {
199
  if ( isset( $post_id ) ) {
200
+ $this->terms = wp_get_post_terms( $post_id, $this->taxonomy, [ 'fields' => 'all' ] );
201
+ }
202
+ ?>
203
 
204
  <div class="category-wrap <?php echo esc_attr( $this->class ); ?>">
205
 
206
  <?php
207
 
208
+ if ( ! count( $this->terms ) ) {
209
  ?>
210
  <div id="lvl0" level="0">
211
  <?php $this->taxnomy_select( null ); ?>
214
  } else {
215
  $tree = $this->catbuildTree( $this->terms );
216
  $this->RecursiveCatWrite( $tree );
217
+ }
218
+ ?>
219
  </div>
220
  <span class="loading"></span>
221
+ <?php
222
  }
223
 
224
  public function tax_select( $post_id = null ) {
226
  $selected = $this->terms ? $this->terms[0] : '';
227
  $required = sprintf( 'data-required="%s" data-type="select"', $attr['required'] );
228
 
229
+ $exclude = wpuf_get_field_settings_excludes( $this->field_settings, $this->exclude_type );
230
 
231
  $tax_args = [
232
  'show_option_none' => isset( $attr['first'] ) ? $attr['first'] : '--select--',
239
  'echo' => 0,
240
  'title_li' => '',
241
  'class' => $this->taxonomy . $this->class,
242
+ $exclude['type'] => ( $this->exclude_type === 'child_of' ) ? $exclude['childs'] : $this->exclude,
243
  'selected' => $selected,
244
  ];
245
 
246
  $tax_args = apply_filters( 'wpuf_taxonomy_checklist_args', $tax_args );
247
 
248
+ $select = wp_dropdown_categories( $tax_args );
249
 
250
  $allowed_html = [
251
+ 'option' => [
252
+ 'value' => [],
253
+ 'selected' => [],
254
+ ],
255
  ];
256
 
257
  echo str_replace( '<select', '<select ' . $required, $select ); // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
273
 
274
  $required = sprintf( 'data-required="%s" data-type="multiselect"', $attr['required'] );
275
 
276
+ $walker = new WPUF_Walker_Category_Multi();
277
 
278
+ $exclude = wpuf_get_field_settings_excludes( $this->field_settings, $this->exclude_type );
279
 
280
  $tax_args = [
281
  // 'show_option_none' => __( '-- Select --', 'wpuf' ),
289
  'echo' => 0,
290
  'title_li' => '',
291
  'class' => $this->taxonomy . ' multiselect' . $this->class,
292
+ $exclude['type'] => ( $this->exclude_type === 'child_of' ) ? $exclude['childs'] : $this->exclude,
293
  'selected' => $selected,
294
  'walker' => $walker,
295
  ];
297
  $tax_args = apply_filters( 'wpuf_taxonomy_checklist_args', $tax_args );
298
  $select = wp_dropdown_categories( $tax_args );
299
 
300
+ echo str_replace( '<select', '<select multiple="multiple" ' . $required, $select ); // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
301
  }
302
 
303
  public function tax_input( $post_id = null ) {
305
  $query_string = '?action=wpuf-ajax-tag-search&tax=' . $attr['name'];
306
 
307
  if ( 'child_of' === $this->exclude_type ) {
308
+ $exclude = wpuf_get_field_settings_excludes( $this->field_settings, $this->exclude_type );
309
 
310
+ $query_string .= '&term_ids=' . implode( ',', $exclude['childs'] );
311
  }
312
 
313
  ?>
317
  <script type="text/javascript">
318
  ;(function($) {
319
  $(document).ready( function(){
320
+ $('#<?php echo esc_attr( $attr['name'] ); ?>').suggest( wpuf_frontend.ajaxurl + '<?php echo $query_string; ?>', { delay: 500, minchars: 2, multiple: true, multipleSep: ', ' } );
321
  });
322
  })(jQuery);
323
  </script>
324
+ <?php
325
  }
326
 
327
  /**
330
  * @return array
331
  */
332
  public function get_options_settings() {
333
+ $default_options = $this->get_default_option_settings( false, [ 'dynamic' ] );
334
  $default_text_options = $this->get_default_taxonomy_option_setttings( false, $this->tax_name );
335
 
336
  return array_merge( $default_options, $default_text_options );
376
  // return sanitize_text_field($_POST[$field['name']]);
377
  check_ajax_referer( 'wpuf_form_add' );
378
 
379
+ $val = isset( $_POST[ $field['name'] ] ) ? sanitize_text_field( wp_unslash( $_POST[ $field['name'] ] ) ) : '';
380
 
381
+ return isset( $field['options'][ $val ] ) ? $field['options'][ $val ] : '';
382
  }
383
  }
includes/fields/class-field-url.php CHANGED
@@ -22,7 +22,7 @@ class WPUF_Form_Field_URL extends WPUF_Form_Field_Text {
22
  * @return void
23
  */
24
  public function render( $field_settings, $form_id, $type = 'post', $post_id = null ) {
25
- if ( isset( $post_id ) && $post_id != '0' ) {
26
  if ( $this->is_meta( $field_settings ) ) {
27
  $value = $this->get_meta( $post_id, $field_settings['name'], $type );
28
  }
@@ -45,7 +45,8 @@ class WPUF_Form_Field_URL extends WPUF_Form_Field_Text {
45
  <?php $this->help_text( $field_settings ); ?>
46
  </div>
47
 
48
- <?php $this->after_field_print_label();
 
49
  }
50
 
51
  /**
@@ -57,7 +58,7 @@ class WPUF_Form_Field_URL extends WPUF_Form_Field_Text {
57
  $default_options = $this->get_default_option_settings();
58
  $settings = $this->get_default_text_option_settings( false ); // word_restriction = false
59
 
60
- $settings[] = [
61
  'name' => 'open_window',
62
  'title' => __( 'Open in : ', 'wp-user-frontend' ),
63
  'type' => 'radio',
@@ -95,7 +96,7 @@ class WPUF_Form_Field_URL extends WPUF_Form_Field_Text {
95
  'hide_field_label' => 'no',
96
  ];
97
 
98
- return array_merge( $defaults, $props );
99
  }
100
 
101
  /**
@@ -108,7 +109,7 @@ class WPUF_Form_Field_URL extends WPUF_Form_Field_Text {
108
  public function prepare_entry( $field ) {
109
  check_ajax_referer( 'wpuf_form_add' );
110
 
111
- $field = isset( $_POST[$field['name']] ) ? sanitize_text_field( wp_unslash( $_POST[$field['name']] ) ) : '';
112
  return esc_url( trim( $field ) );
113
  }
114
 
@@ -123,7 +124,7 @@ class WPUF_Form_Field_URL extends WPUF_Form_Field_Text {
123
  * @return string
124
  */
125
  public function render_field_data( $data, $field ) {
126
- $data = implode( ',' , $data );
127
  $hide_label = isset( $field['hide_field_label'] )
128
  ? wpuf_validate_boolean( $field['hide_field_label'] )
129
  : false;
@@ -136,18 +137,12 @@ class WPUF_Form_Field_URL extends WPUF_Form_Field_Text {
136
 
137
  ob_start();
138
  ?>
139
- <li class="<?php echo esc_attr( implode( ' ' , $container_classnames ) ); ?>">
140
- <?php if ( ! $hide_label ): ?>
141
  <label><?php echo esc_html( $field['label'] ); ?>:</label>
142
  <?php endif; ?>
143
- <?php
144
- echo wp_kses( make_clickable( esc_url_raw( $data ) ), [
145
- 'a' => [
146
- 'href' => [],
147
- 'rel' => []
148
- ],
149
- ] );
150
- ?>
151
  </li>
152
  <?php
153
  return ob_get_clean();
22
  * @return void
23
  */
24
  public function render( $field_settings, $form_id, $type = 'post', $post_id = null ) {
25
+ if ( isset( $post_id ) && $post_id !== '0' ) {
26
  if ( $this->is_meta( $field_settings ) ) {
27
  $value = $this->get_meta( $post_id, $field_settings['name'], $type );
28
  }
45
  <?php $this->help_text( $field_settings ); ?>
46
  </div>
47
 
48
+ <?php
49
+ $this->after_field_print_label();
50
  }
51
 
52
  /**
58
  $default_options = $this->get_default_option_settings();
59
  $settings = $this->get_default_text_option_settings( false ); // word_restriction = false
60
 
61
+ $settings[] = [
62
  'name' => 'open_window',
63
  'title' => __( 'Open in : ', 'wp-user-frontend' ),
64
  'type' => 'radio',
96
  'hide_field_label' => 'no',
97
  ];
98
 
99
+ return array_merge( $defaults, $props );
100
  }
101
 
102
  /**
109
  public function prepare_entry( $field ) {
110
  check_ajax_referer( 'wpuf_form_add' );
111
 
112
+ $field = isset( $_POST[ $field['name'] ] ) ? sanitize_text_field( wp_unslash( $_POST[ $field['name'] ] ) ) : '';
113
  return esc_url( trim( $field ) );
114
  }
115
 
124
  * @return string
125
  */
126
  public function render_field_data( $data, $field ) {
127
+ $data = implode( ',', $data );
128
  $hide_label = isset( $field['hide_field_label'] )
129
  ? wpuf_validate_boolean( $field['hide_field_label'] )
130
  : false;
137
 
138
  ob_start();
139
  ?>
140
+ <li class="<?php echo esc_attr( implode( ' ', $container_classnames ) ); ?>">
141
+ <?php if ( ! $hide_label ) : ?>
142
  <label><?php echo esc_html( $field['label'] ); ?>:</label>
143
  <?php endif; ?>
144
+ <a href="<?php echo esc_url_raw( $data ); ?>"
145
+ <?php echo ! empty( $field['open_window'] ) && $field['open_window'] === 'new' ? 'target="_blank" rel="noreferrer noopener"' : ''; ?> > <?php echo esc_url_raw( $data ); ?> </a>
 
 
 
 
 
 
146
  </li>
147
  <?php
148
  return ob_get_clean();
includes/free/form-element.php CHANGED
@@ -1,6 +1,8 @@
1
  <?php
2
 
 
3
  class WPUF_form_element extends WPUF_Pro_Prompt {
 
4
 
5
  public static function add_form_custom_buttons() {
6
  $title = esc_attr( __( 'Click to add to the editor', 'wp-user-frontend' ) ); ?>
@@ -19,12 +21,13 @@ class WPUF_form_element extends WPUF_Pro_Prompt {
19
  }
20
 
21
  /**
22
- * add formbuilder's button in Others section
23
  */
24
  public static function add_form_other_buttons() {
25
  $title = esc_attr( __( 'Click to add to the editor', 'wp-user-frontend' ) );
26
 
27
- self::get_pro_prompt(); ?>
 
28
  <button class="button" disabled data-type="shortcode" title="<?php echo esc_attr( $title ); ?>"><?php esc_html_e( 'Shortcode', 'wp-user-frontend' ); ?></button>
29
  <button class="button" data-name="recaptcha" data-type="captcha" title="<?php echo esc_attr( $title ); ?>"><?php esc_html_e( 'reCaptcha', 'wp-user-frontend' ); ?></button>
30
  <button class="button" disabled data-type="rscaptcha" title="<?php echo esc_attr( $title ); ?>"><?php esc_html_e( 'Really Simple Captcha', 'wp-user-frontend' ); ?></button>
@@ -46,7 +49,8 @@ class WPUF_form_element extends WPUF_Pro_Prompt {
46
  $is_enable_mail_after_expired = 'checked';
47
  $post_expiration_message = '';
48
 
49
- self::get_pro_prompt(); ?>
 
50
  <div id="wpuf-pro-content">
51
  <table class="form-table">
52
  <tr>
@@ -63,26 +67,29 @@ class WPUF_form_element extends WPUF_Pro_Prompt {
63
  <th><?php esc_html_e( 'Post Expiration Time', 'wp-user-frontend' ); ?></th>
64
  <td>
65
  <?php
66
- $timeType_array = [
67
  'year' => 100,
68
  'month' => 12,
69
  'day' => 30,
70
- ]; ?>
 
71
  <select disabled name="" id="wpuf-expiration_time_value">
72
  <?php
73
- for ( $i = 1; $i <= $timeType_array[$time_type]; $i++ ) {
74
  ?>
75
- <option value="<?php echo esc_attr( $i ); ?>" <?php echo $i == $time_value ? 'selected' : ''; ?> ><?php echo esc_attr( $i ); ?></option>
76
- <?php
77
- } ?>
 
78
  </select>
79
  <select disabled name="" id="wpuf-expiration_time_type">
80
  <?php
81
- foreach ( $timeType_array as $each_time_type=>$each_time_type_val ) {
82
  ?>
83
- <option value="<?php echo esc_attr( $each_time_type ); ?>" <?php echo $each_time_type == $time_type ? 'selected' : ''; ?> ><?php echo esc_html(ucfirst( $each_time_type )); ?></option>
84
- <?php
85
- } ?>
 
86
  </select>
87
  </td>
88
  </tr>
@@ -97,10 +104,16 @@ class WPUF_form_element extends WPUF_Pro_Prompt {
97
  <?php
98
  foreach ( $post_statuses as $post_status => $text ) {
99
  ?>
100
- <option value="<?php echo esc_attr( $post_status ); ?>" <?php echo ( $expired_post_status == $post_status ) ? 'selected' : ''; ?> ><?php echo esc_html(
101
- $text ); ?></option>
102
- <?php
103
- } ?>
 
 
 
 
 
 
104
  </select>
105
  <p class="description"><?php echo esc_html( __( 'Status of post after post expiration time is over ', 'wp-user-frontend' ) ); ?></p>
106
 
@@ -127,7 +140,7 @@ class WPUF_form_element extends WPUF_Pro_Prompt {
127
  </table>
128
  </div>
129
 
130
- <?php
131
  }
132
 
133
  /**
@@ -186,7 +199,7 @@ class WPUF_form_element extends WPUF_Pro_Prompt {
186
  $mail_body .= "Post URL: %permalink%\r\n";
187
  $mail_body .= 'Edit URL: %editlink%';
188
 
189
- $form_settings = wpuf_get_form_settings( $post->ID );
190
 
191
  $new_notificaton = isset( $form_settings['notification']['new'] ) ? $form_settings['notification']['new'] : 'on';
192
  $new_to = isset( $form_settings['notification']['new_to'] ) ? $form_settings['notification']['new_to'] : get_option( 'admin_email' );
@@ -196,7 +209,8 @@ class WPUF_form_element extends WPUF_Pro_Prompt {
196
  $edit_notificaton = 'off';
197
  $edit_to = get_option( 'admin_email' );
198
  $edit_subject = __( 'A post has been edited', 'wp-user-frontend' );
199
- $edit_body = $edit_mail_body . $mail_body; ?>
 
200
 
201
  <h3><?php esc_html_e( 'New Post Notification', 'wp-user-frontend' ); ?></h3>
202
  <table class="form-table">
@@ -270,12 +284,16 @@ class WPUF_form_element extends WPUF_Pro_Prompt {
270
 
271
  <h3><?php esc_html_e( 'You may use in to, subject & message:', 'wp-user-frontend' ); ?></h3>
272
  <p>
273
- <code>%post_title%</code>, <code>%post_content%</code>, <code>%post_excerpt%</code>, <code>%tags%</code>, <code>%category%</code>,
 
 
 
 
274
  <code>%author%</code>, <code>%author_email%</code>, <code>%author_bio%</code>, <code>%sitename%</code>, <code>%siteurl%</code>, <code>%permalink%</code>, <code>%editlink%</code>
275
  <br><code>%custom_{NAME_OF_CUSTOM_FIELD}%</code> e.g: <code>%custom_website_url%</code> for <code>website_url</code> meta field
276
  </p>
277
 
278
- <?php
279
  }
280
 
281
  /**
@@ -286,7 +304,8 @@ class WPUF_form_element extends WPUF_Pro_Prompt {
286
 
287
  $form_inputs = wpuf_get_form_fields( $post->ID );
288
 
289
- self::get_pro_prompt(); ?>
 
290
  <div style="margin-bottom: 10px">
291
  <button class="button wpuf-collapse"><?php esc_html_e( 'Toggle All', 'wp-user-frontend' ); ?></button>
292
  </div>
@@ -305,11 +324,15 @@ class WPUF_form_element extends WPUF_Pro_Prompt {
305
  foreach ( $form_inputs as $order => $input_field ) {
306
  $name = ucwords( str_replace( '_', ' ', $input_field['template'] ) );
307
 
 
308
  WPUF_Admin_Template_Profile::$input_field['template']( $count, $name, $input_field );
 
 
309
 
310
  $count++;
311
  }
312
- } ?>
 
313
  </ul>
314
  <?php
315
  }
@@ -330,7 +353,8 @@ class WPUF_form_element extends WPUF_Pro_Prompt {
330
  $page_id = 0;
331
  $url = '';
332
  $submit_text = __( 'Register', 'wp-user-frontend' );
333
- $update_text = __( 'Update Profile', 'wp-user-frontend' ); ?>
 
334
  <tr>
335
  <td colspan="2">
336
  <?php self::get_pro_prompt(); ?>
@@ -350,10 +374,15 @@ class WPUF_form_element extends WPUF_Pro_Prompt {
350
  <select disabled name="">
351
  <?php
352
  $user_roles = wpuf_get_user_roles();
353
-
354
- foreach ( $user_roles as $role => $label ) {
355
- printf( '<option value="%s"%s>%s</option>', esc_attr( $role ), esc_attr( selected( $role_selected, $role, false ) ), esc_attr( $label ) );
356
- } ?>
 
 
 
 
 
357
  </select>
358
  </td>
359
  </tr>
@@ -371,7 +400,8 @@ class WPUF_form_element extends WPUF_Pro_Prompt {
371
 
372
  foreach ( $redirect_options as $to => $label ) {
373
  printf( '<option value="%s"%s>%s</option>', esc_attr( $to ), esc_attr( selected( $redirect_to, $to, false ) ), esc_html( $label ) );
374
- } ?>
 
375
  </select>
376
  <div class="description">
377
  <?php esc_html_e( 'After successfull submit, where the page will redirect to', 'wp-user-frontend' ); ?>
@@ -398,11 +428,20 @@ class WPUF_form_element extends WPUF_Pro_Prompt {
398
  <td>
399
  <select disabled name="">
400
  <?php
401
- $pages = get_posts( [ 'numberposts' => -1, 'post_type' => 'page'] );
 
 
 
402
 
403
  foreach ( $pages as $page ) {
404
- printf( '<option value="%s"%s>%s</option>', esc_attr( $page->ID ), esc_attr( selected( $page_id, $page->ID, false ) ), esc_attr( $page->post_title ) );
405
- } ?>
 
 
 
 
 
 
406
  </select>
407
  </td>
408
  </tr>
@@ -427,14 +466,14 @@ class WPUF_form_element extends WPUF_Pro_Prompt {
427
  <input disabled type="text" name="" value="<?php echo esc_attr( $update_text ); ?>">
428
  </td>
429
  </tr>
430
- <?php
431
  }
432
 
433
  /**
434
  * Checks what the post type is
435
  */
436
  public static function check_post_type( $post, $update ) {
437
- if ( get_post_type( $post->ID ) == 'wpuf_profile' && $update ) {
438
  $http_referer = isset( $_SERVER['HTTP_REFERER'] ) ? sanitize_text_field( wp_unslash( $_SERVER['HTTP_REFERER'] ) ) : '';
439
  wp_redirect( $http_referer );
440
  die();
@@ -463,6 +502,6 @@ class WPUF_form_element extends WPUF_Pro_Prompt {
463
  <label class="wpuf-pro-text-alert"> (<?php echo esc_attr( self::get_pro_prompt_text() ); ?>)</label>
464
  </div>
465
  </div> <!-- .wpuf-form-rows -->
466
- <?php
467
  }
468
  }
1
  <?php
2
 
3
+ // @codingStandardsIgnoreStart
4
  class WPUF_form_element extends WPUF_Pro_Prompt {
5
+ // @codingStandardsIgnoreEnd
6
 
7
  public static function add_form_custom_buttons() {
8
  $title = esc_attr( __( 'Click to add to the editor', 'wp-user-frontend' ) ); ?>
21
  }
22
 
23
  /**
24
+ * Add formbuilder's button in Others section
25
  */
26
  public static function add_form_other_buttons() {
27
  $title = esc_attr( __( 'Click to add to the editor', 'wp-user-frontend' ) );
28
 
29
+ self::get_pro_prompt();
30
+ ?>
31
  <button class="button" disabled data-type="shortcode" title="<?php echo esc_attr( $title ); ?>"><?php esc_html_e( 'Shortcode', 'wp-user-frontend' ); ?></button>
32
  <button class="button" data-name="recaptcha" data-type="captcha" title="<?php echo esc_attr( $title ); ?>"><?php esc_html_e( 'reCaptcha', 'wp-user-frontend' ); ?></button>
33
  <button class="button" disabled data-type="rscaptcha" title="<?php echo esc_attr( $title ); ?>"><?php esc_html_e( 'Really Simple Captcha', 'wp-user-frontend' ); ?></button>
49
  $is_enable_mail_after_expired = 'checked';
50
  $post_expiration_message = '';
51
 
52
+ self::get_pro_prompt();
53
+ ?>
54
  <div id="wpuf-pro-content">
55
  <table class="form-table">
56
  <tr>
67
  <th><?php esc_html_e( 'Post Expiration Time', 'wp-user-frontend' ); ?></th>
68
  <td>
69
  <?php
70
+ $time_type_array = [
71
  'year' => 100,
72
  'month' => 12,
73
  'day' => 30,
74
+ ];
75
+ ?>
76
  <select disabled name="" id="wpuf-expiration_time_value">
77
  <?php
78
+ for ( $i = 1; $i <= $time_type_array[ $time_type ]; $i++ ) {
79
  ?>
80
+ <option value="<?php echo esc_attr( $i ); ?>" <?php echo $i === $time_value ? 'selected' : ''; ?> ><?php echo esc_attr( $i ); ?></option>
81
+ <?php
82
+ }
83
+ ?>
84
  </select>
85
  <select disabled name="" id="wpuf-expiration_time_type">
86
  <?php
87
+ foreach ( $time_type_array as $each_time_type => $each_time_type_val ) {
88
  ?>
89
+ <option value="<?php echo esc_attr( $each_time_type ); ?>" <?php echo $each_time_type === $time_type ? 'selected' : ''; ?> ><?php echo esc_html( ucfirst( $each_time_type ) ); ?></option>
90
+ <?php
91
+ }
92
+ ?>
93
  </select>
94
  </td>
95
  </tr>
104
  <?php
105
  foreach ( $post_statuses as $post_status => $text ) {
106
  ?>
107
+ <option value="<?php echo esc_attr( $post_status ); ?>" <?php echo ( $expired_post_status === $post_status ) ? 'selected' : ''; ?> >
108
+ <?php
109
+ echo esc_html(
110
+ $text
111
+ );
112
+ ?>
113
+ </option>
114
+ <?php
115
+ }
116
+ ?>
117
  </select>
118
  <p class="description"><?php echo esc_html( __( 'Status of post after post expiration time is over ', 'wp-user-frontend' ) ); ?></p>
119
 
140
  </table>
141
  </div>
142
 
143
+ <?php
144
  }
145
 
146
  /**
199
  $mail_body .= "Post URL: %permalink%\r\n";
200
  $mail_body .= 'Edit URL: %editlink%';
201
 
202
+ $form_settings = wpuf_get_form_settings( $post->ID );
203
 
204
  $new_notificaton = isset( $form_settings['notification']['new'] ) ? $form_settings['notification']['new'] : 'on';
205
  $new_to = isset( $form_settings['notification']['new_to'] ) ? $form_settings['notification']['new_to'] : get_option( 'admin_email' );
209
  $edit_notificaton = 'off';
210
  $edit_to = get_option( 'admin_email' );
211
  $edit_subject = __( 'A post has been edited', 'wp-user-frontend' );
212
+ $edit_body = $edit_mail_body . $mail_body;
213
+ ?>
214
 
215
  <h3><?php esc_html_e( 'New Post Notification', 'wp-user-frontend' ); ?></h3>
216
  <table class="form-table">
284
 
285
  <h3><?php esc_html_e( 'You may use in to, subject & message:', 'wp-user-frontend' ); ?></h3>
286
  <p>
287
+ <code>%post_title%</code>, <code>%post_content%</code>, <code>%post_excerpt%</code>, <code>%tags%</code>, <code>%category%</code>,
288
+ <?php
289
+ if ( class_exists( 'WooCommerce' ) ) :
290
+ ?>
291
+ <code>%product_cat%</code> <?php endif ?>,
292
  <code>%author%</code>, <code>%author_email%</code>, <code>%author_bio%</code>, <code>%sitename%</code>, <code>%siteurl%</code>, <code>%permalink%</code>, <code>%editlink%</code>
293
  <br><code>%custom_{NAME_OF_CUSTOM_FIELD}%</code> e.g: <code>%custom_website_url%</code> for <code>website_url</code> meta field
294
  </p>
295
 
296
+ <?php
297
  }
298
 
299
  /**
304
 
305
  $form_inputs = wpuf_get_form_fields( $post->ID );
306
 
307
+ self::get_pro_prompt();
308
+ ?>
309
  <div style="margin-bottom: 10px">
310
  <button class="button wpuf-collapse"><?php esc_html_e( 'Toggle All', 'wp-user-frontend' ); ?></button>
311
  </div>
324
  foreach ( $form_inputs as $order => $input_field ) {
325
  $name = ucwords( str_replace( '_', ' ', $input_field['template'] ) );
326
 
327
+ // @codingStandardsIgnoreStart
328
  WPUF_Admin_Template_Profile::$input_field['template']( $count, $name, $input_field );
329
+
330
+ // @codingStandardsIgnoreEnd
331
 
332
  $count++;
333
  }
334
+ }
335
+ ?>
336
  </ul>
337
  <?php
338
  }
353
  $page_id = 0;
354
  $url = '';
355
  $submit_text = __( 'Register', 'wp-user-frontend' );
356
+ $update_text = __( 'Update Profile', 'wp-user-frontend' );
357
+ ?>
358
  <tr>
359
  <td colspan="2">
360
  <?php self::get_pro_prompt(); ?>
374
  <select disabled name="">
375
  <?php
376
  $user_roles = wpuf_get_user_roles();
377
+ foreach ( $user_roles as $role => $label ) {
378
+ printf(
379
+ '<option value="%s"%s>%s</option>',
380
+ esc_attr( $role ),
381
+ esc_attr( selected( $role_selected, $role, false ) ),
382
+ esc_attr( $label )
383
+ );
384
+ }
385
+ ?>
386
  </select>
387
  </td>
388
  </tr>
400
 
401
  foreach ( $redirect_options as $to => $label ) {
402
  printf( '<option value="%s"%s>%s</option>', esc_attr( $to ), esc_attr( selected( $redirect_to, $to, false ) ), esc_html( $label ) );
403
+ }
404
+ ?>
405
  </select>
406
  <div class="description">
407
  <?php esc_html_e( 'After successfull submit, where the page will redirect to', 'wp-user-frontend' ); ?>
428
  <td>
429
  <select disabled name="">
430
  <?php
431
+ $pages = get_posts( [
432
+ 'numberposts' => -1,
433
+ 'post_type' => 'page',
434
+ ]);
435
 
436
  foreach ( $pages as $page ) {
437
+ printf(
438
+ '<option value="%s"%s>%s</option>',
439
+ esc_attr( $page->ID ),
440
+ esc_attr( selected( $page_id, $page->ID, false ) ),
441
+ esc_attr( $page->post_title )
442
+ );
443
+ }
444
+ ?>
445
  </select>
446
  </td>
447
  </tr>
466
  <input disabled type="text" name="" value="<?php echo esc_attr( $update_text ); ?>">
467
  </td>
468
  </tr>
469
+ <?php
470
  }
471
 
472
  /**
473
  * Checks what the post type is
474
  */
475
  public static function check_post_type( $post, $update ) {
476
+ if ( get_post_type( $post->ID ) === 'wpuf_profile' && $update ) {
477
  $http_referer = isset( $_SERVER['HTTP_REFERER'] ) ? sanitize_text_field( wp_unslash( $_SERVER['HTTP_REFERER'] ) ) : '';
478
  wp_redirect( $http_referer );
479
  die();
502
  <label class="wpuf-pro-text-alert"> (<?php echo esc_attr( self::get_pro_prompt_text() ); ?>)</label>
503
  </div>
504
  </div> <!-- .wpuf-form-rows -->
505
+ <?php
506
  }
507
  }
languages/wp-user-frontend.pot CHANGED
@@ -2,9 +2,9 @@
2
  # This file is distributed under the GPL2 or later.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: WP User Frontend 3.5.3\n"
6
  "Report-Msgid-Bugs-To: https://wedevs.com/contact/\n"
7
- "POT-Creation-Date: 2020-10-21 05:00:56+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -177,7 +177,7 @@ msgstr ""
177
  #: includes/fields/class-abstract-fields.php:346
178
  #: includes/fields/class-abstract-fields.php:409
179
  #: includes/fields/class-field-checkbox.php:74
180
- #: includes/fields/class-field-radio.php:83 includes/free/form-element.php:460
181
  #: wpuf.php:715
182
  msgid "Yes"
183
  msgstr ""
@@ -192,7 +192,7 @@ msgstr ""
192
  #: includes/fields/class-abstract-fields.php:347
193
  #: includes/fields/class-abstract-fields.php:410
194
  #: includes/fields/class-field-checkbox.php:75
195
- #: includes/fields/class-field-radio.php:84 includes/free/form-element.php:461
196
  #: wpuf.php:716
197
  msgid "No"
198
  msgstr ""
@@ -218,16 +218,16 @@ msgid "Expires In:"
218
  msgstr ""
219
 
220
  #: admin/class-admin-subscription.php:412 admin/form.php:227
221
- #: includes/free/form-element.php:53
222
  msgid "Post Expiration"
223
  msgstr ""
224
 
225
- #: admin/class-admin-subscription.php:417 includes/free/form-element.php:57
226
  msgid "Enable Post Expiration"
227
  msgstr ""
228
 
229
  #: admin/class-admin-subscription.php:428
230
- #: admin/class-admin-subscription.php:691 includes/free/form-element.php:63
231
  msgid "Post Expiration Time"
232
  msgstr ""
233
 
@@ -236,7 +236,7 @@ msgstr ""
236
  msgid "Post Status"
237
  msgstr ""
238
 
239
- #: admin/class-admin-subscription.php:463 includes/free/form-element.php:105
240
  msgid "Status of post after post expiration time is over "
241
  msgstr ""
242
 
@@ -256,7 +256,7 @@ msgstr ""
256
  msgid "Expiration Message"
257
  msgstr ""
258
 
259
- #: admin/class-admin-subscription.php:485 includes/free/form-element.php:124
260
  msgid "You may use: {post_author} {post_url} {blogname} {post_title} {post_status}"
261
  msgstr ""
262
 
@@ -328,7 +328,7 @@ msgstr ""
328
 
329
  #: admin/class-admin-subscription.php:774
330
  #: admin/form-builder/class-wpuf-admin-form-builder.php:284
331
- #: class/payment.php:205 class/subscription.php:787
332
  #: includes/class-list-table-subscribers.php:138 lib/appsero/Insights.php:764
333
  #: templates/dashboard/subscription.php:64
334
  msgid "Cancel"
@@ -364,7 +364,7 @@ msgstr ""
364
 
365
  #: admin/class-tools.php:43 admin/class-tools.php:106
366
  #: admin/post-forms-list-table.php:43 class/transactions-list-table.php:87
367
- #: includes/class-list-table-subscribers.php:136 wpuf-functions.php:3016
368
  msgid "All"
369
  msgstr ""
370
 
@@ -516,12 +516,16 @@ msgstr ""
516
  msgid "Label"
517
  msgstr ""
518
 
519
- #: admin/form-builder/assets/js/components/field-option-data/template.php:36
 
 
 
 
520
  #: admin/template.php:234 admin/template.php:286
521
  msgid "Value"
522
  msgstr ""
523
 
524
- #: admin/form-builder/assets/js/components/field-option-data/template.php:84
525
  msgid "Clear Selection"
526
  msgstr ""
527
 
@@ -541,8 +545,8 @@ msgstr ""
541
  #: admin/form-builder/assets/js/components/form-image_upload/template.php:6
542
  #: class/render-form.php:1655
543
  #: includes/fields/class-field-featured-image.php:122
544
- #: includes/fields/class-field-image.php:115
545
- #: includes/fields/class-field-image.php:136
546
  msgid "Select Image"
547
  msgstr ""
548
 
@@ -792,8 +796,8 @@ msgstr ""
792
  msgid "Registration Forms"
793
  msgstr ""
794
 
795
- #: admin/form.php:189 includes/free/form-element.php:204
796
- #: includes/free/form-element.php:242
797
  msgid "Notification"
798
  msgstr ""
799
 
@@ -958,7 +962,7 @@ msgid "No Change"
958
  msgstr ""
959
 
960
  #: admin/html/form-settings-post-edit.php:31
961
- #: admin/html/form-settings-post.php:130 includes/free/form-element.php:362
962
  msgid "Redirect To"
963
  msgstr ""
964
 
@@ -968,22 +972,22 @@ msgid "Newly created post"
968
  msgstr ""
969
 
970
  #: admin/html/form-settings-post-edit.php:37
971
- #: admin/html/form-settings-post.php:136 includes/free/form-element.php:367
972
  msgid "Same Page"
973
  msgstr ""
974
 
975
  #: admin/html/form-settings-post-edit.php:38
976
- #: admin/html/form-settings-post.php:137 includes/free/form-element.php:368
977
  msgid "To a page"
978
  msgstr ""
979
 
980
  #: admin/html/form-settings-post-edit.php:39
981
- #: admin/html/form-settings-post.php:138 includes/free/form-element.php:369
982
  msgid "To a custom URL"
983
  msgstr ""
984
 
985
  #: admin/html/form-settings-post-edit.php:48
986
- #: admin/html/form-settings-post.php:147 includes/free/form-element.php:377
987
  msgid "After successfull submit, where the page will redirect to"
988
  msgstr ""
989
 
@@ -992,12 +996,12 @@ msgid "Post Update Message"
992
  msgstr ""
993
 
994
  #: admin/html/form-settings-post-edit.php:61
995
- #: admin/html/form-settings-post.php:160 includes/free/form-element.php:397
996
  msgid "Page"
997
  msgstr ""
998
 
999
  #: admin/html/form-settings-post-edit.php:76
1000
- #: admin/html/form-settings-post.php:175 includes/free/form-element.php:411
1001
  msgid "Custom URL"
1002
  msgstr ""
1003
 
@@ -1214,7 +1218,7 @@ msgid "From"
1214
  msgstr ""
1215
 
1216
  #: admin/html/form-submission-restriction.php:141
1217
- #: includes/free/form-element.php:216 includes/free/form-element.php:253
1218
  msgid "To"
1219
  msgstr ""
1220
 
@@ -1407,446 +1411,486 @@ msgstr ""
1407
  msgid "Contact Support"
1408
  msgstr ""
1409
 
1410
- #: admin/html/whats-new.php:8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1411
  msgid "Add character restriction feature"
1412
  msgstr ""
1413
 
1414
- #: admin/html/whats-new.php:12
1415
  msgid "Make sure post author edit link works only in frontend"
1416
  msgstr ""
1417
 
1418
- #: admin/html/whats-new.php:16
1419
  msgid "Inconsistency in lost password reset email message"
1420
  msgstr ""
1421
 
1422
- #: admin/html/whats-new.php:20
1423
  msgid "Saving custom taxonomy terms when input type is text"
1424
  msgstr ""
1425
 
1426
- #: admin/html/whats-new.php:24
1427
  msgid "Taxonomy field JS error in builder"
1428
  msgstr ""
1429
 
1430
- #: admin/html/whats-new.php:28
1431
  msgid "Showing WPUF edit link for WP default roles"
1432
  msgstr ""
1433
 
1434
- #: admin/html/whats-new.php:32
1435
  msgid "Upload button unresponsive issue in iOS"
1436
  msgstr ""
1437
 
1438
- #: admin/html/whats-new.php:42
1439
  msgid "Add post edit link for post authors in single or archive pages"
1440
  msgstr ""
1441
 
1442
- #: admin/html/whats-new.php:46
1443
  msgid "Enhance post delete message"
1444
  msgstr ""
1445
 
1446
- #: admin/html/whats-new.php:50
1447
  msgid "Refactor control buttons visibility in form builder"
1448
  msgstr ""
1449
 
1450
- #: admin/html/whats-new.php:54
1451
  msgid "Add missing colons after field label"
1452
  msgstr ""
1453
 
1454
- #: admin/html/whats-new.php:58
1455
  msgid "Post edit map capability condition"
1456
  msgstr ""
1457
 
1458
- #: admin/html/whats-new.php:62
1459
  msgid "Role based permission for accessing a post form"
1460
  msgstr ""
1461
 
1462
- #: admin/html/whats-new.php:66
1463
  msgid "Section-break field alignment"
1464
  msgstr ""
1465
 
1466
- #: admin/html/whats-new.php:70
1467
  msgid "Pay per post doesn't work if subscription pack is activated"
1468
  msgstr ""
1469
 
1470
- #: admin/html/whats-new.php:74
1471
  msgid "Mime type for uploading JSON files"
1472
  msgstr ""
1473
 
1474
- #: admin/html/whats-new.php:78
1475
  msgid "File upload with same file name"
1476
  msgstr ""
1477
 
1478
- #: admin/html/whats-new.php:82
1479
  msgid "Post preview missing fields"
1480
  msgstr ""
1481
 
1482
- #: admin/html/whats-new.php:86
1483
  msgid "Illigal variable declartion"
1484
  msgstr ""
1485
 
1486
- #: admin/html/whats-new.php:90
1487
  msgid "Featured image updating issue"
1488
  msgstr ""
1489
 
1490
- #: admin/html/whats-new.php:94
1491
  msgid "Conflict with Phlox theme"
1492
  msgstr ""
1493
 
1494
- #: admin/html/whats-new.php:98
1495
  msgid "Textarea custom field data sanitization"
1496
  msgstr ""
1497
 
1498
- #: admin/html/whats-new.php:102
1499
  msgid "exclude_type warning in wpuf_category_checklist"
1500
  msgstr ""
1501
 
1502
- #: admin/html/whats-new.php:106
1503
  msgid "Category field not showing all child categories for selection type child of"
1504
  msgstr ""
1505
 
1506
- #: admin/html/whats-new.php:110
1507
  msgid "Conflict between image and file upload custom fields"
1508
  msgstr ""
1509
 
1510
- #: admin/html/whats-new.php:114
1511
  msgid "Login url when login page is not set"
1512
  msgstr ""
1513
 
1514
- #: admin/html/whats-new.php:124
1515
  msgid ""
1516
  "Use common names for Ivory Coast, North Korea and Sourth Korea instead of "
1517
  "their official names"
1518
  msgstr ""
1519
 
1520
- #: admin/html/whats-new.php:128
1521
  msgid "Fix condition to use default avatar"
1522
  msgstr ""
1523
 
1524
- #: admin/html/whats-new.php:132
1525
  msgid "Make Email and URL fields clickable"
1526
  msgstr ""
1527
 
1528
- #: admin/html/whats-new.php:136
1529
  msgid "Fix redirect after user login"
1530
  msgstr ""
1531
 
1532
- #: admin/html/whats-new.php:140
1533
  msgid "Sanitize textarea field data"
1534
  msgstr ""
1535
 
1536
- #: admin/html/whats-new.php:144
1537
  msgid ""
1538
  "Fix missing colon to email, URL, text and textarea labels when renders "
1539
  "their data"
1540
  msgstr ""
1541
 
1542
- #: admin/html/whats-new.php:148
1543
  msgid "Prevent showing empty labels for fields that have render_field_data method"
1544
  msgstr ""
1545
 
1546
- #: admin/html/whats-new.php:158
1547
  msgid "Add Namibian Dollar in currency list"
1548
  msgstr ""
1549
 
1550
- #: admin/html/whats-new.php:162
1551
  msgid "Add sync values option for option data fields"
1552
  msgstr ""
1553
 
1554
- #: admin/html/whats-new.php:166
1555
  msgid "Allow uploading image that having filesize meets php ini settings"
1556
  msgstr ""
1557
 
1558
- #: admin/html/whats-new.php:170
1559
  msgid "Limit the selection of one image at a time"
1560
  msgstr ""
1561
 
1562
- #: admin/html/whats-new.php:174
1563
  msgid "Use file name and size to generate hash to prevent duplicant image upload"
1564
  msgstr ""
1565
 
1566
- #: admin/html/whats-new.php:178
1567
  msgid "Sanitize text and textarea field data"
1568
  msgstr ""
1569
 
1570
- #: admin/html/whats-new.php:182
1571
  msgid ""
1572
  "Show label instead of values for radio, checkbox, dropdown and multiselect "
1573
  "data"
1574
  msgstr ""
1575
 
1576
- #: admin/html/whats-new.php:186
1577
  msgid "Saving custom taxonomies for type text input"
1578
  msgstr ""
1579
 
1580
- #: admin/html/whats-new.php:190
1581
  msgid "Admin settings link for recaptcha helper text"
1582
  msgstr ""
1583
 
1584
- #: admin/html/whats-new.php:194
1585
  msgid "Undefined name property for Custom HTML fields"
1586
  msgstr ""
1587
 
1588
- #: admin/html/whats-new.php:198
1589
  msgid "Delete attachment process"
1590
  msgstr ""
1591
 
1592
- #: admin/html/whats-new.php:202
1593
  msgid "Missing billing address in invoice PDF"
1594
  msgstr ""
1595
 
1596
- #: admin/html/whats-new.php:206
1597
  msgid "Showing country field value in frontend post content"
1598
  msgstr ""
1599
 
1600
- #: admin/html/whats-new.php:210
1601
  msgid "Avatar size display not complying with admin settings size"
1602
  msgstr ""
1603
 
1604
- #: admin/html/whats-new.php:214
1605
  msgid "Display default avatars on admin settings discussion page"
1606
  msgstr ""
1607
 
1608
- #: admin/html/whats-new.php:218
1609
  msgid "Redirect to subscription page at registration"
1610
  msgstr ""
1611
 
1612
- #: admin/html/whats-new.php:222
1613
  msgid "Error notice regarding registration page redirect"
1614
  msgstr ""
1615
 
1616
- #: admin/html/whats-new.php:226
1617
  msgid "Escaping html in registration errors"
1618
  msgstr ""
1619
 
1620
- #: admin/html/whats-new.php:230
1621
  msgid "Default login redirect link"
1622
  msgstr ""
1623
 
1624
- #: admin/html/whats-new.php:234
1625
  msgid "Implementing default WP login page override option"
1626
  msgstr ""
1627
 
1628
- #: admin/html/whats-new.php:238
1629
  msgid "Transparent background of autosuggestion dropdown"
1630
  msgstr ""
1631
 
1632
- #: admin/html/whats-new.php:248
1633
  msgid "Import forms system"
1634
  msgstr ""
1635
 
1636
- #: admin/html/whats-new.php:252
1637
  msgid "Password reset system"
1638
  msgstr ""
1639
 
1640
- #: admin/html/whats-new.php:256
1641
  msgid "Updated url validation regex to support modern tlds"
1642
  msgstr ""
1643
 
1644
- #: admin/html/whats-new.php:260
1645
  msgid "Export WPUF forms individually from admin tools page"
1646
  msgstr ""
1647
 
1648
- #: admin/html/whats-new.php:264
1649
  msgid "Subscription cycle label translation issue"
1650
  msgstr ""
1651
 
1652
- #: admin/html/whats-new.php:268
1653
  msgid "ACF integration for checkbox fields"
1654
  msgstr ""
1655
 
1656
- #: admin/html/whats-new.php:272
1657
  msgid "Illegal string offset warning while updating settings"
1658
  msgstr ""
1659
 
1660
- #: admin/html/whats-new.php:276
1661
  msgid "Conditional logic for Section Break field"
1662
  msgstr ""
1663
 
1664
- #: admin/html/whats-new.php:280
1665
  msgid "Subscriptions cannot be deleted from backend"
1666
  msgstr ""
1667
 
1668
- #: admin/html/whats-new.php:284
1669
  msgid "A regression regarding saving checkbox data"
1670
  msgstr ""
1671
 
1672
- #: admin/html/whats-new.php:288
1673
  msgid "Default value of multi-select fields is not showing"
1674
  msgstr ""
1675
 
1676
- #: admin/html/whats-new.php:298
1677
  msgid "Hide post edit option when subscription is expired"
1678
  msgstr ""
1679
 
1680
- #: admin/html/whats-new.php:300
1681
  msgid "Hide post edit option from users whose subscription pack is expired."
1682
  msgstr ""
1683
 
1684
- #: admin/html/whats-new.php:303
1685
  msgid "Check files to prevent duplicity in media upload"
1686
  msgstr ""
1687
 
1688
- #: admin/html/whats-new.php:305
1689
  msgid ""
1690
  "A simple measure has been taken to prevent maliciously flooding the site by "
1691
  "uploading same file multiple times. Though this won't work with already "
1692
  "uploaded medias."
1693
  msgstr ""
1694
 
1695
- #: admin/html/whats-new.php:308
1696
  msgid "Refactor address fields in Account section"
1697
  msgstr ""
1698
 
1699
- #: admin/html/whats-new.php:310
1700
  msgid "Address edit section from Account section has been rewritten to improve UX."
1701
  msgstr ""
1702
 
1703
- #: admin/html/whats-new.php:313
1704
  msgid "Update Paypal payment gateway"
1705
  msgstr ""
1706
 
1707
- #: admin/html/whats-new.php:315
1708
  msgid "Paypal payment gateway has seen some improvements."
1709
  msgstr ""
1710
 
1711
- #: admin/html/whats-new.php:318
1712
  msgid "Default Category selection improvements"
1713
  msgstr ""
1714
 
1715
- #: admin/html/whats-new.php:320
1716
  msgid ""
1717
  "An intuitive way of selecting default category of a selected post type has "
1718
  "been introduced."
1719
  msgstr ""
1720
 
1721
- #: admin/html/whats-new.php:323
1722
  msgid "Compatibility issue with ACF date time field"
1723
  msgstr ""
1724
 
1725
- #: admin/html/whats-new.php:325
1726
  msgid "A Compatibility issue with ACF date time field has been addressed."
1727
  msgstr ""
1728
 
1729
- #: admin/html/whats-new.php:328
1730
  msgid "Media title, caption & description not saving"
1731
  msgstr ""
1732
 
1733
- #: admin/html/whats-new.php:330
1734
  msgid ""
1735
  "Media title, caption & description were not saving from frontend. They will "
1736
  "now."
1737
  msgstr ""
1738
 
1739
- #: admin/html/whats-new.php:333
1740
  msgid ""
1741
  "The Events Calendar venue and organizer fields issue in WPUF Custom Fields "
1742
  "metabox"
1743
  msgstr ""
1744
 
1745
- #: admin/html/whats-new.php:335
1746
  msgid ""
1747
  "A workaround has been introduced to save The Events Calendar Venue and "
1748
  "Organizer fields properly from WPUF Custom Fields metabox."
1749
  msgstr ""
1750
 
1751
- #: admin/html/whats-new.php:338
1752
  msgid "Checkbox data not saving from WPUF Custom Fields metabox"
1753
  msgstr ""
1754
 
1755
- #: admin/html/whats-new.php:340
1756
  msgid ""
1757
  "Checkboxe data from WPUF Custom Fields metabox were not saving. It has been "
1758
  "fixed."
1759
  msgstr ""
1760
 
1761
- #: admin/html/whats-new.php:343
1762
  msgid "Multi-column Repeater field data saving issue"
1763
  msgstr ""
1764
 
1765
- #: admin/html/whats-new.php:345
1766
  msgid ""
1767
  "Multi-column Repeater field data from a form was not saving. It has been "
1768
  "fixed."
1769
  msgstr ""
1770
 
1771
- #: admin/html/whats-new.php:348
1772
  msgid "Multistep form conflict with Elementor"
1773
  msgstr ""
1774
 
1775
- #: admin/html/whats-new.php:350
1776
  msgid "Multistep form had a conflict with Elementor. It has been fixed."
1777
  msgstr ""
1778
 
1779
- #: admin/html/whats-new.php:353
1780
  msgid "Multiple images showing issue in frontend"
1781
  msgstr ""
1782
 
1783
- #: admin/html/whats-new.php:355
1784
  msgid "Multiple images in a post were not showing in frontend. Now they will."
1785
  msgstr ""
1786
 
1787
- #: admin/html/whats-new.php:364
1788
  msgid "Nonce not verify on login"
1789
  msgstr ""
1790
 
1791
- #: admin/html/whats-new.php:366
1792
  msgid "Return of function wp_verify_nonce() was ignored."
1793
  msgstr ""
1794
 
1795
- #: admin/html/whats-new.php:375
1796
  msgid "Option to set which tab shows as active on the account page"
1797
  msgstr ""
1798
 
1799
- #: admin/html/whats-new.php:377
1800
  msgid ""
1801
  "Option to set which tab shows as active on the account page. To configure "
1802
  "this setting navigate to wp-admin->User Frontend->Settings->My "
1803
  "Account->Active Tab "
1804
  msgstr ""
1805
 
1806
- #: admin/html/whats-new.php:380
1807
  msgid "Unlock option was unavailable after the post being locked"
1808
  msgstr ""
1809
 
1810
- #: admin/html/whats-new.php:382
1811
  msgid "Unlock option was unavailable after the post being locked."
1812
  msgstr ""
1813
 
1814
- #: admin/html/whats-new.php:385
1815
  msgid "Gutenberg block of WPUF didn't work on bedrock installation"
1816
  msgstr ""
1817
 
1818
- #: admin/html/whats-new.php:387
1819
  msgid "Gutenberg block of WPUF didn't work on bedrock installation."
1820
  msgstr ""
1821
 
1822
- #: admin/html/whats-new.php:390
1823
  msgid "Sending admin payment received email twice"
1824
  msgstr ""
1825
 
1826
- #: admin/html/whats-new.php:392
1827
  msgid ""
1828
  "After processing payment admin & user was receiving payment received email "
1829
  "twice."
1830
  msgstr ""
1831
 
1832
- #: admin/html/whats-new.php:395
1833
  msgid ""
1834
  "Add shortcode support to display post information in the Post Expiration "
1835
  "Message"
1836
  msgstr ""
1837
 
1838
- #: admin/html/whats-new.php:397
1839
  msgid ""
1840
  "Add shortcode support to display post information in the Post Expiration "
1841
  "Message. You can use: <strong>{post_author} {post_url} {blogname} "
1842
  "{post_title} {post_status}</strong>"
1843
  msgstr ""
1844
 
1845
- #: admin/html/whats-new.php:400
1846
  msgid "Add optin on the setup wizard"
1847
  msgstr ""
1848
 
1849
- #: admin/html/whats-new.php:402
1850
  msgid ""
1851
  "Added optin on the setup wizard, admin can choose whether he/she wants to "
1852
  "share server environment details (php, mysql, server, WordPress versions), "
@@ -1854,126 +1898,126 @@ msgid ""
1854
  "name and url, admin name and email address. No sensitive data is tracked"
1855
  msgstr ""
1856
 
1857
- #: admin/html/whats-new.php:411
1858
  msgid "Post Owner problem"
1859
  msgstr ""
1860
 
1861
- #: admin/html/whats-new.php:413
1862
  msgid ""
1863
  "Posts were not assigned to the selected default post owner, this issue has "
1864
  "been fixed."
1865
  msgstr ""
1866
 
1867
- #: admin/html/whats-new.php:416
1868
  msgid "Google reCaptcha was not working"
1869
  msgstr ""
1870
 
1871
- #: admin/html/whats-new.php:418
1872
  msgid ""
1873
  "Google reCaptcha was not working, users could submit the form without "
1874
  "reCaptcha validation."
1875
  msgstr ""
1876
 
1877
- #: admin/html/whats-new.php:427
1878
  msgid "Added column field"
1879
  msgstr ""
1880
 
1881
- #: admin/html/whats-new.php:432
1882
  msgid "Unable to render the events on the front-end dashboard"
1883
  msgstr ""
1884
 
1885
- #: admin/html/whats-new.php:434
1886
  msgid ""
1887
  "On the frontend dashboard, the submitted events were not showing, you will "
1888
  "get it fixed in this version."
1889
  msgstr ""
1890
 
1891
- #: admin/html/whats-new.php:437
1892
  msgid "Page order getting 0(zero) after editing from the frontend"
1893
  msgstr ""
1894
 
1895
- #: admin/html/whats-new.php:439
1896
  msgid ""
1897
  "Page order was not saving while editing a post using WPUF form, it has been "
1898
  "fixed."
1899
  msgstr ""
1900
 
1901
- #: admin/html/whats-new.php:442
1902
  msgid "Text input field for taxonomies not working"
1903
  msgstr ""
1904
 
1905
- #: admin/html/whats-new.php:444
1906
  msgid ""
1907
  "When taxonomy field type is set to `Text Input` then a fatal error was "
1908
  "showing on the frontend, no error with taxonomy field in the latest version."
1909
  msgstr ""
1910
 
1911
- #: admin/html/whats-new.php:447
1912
  msgid ""
1913
  "In radio and checkbox field use conditional logic that value does not save "
1914
  "in database"
1915
  msgstr ""
1916
 
1917
- #: admin/html/whats-new.php:449
1918
  msgid ""
1919
  "The selected value of radio and checkbox field were not showing while "
1920
  "editing posts from the backend or frontend, you can see the selected value "
1921
  "in this version."
1922
  msgstr ""
1923
 
1924
- #: admin/html/whats-new.php:452
1925
  msgid "The args param not working with get_avatar filter"
1926
  msgstr ""
1927
 
1928
- #: admin/html/whats-new.php:454
1929
  msgid "The args parameter did not exist with get_avatar filter, which now exists."
1930
  msgstr ""
1931
 
1932
- #: admin/html/whats-new.php:457
1933
  msgid "The item in ajax taxonomy field was not selected"
1934
  msgstr ""
1935
 
1936
- #: admin/html/whats-new.php:459
1937
  msgid ""
1938
  "When the taxonomy field type is set to Ajax, the submitted terms were not "
1939
  "showing in the backend and frontend which have been fixed."
1940
  msgstr ""
1941
 
1942
- #: admin/html/whats-new.php:468
1943
  msgid "Unable to send new user registration email"
1944
  msgstr ""
1945
 
1946
- #: admin/html/whats-new.php:470
1947
  msgid ""
1948
  "WP User Frontend default registration form `[wpuf-registration]` was unable "
1949
  "to send the new user registration email."
1950
  msgstr ""
1951
 
1952
- #: admin/html/whats-new.php:473
1953
  msgid "WPUF forms block compatibility issue with the latest WP version"
1954
  msgstr ""
1955
 
1956
- #: admin/html/whats-new.php:475
1957
  msgid ""
1958
  "With the latest version of WordPress the gutenberg block of WP User "
1959
  "Frontend were not working. In this version, you will get it fixed."
1960
  msgstr ""
1961
 
1962
- #: admin/html/whats-new.php:478
1963
  msgid "Page not update where `[wpuf_dashboard]` shortcode exist"
1964
  msgstr ""
1965
 
1966
- #: admin/html/whats-new.php:480
1967
  msgid ""
1968
  "While using Gutenberg, the page were not being updated with WPUF shortcode "
1969
  "[wpuf dashboard]"
1970
  msgstr ""
1971
 
1972
- #: admin/html/whats-new.php:483
1973
  msgid "Retain default when determining whether to display the admin bar"
1974
  msgstr ""
1975
 
1976
- #: admin/html/whats-new.php:485
1977
  msgid ""
1978
  "From the User Frontend Settings, set that Administrator, Editor, Vendor can "
1979
  "see the admin bar. Now, the super admin want, one specific user ( who has "
@@ -1983,11 +2027,11 @@ msgid ""
1983
  "frontend."
1984
  msgstr ""
1985
 
1986
- #: admin/html/whats-new.php:488
1987
  msgid "Fatal error when use PHP lower version (5.4 or lower)"
1988
  msgstr ""
1989
 
1990
- #: admin/html/whats-new.php:490
1991
  msgid ""
1992
  "It was unable to install WP User Frontend with PHP 5.4 or lower version. "
1993
  "Here is the error details: <br><br><strong>Fatal error: Can't use method "
@@ -1995,42 +2039,42 @@ msgid ""
1995
  "/wp-user-frontend/class/frontend-form-post.php on line 194</strong>"
1996
  msgstr ""
1997
 
1998
- #: admin/html/whats-new.php:493
1999
  msgid "Product form was unable to show the single gallery image"
2000
  msgstr ""
2001
 
2002
- #: admin/html/whats-new.php:495
2003
  msgid ""
2004
  "When user upload single image for product gallery using WPUF WooCommerce "
2005
  "product form, that image were not showing on the frontend."
2006
  msgstr ""
2007
 
2008
- #: admin/html/whats-new.php:504
2009
  msgid "WooCommerce gallery images not getting saved"
2010
  msgstr ""
2011
 
2012
- #: admin/html/whats-new.php:506
2013
  msgid ""
2014
  "After releasing version 2.9.3, WooCommerce gallery image field stopped "
2015
  "working. You will get it fixed in this version."
2016
  msgstr ""
2017
 
2018
- #: admin/html/whats-new.php:515
2019
  msgid "The Events Calendar Integration Form"
2020
  msgstr ""
2021
 
2022
- #: admin/html/whats-new.php:517
2023
  msgid ""
2024
  "Now admin can allow users to create event from the frontend. Currently WPUF "
2025
  "has a one click pre-build event form that has been integrated with The "
2026
  "Events Calendar plugin"
2027
  msgstr ""
2028
 
2029
- #: admin/html/whats-new.php:520
2030
  msgid "Post Submission Facility From Account Page"
2031
  msgstr ""
2032
 
2033
- #: admin/html/whats-new.php:522
2034
  msgid ""
2035
  "On the frontend account page, added a new menu item named <b>Submit "
2036
  "Post</b>. Now admin can allow users to submit post from their default "
@@ -2039,504 +2083,504 @@ msgid ""
2039
  "you can assign any post form that will use to submit posts."
2040
  msgstr ""
2041
 
2042
- #: admin/html/whats-new.php:525
2043
  msgid "Login/Lost Password Link Under Registration Form"
2044
  msgstr ""
2045
 
2046
- #: admin/html/whats-new.php:527
2047
  msgid "Added Login/Lost Password link under registration form"
2048
  msgstr ""
2049
 
2050
- #: admin/html/whats-new.php:536
2051
  msgid "Added drag and drop image ordering on image upload"
2052
  msgstr ""
2053
 
2054
- #: admin/html/whats-new.php:538
2055
  msgid ""
2056
  "Now frontend users can drag & drop the images/files to change the order "
2057
  "while uploading."
2058
  msgstr ""
2059
 
2060
- #: admin/html/whats-new.php:541
2061
  msgid "Added reCAPTCHA field in login form"
2062
  msgstr ""
2063
 
2064
- #: admin/html/whats-new.php:543
2065
  msgid ""
2066
  "Admin has the option to show reCAPTCHA field in login form. Check the "
2067
  "related settings from <strong>User Frontend > Settings > "
2068
  "Login/Registration</strong>"
2069
  msgstr ""
2070
 
2071
- #: admin/html/whats-new.php:546
2072
  msgid "Added preview option in forms"
2073
  msgstr ""
2074
 
2075
- #: admin/html/whats-new.php:548
2076
  msgid ""
2077
  "You can see a nice <strong>Preview</strong> button with <strong>Save "
2078
  "Form</strong> button, admin can take a quick look of the form without using "
2079
  "shortcode"
2080
  msgstr ""
2081
 
2082
- #: admin/html/whats-new.php:551
2083
  msgid "Fixed hiding “Select Image” button while uploading multiple images."
2084
  msgstr ""
2085
 
2086
- #: admin/html/whats-new.php:553
2087
  msgid ""
2088
  "The upload button will not be hidden until the user selects max number of "
2089
  "files "
2090
  msgstr ""
2091
 
2092
- #: admin/html/whats-new.php:556
2093
  msgid "Added form limit notice before form submission"
2094
  msgstr ""
2095
 
2096
- #: admin/html/whats-new.php:558
2097
  msgid ""
2098
  "Limit notice message was showing after submission, now it is showing when "
2099
  "rendering the form"
2100
  msgstr ""
2101
 
2102
- #: admin/html/whats-new.php:561
2103
  msgid "Fixed: default post category not saving"
2104
  msgstr ""
2105
 
2106
- #: admin/html/whats-new.php:563
2107
  msgid ""
2108
  "From the form <strong>Settings > Post Settings</strong>, default post "
2109
  "category options were not saving. Now, it's fixed."
2110
  msgstr ""
2111
 
2112
- #: admin/html/whats-new.php:566
2113
  msgid ""
2114
  "WPUF dashboard shortcode with form_id attribute was not showing posts "
2115
  "properly"
2116
  msgstr ""
2117
 
2118
- #: admin/html/whats-new.php:568
2119
  msgid ""
2120
  "Now you can list posts on the frontend by using <strong>form_id<strong/> "
2121
  "attribute with <strong>[wpuf_dashboard]</strong> shortcode"
2122
  msgstr ""
2123
 
2124
- #: admin/html/whats-new.php:577
2125
  msgid "Changed text domain to `wp-user-frontend` from `wpuf` "
2126
  msgstr ""
2127
 
2128
- #: admin/html/whats-new.php:579
2129
  msgid ""
2130
  "If you are using other language than English. Please <b>rename</b> your "
2131
  "<i>.po and .mo </i> files to `wp-user-frontend_` from `wpuf_` <br> This "
2132
  "change was made to support translations from translate.wordpress.org"
2133
  msgstr ""
2134
 
2135
- #: admin/html/whats-new.php:582
2136
  msgid "Added WP User Frontend Data export and erase functionality."
2137
  msgstr ""
2138
 
2139
- #: admin/html/whats-new.php:584
2140
  msgid "Added functionality to export WP User Frontend Data to comply with GDPR."
2141
  msgstr ""
2142
 
2143
- #: admin/html/whats-new.php:587
2144
  msgid "Added billing address customizer."
2145
  msgstr ""
2146
 
2147
- #: admin/html/whats-new.php:589
2148
  msgid "Added customizer options for billing address in payment page."
2149
  msgstr ""
2150
 
2151
- #: admin/html/whats-new.php:592
2152
  msgid "Make the payment page responsive."
2153
  msgstr ""
2154
 
2155
- #: admin/html/whats-new.php:594
2156
  msgid "Some css adjustments are made in payment page to make it responsive."
2157
  msgstr ""
2158
 
2159
- #: admin/html/whats-new.php:597
2160
  msgid "Fixed image upload issue in Safari."
2161
  msgstr ""
2162
 
2163
- #: admin/html/whats-new.php:599
2164
  msgid "Images were not showing after upload in safari, it is fixed now."
2165
  msgstr ""
2166
 
2167
- #: admin/html/whats-new.php:602
2168
  msgid "Post update issue after updating or removing post images."
2169
  msgstr ""
2170
 
2171
- #: admin/html/whats-new.php:604
2172
  msgid ""
2173
  "Posts cannot be updated after updating or removing post images, it is fixed "
2174
  "now."
2175
  msgstr ""
2176
 
2177
- #: admin/html/whats-new.php:613
2178
  msgid "Allow overriding form input styles using theme styling."
2179
  msgstr ""
2180
 
2181
- #: admin/html/whats-new.php:615
2182
  msgid "Overriding form input styles using theme style is now possible."
2183
  msgstr ""
2184
 
2185
- #: admin/html/whats-new.php:618
2186
  msgid "Fixed Auto Login after registration."
2187
  msgstr ""
2188
 
2189
- #: admin/html/whats-new.php:620
2190
  msgid "Auto Login after registration was not working is fixed now."
2191
  msgstr ""
2192
 
2193
- #: admin/html/whats-new.php:623
2194
  msgid "Fixed fallback cost calculation"
2195
  msgstr ""
2196
 
2197
- #: admin/html/whats-new.php:625
2198
  msgid "Fallback cost calculation was inaccurate for some cases, it is fixed now."
2199
  msgstr ""
2200
 
2201
- #: admin/html/whats-new.php:628
2202
  msgid "Removal of subscription from User Profile gets reverted if updated"
2203
  msgstr ""
2204
 
2205
- #: admin/html/whats-new.php:630
2206
  msgid "User subscription deletion gets reverted if updated is fixed."
2207
  msgstr ""
2208
 
2209
- #: admin/html/whats-new.php:633
2210
  msgid "Show Free pack users in subscribers list."
2211
  msgstr ""
2212
 
2213
- #: admin/html/whats-new.php:635
2214
  msgid "Free pack users were not showing in subscribers list, now they will."
2215
  msgstr ""
2216
 
2217
- #: admin/html/whats-new.php:644
2218
  msgid "WP User Frontend Guten Block is added"
2219
  msgstr ""
2220
 
2221
- #: admin/html/whats-new.php:646
2222
  msgid ""
2223
  "WPUF Form Block is now available to be used within gutenberg editor with "
2224
  "preview of the form. "
2225
  msgstr ""
2226
 
2227
- #: admin/html/whats-new.php:649
2228
  msgid "Advanced Custom Fields plugin compatibility"
2229
  msgstr ""
2230
 
2231
- #: admin/html/whats-new.php:651
2232
  msgid "Now all your ACF fields can be used within WPUF Post forms. "
2233
  msgstr ""
2234
 
2235
- #: admin/html/whats-new.php:654
2236
  msgid "Taxonomy Terms not showing for custom post types"
2237
  msgstr ""
2238
 
2239
- #: admin/html/whats-new.php:656
2240
  msgid ""
2241
  "Fixed an issue with taxonomy terms not appearing for Custom Post types "
2242
  "within Form Settings and Dashboard Post Listing"
2243
  msgstr ""
2244
 
2245
- #: admin/html/whats-new.php:659
2246
  msgid "Various other code optimizations"
2247
  msgstr ""
2248
 
2249
- #: admin/html/whats-new.php:661 admin/html/whats-new.php:718
2250
  msgid "Code structure organization and optimization for better performance"
2251
  msgstr ""
2252
 
2253
- #: admin/html/whats-new.php:670
2254
  msgid "WoooCommerce billing address Sync"
2255
  msgstr ""
2256
 
2257
- #: admin/html/whats-new.php:672
2258
  msgid ""
2259
  "If an existing customer has previously set his billing address, that will "
2260
  "be imported into WPUF Billing address "
2261
  msgstr ""
2262
 
2263
- #: admin/html/whats-new.php:675
2264
  msgid "Trial subscription message not showing properly"
2265
  msgstr ""
2266
 
2267
- #: admin/html/whats-new.php:677
2268
  msgid "Subscriptions with Trial now shows trial notices"
2269
  msgstr ""
2270
 
2271
- #: admin/html/whats-new.php:680
2272
  msgid "Reset email Key not working"
2273
  msgstr ""
2274
 
2275
- #: admin/html/whats-new.php:682
2276
  msgid "Reset Email key was not working in some cases"
2277
  msgstr ""
2278
 
2279
- #: admin/html/whats-new.php:685
2280
  msgid "Post count not showing on the frontend dashboard"
2281
  msgstr ""
2282
 
2283
- #: admin/html/whats-new.php:687
2284
  msgid ""
2285
  "Dashboard with multiple post type was not showing post counts properly, is "
2286
  "now fixed and shows count for each post type"
2287
  msgstr ""
2288
 
2289
- #: admin/html/whats-new.php:690
2290
  msgid "Login Redirect showing blank page is fixed"
2291
  msgstr ""
2292
 
2293
- #: admin/html/whats-new.php:692
2294
  msgid ""
2295
  "If \"Previous Page\" was set for redirection, login redirect was "
2296
  "redirecting to blank page for users who hit login page directly"
2297
  msgstr ""
2298
 
2299
- #: admin/html/whats-new.php:701
2300
  msgid "Enhanced Login Redirect to redirect users to previous page"
2301
  msgstr ""
2302
 
2303
- #: admin/html/whats-new.php:703
2304
  msgid ""
2305
  "You can choose Previous Page as Login Redirect page settings now to "
2306
  "redirect users to the page from which they went for Login. "
2307
  msgstr ""
2308
 
2309
- #: admin/html/whats-new.php:706
2310
  msgid "Email HTML links not Rendreing properly issue is fixed"
2311
  msgstr ""
2312
 
2313
- #: admin/html/whats-new.php:708
2314
  msgid ""
2315
  "For some clients emails were not rendering the HTML links properly, this is "
2316
  "now fixed"
2317
  msgstr ""
2318
 
2319
- #: admin/html/whats-new.php:711
2320
  msgid "Form Builder : Form Field's Help text styles not showing properly"
2321
  msgstr ""
2322
 
2323
- #: admin/html/whats-new.php:713
2324
  msgid "Help texts styling is now fixed and much easier to read and understand"
2325
  msgstr ""
2326
 
2327
- #: admin/html/whats-new.php:716
2328
  msgid "Various other code improvements"
2329
  msgstr ""
2330
 
2331
- #: admin/html/whats-new.php:727
2332
  msgid "Dashboard Post Listing now supports multiple post types"
2333
  msgstr ""
2334
 
2335
- #: admin/html/whats-new.php:729
2336
  msgid ""
2337
  "Now you can show multiple post type in user dashboard using shortcode like "
2338
  "this : <br><b>[wpuf_dashboard post_type=\"post,page,custom_type\"]</b> "
2339
  msgstr ""
2340
 
2341
- #: admin/html/whats-new.php:732
2342
  msgid "Added Login Redirect Settings"
2343
  msgstr ""
2344
 
2345
- #: admin/html/whats-new.php:734
2346
  msgid ""
2347
  "You can now set a page from <i>WPUF Settings > Login/Registration > "
2348
  "Redirect after Login</i>. When login redirection is active the user will be "
2349
  "redirected to this page after login."
2350
  msgstr ""
2351
 
2352
- #: admin/html/whats-new.php:737
2353
  msgid "Image Upload field button text can be changed"
2354
  msgstr ""
2355
 
2356
- #: admin/html/whats-new.php:739
2357
  msgid ""
2358
  "The upload button text can now be changed for image upload fields which "
2359
  "defaults to \"Select Image\" if not set. "
2360
  msgstr ""
2361
 
2362
- #: admin/html/whats-new.php:742
2363
  msgid "Multi Step Form styles made compatible with more themes"
2364
  msgstr ""
2365
 
2366
- #: admin/html/whats-new.php:744
2367
  msgid "Multi Step form can now be styled more easily with other themes "
2368
  msgstr ""
2369
 
2370
- #: admin/html/whats-new.php:747
2371
  msgid "Required field condition for google map not working is fixed"
2372
  msgstr ""
2373
 
2374
- #: admin/html/whats-new.php:749
2375
  msgid ""
2376
  "If Google Map field was set as required users were able to submit form "
2377
  "without changing the default value."
2378
  msgstr ""
2379
 
2380
- #: admin/html/whats-new.php:758
2381
  msgid "Admin form builder is now fully responsive."
2382
  msgstr ""
2383
 
2384
- #: admin/html/whats-new.php:760
2385
  msgid ""
2386
  "Now you can edit forms from your mobile devices directly. Our improved "
2387
  "responsive layouts of form builder makes it easy for you to build forms on "
2388
  "the go."
2389
  msgstr ""
2390
 
2391
- #: admin/html/whats-new.php:763
2392
  msgid "Added color schemes for creating attractive form layouts."
2393
  msgstr ""
2394
 
2395
- #: admin/html/whats-new.php:765
2396
  msgid ""
2397
  "We have added 3 new color schemes for the form layouts which you can choose "
2398
  "from each form's new display settings."
2399
  msgstr ""
2400
 
2401
- #: admin/html/whats-new.php:768
2402
  msgid "Restrict Free subscription pack to be enabled multiple times "
2403
  msgstr ""
2404
 
2405
- #: admin/html/whats-new.php:770
2406
  msgid ""
2407
  "Free subscription packs now can only be purchased once and the limit "
2408
  "applies properly"
2409
  msgstr ""
2410
 
2411
- #: admin/html/whats-new.php:773
2412
  msgid "Various other bug fixes and improvements were made "
2413
  msgstr ""
2414
 
2415
- #: admin/html/whats-new.php:775
2416
  msgid "Please see the change log to see full details."
2417
  msgstr ""
2418
 
2419
- #: admin/html/whats-new.php:784
2420
  msgid "Added upgrade function for default category"
2421
  msgstr ""
2422
 
2423
- #: admin/html/whats-new.php:786
2424
  msgid "Upgrader added to upgrade previously set default post category."
2425
  msgstr ""
2426
 
2427
- #: admin/html/whats-new.php:789
2428
  msgid "Subscription pack cannot be canceled"
2429
  msgstr ""
2430
 
2431
- #: admin/html/whats-new.php:791
2432
  msgid ""
2433
  "Fixed recurring subscription pack cannot be canceled from my account page "
2434
  "in subscription details section."
2435
  msgstr ""
2436
 
2437
- #: admin/html/whats-new.php:794
2438
  msgid "page installer admin notice logic issue"
2439
  msgstr ""
2440
 
2441
- #: admin/html/whats-new.php:796
2442
  msgid ""
2443
  "Fixed page installer admin notice logic problem due to new payment settings "
2444
  "default value not set."
2445
  msgstr ""
2446
 
2447
- #: admin/html/whats-new.php:806
2448
  msgid "Setup Wizard"
2449
  msgstr ""
2450
 
2451
- #: admin/html/whats-new.php:808
2452
  msgid "Setup Wizard added to turn off payment options and install pages."
2453
  msgstr ""
2454
 
2455
- #: admin/html/whats-new.php:812
2456
  msgid "Multi-select Category"
2457
  msgstr ""
2458
 
2459
- #: admin/html/whats-new.php:814
2460
  msgid "Add multi-select to default category in post form settings."
2461
  msgstr ""
2462
 
2463
- #: admin/html/whats-new.php:818
2464
  msgid "Select Text option for Taxonomy"
2465
  msgstr ""
2466
 
2467
- #: admin/html/whats-new.php:820
2468
  msgid ""
2469
  "Add Select Text option for taxonomy fields. Now you can add default text "
2470
  "with empty value as first option for Taxonomy dropdown."
2471
  msgstr ""
2472
 
2473
- #: admin/html/whats-new.php:823
2474
  msgid "Taxonomy Checkbox Inline"
2475
  msgstr ""
2476
 
2477
- #: admin/html/whats-new.php:825
2478
  msgid ""
2479
  "Added checkbox inline option to taxonomy checkbox. You can now display "
2480
  "Taxonomy checkbox fields inline."
2481
  msgstr ""
2482
 
2483
- #: admin/html/whats-new.php:835
2484
  msgid "Manage schedule for form submission"
2485
  msgstr ""
2486
 
2487
- #: admin/html/whats-new.php:837
2488
  msgid ""
2489
  "Do not accept form submission if the current date is not between the date "
2490
  "range of the schedule."
2491
  msgstr ""
2492
 
2493
- #: admin/html/whats-new.php:841
2494
  msgid "Restrict form submission based on the user roles"
2495
  msgstr ""
2496
 
2497
- #: admin/html/whats-new.php:843
2498
  msgid ""
2499
  "Restrict form submission based on the user roles. Now you can manage user "
2500
  "role base permission on form submission."
2501
  msgstr ""
2502
 
2503
- #: admin/html/whats-new.php:847
2504
  msgid "Limit how many entries a form will accept"
2505
  msgstr ""
2506
 
2507
- #: admin/html/whats-new.php:849
2508
  msgid ""
2509
  "Limit how many entries a form will accept and display a custom message when "
2510
  "that limit is reached."
2511
  msgstr ""
2512
 
2513
- #: admin/html/whats-new.php:853
2514
  msgid "Show/hide Admin Bar"
2515
  msgstr ""
2516
 
2517
- #: admin/html/whats-new.php:855
2518
  msgid "Control the admin bar visibility based on user roles."
2519
  msgstr ""
2520
 
2521
- #: admin/html/whats-new.php:859
2522
  msgid "Ajax Login widget"
2523
  msgstr ""
2524
 
2525
- #: admin/html/whats-new.php:861
2526
  msgid ""
2527
  "Login user is more simple now with Ajax Login Widget. The simple ajax login "
2528
  "form do not required page loading for login."
2529
  msgstr ""
2530
 
2531
- #: admin/html/whats-new.php:865
2532
  msgid "Form submission with Captcha field"
2533
  msgstr ""
2534
 
2535
- #: admin/html/whats-new.php:867
2536
  msgid "Form field validation process updated if form submits with captcha field."
2537
  msgstr ""
2538
 
2539
- #: admin/html/whats-new.php:881
2540
  msgid "What's New in WPUF?"
2541
  msgstr ""
2542
 
@@ -2559,7 +2603,7 @@ msgid "Congratulations!"
2559
  msgstr ""
2560
 
2561
  #: admin/installer.php:84 admin/settings-options.php:24
2562
- #: includes/free/admin/shortcode-button.php:79 wpuf-functions.php:1961
2563
  msgid "Dashboard"
2564
  msgstr ""
2565
 
@@ -2575,7 +2619,7 @@ msgstr ""
2575
  #: admin/installer.php:95 class/subscription.php:381 class/subscription.php:401
2576
  #: class/subscription.php:402 class/subscription.php:403
2577
  #: includes/free/admin/shortcode-button.php:99
2578
- #: templates/dashboard/dashboard.php:19 wpuf-functions.php:1964
2579
  msgid "Subscription"
2580
  msgstr ""
2581
 
@@ -2658,7 +2702,7 @@ msgstr ""
2658
 
2659
  #: admin/post-forms-list-table.php:315 admin/premium.php:39
2660
  #: includes/fields/class-pro-upgrade-fields.php:159
2661
- #: includes/free/form-element.php:28
2662
  msgid "Shortcode"
2663
  msgstr ""
2664
 
@@ -2768,7 +2812,7 @@ msgid "Advanced Fields"
2768
  msgstr ""
2769
 
2770
  #: admin/premium.php:33 includes/fields/class-pro-upgrade-fields.php:19
2771
- #: includes/free/form-element.php:14
2772
  msgid "Country List"
2773
  msgstr ""
2774
 
@@ -2785,7 +2829,7 @@ msgid "Google Map"
2785
  msgstr ""
2786
 
2787
  #: admin/premium.php:37 includes/fields/class-pro-upgrade-fields.php:71
2788
- #: includes/free/form-element.php:31
2789
  msgid "Action Hook"
2790
  msgstr ""
2791
 
@@ -2802,7 +2846,7 @@ msgid "Repeater"
2802
  msgstr ""
2803
 
2804
  #: admin/premium.php:42 includes/fields/class-pro-upgrade-fields.php:49
2805
- #: includes/free/form-element.php:12
2806
  msgid "File Upload"
2807
  msgstr ""
2808
 
@@ -2835,7 +2879,7 @@ msgid ""
2835
  msgstr ""
2836
 
2837
  #: admin/premium.php:71 admin/premium.php:74 includes/class-pro-upgrades.php:94
2838
- #: includes/free/form-element.php:457
2839
  msgid "Conditional Logic"
2840
  msgstr ""
2841
 
@@ -3502,13 +3546,13 @@ msgstr ""
3502
 
3503
  #: admin/template-post.php:88 admin/template.php:608
3504
  #: includes/fields/class-field-featured-image.php:116
3505
- #: includes/fields/class-field-image.php:100
3506
  msgid "Enter maximum upload size limit in KB"
3507
  msgstr ""
3508
 
3509
  #: admin/template-post.php:99 admin/template.php:619
3510
  #: includes/fields/class-field-featured-image.php:112
3511
- #: includes/fields/class-field-image.php:96
3512
  msgid "Max. file size"
3513
  msgstr ""
3514
 
@@ -3791,7 +3835,7 @@ msgstr ""
3791
  #: class/upload.php:264 includes/fields/class-field-recaptcha.php:147
3792
  #: includes/fields/class-field-sectionbreak.php:55
3793
  #: templates/dashboard/posts.php:89 templates/dashboard.php:104
3794
- #: wpuf-functions.php:986
3795
  msgid "Title"
3796
  msgstr ""
3797
 
@@ -3808,15 +3852,15 @@ msgid "Enter the meta value"
3808
  msgstr ""
3809
 
3810
  #: admin/template.php:583 class/upload.php:266
3811
- #: includes/fields/class-field-sectionbreak.php:63 wpuf-functions.php:994
3812
  msgid "Description"
3813
  msgstr ""
3814
 
3815
- #: admin/template.php:609 includes/fields/class-field-image.php:109
3816
  msgid "Number of images can be uploaded"
3817
  msgstr ""
3818
 
3819
- #: admin/template.php:624 includes/fields/class-field-image.php:105
3820
  msgid "Max. files"
3821
  msgstr ""
3822
 
@@ -3982,68 +4026,74 @@ msgstr ""
3982
  msgid "Please select your payment page from admin panel"
3983
  msgstr ""
3984
 
3985
- #: class/payment.php:121
 
 
 
 
3986
  msgid "Your free package has been activated. Enjoy!"
3987
  msgstr ""
3988
 
3989
- #: class/payment.php:123
3990
  msgid "You already have activated a free package previously."
3991
  msgstr ""
3992
 
3993
- #: class/payment.php:138 includes/class-customizer.php:56
3994
- #: wpuf-functions.php:1965
3995
  msgid "Billing Address"
3996
  msgstr ""
3997
 
3998
- #: class/payment.php:167
3999
  msgid "Pricing & Plans"
4000
  msgstr ""
4001
 
4002
- #: class/payment.php:169
4003
  msgid "Change Pack"
4004
  msgstr ""
4005
 
4006
- #: class/payment.php:186
4007
  msgid "Selected Pack "
4008
  msgstr ""
4009
 
4010
- #: class/payment.php:187
4011
  msgid "Pack Price "
4012
  msgstr ""
4013
 
4014
- #: class/payment.php:191 class/payment.php:240 includes/class-privacy.php:338
4015
  msgid "Total"
4016
  msgstr ""
4017
 
4018
- #: class/payment.php:204
4019
  msgid "Apply Coupon"
4020
  msgstr ""
4021
 
4022
- #: class/payment.php:208
4023
  msgid "Have a discount code?"
4024
  msgstr ""
4025
 
4026
- #: class/payment.php:236
4027
  msgid "Post cost"
4028
  msgstr ""
4029
 
4030
- #: class/payment.php:248
4031
  msgid "Choose Your Payment Method"
4032
  msgstr ""
4033
 
4034
- #: class/payment.php:285
4035
  msgid "Proceed"
4036
  msgstr ""
4037
 
4038
- #: class/payment.php:292
4039
  msgid "No Payment gateway found"
4040
  msgstr ""
4041
 
4042
- #: class/payment.php:480 lib/gateway/bank.php:107
 
4043
  msgid "[%s] Payment Received"
4044
  msgstr ""
4045
 
4046
- #: class/payment.php:481
 
4047
  msgid "New payment received at %s"
4048
  msgstr ""
4049
 
@@ -4077,7 +4127,7 @@ msgstr ""
4077
  #: includes/fields/class-abstract-fields.php:188
4078
  #: includes/fields/class-field-dropdown.php:106
4079
  #: includes/fields/class-field-multidropdown.php:83
4080
- #: includes/fields/class-field-post-taxonomy.php:343
4081
  msgid "- select -"
4082
  msgstr ""
4083
 
@@ -4170,12 +4220,12 @@ msgstr ""
4170
  msgid "Strength indicator"
4171
  msgstr ""
4172
 
4173
- #: class/render-form.php:1401 includes/fields/class-field-post-taxonomy.php:120
4174
- #: wpuf-functions.php:1749
4175
  msgid "-- Select --"
4176
  msgstr ""
4177
 
4178
- #: class/render-form.php:1465 includes/fields/class-field-post-taxonomy.php:65
4179
  msgid "This field is no longer available."
4180
  msgstr ""
4181
 
@@ -4365,7 +4415,7 @@ msgstr ""
4365
  msgid "Trans ID"
4366
  msgstr ""
4367
 
4368
- #: class/transactions-list-table.php:52 includes/free/form-element.php:11
4369
  msgid "Date"
4370
  msgstr ""
4371
 
@@ -4385,7 +4435,7 @@ msgstr ""
4385
  msgid "No transactions found."
4386
  msgstr ""
4387
 
4388
- #: class/upload.php:265 wpuf-functions.php:990
4389
  msgid "Caption"
4390
  msgstr ""
4391
 
@@ -4522,7 +4572,7 @@ msgstr ""
4522
 
4523
  #: includes/class-dokan-integration.php:34
4524
  #: includes/class-wc-vendors-integration.php:108
4525
- #: templates/dashboard/dashboard.php:15 wpuf-functions.php:1962
4526
  msgid "Posts"
4527
  msgstr ""
4528
 
@@ -4573,52 +4623,52 @@ msgstr ""
4573
  msgid "Post Limit Exceeded for your purchased subscription pack."
4574
  msgstr ""
4575
 
4576
- #: includes/class-frontend-form-post.php:55
4577
  msgid "You are not logged in"
4578
  msgstr ""
4579
 
4580
- #: includes/class-frontend-form-post.php:65
4581
- #: includes/class-frontend-form-post.php:95
4582
  msgid "Invalid post"
4583
  msgstr ""
4584
 
4585
- #: includes/class-frontend-form-post.php:72
4586
  msgid "Your edit access for this post has been locked by an administrator."
4587
  msgstr ""
4588
 
4589
- #: includes/class-frontend-form-post.php:76
4590
  msgid "Your allocated time for editing this post has been expired."
4591
  msgstr ""
4592
 
4593
- #: includes/class-frontend-form-post.php:84
4594
  msgid "Your post edit access has been locked by an administrator."
4595
  msgstr ""
4596
 
4597
- #: includes/class-frontend-form-post.php:89
4598
  msgid "Post Editing is disabled"
4599
  msgstr ""
4600
 
4601
- #: includes/class-frontend-form-post.php:100
4602
  msgid "You are not allowed to edit"
4603
  msgstr ""
4604
 
4605
- #: includes/class-frontend-form-post.php:111
4606
  msgid "I don't know how to edit this post, I don't have the form ID"
4607
  msgstr ""
4608
 
4609
- #: includes/class-frontend-form-post.php:123
4610
  msgid "You can't edit a post while in pending mode."
4611
  msgstr ""
4612
 
4613
- #: includes/class-frontend-form-post.php:530
4614
  msgid "Something went wrong"
4615
  msgstr ""
4616
 
4617
- #: includes/class-frontend-form-post.php:551
4618
  msgid "Invalid email address."
4619
  msgstr ""
4620
 
4621
- #: includes/class-frontend-form-post.php:561
4622
  msgid ""
4623
  "You already have an account in our site. Please login to continue.\n"
4624
  "\n"
@@ -4627,17 +4677,17 @@ msgid ""
4627
  "Click 'Cancel' to stay at this page."
4628
  msgstr ""
4629
 
4630
- #: includes/class-frontend-form-post.php:610
4631
  #: includes/class-frontend-render-form.php:312
4632
  msgid "You do not have sufficient permissions to access this form."
4633
  msgstr ""
4634
 
4635
- #: includes/class-frontend-form-post.php:891
4636
  msgid "Email successfully verified. Please Login."
4637
  msgstr ""
4638
 
4639
- #: includes/class-frontend-form-post.php:1010
4640
- #: includes/class-frontend-form-post.php:1016
4641
  msgid ""
4642
  "Thank you for posting on our site. We have sent you an confirmation email. "
4643
  "Please check your inbox!"
@@ -4746,7 +4796,7 @@ msgstr ""
4746
 
4747
  #: includes/class-login-widget.php:216 includes/class-login-widget.php:252
4748
  #: includes/free/class-login.php:322 includes/free/class-registration.php:122
4749
- #: includes/free/form-element.php:332
4750
  msgid "Register"
4751
  msgstr ""
4752
 
@@ -5216,8 +5266,7 @@ msgstr ""
5216
  msgid "What's New?"
5217
  msgstr ""
5218
 
5219
- #: includes/class-whats-new.php:107 lib/class-weforms-upsell.php:76
5220
- #: lib/class-weforms-upsell.php:77
5221
  msgid "Dismiss this notice."
5222
  msgstr ""
5223
 
@@ -5362,12 +5411,12 @@ msgid "Email Address"
5362
  msgstr ""
5363
 
5364
  #: includes/fields/class-field-featured-image.php:120
5365
- #: includes/fields/class-field-image.php:113
5366
  msgid "Button Label"
5367
  msgstr ""
5368
 
5369
  #: includes/fields/class-field-featured-image.php:125
5370
- #: includes/fields/class-field-image.php:118
5371
  msgid "Enter a label for the Select button"
5372
  msgstr ""
5373
 
@@ -5391,13 +5440,13 @@ msgstr ""
5391
  msgid "HTML Section"
5392
  msgstr ""
5393
 
5394
- #: includes/fields/class-field-image.php:9 includes/free/form-element.php:7
5395
  msgid "Image Upload"
5396
  msgstr ""
5397
 
5398
  #: includes/fields/class-field-numeric.php:7
5399
  #: includes/fields/class-pro-upgrade-fields.php:82
5400
- #: includes/free/form-element.php:15
5401
  msgid "Numeric Field"
5402
  msgstr ""
5403
 
@@ -5414,7 +5463,7 @@ msgid "Radio"
5414
  msgstr ""
5415
 
5416
  #: includes/fields/class-field-recaptcha.php:9
5417
- #: includes/free/form-element.php:29
5418
  msgid "reCaptcha"
5419
  msgstr ""
5420
 
@@ -5470,24 +5519,24 @@ msgstr ""
5470
  msgid "Website URL"
5471
  msgstr ""
5472
 
5473
- #: includes/fields/class-field-url.php:62
5474
  msgid "Open in : "
5475
  msgstr ""
5476
 
5477
- #: includes/fields/class-field-url.php:65
5478
  msgid "Same Window"
5479
  msgstr ""
5480
 
5481
- #: includes/fields/class-field-url.php:66
5482
  msgid "New Window"
5483
  msgstr ""
5484
 
5485
- #: includes/fields/class-field-url.php:72
5486
  msgid "Choose whether the link will open in new tab or same window"
5487
  msgstr ""
5488
 
5489
  #: includes/fields/class-pro-upgrade-fields.php:8
5490
- #: includes/free/form-element.php:16
5491
  msgid "Address Field"
5492
  msgstr ""
5493
 
@@ -5516,17 +5565,17 @@ msgid "Multiple Choice Grid"
5516
  msgstr ""
5517
 
5518
  #: includes/fields/class-pro-upgrade-fields.php:137
5519
- #: includes/free/form-element.php:10
5520
  msgid "Repeat Field"
5521
  msgstr ""
5522
 
5523
  #: includes/fields/class-pro-upgrade-fields.php:148
5524
- #: includes/free/form-element.php:30
5525
  msgid "Really Simple Captcha"
5526
  msgstr ""
5527
 
5528
  #: includes/fields/class-pro-upgrade-fields.php:170
5529
- #: includes/free/form-element.php:17
5530
  msgid "Step Start"
5531
  msgstr ""
5532
 
@@ -5810,7 +5859,7 @@ msgstr ""
5810
  msgid "Password Strength"
5811
  msgstr ""
5812
 
5813
- #: includes/free/edit-profile.php:233 includes/free/form-element.php:333
5814
  #: templates/dashboard/edit-profile.php:131
5815
  msgid "Update Profile"
5816
  msgstr ""
@@ -5911,119 +5960,119 @@ msgid ""
5911
  "<a href=\"mailto:%s\">webmaster</a> !"
5912
  msgstr ""
5913
 
5914
- #: includes/free/form-element.php:6 includes/free/form-element.php:25
5915
  msgid "Click to add to the editor"
5916
  msgstr ""
5917
 
5918
- #: includes/free/form-element.php:13
5919
  msgid "Google Maps"
5920
  msgstr ""
5921
 
5922
- #: includes/free/form-element.php:32
5923
  msgid "Term &amp; Conditions"
5924
  msgstr ""
5925
 
5926
- #: includes/free/form-element.php:60
5927
  msgid "Learn more about Automatic Post Expiration"
5928
  msgstr ""
5929
 
5930
- #: includes/free/form-element.php:116
5931
  msgid "Send Email to Author After Exceeding Post Expiration Time"
5932
  msgstr ""
5933
 
5934
- #: includes/free/form-element.php:142 includes/free/form-element.php:146
5935
  msgid "Enable Multistep"
5936
  msgstr ""
5937
 
5938
- #: includes/free/form-element.php:149
5939
  msgid "If checked, form will be displayed in frontend in multiple steps"
5940
  msgstr ""
5941
 
5942
- #: includes/free/form-element.php:150
5943
  msgid " Learn more about Multistep"
5944
  msgstr ""
5945
 
5946
- #: includes/free/form-element.php:154
5947
  msgid "Multistep Progressbar Type"
5948
  msgstr ""
5949
 
5950
- #: includes/free/form-element.php:164
5951
  msgid "Choose how you want the progressbar"
5952
  msgstr ""
5953
 
5954
- #: includes/free/form-element.php:193
5955
  msgid "New post created"
5956
  msgstr ""
5957
 
5958
- #: includes/free/form-element.php:198
5959
  msgid "A post has been edited"
5960
  msgstr ""
5961
 
5962
- #: includes/free/form-element.php:201
5963
  msgid "New Post Notification"
5964
  msgstr ""
5965
 
5966
- #: includes/free/form-element.php:209 includes/free/form-element.php:247
5967
  msgid "Enable post notification"
5968
  msgstr ""
5969
 
5970
- #: includes/free/form-element.php:212
5971
  msgid "Learn more about Email Notification"
5972
  msgstr ""
5973
 
5974
- #: includes/free/form-element.php:223 includes/free/form-element.php:258
5975
  msgid "Subject"
5976
  msgstr ""
5977
 
5978
- #: includes/free/form-element.php:228 includes/free/form-element.php:263
5979
  msgid "Message"
5980
  msgstr ""
5981
 
5982
- #: includes/free/form-element.php:235
5983
  msgid "Update Post Notification"
5984
  msgstr ""
5985
 
5986
- #: includes/free/form-element.php:271
5987
  msgid "You may use in to, subject & message:"
5988
  msgstr ""
5989
 
5990
- #: includes/free/form-element.php:291
5991
  msgid "Toggle All"
5992
  msgstr ""
5993
 
5994
- #: includes/free/form-element.php:295
5995
  msgid "Click on a form element to add to the editor"
5996
  msgstr ""
5997
 
5998
- #: includes/free/form-element.php:328
5999
  msgid "Registration successful"
6000
  msgstr ""
6001
 
6002
- #: includes/free/form-element.php:329
6003
  msgid "Profile updated successfully"
6004
  msgstr ""
6005
 
6006
- #: includes/free/form-element.php:340
6007
  msgid "Enable Email Verfication"
6008
  msgstr ""
6009
 
6010
- #: includes/free/form-element.php:348
6011
  msgid "New User Role"
6012
  msgstr ""
6013
 
6014
- #: includes/free/form-element.php:383
6015
  msgid "Registration success message"
6016
  msgstr ""
6017
 
6018
- #: includes/free/form-element.php:390
6019
  msgid "Update profile message"
6020
  msgstr ""
6021
 
6022
- #: includes/free/form-element.php:418
6023
  msgid "Submit Button text"
6024
  msgstr ""
6025
 
6026
- #: includes/free/form-element.php:425
6027
  msgid "Update Button text"
6028
  msgstr ""
6029
 
@@ -6257,14 +6306,6 @@ msgstr ""
6257
  msgid "Submit & Deactivate"
6258
  msgstr ""
6259
 
6260
- #: lib/class-weforms-upsell.php:73
6261
- msgid "Install Now"
6262
- msgstr ""
6263
-
6264
- #: lib/class-weforms-upsell.php:349
6265
- msgid "You don't have permission to install the plugins"
6266
- msgstr ""
6267
-
6268
  #: lib/class.settings-api.php:368
6269
  msgid "Choose File"
6270
  msgstr ""
@@ -6515,263 +6556,263 @@ msgstr ""
6515
  msgid "Private"
6516
  msgstr ""
6517
 
6518
- #: wpuf-functions.php:210 wpuf-functions.php:1980
6519
  msgid "-- select --"
6520
  msgstr ""
6521
 
6522
- #: wpuf-functions.php:495
6523
  msgid "Images"
6524
  msgstr ""
6525
 
6526
- #: wpuf-functions.php:496
6527
  msgid "Audio"
6528
  msgstr ""
6529
 
6530
- #: wpuf-functions.php:497
6531
  msgid "Videos"
6532
  msgstr ""
6533
 
6534
- #: wpuf-functions.php:498
6535
  msgid "PDF"
6536
  msgstr ""
6537
 
6538
- #: wpuf-functions.php:499
6539
  msgid "Office Documents"
6540
  msgstr ""
6541
 
6542
- #: wpuf-functions.php:500
6543
  msgid "Zip Archives"
6544
  msgstr ""
6545
 
6546
- #: wpuf-functions.php:501
6547
  msgid "Executable Files"
6548
  msgstr ""
6549
 
6550
- #: wpuf-functions.php:502
6551
  msgid "CSV"
6552
  msgstr ""
6553
 
6554
- #: wpuf-functions.php:1013
6555
  msgid "Directions »"
6556
  msgstr ""
6557
 
6558
- #: wpuf-functions.php:1963
6559
  msgid "Edit Profile"
6560
  msgstr ""
6561
 
6562
- #: wpuf-functions.php:2092
6563
  msgid "United Arab Emirates Dirham"
6564
  msgstr ""
6565
 
6566
- #: wpuf-functions.php:2093
6567
  msgid "Australian Dollars"
6568
  msgstr ""
6569
 
6570
- #: wpuf-functions.php:2094
6571
  msgid "Argentine Peso"
6572
  msgstr ""
6573
 
6574
- #: wpuf-functions.php:2095
6575
  msgid "Bangladeshi Taka"
6576
  msgstr ""
6577
 
6578
- #: wpuf-functions.php:2096
6579
  msgid "Brazilian Real"
6580
  msgstr ""
6581
 
6582
- #: wpuf-functions.php:2097
6583
  msgid "Bulgarian Lev"
6584
  msgstr ""
6585
 
6586
- #: wpuf-functions.php:2098
6587
  msgid "Canadian Dollars"
6588
  msgstr ""
6589
 
6590
- #: wpuf-functions.php:2099
6591
  msgid "Chilean Peso"
6592
  msgstr ""
6593
 
6594
- #: wpuf-functions.php:2100
6595
  msgid "Chinese Yuan"
6596
  msgstr ""
6597
 
6598
- #: wpuf-functions.php:2101
6599
  msgid "Colombian Peso"
6600
  msgstr ""
6601
 
6602
- #: wpuf-functions.php:2102
6603
  msgid "Czech Koruna"
6604
  msgstr ""
6605
 
6606
- #: wpuf-functions.php:2103
6607
  msgid "Danish Krone"
6608
  msgstr ""
6609
 
6610
- #: wpuf-functions.php:2104
6611
  msgid "Dominican Peso"
6612
  msgstr ""
6613
 
6614
- #: wpuf-functions.php:2105
6615
  msgid "Algerian Dinar"
6616
  msgstr ""
6617
 
6618
- #: wpuf-functions.php:2106
6619
  msgid "Euros"
6620
  msgstr ""
6621
 
6622
- #: wpuf-functions.php:2107
6623
  msgid "Hong Kong Dollar"
6624
  msgstr ""
6625
 
6626
- #: wpuf-functions.php:2108
6627
  msgid "Croatia kuna"
6628
  msgstr ""
6629
 
6630
- #: wpuf-functions.php:2109
6631
  msgid "Hungarian Forint"
6632
  msgstr ""
6633
 
6634
- #: wpuf-functions.php:2110
6635
  msgid "Icelandic krona"
6636
  msgstr ""
6637
 
6638
- #: wpuf-functions.php:2111
6639
  msgid "Indonesia Rupiah"
6640
  msgstr ""
6641
 
6642
- #: wpuf-functions.php:2112
6643
  msgid "Indian Rupee"
6644
  msgstr ""
6645
 
6646
- #: wpuf-functions.php:2113
6647
  msgid "Nepali Rupee"
6648
  msgstr ""
6649
 
6650
- #: wpuf-functions.php:2114
6651
  msgid "Israeli Shekel"
6652
  msgstr ""
6653
 
6654
- #: wpuf-functions.php:2115
6655
  msgid "Japanese Yen"
6656
  msgstr ""
6657
 
6658
- #: wpuf-functions.php:2116
6659
  msgid "Lao Kip"
6660
  msgstr ""
6661
 
6662
- #: wpuf-functions.php:2117
6663
  msgid "South Korean Won"
6664
  msgstr ""
6665
 
6666
- #: wpuf-functions.php:2118
6667
  msgid "Malaysian Ringgits"
6668
  msgstr ""
6669
 
6670
- #: wpuf-functions.php:2119
6671
  msgid "Mexican Peso"
6672
  msgstr ""
6673
 
6674
- #: wpuf-functions.php:2120
6675
  msgid "Nigerian Naira"
6676
  msgstr ""
6677
 
6678
- #: wpuf-functions.php:2121
6679
  msgid "Norwegian Krone"
6680
  msgstr ""
6681
 
6682
- #: wpuf-functions.php:2122
6683
  msgid "New Zealand Dollar"
6684
  msgstr ""
6685
 
6686
- #: wpuf-functions.php:2123
6687
  msgid "Namibian dollar"
6688
  msgstr ""
6689
 
6690
- #: wpuf-functions.php:2124
6691
  msgid "Omani Rial"
6692
  msgstr ""
6693
 
6694
- #: wpuf-functions.php:2125
6695
  msgid "Iranian Rial"
6696
  msgstr ""
6697
 
6698
- #: wpuf-functions.php:2126
6699
  msgid "Pakistani Rupee"
6700
  msgstr ""
6701
 
6702
- #: wpuf-functions.php:2127
6703
  msgid "Paraguayan Guaraní"
6704
  msgstr ""
6705
 
6706
- #: wpuf-functions.php:2128
6707
  msgid "Philippine Pesos"
6708
  msgstr ""
6709
 
6710
- #: wpuf-functions.php:2129
6711
  msgid "Polish Zloty"
6712
  msgstr ""
6713
 
6714
- #: wpuf-functions.php:2130
6715
  msgid "Pounds Sterling"
6716
  msgstr ""
6717
 
6718
- #: wpuf-functions.php:2131
6719
  msgid "Romanian Leu"
6720
  msgstr ""
6721
 
6722
- #: wpuf-functions.php:2132
6723
  msgid "Russian Ruble"
6724
  msgstr ""
6725
 
6726
- #: wpuf-functions.php:2133
6727
  msgid "Saudi Riyal"
6728
  msgstr ""
6729
 
6730
- #: wpuf-functions.php:2134
6731
  msgid "Singapore Dollar"
6732
  msgstr ""
6733
 
6734
- #: wpuf-functions.php:2135
6735
  msgid "South African rand"
6736
  msgstr ""
6737
 
6738
- #: wpuf-functions.php:2136
6739
  msgid "Swedish Krona"
6740
  msgstr ""
6741
 
6742
- #: wpuf-functions.php:2137
6743
  msgid "Swiss Franc"
6744
  msgstr ""
6745
 
6746
- #: wpuf-functions.php:2138
6747
  msgid "Taiwan New Dollars"
6748
  msgstr ""
6749
 
6750
- #: wpuf-functions.php:2139
6751
  msgid "Thai Baht"
6752
  msgstr ""
6753
 
6754
- #: wpuf-functions.php:2140
6755
  msgid "Turkish Lira"
6756
  msgstr ""
6757
 
6758
- #: wpuf-functions.php:2141
6759
  msgid "US Dollar"
6760
  msgstr ""
6761
 
6762
- #: wpuf-functions.php:2142
6763
  msgid "Vietnamese Dong"
6764
  msgstr ""
6765
 
6766
- #: wpuf-functions.php:2143
6767
  msgid "Egyptian Pound"
6768
  msgstr ""
6769
 
6770
- #: wpuf-functions.php:2144
6771
  msgid "Jordanian dinar"
6772
  msgstr ""
6773
 
6774
- #: wpuf-functions.php:3017
6775
  msgid "None"
6776
  msgstr ""
6777
 
@@ -6898,7 +6939,7 @@ msgctxt "enhanced select"
6898
  msgid "Searching&hellip;"
6899
  msgstr ""
6900
 
6901
- #: wpuf-functions.php:1460
6902
  msgctxt "tag delimiter"
6903
  msgid ","
6904
  msgstr ""
2
  # This file is distributed under the GPL2 or later.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: WP User Frontend 3.5.4\n"
6
  "Report-Msgid-Bugs-To: https://wedevs.com/contact/\n"
7
+ "POT-Creation-Date: 2020-11-11 09:52:23+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
177
  #: includes/fields/class-abstract-fields.php:346
178
  #: includes/fields/class-abstract-fields.php:409
179
  #: includes/fields/class-field-checkbox.php:74
180
+ #: includes/fields/class-field-radio.php:83 includes/free/form-element.php:499
181
  #: wpuf.php:715
182
  msgid "Yes"
183
  msgstr ""
192
  #: includes/fields/class-abstract-fields.php:347
193
  #: includes/fields/class-abstract-fields.php:410
194
  #: includes/fields/class-field-checkbox.php:75
195
+ #: includes/fields/class-field-radio.php:84 includes/free/form-element.php:500
196
  #: wpuf.php:716
197
  msgid "No"
198
  msgstr ""
218
  msgstr ""
219
 
220
  #: admin/class-admin-subscription.php:412 admin/form.php:227
221
+ #: includes/free/form-element.php:57
222
  msgid "Post Expiration"
223
  msgstr ""
224
 
225
+ #: admin/class-admin-subscription.php:417 includes/free/form-element.php:61
226
  msgid "Enable Post Expiration"
227
  msgstr ""
228
 
229
  #: admin/class-admin-subscription.php:428
230
+ #: admin/class-admin-subscription.php:691 includes/free/form-element.php:67
231
  msgid "Post Expiration Time"
232
  msgstr ""
233
 
236
  msgid "Post Status"
237
  msgstr ""
238
 
239
+ #: admin/class-admin-subscription.php:463 includes/free/form-element.php:118
240
  msgid "Status of post after post expiration time is over "
241
  msgstr ""
242
 
256
  msgid "Expiration Message"
257
  msgstr ""
258
 
259
+ #: admin/class-admin-subscription.php:485 includes/free/form-element.php:137
260
  msgid "You may use: {post_author} {post_url} {blogname} {post_title} {post_status}"
261
  msgstr ""
262
 
328
 
329
  #: admin/class-admin-subscription.php:774
330
  #: admin/form-builder/class-wpuf-admin-form-builder.php:284
331
+ #: class/payment.php:217 class/subscription.php:787
332
  #: includes/class-list-table-subscribers.php:138 lib/appsero/Insights.php:764
333
  #: templates/dashboard/subscription.php:64
334
  msgid "Cancel"
364
 
365
  #: admin/class-tools.php:43 admin/class-tools.php:106
366
  #: admin/post-forms-list-table.php:43 class/transactions-list-table.php:87
367
+ #: includes/class-list-table-subscribers.php:136 wpuf-functions.php:3313
368
  msgid "All"
369
  msgstr ""
370
 
516
  msgid "Label"
517
  msgstr ""
518
 
519
+ #: admin/form-builder/assets/js/components/field-option-data/template.php:33
520
+ msgid "Do not use & or other special character for option label"
521
+ msgstr ""
522
+
523
+ #: admin/form-builder/assets/js/components/field-option-data/template.php:37
524
  #: admin/template.php:234 admin/template.php:286
525
  msgid "Value"
526
  msgstr ""
527
 
528
+ #: admin/form-builder/assets/js/components/field-option-data/template.php:85
529
  msgid "Clear Selection"
530
  msgstr ""
531
 
545
  #: admin/form-builder/assets/js/components/form-image_upload/template.php:6
546
  #: class/render-form.php:1655
547
  #: includes/fields/class-field-featured-image.php:122
548
+ #: includes/fields/class-field-image.php:116
549
+ #: includes/fields/class-field-image.php:137
550
  msgid "Select Image"
551
  msgstr ""
552
 
796
  msgid "Registration Forms"
797
  msgstr ""
798
 
799
+ #: admin/form.php:189 includes/free/form-element.php:218
800
+ #: includes/free/form-element.php:256
801
  msgid "Notification"
802
  msgstr ""
803
 
962
  msgstr ""
963
 
964
  #: admin/html/form-settings-post-edit.php:31
965
+ #: admin/html/form-settings-post.php:130 includes/free/form-element.php:391
966
  msgid "Redirect To"
967
  msgstr ""
968
 
972
  msgstr ""
973
 
974
  #: admin/html/form-settings-post-edit.php:37
975
+ #: admin/html/form-settings-post.php:136 includes/free/form-element.php:396
976
  msgid "Same Page"
977
  msgstr ""
978
 
979
  #: admin/html/form-settings-post-edit.php:38
980
+ #: admin/html/form-settings-post.php:137 includes/free/form-element.php:397
981
  msgid "To a page"
982
  msgstr ""
983
 
984
  #: admin/html/form-settings-post-edit.php:39
985
+ #: admin/html/form-settings-post.php:138 includes/free/form-element.php:398
986
  msgid "To a custom URL"
987
  msgstr ""
988
 
989
  #: admin/html/form-settings-post-edit.php:48
990
+ #: admin/html/form-settings-post.php:147 includes/free/form-element.php:407
991
  msgid "After successfull submit, where the page will redirect to"
992
  msgstr ""
993
 
996
  msgstr ""
997
 
998
  #: admin/html/form-settings-post-edit.php:61
999
+ #: admin/html/form-settings-post.php:160 includes/free/form-element.php:427
1000
  msgid "Page"
1001
  msgstr ""
1002
 
1003
  #: admin/html/form-settings-post-edit.php:76
1004
+ #: admin/html/form-settings-post.php:175 includes/free/form-element.php:450
1005
  msgid "Custom URL"
1006
  msgstr ""
1007
 
1218
  msgstr ""
1219
 
1220
  #: admin/html/form-submission-restriction.php:141
1221
+ #: includes/free/form-element.php:230 includes/free/form-element.php:267
1222
  msgid "To"
1223
  msgstr ""
1224
 
1411
  msgid "Contact Support"
1412
  msgstr ""
1413
 
1414
+ #: admin/html/whats-new.php:9
1415
+ msgid "Get appropriate user id when role based conditions are present"
1416
+ msgstr ""
1417
+
1418
+ #: admin/html/whats-new.php:13
1419
+ msgid "Show Invalid subscription message if wrong pack id passed"
1420
+ msgstr ""
1421
+
1422
+ #: admin/html/whats-new.php:17
1423
+ msgid "URL field new window not working"
1424
+ msgstr ""
1425
+
1426
+ #: admin/html/whats-new.php:21
1427
+ msgid "Option label not working when & use"
1428
+ msgstr ""
1429
+
1430
+ #: admin/html/whats-new.php:25
1431
+ msgid "Ajax type category not showing on edit"
1432
+ msgstr ""
1433
+
1434
+ #: admin/html/whats-new.php:29
1435
+ msgid "Multiple file image can't select"
1436
+ msgstr ""
1437
+
1438
+ #: admin/html/whats-new.php:33
1439
+ msgid "Subscription pack PayPal Checkout gets \"Error: Access Denied\""
1440
+ msgstr ""
1441
+
1442
+ #: admin/html/whats-new.php:37
1443
+ msgid "Conflict image field with acf image field"
1444
+ msgstr ""
1445
+
1446
+ #: admin/html/whats-new.php:41
1447
+ msgid "Missing Auckland State for New Zealand country"
1448
+ msgstr ""
1449
+
1450
+ #: admin/html/whats-new.php:45
1451
+ msgid "Added support for WooCommerce product category value replacemen"
1452
+ msgstr ""
1453
+
1454
+ #: admin/html/whats-new.php:55
1455
  msgid "Add character restriction feature"
1456
  msgstr ""
1457
 
1458
+ #: admin/html/whats-new.php:59
1459
  msgid "Make sure post author edit link works only in frontend"
1460
  msgstr ""
1461
 
1462
+ #: admin/html/whats-new.php:63
1463
  msgid "Inconsistency in lost password reset email message"
1464
  msgstr ""
1465
 
1466
+ #: admin/html/whats-new.php:67
1467
  msgid "Saving custom taxonomy terms when input type is text"
1468
  msgstr ""
1469
 
1470
+ #: admin/html/whats-new.php:71
1471
  msgid "Taxonomy field JS error in builder"
1472
  msgstr ""
1473
 
1474
+ #: admin/html/whats-new.php:75
1475
  msgid "Showing WPUF edit link for WP default roles"
1476
  msgstr ""
1477
 
1478
+ #: admin/html/whats-new.php:79
1479
  msgid "Upload button unresponsive issue in iOS"
1480
  msgstr ""
1481
 
1482
+ #: admin/html/whats-new.php:89
1483
  msgid "Add post edit link for post authors in single or archive pages"
1484
  msgstr ""
1485
 
1486
+ #: admin/html/whats-new.php:93
1487
  msgid "Enhance post delete message"
1488
  msgstr ""
1489
 
1490
+ #: admin/html/whats-new.php:97
1491
  msgid "Refactor control buttons visibility in form builder"
1492
  msgstr ""
1493
 
1494
+ #: admin/html/whats-new.php:101
1495
  msgid "Add missing colons after field label"
1496
  msgstr ""
1497
 
1498
+ #: admin/html/whats-new.php:105
1499
  msgid "Post edit map capability condition"
1500
  msgstr ""
1501
 
1502
+ #: admin/html/whats-new.php:109
1503
  msgid "Role based permission for accessing a post form"
1504
  msgstr ""
1505
 
1506
+ #: admin/html/whats-new.php:113
1507
  msgid "Section-break field alignment"
1508
  msgstr ""
1509
 
1510
+ #: admin/html/whats-new.php:117
1511
  msgid "Pay per post doesn't work if subscription pack is activated"
1512
  msgstr ""
1513
 
1514
+ #: admin/html/whats-new.php:121
1515
  msgid "Mime type for uploading JSON files"
1516
  msgstr ""
1517
 
1518
+ #: admin/html/whats-new.php:125
1519
  msgid "File upload with same file name"
1520
  msgstr ""
1521
 
1522
+ #: admin/html/whats-new.php:129
1523
  msgid "Post preview missing fields"
1524
  msgstr ""
1525
 
1526
+ #: admin/html/whats-new.php:133
1527
  msgid "Illigal variable declartion"
1528
  msgstr ""
1529
 
1530
+ #: admin/html/whats-new.php:137
1531
  msgid "Featured image updating issue"
1532
  msgstr ""
1533
 
1534
+ #: admin/html/whats-new.php:141
1535
  msgid "Conflict with Phlox theme"
1536
  msgstr ""
1537
 
1538
+ #: admin/html/whats-new.php:145
1539
  msgid "Textarea custom field data sanitization"
1540
  msgstr ""
1541
 
1542
+ #: admin/html/whats-new.php:149
1543
  msgid "exclude_type warning in wpuf_category_checklist"
1544
  msgstr ""
1545
 
1546
+ #: admin/html/whats-new.php:153
1547
  msgid "Category field not showing all child categories for selection type child of"
1548
  msgstr ""
1549
 
1550
+ #: admin/html/whats-new.php:157
1551
  msgid "Conflict between image and file upload custom fields"
1552
  msgstr ""
1553
 
1554
+ #: admin/html/whats-new.php:161
1555
  msgid "Login url when login page is not set"
1556
  msgstr ""
1557
 
1558
+ #: admin/html/whats-new.php:171
1559
  msgid ""
1560
  "Use common names for Ivory Coast, North Korea and Sourth Korea instead of "
1561
  "their official names"
1562
  msgstr ""
1563
 
1564
+ #: admin/html/whats-new.php:175
1565
  msgid "Fix condition to use default avatar"
1566
  msgstr ""
1567
 
1568
+ #: admin/html/whats-new.php:179
1569
  msgid "Make Email and URL fields clickable"
1570
  msgstr ""
1571
 
1572
+ #: admin/html/whats-new.php:183
1573
  msgid "Fix redirect after user login"
1574
  msgstr ""
1575
 
1576
+ #: admin/html/whats-new.php:187
1577
  msgid "Sanitize textarea field data"
1578
  msgstr ""
1579
 
1580
+ #: admin/html/whats-new.php:191
1581
  msgid ""
1582
  "Fix missing colon to email, URL, text and textarea labels when renders "
1583
  "their data"
1584
  msgstr ""
1585
 
1586
+ #: admin/html/whats-new.php:195
1587
  msgid "Prevent showing empty labels for fields that have render_field_data method"
1588
  msgstr ""
1589
 
1590
+ #: admin/html/whats-new.php:205
1591
  msgid "Add Namibian Dollar in currency list"
1592
  msgstr ""
1593
 
1594
+ #: admin/html/whats-new.php:209
1595
  msgid "Add sync values option for option data fields"
1596
  msgstr ""
1597
 
1598
+ #: admin/html/whats-new.php:213
1599
  msgid "Allow uploading image that having filesize meets php ini settings"
1600
  msgstr ""
1601
 
1602
+ #: admin/html/whats-new.php:217
1603
  msgid "Limit the selection of one image at a time"
1604
  msgstr ""
1605
 
1606
+ #: admin/html/whats-new.php:221
1607
  msgid "Use file name and size to generate hash to prevent duplicant image upload"
1608
  msgstr ""
1609
 
1610
+ #: admin/html/whats-new.php:225
1611
  msgid "Sanitize text and textarea field data"
1612
  msgstr ""
1613
 
1614
+ #: admin/html/whats-new.php:229
1615
  msgid ""
1616
  "Show label instead of values for radio, checkbox, dropdown and multiselect "
1617
  "data"
1618
  msgstr ""
1619
 
1620
+ #: admin/html/whats-new.php:233
1621
  msgid "Saving custom taxonomies for type text input"
1622
  msgstr ""
1623
 
1624
+ #: admin/html/whats-new.php:237
1625
  msgid "Admin settings link for recaptcha helper text"
1626
  msgstr ""
1627
 
1628
+ #: admin/html/whats-new.php:241
1629
  msgid "Undefined name property for Custom HTML fields"
1630
  msgstr ""
1631
 
1632
+ #: admin/html/whats-new.php:245
1633
  msgid "Delete attachment process"
1634
  msgstr ""
1635
 
1636
+ #: admin/html/whats-new.php:249
1637
  msgid "Missing billing address in invoice PDF"
1638
  msgstr ""
1639
 
1640
+ #: admin/html/whats-new.php:253
1641
  msgid "Showing country field value in frontend post content"
1642
  msgstr ""
1643
 
1644
+ #: admin/html/whats-new.php:257
1645
  msgid "Avatar size display not complying with admin settings size"
1646
  msgstr ""
1647
 
1648
+ #: admin/html/whats-new.php:261
1649
  msgid "Display default avatars on admin settings discussion page"
1650
  msgstr ""
1651
 
1652
+ #: admin/html/whats-new.php:265
1653
  msgid "Redirect to subscription page at registration"
1654
  msgstr ""
1655
 
1656
+ #: admin/html/whats-new.php:269
1657
  msgid "Error notice regarding registration page redirect"
1658
  msgstr ""
1659
 
1660
+ #: admin/html/whats-new.php:273
1661
  msgid "Escaping html in registration errors"
1662
  msgstr ""
1663
 
1664
+ #: admin/html/whats-new.php:277
1665
  msgid "Default login redirect link"
1666
  msgstr ""
1667
 
1668
+ #: admin/html/whats-new.php:281
1669
  msgid "Implementing default WP login page override option"
1670
  msgstr ""
1671
 
1672
+ #: admin/html/whats-new.php:285
1673
  msgid "Transparent background of autosuggestion dropdown"
1674
  msgstr ""
1675
 
1676
+ #: admin/html/whats-new.php:295
1677
  msgid "Import forms system"
1678
  msgstr ""
1679
 
1680
+ #: admin/html/whats-new.php:299
1681
  msgid "Password reset system"
1682
  msgstr ""
1683
 
1684
+ #: admin/html/whats-new.php:303
1685
  msgid "Updated url validation regex to support modern tlds"
1686
  msgstr ""
1687
 
1688
+ #: admin/html/whats-new.php:307
1689
  msgid "Export WPUF forms individually from admin tools page"
1690
  msgstr ""
1691
 
1692
+ #: admin/html/whats-new.php:311
1693
  msgid "Subscription cycle label translation issue"
1694
  msgstr ""
1695
 
1696
+ #: admin/html/whats-new.php:315
1697
  msgid "ACF integration for checkbox fields"
1698
  msgstr ""
1699
 
1700
+ #: admin/html/whats-new.php:319
1701
  msgid "Illegal string offset warning while updating settings"
1702
  msgstr ""
1703
 
1704
+ #: admin/html/whats-new.php:323
1705
  msgid "Conditional logic for Section Break field"
1706
  msgstr ""
1707
 
1708
+ #: admin/html/whats-new.php:327
1709
  msgid "Subscriptions cannot be deleted from backend"
1710
  msgstr ""
1711
 
1712
+ #: admin/html/whats-new.php:331
1713
  msgid "A regression regarding saving checkbox data"
1714
  msgstr ""
1715
 
1716
+ #: admin/html/whats-new.php:335
1717
  msgid "Default value of multi-select fields is not showing"
1718
  msgstr ""
1719
 
1720
+ #: admin/html/whats-new.php:345
1721
  msgid "Hide post edit option when subscription is expired"
1722
  msgstr ""
1723
 
1724
+ #: admin/html/whats-new.php:347
1725
  msgid "Hide post edit option from users whose subscription pack is expired."
1726
  msgstr ""
1727
 
1728
+ #: admin/html/whats-new.php:350
1729
  msgid "Check files to prevent duplicity in media upload"
1730
  msgstr ""
1731
 
1732
+ #: admin/html/whats-new.php:352
1733
  msgid ""
1734
  "A simple measure has been taken to prevent maliciously flooding the site by "
1735
  "uploading same file multiple times. Though this won't work with already "
1736
  "uploaded medias."
1737
  msgstr ""
1738
 
1739
+ #: admin/html/whats-new.php:355
1740
  msgid "Refactor address fields in Account section"
1741
  msgstr ""
1742
 
1743
+ #: admin/html/whats-new.php:357
1744
  msgid "Address edit section from Account section has been rewritten to improve UX."
1745
  msgstr ""
1746
 
1747
+ #: admin/html/whats-new.php:360
1748
  msgid "Update Paypal payment gateway"
1749
  msgstr ""
1750
 
1751
+ #: admin/html/whats-new.php:362
1752
  msgid "Paypal payment gateway has seen some improvements."
1753
  msgstr ""
1754
 
1755
+ #: admin/html/whats-new.php:365
1756
  msgid "Default Category selection improvements"
1757
  msgstr ""
1758
 
1759
+ #: admin/html/whats-new.php:367
1760
  msgid ""
1761
  "An intuitive way of selecting default category of a selected post type has "
1762
  "been introduced."
1763
  msgstr ""
1764
 
1765
+ #: admin/html/whats-new.php:370
1766
  msgid "Compatibility issue with ACF date time field"
1767
  msgstr ""
1768
 
1769
+ #: admin/html/whats-new.php:372
1770
  msgid "A Compatibility issue with ACF date time field has been addressed."
1771
  msgstr ""
1772
 
1773
+ #: admin/html/whats-new.php:375
1774
  msgid "Media title, caption & description not saving"
1775
  msgstr ""
1776
 
1777
+ #: admin/html/whats-new.php:377
1778
  msgid ""
1779
  "Media title, caption & description were not saving from frontend. They will "
1780
  "now."
1781
  msgstr ""
1782
 
1783
+ #: admin/html/whats-new.php:380
1784
  msgid ""
1785
  "The Events Calendar venue and organizer fields issue in WPUF Custom Fields "
1786
  "metabox"
1787
  msgstr ""
1788
 
1789
+ #: admin/html/whats-new.php:382
1790
  msgid ""
1791
  "A workaround has been introduced to save The Events Calendar Venue and "
1792
  "Organizer fields properly from WPUF Custom Fields metabox."
1793
  msgstr ""
1794
 
1795
+ #: admin/html/whats-new.php:385
1796
  msgid "Checkbox data not saving from WPUF Custom Fields metabox"
1797
  msgstr ""
1798
 
1799
+ #: admin/html/whats-new.php:387
1800
  msgid ""
1801
  "Checkboxe data from WPUF Custom Fields metabox were not saving. It has been "
1802
  "fixed."
1803
  msgstr ""
1804
 
1805
+ #: admin/html/whats-new.php:390
1806
  msgid "Multi-column Repeater field data saving issue"
1807
  msgstr ""
1808
 
1809
+ #: admin/html/whats-new.php:392
1810
  msgid ""
1811
  "Multi-column Repeater field data from a form was not saving. It has been "
1812
  "fixed."
1813
  msgstr ""
1814
 
1815
+ #: admin/html/whats-new.php:395
1816
  msgid "Multistep form conflict with Elementor"
1817
  msgstr ""
1818
 
1819
+ #: admin/html/whats-new.php:397
1820
  msgid "Multistep form had a conflict with Elementor. It has been fixed."
1821
  msgstr ""
1822
 
1823
+ #: admin/html/whats-new.php:400
1824
  msgid "Multiple images showing issue in frontend"
1825
  msgstr ""
1826
 
1827
+ #: admin/html/whats-new.php:402
1828
  msgid "Multiple images in a post were not showing in frontend. Now they will."
1829
  msgstr ""
1830
 
1831
+ #: admin/html/whats-new.php:411
1832
  msgid "Nonce not verify on login"
1833
  msgstr ""
1834
 
1835
+ #: admin/html/whats-new.php:413
1836
  msgid "Return of function wp_verify_nonce() was ignored."
1837
  msgstr ""
1838
 
1839
+ #: admin/html/whats-new.php:422
1840
  msgid "Option to set which tab shows as active on the account page"
1841
  msgstr ""
1842
 
1843
+ #: admin/html/whats-new.php:424
1844
  msgid ""
1845
  "Option to set which tab shows as active on the account page. To configure "
1846
  "this setting navigate to wp-admin->User Frontend->Settings->My "
1847
  "Account->Active Tab "
1848
  msgstr ""
1849
 
1850
+ #: admin/html/whats-new.php:427
1851
  msgid "Unlock option was unavailable after the post being locked"
1852
  msgstr ""
1853
 
1854
+ #: admin/html/whats-new.php:429
1855
  msgid "Unlock option was unavailable after the post being locked."
1856
  msgstr ""
1857
 
1858
+ #: admin/html/whats-new.php:432
1859
  msgid "Gutenberg block of WPUF didn't work on bedrock installation"
1860
  msgstr ""
1861
 
1862
+ #: admin/html/whats-new.php:434
1863
  msgid "Gutenberg block of WPUF didn't work on bedrock installation."
1864
  msgstr ""
1865
 
1866
+ #: admin/html/whats-new.php:437
1867
  msgid "Sending admin payment received email twice"
1868
  msgstr ""
1869
 
1870
+ #: admin/html/whats-new.php:439
1871
  msgid ""
1872
  "After processing payment admin & user was receiving payment received email "
1873
  "twice."
1874
  msgstr ""
1875
 
1876
+ #: admin/html/whats-new.php:442
1877
  msgid ""
1878
  "Add shortcode support to display post information in the Post Expiration "
1879
  "Message"
1880
  msgstr ""
1881
 
1882
+ #: admin/html/whats-new.php:444
1883
  msgid ""
1884
  "Add shortcode support to display post information in the Post Expiration "
1885
  "Message. You can use: <strong>{post_author} {post_url} {blogname} "
1886
  "{post_title} {post_status}</strong>"
1887
  msgstr ""
1888
 
1889
+ #: admin/html/whats-new.php:447
1890
  msgid "Add optin on the setup wizard"
1891
  msgstr ""
1892
 
1893
+ #: admin/html/whats-new.php:449
1894
  msgid ""
1895
  "Added optin on the setup wizard, admin can choose whether he/she wants to "
1896
  "share server environment details (php, mysql, server, WordPress versions), "
1898
  "name and url, admin name and email address. No sensitive data is tracked"
1899
  msgstr ""
1900
 
1901
+ #: admin/html/whats-new.php:458
1902
  msgid "Post Owner problem"
1903
  msgstr ""
1904
 
1905
+ #: admin/html/whats-new.php:460
1906
  msgid ""
1907
  "Posts were not assigned to the selected default post owner, this issue has "
1908
  "been fixed."
1909
  msgstr ""
1910
 
1911
+ #: admin/html/whats-new.php:463
1912
  msgid "Google reCaptcha was not working"
1913
  msgstr ""
1914
 
1915
+ #: admin/html/whats-new.php:465
1916
  msgid ""
1917
  "Google reCaptcha was not working, users could submit the form without "
1918
  "reCaptcha validation."
1919
  msgstr ""
1920
 
1921
+ #: admin/html/whats-new.php:474
1922
  msgid "Added column field"
1923
  msgstr ""
1924
 
1925
+ #: admin/html/whats-new.php:479
1926
  msgid "Unable to render the events on the front-end dashboard"
1927
  msgstr ""
1928
 
1929
+ #: admin/html/whats-new.php:481
1930
  msgid ""
1931
  "On the frontend dashboard, the submitted events were not showing, you will "
1932
  "get it fixed in this version."
1933
  msgstr ""
1934
 
1935
+ #: admin/html/whats-new.php:484
1936
  msgid "Page order getting 0(zero) after editing from the frontend"
1937
  msgstr ""
1938
 
1939
+ #: admin/html/whats-new.php:486
1940
  msgid ""
1941
  "Page order was not saving while editing a post using WPUF form, it has been "
1942
  "fixed."
1943
  msgstr ""
1944
 
1945
+ #: admin/html/whats-new.php:489
1946
  msgid "Text input field for taxonomies not working"
1947
  msgstr ""
1948
 
1949
+ #: admin/html/whats-new.php:491
1950
  msgid ""
1951
  "When taxonomy field type is set to `Text Input` then a fatal error was "
1952
  "showing on the frontend, no error with taxonomy field in the latest version."
1953
  msgstr ""
1954
 
1955
+ #: admin/html/whats-new.php:494
1956
  msgid ""
1957
  "In radio and checkbox field use conditional logic that value does not save "
1958
  "in database"
1959
  msgstr ""
1960
 
1961
+ #: admin/html/whats-new.php:496
1962
  msgid ""
1963
  "The selected value of radio and checkbox field were not showing while "
1964
  "editing posts from the backend or frontend, you can see the selected value "
1965
  "in this version."
1966
  msgstr ""
1967
 
1968
+ #: admin/html/whats-new.php:499
1969
  msgid "The args param not working with get_avatar filter"
1970
  msgstr ""
1971
 
1972
+ #: admin/html/whats-new.php:501
1973
  msgid "The args parameter did not exist with get_avatar filter, which now exists."
1974
  msgstr ""
1975
 
1976
+ #: admin/html/whats-new.php:504
1977
  msgid "The item in ajax taxonomy field was not selected"
1978
  msgstr ""
1979
 
1980
+ #: admin/html/whats-new.php:506
1981
  msgid ""
1982
  "When the taxonomy field type is set to Ajax, the submitted terms were not "
1983
  "showing in the backend and frontend which have been fixed."
1984
  msgstr ""
1985
 
1986
+ #: admin/html/whats-new.php:515
1987
  msgid "Unable to send new user registration email"
1988
  msgstr ""
1989
 
1990
+ #: admin/html/whats-new.php:517
1991
  msgid ""
1992
  "WP User Frontend default registration form `[wpuf-registration]` was unable "
1993
  "to send the new user registration email."
1994
  msgstr ""
1995
 
1996
+ #: admin/html/whats-new.php:520
1997
  msgid "WPUF forms block compatibility issue with the latest WP version"
1998
  msgstr ""
1999
 
2000
+ #: admin/html/whats-new.php:522
2001
  msgid ""
2002
  "With the latest version of WordPress the gutenberg block of WP User "
2003
  "Frontend were not working. In this version, you will get it fixed."
2004
  msgstr ""
2005
 
2006
+ #: admin/html/whats-new.php:525
2007
  msgid "Page not update where `[wpuf_dashboard]` shortcode exist"
2008
  msgstr ""
2009
 
2010
+ #: admin/html/whats-new.php:527
2011
  msgid ""
2012
  "While using Gutenberg, the page were not being updated with WPUF shortcode "
2013
  "[wpuf dashboard]"
2014
  msgstr ""
2015
 
2016
+ #: admin/html/whats-new.php:530
2017
  msgid "Retain default when determining whether to display the admin bar"
2018
  msgstr ""
2019
 
2020
+ #: admin/html/whats-new.php:532
2021
  msgid ""
2022
  "From the User Frontend Settings, set that Administrator, Editor, Vendor can "
2023
  "see the admin bar. Now, the super admin want, one specific user ( who has "
2027
  "frontend."
2028
  msgstr ""
2029
 
2030
+ #: admin/html/whats-new.php:535
2031
  msgid "Fatal error when use PHP lower version (5.4 or lower)"
2032
  msgstr ""
2033
 
2034
+ #: admin/html/whats-new.php:537
2035
  msgid ""
2036
  "It was unable to install WP User Frontend with PHP 5.4 or lower version. "
2037
  "Here is the error details: <br><br><strong>Fatal error: Can't use method "
2039
  "/wp-user-frontend/class/frontend-form-post.php on line 194</strong>"
2040
  msgstr ""
2041
 
2042
+ #: admin/html/whats-new.php:540
2043
  msgid "Product form was unable to show the single gallery image"
2044
  msgstr ""
2045
 
2046
+ #: admin/html/whats-new.php:542
2047
  msgid ""
2048
  "When user upload single image for product gallery using WPUF WooCommerce "
2049
  "product form, that image were not showing on the frontend."
2050
  msgstr ""
2051
 
2052
+ #: admin/html/whats-new.php:551
2053
  msgid "WooCommerce gallery images not getting saved"
2054
  msgstr ""
2055
 
2056
+ #: admin/html/whats-new.php:553
2057
  msgid ""
2058
  "After releasing version 2.9.3, WooCommerce gallery image field stopped "
2059
  "working. You will get it fixed in this version."
2060
  msgstr ""
2061
 
2062
+ #: admin/html/whats-new.php:562
2063
  msgid "The Events Calendar Integration Form"
2064
  msgstr ""
2065
 
2066
+ #: admin/html/whats-new.php:564
2067
  msgid ""
2068
  "Now admin can allow users to create event from the frontend. Currently WPUF "
2069
  "has a one click pre-build event form that has been integrated with The "
2070
  "Events Calendar plugin"
2071
  msgstr ""
2072
 
2073
+ #: admin/html/whats-new.php:567
2074
  msgid "Post Submission Facility From Account Page"
2075
  msgstr ""
2076
 
2077
+ #: admin/html/whats-new.php:569
2078
  msgid ""
2079
  "On the frontend account page, added a new menu item named <b>Submit "
2080
  "Post</b>. Now admin can allow users to submit post from their default "
2083
  "you can assign any post form that will use to submit posts."
2084
  msgstr ""
2085
 
2086
+ #: admin/html/whats-new.php:572
2087
  msgid "Login/Lost Password Link Under Registration Form"
2088
  msgstr ""
2089
 
2090
+ #: admin/html/whats-new.php:574
2091
  msgid "Added Login/Lost Password link under registration form"
2092
  msgstr ""
2093
 
2094
+ #: admin/html/whats-new.php:583
2095
  msgid "Added drag and drop image ordering on image upload"
2096
  msgstr ""
2097
 
2098
+ #: admin/html/whats-new.php:585
2099
  msgid ""
2100
  "Now frontend users can drag & drop the images/files to change the order "
2101
  "while uploading."
2102
  msgstr ""
2103
 
2104
+ #: admin/html/whats-new.php:588
2105
  msgid "Added reCAPTCHA field in login form"
2106
  msgstr ""
2107
 
2108
+ #: admin/html/whats-new.php:590
2109
  msgid ""
2110
  "Admin has the option to show reCAPTCHA field in login form. Check the "
2111
  "related settings from <strong>User Frontend > Settings > "
2112
  "Login/Registration</strong>"
2113
  msgstr ""
2114
 
2115
+ #: admin/html/whats-new.php:593
2116
  msgid "Added preview option in forms"
2117
  msgstr ""
2118
 
2119
+ #: admin/html/whats-new.php:595
2120
  msgid ""
2121
  "You can see a nice <strong>Preview</strong> button with <strong>Save "
2122
  "Form</strong> button, admin can take a quick look of the form without using "
2123
  "shortcode"
2124
  msgstr ""
2125
 
2126
+ #: admin/html/whats-new.php:598
2127
  msgid "Fixed hiding “Select Image” button while uploading multiple images."
2128
  msgstr ""
2129
 
2130
+ #: admin/html/whats-new.php:600
2131
  msgid ""
2132
  "The upload button will not be hidden until the user selects max number of "
2133
  "files "
2134
  msgstr ""
2135
 
2136
+ #: admin/html/whats-new.php:603
2137
  msgid "Added form limit notice before form submission"
2138
  msgstr ""
2139
 
2140
+ #: admin/html/whats-new.php:605
2141
  msgid ""
2142
  "Limit notice message was showing after submission, now it is showing when "
2143
  "rendering the form"
2144
  msgstr ""
2145
 
2146
+ #: admin/html/whats-new.php:608
2147
  msgid "Fixed: default post category not saving"
2148
  msgstr ""
2149
 
2150
+ #: admin/html/whats-new.php:610
2151
  msgid ""
2152
  "From the form <strong>Settings > Post Settings</strong>, default post "
2153
  "category options were not saving. Now, it's fixed."
2154
  msgstr ""
2155
 
2156
+ #: admin/html/whats-new.php:613
2157
  msgid ""
2158
  "WPUF dashboard shortcode with form_id attribute was not showing posts "
2159
  "properly"
2160
  msgstr ""
2161
 
2162
+ #: admin/html/whats-new.php:615
2163
  msgid ""
2164
  "Now you can list posts on the frontend by using <strong>form_id<strong/> "
2165
  "attribute with <strong>[wpuf_dashboard]</strong> shortcode"
2166
  msgstr ""
2167
 
2168
+ #: admin/html/whats-new.php:624
2169
  msgid "Changed text domain to `wp-user-frontend` from `wpuf` "
2170
  msgstr ""
2171
 
2172
+ #: admin/html/whats-new.php:626
2173
  msgid ""
2174
  "If you are using other language than English. Please <b>rename</b> your "
2175
  "<i>.po and .mo </i> files to `wp-user-frontend_` from `wpuf_` <br> This "
2176
  "change was made to support translations from translate.wordpress.org"
2177
  msgstr ""
2178
 
2179
+ #: admin/html/whats-new.php:629
2180
  msgid "Added WP User Frontend Data export and erase functionality."
2181
  msgstr ""
2182
 
2183
+ #: admin/html/whats-new.php:631
2184
  msgid "Added functionality to export WP User Frontend Data to comply with GDPR."
2185
  msgstr ""
2186
 
2187
+ #: admin/html/whats-new.php:634
2188
  msgid "Added billing address customizer."
2189
  msgstr ""
2190
 
2191
+ #: admin/html/whats-new.php:636
2192
  msgid "Added customizer options for billing address in payment page."
2193
  msgstr ""
2194
 
2195
+ #: admin/html/whats-new.php:639
2196
  msgid "Make the payment page responsive."
2197
  msgstr ""
2198
 
2199
+ #: admin/html/whats-new.php:641
2200
  msgid "Some css adjustments are made in payment page to make it responsive."
2201
  msgstr ""
2202
 
2203
+ #: admin/html/whats-new.php:644
2204
  msgid "Fixed image upload issue in Safari."
2205
  msgstr ""
2206
 
2207
+ #: admin/html/whats-new.php:646
2208
  msgid "Images were not showing after upload in safari, it is fixed now."
2209
  msgstr ""
2210
 
2211
+ #: admin/html/whats-new.php:649
2212
  msgid "Post update issue after updating or removing post images."
2213
  msgstr ""
2214
 
2215
+ #: admin/html/whats-new.php:651
2216
  msgid ""
2217
  "Posts cannot be updated after updating or removing post images, it is fixed "
2218
  "now."
2219
  msgstr ""
2220
 
2221
+ #: admin/html/whats-new.php:660
2222
  msgid "Allow overriding form input styles using theme styling."
2223
  msgstr ""
2224
 
2225
+ #: admin/html/whats-new.php:662
2226
  msgid "Overriding form input styles using theme style is now possible."
2227
  msgstr ""
2228
 
2229
+ #: admin/html/whats-new.php:665
2230
  msgid "Fixed Auto Login after registration."
2231
  msgstr ""
2232
 
2233
+ #: admin/html/whats-new.php:667
2234
  msgid "Auto Login after registration was not working is fixed now."
2235
  msgstr ""
2236
 
2237
+ #: admin/html/whats-new.php:670
2238
  msgid "Fixed fallback cost calculation"
2239
  msgstr ""
2240
 
2241
+ #: admin/html/whats-new.php:672
2242
  msgid "Fallback cost calculation was inaccurate for some cases, it is fixed now."
2243
  msgstr ""
2244
 
2245
+ #: admin/html/whats-new.php:675
2246
  msgid "Removal of subscription from User Profile gets reverted if updated"
2247
  msgstr ""
2248
 
2249
+ #: admin/html/whats-new.php:677
2250
  msgid "User subscription deletion gets reverted if updated is fixed."
2251
  msgstr ""
2252
 
2253
+ #: admin/html/whats-new.php:680
2254
  msgid "Show Free pack users in subscribers list."
2255
  msgstr ""
2256
 
2257
+ #: admin/html/whats-new.php:682
2258
  msgid "Free pack users were not showing in subscribers list, now they will."
2259
  msgstr ""
2260
 
2261
+ #: admin/html/whats-new.php:691
2262
  msgid "WP User Frontend Guten Block is added"
2263
  msgstr ""
2264
 
2265
+ #: admin/html/whats-new.php:693
2266
  msgid ""
2267
  "WPUF Form Block is now available to be used within gutenberg editor with "
2268
  "preview of the form. "
2269
  msgstr ""
2270
 
2271
+ #: admin/html/whats-new.php:696
2272
  msgid "Advanced Custom Fields plugin compatibility"
2273
  msgstr ""
2274
 
2275
+ #: admin/html/whats-new.php:698
2276
  msgid "Now all your ACF fields can be used within WPUF Post forms. "
2277
  msgstr ""
2278
 
2279
+ #: admin/html/whats-new.php:701
2280
  msgid "Taxonomy Terms not showing for custom post types"
2281
  msgstr ""
2282
 
2283
+ #: admin/html/whats-new.php:703
2284
  msgid ""
2285
  "Fixed an issue with taxonomy terms not appearing for Custom Post types "
2286
  "within Form Settings and Dashboard Post Listing"
2287
  msgstr ""
2288
 
2289
+ #: admin/html/whats-new.php:706
2290
  msgid "Various other code optimizations"
2291
  msgstr ""
2292
 
2293
+ #: admin/html/whats-new.php:708 admin/html/whats-new.php:765
2294
  msgid "Code structure organization and optimization for better performance"
2295
  msgstr ""
2296
 
2297
+ #: admin/html/whats-new.php:717
2298
  msgid "WoooCommerce billing address Sync"
2299
  msgstr ""
2300
 
2301
+ #: admin/html/whats-new.php:719
2302
  msgid ""
2303
  "If an existing customer has previously set his billing address, that will "
2304
  "be imported into WPUF Billing address "
2305
  msgstr ""
2306
 
2307
+ #: admin/html/whats-new.php:722
2308
  msgid "Trial subscription message not showing properly"
2309
  msgstr ""
2310
 
2311
+ #: admin/html/whats-new.php:724
2312
  msgid "Subscriptions with Trial now shows trial notices"
2313
  msgstr ""
2314
 
2315
+ #: admin/html/whats-new.php:727
2316
  msgid "Reset email Key not working"
2317
  msgstr ""
2318
 
2319
+ #: admin/html/whats-new.php:729
2320
  msgid "Reset Email key was not working in some cases"
2321
  msgstr ""
2322
 
2323
+ #: admin/html/whats-new.php:732
2324
  msgid "Post count not showing on the frontend dashboard"
2325
  msgstr ""
2326
 
2327
+ #: admin/html/whats-new.php:734
2328
  msgid ""
2329
  "Dashboard with multiple post type was not showing post counts properly, is "
2330
  "now fixed and shows count for each post type"
2331
  msgstr ""
2332
 
2333
+ #: admin/html/whats-new.php:737
2334
  msgid "Login Redirect showing blank page is fixed"
2335
  msgstr ""
2336
 
2337
+ #: admin/html/whats-new.php:739
2338
  msgid ""
2339
  "If \"Previous Page\" was set for redirection, login redirect was "
2340
  "redirecting to blank page for users who hit login page directly"
2341
  msgstr ""
2342
 
2343
+ #: admin/html/whats-new.php:748
2344
  msgid "Enhanced Login Redirect to redirect users to previous page"
2345
  msgstr ""
2346
 
2347
+ #: admin/html/whats-new.php:750
2348
  msgid ""
2349
  "You can choose Previous Page as Login Redirect page settings now to "
2350
  "redirect users to the page from which they went for Login. "
2351
  msgstr ""
2352
 
2353
+ #: admin/html/whats-new.php:753
2354
  msgid "Email HTML links not Rendreing properly issue is fixed"
2355
  msgstr ""
2356
 
2357
+ #: admin/html/whats-new.php:755
2358
  msgid ""
2359
  "For some clients emails were not rendering the HTML links properly, this is "
2360
  "now fixed"
2361
  msgstr ""
2362
 
2363
+ #: admin/html/whats-new.php:758
2364
  msgid "Form Builder : Form Field's Help text styles not showing properly"
2365
  msgstr ""
2366
 
2367
+ #: admin/html/whats-new.php:760
2368
  msgid "Help texts styling is now fixed and much easier to read and understand"
2369
  msgstr ""
2370
 
2371
+ #: admin/html/whats-new.php:763
2372
  msgid "Various other code improvements"
2373
  msgstr ""
2374
 
2375
+ #: admin/html/whats-new.php:774
2376
  msgid "Dashboard Post Listing now supports multiple post types"
2377
  msgstr ""
2378
 
2379
+ #: admin/html/whats-new.php:776
2380
  msgid ""
2381
  "Now you can show multiple post type in user dashboard using shortcode like "
2382
  "this : <br><b>[wpuf_dashboard post_type=\"post,page,custom_type\"]</b> "
2383
  msgstr ""
2384
 
2385
+ #: admin/html/whats-new.php:779
2386
  msgid "Added Login Redirect Settings"
2387
  msgstr ""
2388
 
2389
+ #: admin/html/whats-new.php:781
2390
  msgid ""
2391
  "You can now set a page from <i>WPUF Settings > Login/Registration > "
2392
  "Redirect after Login</i>. When login redirection is active the user will be "
2393
  "redirected to this page after login."
2394
  msgstr ""
2395
 
2396
+ #: admin/html/whats-new.php:784
2397
  msgid "Image Upload field button text can be changed"
2398
  msgstr ""
2399
 
2400
+ #: admin/html/whats-new.php:786
2401
  msgid ""
2402
  "The upload button text can now be changed for image upload fields which "
2403
  "defaults to \"Select Image\" if not set. "
2404
  msgstr ""
2405
 
2406
+ #: admin/html/whats-new.php:789
2407
  msgid "Multi Step Form styles made compatible with more themes"
2408
  msgstr ""
2409
 
2410
+ #: admin/html/whats-new.php:791
2411
  msgid "Multi Step form can now be styled more easily with other themes "
2412
  msgstr ""
2413
 
2414
+ #: admin/html/whats-new.php:794
2415
  msgid "Required field condition for google map not working is fixed"
2416
  msgstr ""
2417
 
2418
+ #: admin/html/whats-new.php:796
2419
  msgid ""
2420
  "If Google Map field was set as required users were able to submit form "
2421
  "without changing the default value."
2422
  msgstr ""
2423
 
2424
+ #: admin/html/whats-new.php:805
2425
  msgid "Admin form builder is now fully responsive."
2426
  msgstr ""
2427
 
2428
+ #: admin/html/whats-new.php:807
2429
  msgid ""
2430
  "Now you can edit forms from your mobile devices directly. Our improved "
2431
  "responsive layouts of form builder makes it easy for you to build forms on "
2432
  "the go."
2433
  msgstr ""
2434
 
2435
+ #: admin/html/whats-new.php:810
2436
  msgid "Added color schemes for creating attractive form layouts."
2437
  msgstr ""
2438
 
2439
+ #: admin/html/whats-new.php:812
2440
  msgid ""
2441
  "We have added 3 new color schemes for the form layouts which you can choose "
2442
  "from each form's new display settings."
2443
  msgstr ""
2444
 
2445
+ #: admin/html/whats-new.php:815
2446
  msgid "Restrict Free subscription pack to be enabled multiple times "
2447
  msgstr ""
2448
 
2449
+ #: admin/html/whats-new.php:817
2450
  msgid ""
2451
  "Free subscription packs now can only be purchased once and the limit "
2452
  "applies properly"
2453
  msgstr ""
2454
 
2455
+ #: admin/html/whats-new.php:820
2456
  msgid "Various other bug fixes and improvements were made "
2457
  msgstr ""
2458
 
2459
+ #: admin/html/whats-new.php:822
2460
  msgid "Please see the change log to see full details."
2461
  msgstr ""
2462
 
2463
+ #: admin/html/whats-new.php:831
2464
  msgid "Added upgrade function for default category"
2465
  msgstr ""
2466
 
2467
+ #: admin/html/whats-new.php:833
2468
  msgid "Upgrader added to upgrade previously set default post category."
2469
  msgstr ""
2470
 
2471
+ #: admin/html/whats-new.php:836
2472
  msgid "Subscription pack cannot be canceled"
2473
  msgstr ""
2474
 
2475
+ #: admin/html/whats-new.php:838
2476
  msgid ""
2477
  "Fixed recurring subscription pack cannot be canceled from my account page "
2478
  "in subscription details section."
2479
  msgstr ""
2480
 
2481
+ #: admin/html/whats-new.php:841
2482
  msgid "page installer admin notice logic issue"
2483
  msgstr ""
2484
 
2485
+ #: admin/html/whats-new.php:843
2486
  msgid ""
2487
  "Fixed page installer admin notice logic problem due to new payment settings "
2488
  "default value not set."
2489
  msgstr ""
2490
 
2491
+ #: admin/html/whats-new.php:853
2492
  msgid "Setup Wizard"
2493
  msgstr ""
2494
 
2495
+ #: admin/html/whats-new.php:855
2496
  msgid "Setup Wizard added to turn off payment options and install pages."
2497
  msgstr ""
2498
 
2499
+ #: admin/html/whats-new.php:859
2500
  msgid "Multi-select Category"
2501
  msgstr ""
2502
 
2503
+ #: admin/html/whats-new.php:861
2504
  msgid "Add multi-select to default category in post form settings."
2505
  msgstr ""
2506
 
2507
+ #: admin/html/whats-new.php:865
2508
  msgid "Select Text option for Taxonomy"
2509
  msgstr ""
2510
 
2511
+ #: admin/html/whats-new.php:867
2512
  msgid ""
2513
  "Add Select Text option for taxonomy fields. Now you can add default text "
2514
  "with empty value as first option for Taxonomy dropdown."
2515
  msgstr ""
2516
 
2517
+ #: admin/html/whats-new.php:870
2518
  msgid "Taxonomy Checkbox Inline"
2519
  msgstr ""
2520
 
2521
+ #: admin/html/whats-new.php:872
2522
  msgid ""
2523
  "Added checkbox inline option to taxonomy checkbox. You can now display "
2524
  "Taxonomy checkbox fields inline."
2525
  msgstr ""
2526
 
2527
+ #: admin/html/whats-new.php:882
2528
  msgid "Manage schedule for form submission"
2529
  msgstr ""
2530
 
2531
+ #: admin/html/whats-new.php:884
2532
  msgid ""
2533
  "Do not accept form submission if the current date is not between the date "
2534
  "range of the schedule."
2535
  msgstr ""
2536
 
2537
+ #: admin/html/whats-new.php:888
2538
  msgid "Restrict form submission based on the user roles"
2539
  msgstr ""
2540
 
2541
+ #: admin/html/whats-new.php:890
2542
  msgid ""
2543
  "Restrict form submission based on the user roles. Now you can manage user "
2544
  "role base permission on form submission."
2545
  msgstr ""
2546
 
2547
+ #: admin/html/whats-new.php:894
2548
  msgid "Limit how many entries a form will accept"
2549
  msgstr ""
2550
 
2551
+ #: admin/html/whats-new.php:896
2552
  msgid ""
2553
  "Limit how many entries a form will accept and display a custom message when "
2554
  "that limit is reached."
2555
  msgstr ""
2556
 
2557
+ #: admin/html/whats-new.php:900
2558
  msgid "Show/hide Admin Bar"
2559
  msgstr ""
2560
 
2561
+ #: admin/html/whats-new.php:902
2562
  msgid "Control the admin bar visibility based on user roles."
2563
  msgstr ""
2564
 
2565
+ #: admin/html/whats-new.php:906
2566
  msgid "Ajax Login widget"
2567
  msgstr ""
2568
 
2569
+ #: admin/html/whats-new.php:908
2570
  msgid ""
2571
  "Login user is more simple now with Ajax Login Widget. The simple ajax login "
2572
  "form do not required page loading for login."
2573
  msgstr ""
2574
 
2575
+ #: admin/html/whats-new.php:912
2576
  msgid "Form submission with Captcha field"
2577
  msgstr ""
2578
 
2579
+ #: admin/html/whats-new.php:914
2580
  msgid "Form field validation process updated if form submits with captcha field."
2581
  msgstr ""
2582
 
2583
+ #: admin/html/whats-new.php:928
2584
  msgid "What's New in WPUF?"
2585
  msgstr ""
2586
 
2603
  msgstr ""
2604
 
2605
  #: admin/installer.php:84 admin/settings-options.php:24
2606
+ #: includes/free/admin/shortcode-button.php:79 wpuf-functions.php:2011
2607
  msgid "Dashboard"
2608
  msgstr ""
2609
 
2619
  #: admin/installer.php:95 class/subscription.php:381 class/subscription.php:401
2620
  #: class/subscription.php:402 class/subscription.php:403
2621
  #: includes/free/admin/shortcode-button.php:99
2622
+ #: templates/dashboard/dashboard.php:19 wpuf-functions.php:2023
2623
  msgid "Subscription"
2624
  msgstr ""
2625
 
2702
 
2703
  #: admin/post-forms-list-table.php:315 admin/premium.php:39
2704
  #: includes/fields/class-pro-upgrade-fields.php:159
2705
+ #: includes/free/form-element.php:31
2706
  msgid "Shortcode"
2707
  msgstr ""
2708
 
2812
  msgstr ""
2813
 
2814
  #: admin/premium.php:33 includes/fields/class-pro-upgrade-fields.php:19
2815
+ #: includes/free/form-element.php:16
2816
  msgid "Country List"
2817
  msgstr ""
2818
 
2829
  msgstr ""
2830
 
2831
  #: admin/premium.php:37 includes/fields/class-pro-upgrade-fields.php:71
2832
+ #: includes/free/form-element.php:34
2833
  msgid "Action Hook"
2834
  msgstr ""
2835
 
2846
  msgstr ""
2847
 
2848
  #: admin/premium.php:42 includes/fields/class-pro-upgrade-fields.php:49
2849
+ #: includes/free/form-element.php:14
2850
  msgid "File Upload"
2851
  msgstr ""
2852
 
2879
  msgstr ""
2880
 
2881
  #: admin/premium.php:71 admin/premium.php:74 includes/class-pro-upgrades.php:94
2882
+ #: includes/free/form-element.php:496
2883
  msgid "Conditional Logic"
2884
  msgstr ""
2885
 
3546
 
3547
  #: admin/template-post.php:88 admin/template.php:608
3548
  #: includes/fields/class-field-featured-image.php:116
3549
+ #: includes/fields/class-field-image.php:101
3550
  msgid "Enter maximum upload size limit in KB"
3551
  msgstr ""
3552
 
3553
  #: admin/template-post.php:99 admin/template.php:619
3554
  #: includes/fields/class-field-featured-image.php:112
3555
+ #: includes/fields/class-field-image.php:97
3556
  msgid "Max. file size"
3557
  msgstr ""
3558
 
3835
  #: class/upload.php:264 includes/fields/class-field-recaptcha.php:147
3836
  #: includes/fields/class-field-sectionbreak.php:55
3837
  #: templates/dashboard/posts.php:89 templates/dashboard.php:104
3838
+ #: wpuf-functions.php:1024
3839
  msgid "Title"
3840
  msgstr ""
3841
 
3852
  msgstr ""
3853
 
3854
  #: admin/template.php:583 class/upload.php:266
3855
+ #: includes/fields/class-field-sectionbreak.php:63 wpuf-functions.php:1032
3856
  msgid "Description"
3857
  msgstr ""
3858
 
3859
+ #: admin/template.php:609 includes/fields/class-field-image.php:110
3860
  msgid "Number of images can be uploaded"
3861
  msgstr ""
3862
 
3863
+ #: admin/template.php:624 includes/fields/class-field-image.php:106
3864
  msgid "Max. files"
3865
  msgstr ""
3866
 
4026
  msgid "Please select your payment page from admin panel"
4027
  msgstr ""
4028
 
4029
+ #: class/payment.php:89
4030
+ msgid "No subscription pack found."
4031
+ msgstr ""
4032
+
4033
+ #: class/payment.php:126
4034
  msgid "Your free package has been activated. Enjoy!"
4035
  msgstr ""
4036
 
4037
+ #: class/payment.php:128
4038
  msgid "You already have activated a free package previously."
4039
  msgstr ""
4040
 
4041
+ #: class/payment.php:146 includes/class-customizer.php:56
4042
+ #: wpuf-functions.php:2027
4043
  msgid "Billing Address"
4044
  msgstr ""
4045
 
4046
+ #: class/payment.php:178
4047
  msgid "Pricing & Plans"
4048
  msgstr ""
4049
 
4050
+ #: class/payment.php:180
4051
  msgid "Change Pack"
4052
  msgstr ""
4053
 
4054
+ #: class/payment.php:197
4055
  msgid "Selected Pack "
4056
  msgstr ""
4057
 
4058
+ #: class/payment.php:198
4059
  msgid "Pack Price "
4060
  msgstr ""
4061
 
4062
+ #: class/payment.php:202 class/payment.php:253 includes/class-privacy.php:338
4063
  msgid "Total"
4064
  msgstr ""
4065
 
4066
+ #: class/payment.php:216
4067
  msgid "Apply Coupon"
4068
  msgstr ""
4069
 
4070
+ #: class/payment.php:220
4071
  msgid "Have a discount code?"
4072
  msgstr ""
4073
 
4074
+ #: class/payment.php:249
4075
  msgid "Post cost"
4076
  msgstr ""
4077
 
4078
+ #: class/payment.php:262
4079
  msgid "Choose Your Payment Method"
4080
  msgstr ""
4081
 
4082
+ #: class/payment.php:299
4083
  msgid "Proceed"
4084
  msgstr ""
4085
 
4086
+ #: class/payment.php:307
4087
  msgid "No Payment gateway found"
4088
  msgstr ""
4089
 
4090
+ #: class/payment.php:497 lib/gateway/bank.php:107
4091
+ #. translators: %s is site title name
4092
  msgid "[%s] Payment Received"
4093
  msgstr ""
4094
 
4095
+ #: class/payment.php:499
4096
+ #. translators: %s is site title name
4097
  msgid "New payment received at %s"
4098
  msgstr ""
4099
 
4127
  #: includes/fields/class-abstract-fields.php:188
4128
  #: includes/fields/class-field-dropdown.php:106
4129
  #: includes/fields/class-field-multidropdown.php:83
4130
+ #: includes/fields/class-field-post-taxonomy.php:353
4131
  msgid "- select -"
4132
  msgstr ""
4133
 
4220
  msgid "Strength indicator"
4221
  msgstr ""
4222
 
4223
+ #: class/render-form.php:1401 includes/fields/class-field-post-taxonomy.php:127
4224
+ #: wpuf-functions.php:1796
4225
  msgid "-- Select --"
4226
  msgstr ""
4227
 
4228
+ #: class/render-form.php:1465 includes/fields/class-field-post-taxonomy.php:66
4229
  msgid "This field is no longer available."
4230
  msgstr ""
4231
 
4415
  msgid "Trans ID"
4416
  msgstr ""
4417
 
4418
+ #: class/transactions-list-table.php:52 includes/free/form-element.php:13
4419
  msgid "Date"
4420
  msgstr ""
4421
 
4435
  msgid "No transactions found."
4436
  msgstr ""
4437
 
4438
+ #: class/upload.php:265 wpuf-functions.php:1028
4439
  msgid "Caption"
4440
  msgstr ""
4441
 
4572
 
4573
  #: includes/class-dokan-integration.php:34
4574
  #: includes/class-wc-vendors-integration.php:108
4575
+ #: templates/dashboard/dashboard.php:15 wpuf-functions.php:2015
4576
  msgid "Posts"
4577
  msgstr ""
4578
 
4623
  msgid "Post Limit Exceeded for your purchased subscription pack."
4624
  msgstr ""
4625
 
4626
+ #: includes/class-frontend-form-post.php:57
4627
  msgid "You are not logged in"
4628
  msgstr ""
4629
 
4630
+ #: includes/class-frontend-form-post.php:67
4631
+ #: includes/class-frontend-form-post.php:97
4632
  msgid "Invalid post"
4633
  msgstr ""
4634
 
4635
+ #: includes/class-frontend-form-post.php:74
4636
  msgid "Your edit access for this post has been locked by an administrator."
4637
  msgstr ""
4638
 
4639
+ #: includes/class-frontend-form-post.php:78
4640
  msgid "Your allocated time for editing this post has been expired."
4641
  msgstr ""
4642
 
4643
+ #: includes/class-frontend-form-post.php:86
4644
  msgid "Your post edit access has been locked by an administrator."
4645
  msgstr ""
4646
 
4647
+ #: includes/class-frontend-form-post.php:91
4648
  msgid "Post Editing is disabled"
4649
  msgstr ""
4650
 
4651
+ #: includes/class-frontend-form-post.php:102
4652
  msgid "You are not allowed to edit"
4653
  msgstr ""
4654
 
4655
+ #: includes/class-frontend-form-post.php:113
4656
  msgid "I don't know how to edit this post, I don't have the form ID"
4657
  msgstr ""
4658
 
4659
+ #: includes/class-frontend-form-post.php:125
4660
  msgid "You can't edit a post while in pending mode."
4661
  msgstr ""
4662
 
4663
+ #: includes/class-frontend-form-post.php:533
4664
  msgid "Something went wrong"
4665
  msgstr ""
4666
 
4667
+ #: includes/class-frontend-form-post.php:554
4668
  msgid "Invalid email address."
4669
  msgstr ""
4670
 
4671
+ #: includes/class-frontend-form-post.php:564
4672
  msgid ""
4673
  "You already have an account in our site. Please login to continue.\n"
4674
  "\n"
4677
  "Click 'Cancel' to stay at this page."
4678
  msgstr ""
4679
 
4680
+ #: includes/class-frontend-form-post.php:615
4681
  #: includes/class-frontend-render-form.php:312
4682
  msgid "You do not have sufficient permissions to access this form."
4683
  msgstr ""
4684
 
4685
+ #: includes/class-frontend-form-post.php:925
4686
  msgid "Email successfully verified. Please Login."
4687
  msgstr ""
4688
 
4689
+ #: includes/class-frontend-form-post.php:1049
4690
+ #: includes/class-frontend-form-post.php:1055
4691
  msgid ""
4692
  "Thank you for posting on our site. We have sent you an confirmation email. "
4693
  "Please check your inbox!"
4796
 
4797
  #: includes/class-login-widget.php:216 includes/class-login-widget.php:252
4798
  #: includes/free/class-login.php:322 includes/free/class-registration.php:122
4799
+ #: includes/free/form-element.php:355
4800
  msgid "Register"
4801
  msgstr ""
4802
 
5266
  msgid "What's New?"
5267
  msgstr ""
5268
 
5269
+ #: includes/class-whats-new.php:107
 
5270
  msgid "Dismiss this notice."
5271
  msgstr ""
5272
 
5411
  msgstr ""
5412
 
5413
  #: includes/fields/class-field-featured-image.php:120
5414
+ #: includes/fields/class-field-image.php:114
5415
  msgid "Button Label"
5416
  msgstr ""
5417
 
5418
  #: includes/fields/class-field-featured-image.php:125
5419
+ #: includes/fields/class-field-image.php:119
5420
  msgid "Enter a label for the Select button"
5421
  msgstr ""
5422
 
5440
  msgid "HTML Section"
5441
  msgstr ""
5442
 
5443
+ #: includes/fields/class-field-image.php:9 includes/free/form-element.php:9
5444
  msgid "Image Upload"
5445
  msgstr ""
5446
 
5447
  #: includes/fields/class-field-numeric.php:7
5448
  #: includes/fields/class-pro-upgrade-fields.php:82
5449
+ #: includes/free/form-element.php:17
5450
  msgid "Numeric Field"
5451
  msgstr ""
5452
 
5463
  msgstr ""
5464
 
5465
  #: includes/fields/class-field-recaptcha.php:9
5466
+ #: includes/free/form-element.php:32
5467
  msgid "reCaptcha"
5468
  msgstr ""
5469
 
5519
  msgid "Website URL"
5520
  msgstr ""
5521
 
5522
+ #: includes/fields/class-field-url.php:63
5523
  msgid "Open in : "
5524
  msgstr ""
5525
 
5526
+ #: includes/fields/class-field-url.php:66
5527
  msgid "Same Window"
5528
  msgstr ""
5529
 
5530
+ #: includes/fields/class-field-url.php:67
5531
  msgid "New Window"
5532
  msgstr ""
5533
 
5534
+ #: includes/fields/class-field-url.php:73
5535
  msgid "Choose whether the link will open in new tab or same window"
5536
  msgstr ""
5537
 
5538
  #: includes/fields/class-pro-upgrade-fields.php:8
5539
+ #: includes/free/form-element.php:18
5540
  msgid "Address Field"
5541
  msgstr ""
5542
 
5565
  msgstr ""
5566
 
5567
  #: includes/fields/class-pro-upgrade-fields.php:137
5568
+ #: includes/free/form-element.php:12
5569
  msgid "Repeat Field"
5570
  msgstr ""
5571
 
5572
  #: includes/fields/class-pro-upgrade-fields.php:148
5573
+ #: includes/free/form-element.php:33
5574
  msgid "Really Simple Captcha"
5575
  msgstr ""
5576
 
5577
  #: includes/fields/class-pro-upgrade-fields.php:170
5578
+ #: includes/free/form-element.php:19
5579
  msgid "Step Start"
5580
  msgstr ""
5581
 
5859
  msgid "Password Strength"
5860
  msgstr ""
5861
 
5862
+ #: includes/free/edit-profile.php:233 includes/free/form-element.php:356
5863
  #: templates/dashboard/edit-profile.php:131
5864
  msgid "Update Profile"
5865
  msgstr ""
5960
  "<a href=\"mailto:%s\">webmaster</a> !"
5961
  msgstr ""
5962
 
5963
+ #: includes/free/form-element.php:8 includes/free/form-element.php:27
5964
  msgid "Click to add to the editor"
5965
  msgstr ""
5966
 
5967
+ #: includes/free/form-element.php:15
5968
  msgid "Google Maps"
5969
  msgstr ""
5970
 
5971
+ #: includes/free/form-element.php:35
5972
  msgid "Term &amp; Conditions"
5973
  msgstr ""
5974
 
5975
+ #: includes/free/form-element.php:64
5976
  msgid "Learn more about Automatic Post Expiration"
5977
  msgstr ""
5978
 
5979
+ #: includes/free/form-element.php:129
5980
  msgid "Send Email to Author After Exceeding Post Expiration Time"
5981
  msgstr ""
5982
 
5983
+ #: includes/free/form-element.php:155 includes/free/form-element.php:159
5984
  msgid "Enable Multistep"
5985
  msgstr ""
5986
 
5987
+ #: includes/free/form-element.php:162
5988
  msgid "If checked, form will be displayed in frontend in multiple steps"
5989
  msgstr ""
5990
 
5991
+ #: includes/free/form-element.php:163
5992
  msgid " Learn more about Multistep"
5993
  msgstr ""
5994
 
5995
+ #: includes/free/form-element.php:167
5996
  msgid "Multistep Progressbar Type"
5997
  msgstr ""
5998
 
5999
+ #: includes/free/form-element.php:177
6000
  msgid "Choose how you want the progressbar"
6001
  msgstr ""
6002
 
6003
+ #: includes/free/form-element.php:206
6004
  msgid "New post created"
6005
  msgstr ""
6006
 
6007
+ #: includes/free/form-element.php:211
6008
  msgid "A post has been edited"
6009
  msgstr ""
6010
 
6011
+ #: includes/free/form-element.php:215
6012
  msgid "New Post Notification"
6013
  msgstr ""
6014
 
6015
+ #: includes/free/form-element.php:223 includes/free/form-element.php:261
6016
  msgid "Enable post notification"
6017
  msgstr ""
6018
 
6019
+ #: includes/free/form-element.php:226
6020
  msgid "Learn more about Email Notification"
6021
  msgstr ""
6022
 
6023
+ #: includes/free/form-element.php:237 includes/free/form-element.php:272
6024
  msgid "Subject"
6025
  msgstr ""
6026
 
6027
+ #: includes/free/form-element.php:242 includes/free/form-element.php:277
6028
  msgid "Message"
6029
  msgstr ""
6030
 
6031
+ #: includes/free/form-element.php:249
6032
  msgid "Update Post Notification"
6033
  msgstr ""
6034
 
6035
+ #: includes/free/form-element.php:285
6036
  msgid "You may use in to, subject & message:"
6037
  msgstr ""
6038
 
6039
+ #: includes/free/form-element.php:310
6040
  msgid "Toggle All"
6041
  msgstr ""
6042
 
6043
+ #: includes/free/form-element.php:314
6044
  msgid "Click on a form element to add to the editor"
6045
  msgstr ""
6046
 
6047
+ #: includes/free/form-element.php:351
6048
  msgid "Registration successful"
6049
  msgstr ""
6050
 
6051
+ #: includes/free/form-element.php:352
6052
  msgid "Profile updated successfully"
6053
  msgstr ""
6054
 
6055
+ #: includes/free/form-element.php:364
6056
  msgid "Enable Email Verfication"
6057
  msgstr ""
6058
 
6059
+ #: includes/free/form-element.php:372
6060
  msgid "New User Role"
6061
  msgstr ""
6062
 
6063
+ #: includes/free/form-element.php:413
6064
  msgid "Registration success message"
6065
  msgstr ""
6066
 
6067
+ #: includes/free/form-element.php:420
6068
  msgid "Update profile message"
6069
  msgstr ""
6070
 
6071
+ #: includes/free/form-element.php:457
6072
  msgid "Submit Button text"
6073
  msgstr ""
6074
 
6075
+ #: includes/free/form-element.php:464
6076
  msgid "Update Button text"
6077
  msgstr ""
6078
 
6306
  msgid "Submit & Deactivate"
6307
  msgstr ""
6308
 
 
 
 
 
 
 
 
 
6309
  #: lib/class.settings-api.php:368
6310
  msgid "Choose File"
6311
  msgstr ""
6556
  msgid "Private"
6557
  msgstr ""
6558
 
6559
+ #: wpuf-functions.php:210 wpuf-functions.php:2043
6560
  msgid "-- select --"
6561
  msgstr ""
6562
 
6563
+ #: wpuf-functions.php:510
6564
  msgid "Images"
6565
  msgstr ""
6566
 
6567
+ #: wpuf-functions.php:514
6568
  msgid "Audio"
6569
  msgstr ""
6570
 
6571
+ #: wpuf-functions.php:518
6572
  msgid "Videos"
6573
  msgstr ""
6574
 
6575
+ #: wpuf-functions.php:522
6576
  msgid "PDF"
6577
  msgstr ""
6578
 
6579
+ #: wpuf-functions.php:526
6580
  msgid "Office Documents"
6581
  msgstr ""
6582
 
6583
+ #: wpuf-functions.php:530
6584
  msgid "Zip Archives"
6585
  msgstr ""
6586
 
6587
+ #: wpuf-functions.php:534
6588
  msgid "Executable Files"
6589
  msgstr ""
6590
 
6591
+ #: wpuf-functions.php:538
6592
  msgid "CSV"
6593
  msgstr ""
6594
 
6595
+ #: wpuf-functions.php:1051
6596
  msgid "Directions »"
6597
  msgstr ""
6598
 
6599
+ #: wpuf-functions.php:2019
6600
  msgid "Edit Profile"
6601
  msgstr ""
6602
 
6603
+ #: wpuf-functions.php:2157
6604
  msgid "United Arab Emirates Dirham"
6605
  msgstr ""
6606
 
6607
+ #: wpuf-functions.php:2162
6608
  msgid "Australian Dollars"
6609
  msgstr ""
6610
 
6611
+ #: wpuf-functions.php:2167
6612
  msgid "Argentine Peso"
6613
  msgstr ""
6614
 
6615
+ #: wpuf-functions.php:2172
6616
  msgid "Bangladeshi Taka"
6617
  msgstr ""
6618
 
6619
+ #: wpuf-functions.php:2177
6620
  msgid "Brazilian Real"
6621
  msgstr ""
6622
 
6623
+ #: wpuf-functions.php:2182
6624
  msgid "Bulgarian Lev"
6625
  msgstr ""
6626
 
6627
+ #: wpuf-functions.php:2187
6628
  msgid "Canadian Dollars"
6629
  msgstr ""
6630
 
6631
+ #: wpuf-functions.php:2192
6632
  msgid "Chilean Peso"
6633
  msgstr ""
6634
 
6635
+ #: wpuf-functions.php:2197
6636
  msgid "Chinese Yuan"
6637
  msgstr ""
6638
 
6639
+ #: wpuf-functions.php:2202
6640
  msgid "Colombian Peso"
6641
  msgstr ""
6642
 
6643
+ #: wpuf-functions.php:2207
6644
  msgid "Czech Koruna"
6645
  msgstr ""
6646
 
6647
+ #: wpuf-functions.php:2212
6648
  msgid "Danish Krone"
6649
  msgstr ""
6650
 
6651
+ #: wpuf-functions.php:2217
6652
  msgid "Dominican Peso"
6653
  msgstr ""
6654
 
6655
+ #: wpuf-functions.php:2222
6656
  msgid "Algerian Dinar"
6657
  msgstr ""
6658
 
6659
+ #: wpuf-functions.php:2227
6660
  msgid "Euros"
6661
  msgstr ""
6662
 
6663
+ #: wpuf-functions.php:2232
6664
  msgid "Hong Kong Dollar"
6665
  msgstr ""
6666
 
6667
+ #: wpuf-functions.php:2237
6668
  msgid "Croatia kuna"
6669
  msgstr ""
6670
 
6671
+ #: wpuf-functions.php:2242
6672
  msgid "Hungarian Forint"
6673
  msgstr ""
6674
 
6675
+ #: wpuf-functions.php:2247
6676
  msgid "Icelandic krona"
6677
  msgstr ""
6678
 
6679
+ #: wpuf-functions.php:2252
6680
  msgid "Indonesia Rupiah"
6681
  msgstr ""
6682
 
6683
+ #: wpuf-functions.php:2257
6684
  msgid "Indian Rupee"
6685
  msgstr ""
6686
 
6687
+ #: wpuf-functions.php:2262
6688
  msgid "Nepali Rupee"
6689
  msgstr ""
6690
 
6691
+ #: wpuf-functions.php:2267
6692
  msgid "Israeli Shekel"
6693
  msgstr ""
6694
 
6695
+ #: wpuf-functions.php:2272
6696
  msgid "Japanese Yen"
6697
  msgstr ""
6698
 
6699
+ #: wpuf-functions.php:2277
6700
  msgid "Lao Kip"
6701
  msgstr ""
6702
 
6703
+ #: wpuf-functions.php:2282
6704
  msgid "South Korean Won"
6705
  msgstr ""
6706
 
6707
+ #: wpuf-functions.php:2287
6708
  msgid "Malaysian Ringgits"
6709
  msgstr ""
6710
 
6711
+ #: wpuf-functions.php:2292
6712
  msgid "Mexican Peso"
6713
  msgstr ""
6714
 
6715
+ #: wpuf-functions.php:2297
6716
  msgid "Nigerian Naira"
6717
  msgstr ""
6718
 
6719
+ #: wpuf-functions.php:2302
6720
  msgid "Norwegian Krone"
6721
  msgstr ""
6722
 
6723
+ #: wpuf-functions.php:2307
6724
  msgid "New Zealand Dollar"
6725
  msgstr ""
6726
 
6727
+ #: wpuf-functions.php:2312
6728
  msgid "Namibian dollar"
6729
  msgstr ""
6730
 
6731
+ #: wpuf-functions.php:2317
6732
  msgid "Omani Rial"
6733
  msgstr ""
6734
 
6735
+ #: wpuf-functions.php:2322
6736
  msgid "Iranian Rial"
6737
  msgstr ""
6738
 
6739
+ #: wpuf-functions.php:2327
6740
  msgid "Pakistani Rupee"
6741
  msgstr ""
6742
 
6743
+ #: wpuf-functions.php:2332
6744
  msgid "Paraguayan Guaraní"
6745
  msgstr ""
6746
 
6747
+ #: wpuf-functions.php:2337
6748
  msgid "Philippine Pesos"
6749
  msgstr ""
6750
 
6751
+ #: wpuf-functions.php:2342
6752
  msgid "Polish Zloty"
6753
  msgstr ""
6754
 
6755
+ #: wpuf-functions.php:2347
6756
  msgid "Pounds Sterling"
6757
  msgstr ""
6758
 
6759
+ #: wpuf-functions.php:2352
6760
  msgid "Romanian Leu"
6761
  msgstr ""
6762
 
6763
+ #: wpuf-functions.php:2357
6764
  msgid "Russian Ruble"
6765
  msgstr ""
6766
 
6767
+ #: wpuf-functions.php:2362
6768
  msgid "Saudi Riyal"
6769
  msgstr ""
6770
 
6771
+ #: wpuf-functions.php:2367
6772
  msgid "Singapore Dollar"
6773
  msgstr ""
6774
 
6775
+ #: wpuf-functions.php:2372
6776
  msgid "South African rand"
6777
  msgstr ""
6778
 
6779
+ #: wpuf-functions.php:2377
6780
  msgid "Swedish Krona"
6781
  msgstr ""
6782
 
6783
+ #: wpuf-functions.php:2382
6784
  msgid "Swiss Franc"
6785
  msgstr ""
6786
 
6787
+ #: wpuf-functions.php:2387
6788
  msgid "Taiwan New Dollars"
6789
  msgstr ""
6790
 
6791
+ #: wpuf-functions.php:2392
6792
  msgid "Thai Baht"
6793
  msgstr ""
6794
 
6795
+ #: wpuf-functions.php:2397
6796
  msgid "Turkish Lira"
6797
  msgstr ""
6798
 
6799
+ #: wpuf-functions.php:2402
6800
  msgid "US Dollar"
6801
  msgstr ""
6802
 
6803
+ #: wpuf-functions.php:2407
6804
  msgid "Vietnamese Dong"
6805
  msgstr ""
6806
 
6807
+ #: wpuf-functions.php:2412
6808
  msgid "Egyptian Pound"
6809
  msgstr ""
6810
 
6811
+ #: wpuf-functions.php:2417
6812
  msgid "Jordanian dinar"
6813
  msgstr ""
6814
 
6815
+ #: wpuf-functions.php:3314
6816
  msgid "None"
6817
  msgstr ""
6818
 
6939
  msgid "Searching&hellip;"
6940
  msgstr ""
6941
 
6942
+ #: wpuf-functions.php:1518
6943
  msgctxt "tag delimiter"
6944
  msgid ","
6945
  msgstr ""
lib/class-weforms-upsell.php DELETED
@@ -1,407 +0,0 @@
1
- <?php
2
-
3
- if ( !class_exists( 'WeForms_Upsell' ) ) {
4
-
5
- /**
6
- * weForms Upsell Class
7
- */
8
- class WeForms_Upsell {
9
- /**
10
- * Affiliate code for referal tracking
11
- *
12
- * @var string
13
- */
14
- private $affiliate;
15
-
16
- /**
17
- * Learn more link
18
- *
19
- * @var string
20
- */
21
- private $learn_more = 'https://wedevs.com/weforms-details/';
22
-
23
- /**
24
- * Instantiate the class
25
- *
26
- * @param string $affiliate
27
- */
28
- public function __construct( $affiliate = '' ) {
29
- $this->affiliate = $affiliate;
30
-
31
- add_action( 'init', [ $this, 'init_hooks' ] );
32
- }
33
-
34
- /**
35
- * Initialize the hooks
36
- *
37
- * @return void
38
- */
39
- public function init_hooks() {
40
- if ( class_exists( 'weForms' ) ) {
41
- return;
42
- }
43
-
44
- if ( !current_user_can( 'manage_options' ) ) {
45
- return;
46
- }
47
-
48
- add_action( 'admin_notices', [ $this, 'activation_notice' ] );
49
-
50
- add_action( 'wp_ajax_weforms_upsell_installer', [ $this, 'install_weforms' ] );
51
- add_action( 'wp_ajax_weforms_upsell_dismiss', [ $this, 'dismiss_weforms_notice' ] );
52
- }
53
-
54
- /**
55
- * Show the plugin installation notice
56
- *
57
- * @return void
58
- */
59
- public function activation_notice() {
60
- if ( $this->is_dismissed() ) {
61
- return;
62
- } ?>
63
- <div class="updated" id="weforms-upsell-prompt">
64
- <div class="weforms-upsell-logo">
65
- <img src="https://wedevs-com-wedevs.netdna-ssl.com/wp-content/uploads/2017/08/weforms-upsell.png" width="272" height="71" alt="weForms Logo">
66
- </div>
67
- <div class="weforms-upsell-text">
68
- <h2>weForms is here!</h2>
69
-
70
- <p>weForms is the next generation contact form plugin for WordPress.</p>
71
- </div>
72
- <div class="weforms-upsell-cta">
73
- <button id="weforms-upsell-prompt-btn" class="button"><?php _e( 'Install Now', 'wp-user-frontend' ); ?></button>
74
- &nbsp;<a href="#" class="learn-more" data-tube="NJvjy9WFyAM">Learn More</a>
75
- </div>
76
- <button type="button" class="notice-dismiss" style="padding: 3px;" title="<?php _e( 'Dismiss this notice.', 'wp-user-frontend' ); ?>">
77
- <span class="screen-reader-text"><?php _e( 'Dismiss this notice.', 'wp-user-frontend' ); ?></span>
78
- </button>
79
- </div>
80
-
81
- <div class="weforms-upsell-modal" id="weforms-upsell-modal">
82
- <a class="close">
83
- &times;
84
- <span class="screen-reader-text">Close modal window</span>
85
- </a>
86
- <div class="video-wrap">
87
- <iframe id="weforms-upsell-modal-iframe" width="1280" height="720" src="" frameborder="0" allowfullscreen></iframe>
88
- </div>
89
-
90
- <div class="learn-more">
91
- <a href="<?php echo $this->learn_more_link(); ?>" target="_blank" class="button button-primary">Learn more about weForms</a>
92
- </div>
93
- </div>
94
- <div class="weforms-upsell-modal-backdrop" id="weforms-upsell-modal-backdrop"></div>
95
-
96
- <style type="text/css">
97
- div#weforms-upsell-prompt * {
98
- box-sizing: border-box;
99
- }
100
-
101
- div#weforms-upsell-prompt {
102
- display: flex;
103
- flex-direction: row;
104
- flex-wrap: nowrap;
105
- justify-content: flex-start;
106
- align-content: flex-start;
107
- align-items: flex-start;
108
- position: relative;
109
- border: none;
110
- margin: 5px 0 15px;
111
- padding: 0 0 0 10px;
112
- }
113
-
114
- .weforms-upsell-logo {
115
- margin: 0;
116
- height: 71px;
117
- order: 0;
118
- flex: 0 1 272px;
119
- align-self: auto;
120
- padding-left: 15px;
121
- }
122
-
123
- .weforms-upsell-text {
124
- background: #46b450;
125
- color: #fff;
126
- padding: 0;
127
- height: 71px;
128
- margin-left: -35px;
129
- order: 0;
130
- flex: 1 1 auto;
131
- align-self: auto;
132
- }
133
-
134
- .weforms-upsell-text h2 {
135
- color: #fff;
136
- margin: 10px 0;
137
- }
138
-
139
- .weforms-upsell-cta {
140
- text-align: center;
141
- order: 0;
142
- flex: 0 1 220px;
143
- align-self: auto;
144
- padding-top: 20px;
145
- vertical-align: middle;
146
- height: 71px;
147
- line-height: 28px;
148
- }
149
-
150
- .weforms-upsell-modal {
151
- background: #fff;
152
- position: fixed;
153
- top: 5%;
154
- bottom: 5%;
155
- right: 10%;
156
- left: 10%;
157
- display: none;
158
- box-shadow: 0 1px 20px 5px rgba(0, 0, 0, 0.1);
159
- z-index: 160000;
160
- }
161
-
162
- .weforms-upsell-modal .video-wrap {
163
- position: relative;
164
- padding-bottom: 56.25%; /* 16:9 */
165
- padding-top: 25px;
166
- height: 0;
167
- }
168
-
169
- .weforms-upsell-modal .video-wrap iframe {
170
- position: absolute;
171
- top: 0;
172
- left: 0;
173
- width: 100%;
174
- height: 100%;
175
- }
176
-
177
- .weforms-upsell-modal .learn-more {
178
- position: absolute;
179
- bottom: 0;
180
- right: 10px;
181
- background: #fff;
182
- padding: 10px;
183
- border-radius: 3px;
184
- }
185
-
186
- .weforms-upsell-modal a.close {
187
- position: absolute;
188
- top: 20px;
189
- right: -60px;
190
- font: 300 1.71429em "dashicons" !important;
191
- content: '\f335';
192
- display: inline-block;
193
- padding: 10px 20px 0 20px;
194
- z-index: 5;
195
- text-decoration: none;
196
- height: 40px;
197
- cursor: pointer;
198
- background: #000;
199
- color: #fff;
200
- border-radius: 50%;
201
- }
202
-
203
- .weforms-upsell-modal-backdrop {
204
- position: fixed;
205
- z-index: 159999;
206
- top: 0;
207
- left: 0;
208
- right: 0;
209
- bottom: 0;
210
- min-height: 360px;
211
- background: #000;
212
- opacity: .7;
213
- display: none;
214
- }
215
-
216
- .weforms-upsell-modal.show,
217
- .weforms-upsell-modal-backdrop.show {
218
- display: block;
219
- }
220
- </style>
221
-
222
- <script type="text/javascript">
223
- (function ($) {
224
- var wrapper = $('#weforms-upsell-prompt'),
225
- modal = $('#weforms-upsell-modal'),
226
- modalBackdrop = $('#weforms-upsell-modal-backdrop'),
227
- iframe = $('#weforms-upsell-modal-iframe');
228
-
229
- wrapper.on('click', '#weforms-upsell-prompt-btn', function (e) {
230
- var self = $(this);
231
-
232
- e.preventDefault();
233
- self.addClass('install-now updating-message');
234
- self.text('<?php echo esc_js( 'Installing...' ); ?>');
235
-
236
- wp.ajax.send( 'weforms_upsell_installer', {
237
- data: {
238
- _wpnonce: '<?php echo wp_create_nonce( 'weforms_upsell_installer' ); ?>'
239
- },
240
-
241
- success: function(response) {
242
- self.text('<?php echo esc_js( 'Installed' ); ?>');
243
- window.location.href = '<?php echo admin_url( 'admin.php?page=weforms' ); ?>';
244
- },
245
-
246
- error: function(error) {
247
- self.removeClass('install-now updating-message');
248
- alert( error );
249
- },
250
-
251
- complete: function() {
252
- self.attr('disabled', 'disabled');
253
- self.removeClass('install-now updating-message');
254
- }
255
- });
256
- });
257
-
258
- wrapper.on('click', '.notice-dismiss', function (e) {
259
- e.preventDefault();
260
-
261
- var self = $(this);
262
-
263
- wp.ajax.send( 'weforms_upsell_dismiss' );
264
-
265
- self.closest('.updated').slideUp('fast', function() {
266
- self.remove();
267
- });
268
- });
269
-
270
- wrapper.on('click', 'a.learn-more', function(e) {
271
- e.preventDefault();
272
-
273
- modal.addClass('show');
274
- modalBackdrop.addClass('show');
275
-
276
- iframe.attr( 'src', 'https://www.youtube.com/embed/sqP-nvyqUdQ?rel=0&amp;controls=0&amp;showinfo=0&amp;autoplay=1' );
277
- });
278
-
279
- $('body').on('click', '.weforms-upsell-modal a.close', function(e) {
280
- e.preventDefault();
281
-
282
- console.log('close modal');
283
-
284
- modal.removeClass('show');
285
- modalBackdrop.removeClass('show');
286
-
287
- iframe.attr( 'src', '' );
288
- });
289
- })(jQuery);
290
- </script>
291
- <?php
292
- }
293
-
294
- /**
295
- * Check if the notice is dimissed
296
- *
297
- * @return bool
298
- */
299
- public function is_dismissed() {
300
- return 'yes' == get_option( 'weforms_upsell_dismiss', 'no' );
301
- }
302
-
303
- /**
304
- * Dismiss the weForms notice
305
- *
306
- * @return void
307
- */
308
- public function dismiss_notice() {
309
- update_option( 'weforms_upsell_dismiss', 'yes' );
310
- }
311
-
312
- /**
313
- * Learn more link, append affiliate link if present
314
- *
315
- * @return string
316
- */
317
- public function learn_more_link() {
318
- $link = $this->learn_more;
319
-
320
- if ( !empty( $this->affiliate ) ) {
321
- $link = add_query_arg( [ 'ref' => $this->affiliate ], $link );
322
- }
323
-
324
- return $link;
325
- }
326
-
327
- /**
328
- * Fail if plugin installtion/activation fails
329
- *
330
- * @param object $thing
331
- *
332
- * @return void
333
- */
334
- public function fail_on_error( $thing ) {
335
- if ( is_wp_error( $thing ) ) {
336
- wp_send_json_error( $thing->get_error_message() );
337
- }
338
- }
339
-
340
- /**
341
- * Install weForms
342
- *
343
- * @return void
344
- */
345
- public function install_weforms() {
346
- check_ajax_referer( 'weforms_upsell_installer' );
347
-
348
- if ( !current_user_can( 'manage_options' ) ) {
349
- wp_send_json_error( __( 'You don\'t have permission to install the plugins', 'wp-user-frontend' ) );
350
- }
351
-
352
- $weforms_status = $this->install_plugin( 'weforms', 'weforms.php' );
353
- $this->fail_on_error( $weforms_status );
354
-
355
- $this->dismiss_notice();
356
-
357
- if ( !empty( $this->affiliate ) ) {
358
- update_option( '_weforms_aff_ref', $this->affiliate );
359
- }
360
-
361
- wp_send_json_success();
362
- }
363
-
364
- /**
365
- * Install and activate a plugin
366
- *
367
- * @param string $slug
368
- * @param string $file
369
- *
370
- * @return WP_Error|null
371
- */
372
- public function install_plugin( $slug, $file ) {
373
- include_once ABSPATH . 'wp-admin/includes/plugin-install.php';
374
- include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
375
-
376
- $plugin_basename = $slug . '/' . $file;
377
-
378
- // if exists and not activated
379
- if ( file_exists( WP_PLUGIN_DIR . '/' . $plugin_basename ) ) {
380
- return activate_plugin( $plugin_basename );
381
- }
382
-
383
- // seems like the plugin doesn't exists. Download and activate it
384
- $upgrader = new Plugin_Upgrader( new WP_Ajax_Upgrader_Skin() );
385
-
386
- $api = plugins_api( 'plugin_information', [ 'slug' => $slug, 'fields' => [ 'sections' => false ] ] );
387
- $result = $upgrader->install( $api->download_link );
388
-
389
- if ( is_wp_error( $result ) ) {
390
- return $result;
391
- }
392
-
393
- return activate_plugin( $plugin_basename );
394
- }
395
-
396
- /**
397
- * Dismiss the notice via Ajax
398
- *
399
- * @return void
400
- */
401
- public function dismiss_weforms_notice() {
402
- $this->dismiss_notice();
403
-
404
- wp_send_json_success();
405
- }
406
- }
407
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lib/gateway/paypal.php CHANGED
@@ -127,9 +127,9 @@ class WPUF_Paypal {
127
  $redirect_page_id = wpuf_get_option( 'payment_success', 'wpuf_payment' );
128
 
129
  if ( $redirect_page_id ) {
130
- $return_url = add_query_arg( 'action', 'wpuf_paypal_success', get_permalink( $redirect_page_id ) );
131
  } else {
132
- $return_url = add_query_arg( 'action', 'wpuf_paypal_success', get_permalink( wpuf_get_option( 'subscription_page', 'wpuf_payment' ) ) );
133
  }
134
 
135
  $billing_amount = empty( $data['price'] ) ? 0 : $data['price'];
127
  $redirect_page_id = wpuf_get_option( 'payment_success', 'wpuf_payment' );
128
 
129
  if ( $redirect_page_id ) {
130
+ $return_url = add_query_arg( 'action', 'wpuf_paypal_success', untrailingslashit(get_permalink( $redirect_page_id ) ) );
131
  } else {
132
+ $return_url = add_query_arg( 'action', 'wpuf_paypal_success', untrailingslashit(get_permalink( wpuf_get_option( 'subscription_page', 'wpuf_payment' ) ) ) );
133
  }
134
 
135
  $billing_amount = empty( $data['price'] ) ? 0 : $data['price'];
readme.txt CHANGED
@@ -3,9 +3,9 @@ Contributors: tareq1988, nizamuddinbabu, wedevs
3
  Donate link: https://tareq.co/donate/
4
  Tags: Forms, registration, profile-builder, login, membership, frontend-post
5
  Requires at least: 4.0
6
- Tested up to: 5.5.1
7
  Requires PHP: 5.6
8
- Stable tag: 3.5.3
9
  License: GPLv2
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -263,6 +263,18 @@ redirected to the edit page with that post id. Then you'll see the edit post for
263
 
264
  == Changelog ==
265
 
 
 
 
 
 
 
 
 
 
 
 
 
266
  = v3.5.3 (21 October, 2020) =
267
  * Fix - Default post form is not showing on the frontend account
268
  * Fix - Missing featured image field when previewing a post form
3
  Donate link: https://tareq.co/donate/
4
  Tags: Forms, registration, profile-builder, login, membership, frontend-post
5
  Requires at least: 4.0
6
+ Tested up to: 5.5.3
7
  Requires PHP: 5.6
8
+ Stable tag: 3.5.4
9
  License: GPLv2
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
 
263
 
264
  == Changelog ==
265
 
266
+ = v3.5.4 (11 November, 2020) =
267
+ * Fix - Get appropriate user id when role based conditions are present
268
+ * Fix - Show Invalid subscription message if wrong pack id passed
269
+ * Fix - URL field new window not working
270
+ * Fix - Option label not working when & use
271
+ * Fix - Ajax type category not showing on edit
272
+ * Fix - Multiple file image can't select
273
+ * Fix - Subscription pack PayPal Checkout gets "Error: Access Denied"
274
+ * Fix - Conflict image field with acf image field
275
+ * Enhancement - Missing Auckland State for New Zealand country.
276
+ * Enhancement - Added support for WooCommerce product category value replacemen
277
+
278
  = v3.5.3 (21 October, 2020) =
279
  * Fix - Default post form is not showing on the frontend account
280
  * Fix - Missing featured image field when previewing a post form
wpuf-functions.php CHANGED
@@ -23,19 +23,19 @@ add_action( 'init', 'wpuf_buffer_start' );
23
  * @author Tareq Hasan
24
  */
25
  function wpuf_show_post_status( $status ) {
26
- if ( $status == 'publish' ) {
27
  $title = __( 'Live', 'wp-user-frontend' );
28
  $fontcolor = '#33CC33';
29
- } elseif ( $status == 'draft' ) {
30
  $title = __( 'Offline', 'wp-user-frontend' );
31
  $fontcolor = '#bbbbbb';
32
- } elseif ( $status == 'pending' ) {
33
  $title = __( 'Awaiting Approval', 'wp-user-frontend' );
34
  $fontcolor = '#C00202';
35
- } elseif ( $status == 'future' ) {
36
  $title = __( 'Scheduled', 'wp-user-frontend' );
37
  $fontcolor = '#bbbbbb';
38
- } elseif ( $status == 'private' ) {
39
  $title = __( 'Private', 'wp-user-frontend' );
40
  $fontcolor = '#bbbbbb';
41
  }
@@ -54,16 +54,16 @@ function wpuf_show_post_status( $status ) {
54
  * @author Tareq Hasan
55
  */
56
  function wpuf_admin_post_status( $status ) {
57
- if ( $status == 'publish' ) {
58
  $title = __( 'Published', 'wp-user-frontend' );
59
  $fontcolor = '#009200';
60
- } elseif ( $status == 'draft' || $status == 'private' ) {
61
  $title = __( 'Draft', 'wp-user-frontend' );
62
  $fontcolor = '#bbbbbb';
63
- } elseif ( $status == 'pending' ) {
64
  $title = __( 'Pending', 'wp-user-frontend' );
65
  $fontcolor = '#C00202';
66
- } elseif ( $status == 'future' ) {
67
  $title = __( 'Scheduled', 'wp-user-frontend' );
68
  $fontcolor = '#bbbbbb';
69
  }
@@ -77,27 +77,25 @@ function wpuf_admin_post_status( $status ) {
77
  * @param <type> $post_id
78
  */
79
  function wpuf_upload_attachment( $post_id ) {
80
- if ( !isset( $_FILES['wpuf_post_attachments'] ) ) {
81
  return false;
82
  }
83
 
84
-
85
-
86
  $fields = (int) wpuf_get_option( 'attachment_num' );
87
 
88
  $wpuf_post_attachments = isset( $_FILES['wpuf_post_attachments'] ) ? array_map( 'sanitize_text_field', wp_unslash( $_FILES['wpuf_post_attachments'] ) ) : [];
89
 
90
  for ( $i = 0; $i < $fields; $i++ ) {
91
- $file_name = basename( $wpuf_post_attachments['name'][$i] );
92
 
93
  if ( $file_name ) {
94
  if ( $file_name ) {
95
  $upload = [
96
- 'name' => $wpuf_post_attachments['name'][$i],
97
- 'type' => $wpuf_post_attachments['type'][$i],
98
- 'tmp_name' => $wpuf_post_attachments['tmp_name'][$i],
99
- 'error' => $wpuf_post_attachments['error'][$i],
100
- 'size' => $wpuf_post_attachments['size'][$i],
101
  ];
102
 
103
  wp_handle_upload( $upload );
@@ -145,7 +143,7 @@ function wpfu_get_attachments( $post_id ) {
145
  * @author Tareq Hasan
146
  */
147
  function wpuf_unset_media_tab( $list ) {
148
- if ( !current_user_can( 'edit_posts' ) ) {
149
  unset( $list['library'] );
150
  unset( $list['gallery'] );
151
  }
@@ -168,12 +166,14 @@ function wpuf_get_post_types( $args = [] ) {
168
  $post_types = get_post_types( $args );
169
 
170
  $ignore_post_types = [
171
- 'attachment', 'revision', 'nav_menu_item',
 
 
172
  ];
173
 
174
  foreach ( $post_types as $key => $val ) {
175
- if ( in_array( $val, $ignore_post_types ) ) {
176
- unset( $post_types[$key] );
177
  }
178
  }
179
 
@@ -194,7 +194,7 @@ function wpuf_list_users() {
194
 
195
  if ( $users ) {
196
  foreach ( $users as $user ) {
197
- $list[$user->ID] = $user->user_login;
198
  }
199
  }
200
 
@@ -208,12 +208,15 @@ function wpuf_list_users() {
208
  */
209
  function wpuf_get_pages( $post_type = 'page' ) {
210
  $array = [ '' => __( '-- select --', 'wp-user-frontend' ) ];
211
- $pages = get_posts( [ 'post_type' => $post_type,
212
- 'numberposts' => - 1,
213
- 'no_found_rows' => true,
214
- 'update_post_meta_cache' => false,
215
- 'update_post_term_cache' => false
216
- ] );
 
 
 
217
 
218
  if ( $pages ) {
219
  foreach ( $pages as $page ) {
@@ -241,10 +244,10 @@ function wpuf_override_admin_edit_link( $url, $post_id ) {
241
 
242
  $override = wpuf_get_option( 'override_editlink', 'wpuf_general', 'no' );
243
 
244
- if ( $override == 'yes' ) {
245
  $url = '';
246
 
247
- if ( wpuf_get_option( 'enable_post_edit', 'wpuf_dashboard', 'yes' ) == 'yes' ) {
248
  $edit_page = (int) wpuf_get_option( 'edit_page_id', 'wpuf_frontend_posting' );
249
  $url = get_permalink( $edit_page );
250
 
@@ -278,7 +281,10 @@ class WPUF_Walker_Category_Multi extends Walker {
278
  *
279
  * @var array
280
  */
281
- public $db_fields = ['parent' => 'parent', 'id' => 'term_id'];
 
 
 
282
 
283
  /**
284
  * @see Walker::start_el()
@@ -294,7 +300,7 @@ class WPUF_Walker_Category_Multi extends Walker {
294
  $cat_name = apply_filters( 'list_cats', $category->name, $category );
295
  $output .= "\t<option class=\"level-$depth\" value=\"" . $category->term_id . '"';
296
 
297
- if ( in_array( $category->term_id, $args['selected'] ) ) {
298
  $output .= ' selected="selected"';
299
  }
300
 
@@ -317,7 +323,10 @@ class WPUF_Walker_Category_Multi extends Walker {
317
  class WPUF_Walker_Category_Checklist extends Walker {
318
  public $tree_type = 'category';
319
 
320
- public $db_fields = ['parent' => 'parent', 'id' => 'term_id']; //TODO: decouple this
 
 
 
321
 
322
  public function start_lvl( &$output, $depth = 0, $args = [] ) {
323
  $indent = str_repeat( "\t", $depth );
@@ -330,13 +339,13 @@ class WPUF_Walker_Category_Checklist extends Walker {
330
  }
331
 
332
  public function start_el( &$output, $category, $depth = 0, $args = [], $current_object_id = 0 ) {
333
- extract( $args );
334
 
335
  if ( empty( $taxonomy ) ) {
336
  $taxonomy = 'category';
337
  }
338
 
339
- if ( $taxonomy == 'category' ) {
340
  $name = 'category';
341
  } else {
342
  $name = $taxonomy;
@@ -349,7 +358,7 @@ class WPUF_Walker_Category_Checklist extends Walker {
349
  }
350
 
351
  $class = isset( $args['class'] ) ? $args['class'] : '';
352
- $output .= "\n<li class='" . $inline_class . "' id='{$taxonomy}-{$category->term_id}'>" . '<label class="selectit"><input class="' . $class . '" value="' . $category->term_id . '" type="checkbox" name="' . $name . '[]" id="in-' . $taxonomy . '-' . $category->term_id . '"' . checked( in_array( $category->term_id, $args['selected_cats'] ), true, false ) . disabled( empty( $args['disabled'] ), false, false ) . ' /> ' . esc_html( apply_filters( 'the_category', $category->name ) ) . '</label>';
353
  }
354
 
355
  public function end_el( &$output, $category, $depth = 0, $args = [] ) {
@@ -364,7 +373,6 @@ class WPUF_Walker_Category_Checklist extends Walker {
364
  * @param array $selected_cats
365
  *
366
  * @since 0.8
367
- *
368
  */
369
  function wpuf_category_checklist( $post_id = 0, $selected_cats = false, $attr = [], $class = null ) {
370
  require_once ABSPATH . '/wp-admin/includes/template.php';
@@ -396,7 +404,7 @@ function wpuf_category_checklist( $post_id = 0, $selected_cats = false, $attr =
396
  $tax_args = [
397
  'taxonomy' => $tax,
398
  'hide_empty' => false,
399
- $exclude['type'] => ( $exclude_type == 'child_of' ) ? $exclude['childs'] : $attr['exclude'],
400
  'orderby' => isset( $attr['orderby'] ) ? $attr['orderby'] : 'name',
401
  'order' => isset( $attr['order'] ) ? $attr['order'] : 'ASC',
402
  ];
@@ -406,25 +414,27 @@ function wpuf_category_checklist( $post_id = 0, $selected_cats = false, $attr =
406
 
407
  echo wp_kses_post( '<ul class="wpuf-category-checklist">' );
408
  printf( '<input type="hidden" name="%s" value="0" />', esc_attr( $tax ) );
409
- echo wp_kses( call_user_func_array( [ &$walker, 'walk' ], [ $categories, 0, $args ] ), [
410
- 'li' => [
411
- 'class' => []
412
- ],
413
- 'label' => [
414
- 'class' => []
415
- ],
416
- 'input' => [
417
- 'class' => [],
418
- 'type' => [],
419
- 'value' => [],
420
- 'name' => [],
421
- 'id' => [],
422
- 'checked' => [],
423
- ],
424
- 'ul' => [
425
- 'class' => []
 
 
426
  ]
427
- ] );
428
  echo wp_kses_post( '</ul>' );
429
  }
430
 
@@ -442,12 +452,15 @@ function wpuf_get_field_settings_excludes( $field_settings, $exclude_type ) {
442
  $attributes = $field_settings['exclude'];
443
  $child_ids = [];
444
 
445
- if ( !empty( $attributes ) ) {
446
  foreach ( $attributes as $attr ) {
447
- $terms = get_terms( 'category', array(
448
- 'hide_empty' => false,
449
- 'parent' => $attr
450
- ) );
 
 
 
451
 
452
  foreach ( $terms as $term ) {
453
  array_push( $child_ids, $term->term_id );
@@ -460,8 +473,8 @@ function wpuf_get_field_settings_excludes( $field_settings, $exclude_type ) {
460
  }
461
 
462
  $excludes = [
463
- 'type' => $exclude_type,
464
- 'childs' => $child_ids
465
  ];
466
 
467
  return $excludes;
@@ -484,7 +497,7 @@ function wpuf_get_image_sizes() {
484
  $image_sizes = [];
485
 
486
  foreach ( $image_sizes_orig as $size ) {
487
- $image_sizes[$size] = $size;
488
  }
489
 
490
  return $image_sizes;
@@ -492,14 +505,38 @@ function wpuf_get_image_sizes() {
492
 
493
  function wpuf_allowed_extensions() {
494
  $extesions = [
495
- 'images' => ['ext' => 'jpg,jpeg,gif,png,bmp', 'label' => __( 'Images', 'wp-user-frontend' )],
496
- 'audio' => ['ext' => 'mp3,wav,ogg,wma,mka,m4a,ra,mid,midi', 'label' => __( 'Audio', 'wp-user-frontend' )],
497
- 'video' => ['ext' => 'avi,divx,flv,mov,ogv,mkv,mp4,m4v,divx,mpg,mpeg,mpe', 'label' => __( 'Videos', 'wp-user-frontend' )],
498
- 'pdf' => ['ext' => 'pdf', 'label' => __( 'PDF', 'wp-user-frontend' )],
499
- 'office' => ['ext' => 'doc,ppt,pps,xls,mdb,docx,xlsx,pptx,odt,odp,ods,odg,odc,odb,odf,rtf,txt', 'label' => __( 'Office Documents', 'wp-user-frontend' )],
500
- 'zip' => ['ext' => 'zip,gz,gzip,rar,7z', 'label' => __( 'Zip Archives', 'wp-user-frontend' )],
501
- 'exe' => ['ext' => 'exe', 'label' => __( 'Executable Files', 'wp-user-frontend' )],
502
- 'csv' => ['ext' => 'csv', 'label' => __( 'CSV', 'wp-user-frontend' )],
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
503
  ];
504
 
505
  return apply_filters( 'wpuf_allowed_extensions', $extesions );
@@ -516,9 +553,9 @@ function wpuf_addpost_notice( $text ) {
516
  $user = wp_get_current_user();
517
 
518
  if ( is_user_logged_in() ) {
519
- $lock = ( $user->wpuf_postlock == 'yes' ) ? 'yes' : 'no';
520
 
521
- if ( $lock == 'yes' ) {
522
  return $user->wpuf_lock_cause;
523
  }
524
  }
@@ -553,7 +590,7 @@ function wpuf_associate_attachment( $attachment_id, $post_id ) {
553
  * @param array args
554
  */
555
  function wpuf_update_post( $args ) {
556
- if ( !wp_is_post_revision( $args['ID'] ) ) {
557
  // unhook this function so it doesn't loop infinitely
558
  remove_action( 'save_post', [ WPUF_Admin_Posting::init(), 'save_meta' ], 1 );
559
 
@@ -575,10 +612,11 @@ function wpuf_update_post( $args ) {
575
  * @return array
576
  */
577
  function wpuf_get_user_roles() {
578
- global $wp_roles;
579
-
580
- if ( !isset( $wp_roles ) ) {
581
- $wp_roles = new WP_Roles();
 
582
  }
583
 
584
  return $wp_roles->get_names();
@@ -661,7 +699,7 @@ function wpuf_get_avatar( $avatar, $id_or_email, $size, $default, $alt, $args )
661
  if ( is_numeric( $id_or_email ) ) {
662
  $user = get_user_by( 'id', $id_or_email );
663
  } elseif ( is_object( $id_or_email ) ) {
664
- if ( $id_or_email->user_id != '0' ) {
665
  $user = get_user_by( 'id', $id_or_email->user_id );
666
  } else {
667
  return $avatar;
@@ -737,7 +775,7 @@ function wpuf_update_avatar( $user_id, $attachment_id ) {
737
 
738
  $editor = wp_get_image_editor( $file_path );
739
 
740
- if ( !is_wp_error( $editor ) ) {
741
  $avatar_size = wpuf_get_option( 'avatar_size', 'wpuf_profile', '100x100' );
742
  $avatar_size = explode( 'x', $avatar_size );
743
  $avatar_width = $avatar_size[0];
@@ -756,7 +794,7 @@ function wpuf_update_avatar( $user_id, $attachment_id ) {
756
  // delete any previous avatar
757
  $prev_avatar = get_user_meta( $user_id, 'user_avatar', true );
758
 
759
- if ( !empty( $prev_avatar ) ) {
760
  $prev_avatar_path = str_replace( $upload_dir['baseurl'], $upload_dir['basedir'], $prev_avatar );
761
 
762
  if ( file_exists( $prev_avatar_path ) ) {
@@ -782,10 +820,10 @@ function wpuf_get_gateways( $context = 'admin' ) {
782
  $return = [];
783
 
784
  foreach ( $gateways as $id => $gate ) {
785
- if ( $context == 'admin' ) {
786
- $return[$id] = $gate['admin_label'];
787
  } else {
788
- $return[$id] = [
789
  'label' => $gate['checkout_label'],
790
  'icon' => isset( $gate['icon'] ) ? $gate['icon'] : '',
791
  ];
@@ -812,9 +850,9 @@ function wpuf_get_gateways( $context = 'admin' ) {
812
  function wpuf_show_custom_fields( $content ) {
813
  global $post;
814
 
815
- $show_custom = wpuf_get_option( 'cf_show_front', 'wpuf_frontend_posting' );
816
 
817
- if ( $show_custom != 'on' ) {
818
  return $content;
819
  }
820
 
@@ -822,7 +860,7 @@ function wpuf_show_custom_fields( $content ) {
822
  $form_id = get_post_meta( $post->ID, '_wpuf_form_id', true );
823
  $form_settings = wpuf_get_form_settings( $form_id );
824
 
825
- if ( !$form_id ) {
826
  return $content;
827
  }
828
 
@@ -834,14 +872,14 @@ function wpuf_show_custom_fields( $content ) {
834
  if ( $form_vars ) {
835
  foreach ( $form_vars as $attr ) {
836
  // get column field input fields
837
- if ( $attr['input_type'] == 'column_field' ) {
838
  $inner_fields = $attr['inner_fields'];
839
 
840
  foreach ( $inner_fields as $column_key => $column_fields ) {
841
- if ( !empty( $column_fields ) ) {
842
  // ignore section break and HTML input type
843
  foreach ( $column_fields as $column_field_key => $column_field ) {
844
- if ( isset( $column_field['show_in_post'] ) && $column_field['show_in_post'] == 'yes' ) {
845
  $meta[] = $column_field;
846
  }
847
  }
@@ -850,19 +888,19 @@ function wpuf_show_custom_fields( $content ) {
850
  continue;
851
  }
852
 
853
- if ( isset( $attr['show_in_post'] ) && $attr['show_in_post'] == 'yes' ) {
854
  $meta[] = $attr;
855
  }
856
  }
857
 
858
- if ( !$meta ) {
859
  return $content;
860
  }
861
 
862
  foreach ( $meta as $attr ) {
863
  $wpuf_field = wpuf()->fields->get_field( $attr['template'] );
864
 
865
- if ( !isset( $attr['name'] ) ) {
866
  $attr['name'] = $attr['input_type'];
867
  }
868
 
@@ -871,7 +909,7 @@ function wpuf_show_custom_fields( $content ) {
871
 
872
  $return_for_no_cond = 0;
873
 
874
- if ( isset( $attr['wpuf_cond']['condition_status'] ) && $attr['wpuf_cond']['condition_status'] == 'yes' ) {
875
  foreach ( $attr['wpuf_cond']['cond_field'] as $field_key => $cond_field_name ) {
876
 
877
  //check if the conditional field is a taxonomy
@@ -884,16 +922,16 @@ function wpuf_show_custom_fields( $content ) {
884
  $cond_field_value[] = $term_array->term_id;
885
  }
886
  }
887
- $cond_field_value = isset($post_terms[0]) ? $post_terms[0]->term_id : '';
888
  } else {
889
  $cond_field_value = get_post_meta( $post->ID, $cond_field_name, 'true' );
890
  }
891
 
892
- if ( isset( $attr['wpuf_cond']['cond_option'][$field_key] ) ) {
893
  if ( is_array( $cond_field_value ) ) {
894
  continue;
895
  } else {
896
- if ( $attr['wpuf_cond']['cond_option'][$field_key] != $cond_field_value ) {
897
  $return_for_no_cond = 1;
898
  } else {
899
  $return_for_no_cond = 0;
@@ -904,15 +942,15 @@ function wpuf_show_custom_fields( $content ) {
904
  }
905
  }
906
 
907
- if ( $return_for_no_cond == 1 ) {
908
  continue;
909
  }
910
 
911
- if ( !count( $field_value ) ) {
912
  continue;
913
  }
914
 
915
- if ( $attr['input_type'] == 'hidden' ) {
916
  continue;
917
  }
918
 
@@ -924,9 +962,9 @@ function wpuf_show_custom_fields( $content ) {
924
  switch ( $attr['input_type'] ) {
925
  case 'image_upload':
926
  case 'file_upload':
927
- $image_html = '<li style="list-style-type:none;">';
928
 
929
- if ( $hide_label == 'no' ) {
930
  $image_html .= '<label>' . $attr['label'] . ':</label> ';
931
  }
932
 
@@ -940,7 +978,7 @@ function wpuf_show_custom_fields( $content ) {
940
  }
941
 
942
  foreach ( $field_value as $attachment_id ) {
943
- if ( $attr['input_type'] == 'image_upload' ) {
944
  $image_size = wpuf_get_option( 'insert_photo_size', 'wpuf_frontend_posting', 'thumbnail' );
945
  $thumb = wp_get_attachment_image( $attachment_id, $image_size );
946
  } else {
@@ -958,9 +996,9 @@ function wpuf_show_custom_fields( $content ) {
958
  $allowed_video_extensions = explode( ',', $wpuf_allowed_extensions['video']['ext'] );
959
  $allowed_extenstions = array_merge( $allowed_audio_extensions, $allowed_video_extensions );
960
 
961
- if ( $playable == 'yes' && in_array( $extension, $allowed_extenstions ) ) {
962
- $is_video = in_array( $extension, $allowed_video_extensions );
963
- $is_audio = in_array( $extension, $allowed_audio_extensions );
964
  $preview_width = isset( $attr['preview_width'] ) ? $attr['preview_width'] : '123';
965
  $preview_height = isset( $attr['preview_height'] ) ? $attr['preview_height'] : '456';
966
 
@@ -979,18 +1017,18 @@ function wpuf_show_custom_fields( $content ) {
979
  $image_html .= sprintf( '<a href="%s">%s</a> ', $full_size, $thumb );
980
  }
981
 
982
- if ( $show_caption == 'on' ) {
983
  $post_detail = get_post( $attachment_id );
984
 
985
- if ( !empty( $post_detail->post_title ) ) {
986
  $image_html .= '<br /><label>' . __( 'Title', 'wp-user-frontend' ) . ':</label> <span class="image_title">' . esc_html( $post_detail->post_title ) . '</span>';
987
  }
988
 
989
- if ( !empty( $post_detail->post_excerpt ) ) {
990
  $image_html .= '<br /><label>' . __( 'Caption', 'wp-user-frontend' ) . ':</label> <span class="image_caption">' . esc_html( $post_detail->post_excerpt ) . '</span>';
991
  }
992
 
993
- if ( !empty( $post_detail->post_content ) ) {
994
  $image_html .= '<br /><label>' . __( 'Description', 'wp-user-frontend' ) . ':</label> <span class="image_description">' . esc_html( $post_detail->post_content ) . '</span>';
995
  }
996
  }
@@ -1012,7 +1050,7 @@ function wpuf_show_custom_fields( $content ) {
1012
  <div>
1013
  <a class="btn btn-brand btn-sm" href="https://www.google.com/maps/dir/?api=1&amp;destination=<?php echo esc_attr( $def_lat ); ?>,<?php echo esc_attr( $def_long ); ?>" target="_blank" rel="nofollow external"><?php esc_html_e( 'Directions »', 'wp-user-frontend' ); ?></a>
1014
  </div>
1015
- <?php
1016
  }
1017
 
1018
  $html .= ob_get_clean();
@@ -1025,16 +1063,16 @@ function wpuf_show_custom_fields( $content ) {
1025
 
1026
  if ( isset( $field_value[0] ) && is_array( $field_value[0] ) ) {
1027
  foreach ( $field_value[0] as $field_key => $value ) {
1028
- if ( $field_key == 'country_select' ) {
1029
- if ( isset( $countries[$value] ) ) {
1030
- $value = $countries[$value];
1031
  }
1032
  }
1033
 
1034
  $address_html .= '<li>';
1035
 
1036
- if ( $hide_label == 'no' ) {
1037
- $address_html .= '<label>' . $attr['address'][$field_key]['label'] . ': </label> ';
1038
  }
1039
 
1040
  $address_html .= ' ' . $value . '</li>';
@@ -1059,7 +1097,7 @@ function wpuf_show_custom_fields( $content ) {
1059
  if ( $new ) {
1060
  $html .= '<li>';
1061
 
1062
- if ( $hide_label == 'no' ) {
1063
  $html .= '<label>' . $attr['label'] . ': </label>';
1064
  }
1065
 
@@ -1074,16 +1112,16 @@ function wpuf_show_custom_fields( $content ) {
1074
  break;
1075
  }
1076
 
1077
- if ( $attr['template'] == 'embed' ) {
1078
  global $wp_embed;
1079
 
1080
  $preview_width = isset( $attr['preview_width'] ) ? $attr['preview_width'] : '123';
1081
  $preview_height = isset( $attr['preview_height'] ) ? $attr['preview_height'] : '456';
1082
  $shortcode = '[embed width="' . $preview_width . '" height="' . $preview_height . '"]' . $value . '[/embed]';
1083
 
1084
- $preview = '<li>';
1085
 
1086
- if ( $hide_label == 'no' ) {
1087
  $preview .= sprintf( '<label>%s: </label>', $attr['label'] );
1088
  }
1089
 
@@ -1096,11 +1134,11 @@ function wpuf_show_custom_fields( $content ) {
1096
  break;
1097
  }
1098
 
1099
- $open_in = $attr['open_window'] == 'same' ? '' : '_blank';
1100
 
1101
- $link = '<li>';
1102
 
1103
- if ( $hide_label == 'no' ) {
1104
  $link .= '<label>' . $attr['label'] . ':</label>';
1105
  }
1106
 
@@ -1114,7 +1152,7 @@ function wpuf_show_custom_fields( $content ) {
1114
 
1115
  $html .= '<li>';
1116
 
1117
- if ( $hide_label == 'no' ) {
1118
  $html .= '<label>' . $attr['label'] . ':</label>';
1119
  }
1120
 
@@ -1132,7 +1170,7 @@ function wpuf_show_custom_fields( $content ) {
1132
 
1133
  $html .= '<li>';
1134
 
1135
- if ( $hide_label == 'no' ) {
1136
  $html .= '<label>' . $attr['label'] . ':</label>';
1137
  }
1138
 
@@ -1144,7 +1182,7 @@ function wpuf_show_custom_fields( $content ) {
1144
  $filter_html = apply_filters( 'wpuf_custom_field_render', '', $value, $attr, $form_settings );
1145
  $separator = ' | ';
1146
 
1147
- if ( !empty( $filter_html ) ) {
1148
  $html .= $filter_html;
1149
  } elseif ( is_serialized( $value[0] ) ) {
1150
  $new = maybe_unserialize( $value[0] );
@@ -1153,20 +1191,20 @@ function wpuf_show_custom_fields( $content ) {
1153
  if ( $modified_value ) {
1154
  $html .= '<li>';
1155
 
1156
- if ( $hide_label == 'no' ) {
1157
  $html .= '<label>' . $attr['label'] . ':</label>';
1158
  }
1159
 
1160
  $html .= sprintf( ' %s</li>', make_clickable( $modified_value ) );
1161
  }
1162
- } elseif ( ( $attr['input_type'] == 'checkbox' || $attr['input_type'] == 'multiselect' ) && is_array( $value[0] ) ) {
1163
- if ( !empty( $value[0] ) ) {
1164
  $modified_value = implode( $separator, $value[0] );
1165
 
1166
  if ( $modified_value ) {
1167
  $html .= '<li>';
1168
 
1169
- if ( $hide_label == 'no' ) {
1170
  $html .= '<label>' . $attr['label'] . ':</label>';
1171
  }
1172
 
@@ -1179,7 +1217,7 @@ function wpuf_show_custom_fields( $content ) {
1179
  if ( $new ) {
1180
  $html .= '<li>';
1181
 
1182
- if ( $hide_label == 'no' ) {
1183
  $html .= '<label>' . $attr['label'] . ':</label>';
1184
  }
1185
 
@@ -1207,7 +1245,7 @@ add_filter( 'the_content', 'wpuf_show_custom_fields', 10 );
1207
  * @param array $args
1208
  */
1209
  function wpuf_shortcode_map( $location, $post_id = null, $args = [], $meta_key = '' ) {
1210
- if ( !wpuf()->is_pro() || !$location ) {
1211
  return;
1212
  }
1213
 
@@ -1220,7 +1258,11 @@ function wpuf_shortcode_map( $location, $post_id = null, $args = [], $meta_key =
1220
  return;
1221
  }
1222
 
1223
- $default = ['width' => 450, 'height' => 250, 'zoom' => 12];
 
 
 
 
1224
  $args = wp_parse_args( $args, $default );
1225
 
1226
  if ( is_array( $location ) ) {
@@ -1232,7 +1274,8 @@ function wpuf_shortcode_map( $location, $post_id = null, $args = [], $meta_key =
1232
  list( $def_lat, $def_long ) = explode( ',', $location );
1233
  $def_lat = $def_lat ? $def_lat : 0;
1234
  $def_long = $def_long ? $def_long : 0;
1235
- } ?>
 
1236
 
1237
  <div class="google-map" style="margin: 10px 0; height: <?php echo esc_attr( $args['height'] ); ?>px; width: <?php echo esc_attr( $args['width'] ); ?>px;" id="wpuf-map-<?php echo esc_attr( $meta_key . $post->ID ); ?>"></div>
1238
 
@@ -1281,7 +1324,7 @@ function wpuf_shortcode_map_user( $meta_key, $user_id = null, $args = [] ) {
1281
  function wpuf_shortcode_map_post( $meta_key, $post_id = null, $args = [] ) {
1282
  global $post;
1283
 
1284
- if ( !$post_id ) {
1285
  $post_id = $post->ID;
1286
  }
1287
 
@@ -1292,20 +1335,29 @@ function wpuf_shortcode_map_post( $meta_key, $post_id = null, $args = [] ) {
1292
  function wpuf_meta_shortcode( $atts ) {
1293
  global $post;
1294
 
1295
- extract( shortcode_atts( [
1296
- 'name' => '',
1297
- 'type' => 'normal',
1298
- 'size' => 'thumbnail',
1299
- 'height' => 250,
1300
- 'width' => 450,
1301
- 'zoom' => 12,
1302
- ], $atts ) );
 
 
 
 
 
 
 
 
 
1303
 
1304
  if ( empty( $name ) ) {
1305
  return;
1306
  }
1307
 
1308
- if ( $type == 'image' || $type == 'file' ) {
1309
  $images = get_post_meta( $post->ID, $name, true );
1310
 
1311
  if ( ! is_array( $images ) ) {
@@ -1316,7 +1368,7 @@ function wpuf_meta_shortcode( $atts ) {
1316
  $html = '';
1317
 
1318
  foreach ( $images as $attachment_id ) {
1319
- if ( $type == 'image' ) {
1320
  $thumb = wp_get_attachment_image( $attachment_id, $size );
1321
  } else {
1322
  $thumb = get_post_field( 'post_title', $attachment_id );
@@ -1328,14 +1380,20 @@ function wpuf_meta_shortcode( $atts ) {
1328
 
1329
  return $html;
1330
  }
1331
- } elseif ( $type == 'map' ) {
1332
  ob_start();
1333
- wpuf_shortcode_map( $name, $post->ID, ['width' => $width, 'height' => $height, 'zoom' => $zoom ] );
 
 
 
 
 
 
1334
 
1335
  return ob_get_clean();
1336
- } elseif ( $type == 'repeat' ) {
1337
  return implode( '; ', get_post_meta( $post->ID, $name ) );
1338
- } elseif ( $type == 'normal' ) {
1339
  return implode( ', ', get_post_meta( $post->ID, $name ) );
1340
  } else {
1341
  return make_clickable( implode( ', ', get_post_meta( $post->ID, $name ) ) );
@@ -1356,15 +1414,15 @@ add_shortcode( 'wpuf-meta', 'wpuf_meta_shortcode' );
1356
  function wpuf_get_option( $option, $section, $default = '' ) {
1357
  $options = get_option( $section );
1358
 
1359
- if ( isset( $options[$option] ) ) {
1360
- return $options[$option];
1361
  }
1362
 
1363
  return $default;
1364
  }
1365
 
1366
  /**
1367
- * check the current post for the existence of a short code
1368
  *
1369
  * @see http://wp.tutsplus.com/articles/quick-tip-improving-shortcodes-with-the-has_shortcode-function/
1370
  *
@@ -1373,9 +1431,9 @@ function wpuf_get_option( $option, $section, $default = '' ) {
1373
  * @return bool
1374
  */
1375
  function wpuf_has_shortcode( $shortcode = '', $post_id = false ) {
1376
- $post_to_check = ( $post_id == false ) ? get_post( get_the_ID() ) : get_post( $post_id );
1377
 
1378
- if ( !$post_to_check ) {
1379
  return false;
1380
  }
1381
 
@@ -1383,7 +1441,7 @@ function wpuf_has_shortcode( $shortcode = '', $post_id = false ) {
1383
  $found = false;
1384
 
1385
  // if no short code was provided, return false
1386
- if ( !$shortcode ) {
1387
  return $found;
1388
  }
1389
 
@@ -1414,7 +1472,7 @@ function wpuf_get_attachment_id_from_url( $attachment_url = '' ) {
1414
  $attachment_id = false;
1415
 
1416
  // If there is no url, return.
1417
- if ( '' == $attachment_url ) {
1418
  return;
1419
  }
1420
 
@@ -1431,7 +1489,7 @@ function wpuf_get_attachment_id_from_url( $attachment_url = '' ) {
1431
  $attachment_url = str_replace( $upload_dir_paths['baseurl'] . '/', '', $attachment_url );
1432
 
1433
  // Finally, run a custom database query to get the attachment ID from the modified attachment URL
1434
- $attachment_id = $wpdb->get_var( $wpdb->prepare( "SELECT wposts.ID FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta WHERE wposts.ID = wpostmeta.post_id AND wpostmeta.meta_key = '_wp_attached_file' AND wpostmeta.meta_value = '%s' AND wposts.post_type = 'attachment'", $attachment_url ) );
1435
  }
1436
 
1437
  return $attachment_id;
@@ -1448,10 +1506,10 @@ function wpufe_ajax_tag_search() {
1448
  global $wpdb;
1449
 
1450
  $taxonomy = isset( $_GET['tax'] ) ? sanitize_text_field( wp_unslash( $_GET['tax'] ) ) : '';
1451
- $term_ids = isset( $_GET['term_ids'] ) ? sanitize_text_field( $_GET['term_ids'] ) : '';
1452
  $tax = get_taxonomy( $taxonomy );
1453
 
1454
- if ( !$tax ) {
1455
  wp_die( 0 );
1456
  }
1457
 
@@ -1465,7 +1523,7 @@ function wpufe_ajax_tag_search() {
1465
 
1466
  if ( false !== strpos( $s, ',' ) ) {
1467
  $s = explode( ',', $s );
1468
- $s = $s[count( $s ) - 1];
1469
  }
1470
 
1471
  $s = trim( $s );
@@ -1474,15 +1532,12 @@ function wpufe_ajax_tag_search() {
1474
  wp_die();
1475
  } // require 2 chars for matching
1476
 
1477
-
1478
-
1479
  if ( ! empty( $term_ids ) ) {
 
1480
  $results = $wpdb->get_col( $wpdb->prepare( "SELECT t.name FROM $wpdb->term_taxonomy AS tt INNER JOIN $wpdb->terms AS t ON tt.term_id = t.term_id WHERE tt.taxonomy = %s AND t.term_id IN ($term_ids) AND t.name LIKE (%s)", $taxonomy, '%' . $wpdb->esc_like( $s ) . '%' ) );
1481
  } else {
1482
  $results = $wpdb->get_col( $wpdb->prepare( "SELECT t.name FROM $wpdb->term_taxonomy AS tt INNER JOIN $wpdb->terms AS t ON tt.term_id = t.term_id WHERE tt.taxonomy = %s AND t.name LIKE (%s)", $taxonomy, '%' . $wpdb->esc_like( $s ) . '%' ) );
1483
  }
1484
-
1485
-
1486
  echo esc_html( join( $results, "\n" ) );
1487
  wp_die();
1488
  }
@@ -1519,10 +1574,6 @@ function wpuf_dropdown_helper( $options, $selected = '' ) {
1519
  * @param string $file file name or path to file
1520
  */
1521
  function wpuf_load_template( $file, $args = [] ) {
1522
- if ( $args && is_array( $args ) ) {
1523
- extract( $args );
1524
- }
1525
-
1526
  $child_theme_dir = get_stylesheet_directory() . '/wpuf/';
1527
  $parent_theme_dir = get_template_directory() . '/wpuf/';
1528
  $wpuf_dir = WPUF_ROOT . '/templates/';
@@ -1547,10 +1598,6 @@ function wpuf_load_template( $file, $args = [] ) {
1547
  * @param string $file file name or path to file
1548
  */
1549
  function wpuf_load_pro_template( $file, $args = [] ) {
1550
- if ( $args && is_array( $args ) ) {
1551
- extract( $args );
1552
- }
1553
-
1554
  if ( wpuf()->is_pro() ) {
1555
  $child_theme_dir = get_stylesheet_directory() . '/wpuf/';
1556
  $parent_theme_dir = get_template_directory() . '/wpuf/';
@@ -1627,14 +1674,16 @@ function wpuf_date2mysql( $date, $gmt = 0 ) {
1627
  * @return array
1628
  */
1629
  function wpuf_get_form_fields( $form_id ) {
1630
- $fields = get_children( [
1631
- 'post_parent' => $form_id,
1632
- 'post_status' => 'publish',
1633
- 'post_type' => 'wpuf_input',
1634
- 'numberposts' => '-1',
1635
- 'orderby' => 'menu_order',
1636
- 'order' => 'ASC',
1637
- ] );
 
 
1638
 
1639
  $form_fields = [];
1640
 
@@ -1646,8 +1695,8 @@ function wpuf_get_form_fields( $form_id ) {
1646
  // Add inline property for radio and checkbox fields
1647
  $inline_supported_fields = [ 'radio', 'checkbox' ];
1648
 
1649
- if ( in_array( $field['input_type'], $inline_supported_fields ) ) {
1650
- if ( !isset( $field['inline'] ) ) {
1651
  $field['inline'] = 'no';
1652
  }
1653
  }
@@ -1655,8 +1704,8 @@ function wpuf_get_form_fields( $form_id ) {
1655
  // Add 'selected' property
1656
  $option_based_fields = [ 'select', 'multiselect', 'radio', 'checkbox' ];
1657
 
1658
- if ( in_array( $field['input_type'], $option_based_fields ) ) {
1659
- if ( !isset( $field['selected'] ) ) {
1660
  if ( 'select' === $field['input_type'] || 'radio' === $field['input_type'] ) {
1661
  $field['selected'] = '';
1662
  } else {
@@ -1666,7 +1715,7 @@ function wpuf_get_form_fields( $form_id ) {
1666
  }
1667
 
1668
  // Add 'multiple' key for input_type:repeat
1669
- if ( 'repeat' === $field['input_type'] && !isset( $field['multiple'] ) ) {
1670
  $field['multiple'] = '';
1671
  }
1672
 
@@ -1688,40 +1737,38 @@ add_action( 'wp_ajax_nopriv_wpuf_get_child_cat', 'wpuf_get_child_cats' );
1688
  * Returns child category dropdown on ajax request
1689
  */
1690
  function wpuf_get_child_cats() {
1691
-
1692
  $nonce = isset( $_REQUEST['_wpnonce'] ) ? sanitize_key( wp_unslash( $_REQUEST['_wpnonce'] ) ) : '';
1693
 
1694
- $parentCat = isset( $_POST['catID'] ) ? sanitize_text_field( wp_unslash( $_POST['catID'] ) ) : '';
1695
- $field_attr = isset( $_POST['field_attr'] ) ? array_map('sanitize_text_field', wp_unslash( $_POST['field_attr'] ) ) : [];
1696
 
1697
- if ( isset( $nonce ) && ! wp_verify_nonce( $nonce, 'wpuf_nonce' ) ) {
1698
 
1699
- }
1700
  $allowed_tags = wp_kses_allowed_html( 'post' );
1701
 
1702
-
1703
- $taxonomy = $field_attr['name'];
1704
 
1705
  $terms = null;
1706
  $result = '';
1707
 
1708
- if ( $parentCat < 1 ) {
1709
  die( wp_kses( $result, $allowed_tags ) );
1710
  }
1711
 
1712
- if ( $terms = get_categories( 'taxonomy=' . $taxonomy . '&child_of=' . $parentCat . '&hide_empty=0' ) ) {
1713
- $field_attr['parent_cat'] = $parentCat;
 
 
1714
 
1715
  if ( is_array( $terms ) ) {
1716
  foreach ( $terms as $key => $term ) {
1717
- $terms[$key] = (array) $term;
1718
  }
1719
  }
1720
 
1721
- $field_attr[ 'form_id' ] = isset( $_POST['form_id'] ) ? absint( $_POST['form_id'] ) : 0;
1722
 
1723
  $result .= taxnomy_select( '', $field_attr );
1724
-
1725
  } else {
1726
  die( '' );
1727
  }
@@ -1735,17 +1782,17 @@ function taxnomy_select( $terms, $attr ) {
1735
  $exclude_type = isset( $attr['exclude_type'] ) ? $attr['exclude_type'] : 'exclude';
1736
  $exclude = isset( $attr['exclude'] ) ? $attr['exclude'] : '';
1737
 
1738
- $dataset = sprintf(
1739
  'data-required="%s" data-type="select" data-form-id="%d"',
1740
  $attr['required'],
1741
  $attr['form_id']
1742
- );
1743
 
1744
- if ( $exclude_type == 'child_of' && !empty( $exclude ) ) {
1745
  $exclude = $exclude[0];
1746
  }
1747
 
1748
- $tax_args = [
1749
  'show_option_none' => __( '-- Select --', 'wp-user-frontend' ),
1750
  'hierarchical' => 1,
1751
  'hide_empty' => 0,
@@ -1777,7 +1824,8 @@ function taxnomy_select( $terms, $attr ) {
1777
  //'last_term_id' => isset( $attr['parent_cat'] ) ? $attr['parent_cat'] : '',
1778
  //'term_id' => $selected
1779
  ];
1780
- $attr = apply_filters( 'wpuf_taxonomy_checklist_args', $attr ); ?>
 
1781
  <span data-taxonomy=<?php echo json_encode( $attr ); ?>></span>
1782
  <?php
1783
  }
@@ -1804,9 +1852,9 @@ function wpuf_get_form_settings( $form_id, $status = true ) {
1804
  * @return array
1805
  */
1806
  function wpuf_get_form_notifications( $form_id ) {
1807
- $notifications = get_post_meta( $form_id, 'notifications', true );
1808
 
1809
- if ( !$notifications ) {
1810
  return [];
1811
  }
1812
 
@@ -1823,9 +1871,9 @@ function wpuf_get_form_notifications( $form_id ) {
1823
  * @return array
1824
  */
1825
  function wpuf_get_form_integrations( $form_id ) {
1826
- $integrations = get_post_meta( $form_id, 'integrations', true );
1827
 
1828
- if ( !$integrations ) {
1829
  return [];
1830
  }
1831
 
@@ -1845,12 +1893,12 @@ function wpuf_get_form_integrations( $form_id ) {
1845
  function wpuf_is_integration_active( $form_id, $integration_id ) {
1846
  $integrations = wpuf_get_form_integrations( $form_id );
1847
 
1848
- if ( !$integrations ) {
1849
  return false;
1850
  }
1851
 
1852
  foreach ( $integrations as $id => $integration ) {
1853
- if ( $integration_id == $id && $integration->enabled == true ) {
1854
  return $integration;
1855
  }
1856
  }
@@ -1872,7 +1920,7 @@ function wpuf_get_subscription_page_url() {
1872
  /**
1873
  * Clear the buffer
1874
  *
1875
- * prevents ajax breakage and endless loading icon. A LIFE SAVER!!!
1876
  *
1877
  * @return void
1878
  */
@@ -1890,14 +1938,14 @@ function wpuf_clear_buffer() {
1890
  function wpuf_is_license_expired() {
1891
  $remote_addr = isset( $_SERVER['REMOTE_ADDR'] ) ? sanitize_text_field( wp_unslash( $_SERVER['REMOTE_ADDR'] ) ) : '';
1892
 
1893
- if ( in_array( $remote_addr, [ '127.0.0.1', '::1' ] ) ) {
1894
  return false;
1895
  }
1896
 
1897
  $license_status = get_option( 'wpuf_license_status' );
1898
 
1899
  // seems like this wasn't activated at all
1900
- if ( !isset( $license_status->update ) ) {
1901
  return false;
1902
  }
1903
 
@@ -1942,7 +1990,7 @@ function wpuf_get_post_form_templates() {
1942
  function wpuf_get_countries( $type = 'array' ) {
1943
  $countries = include __DIR__ . '/includes/countries-formated.php';
1944
 
1945
- if ( $type == 'json' ) {
1946
  $countries = json_encode( $countries );
1947
  }
1948
 
@@ -1958,11 +2006,26 @@ function wpuf_get_countries( $type = 'array' ) {
1958
  */
1959
  function wpuf_get_account_sections() {
1960
  $account_sections = [
1961
- [ 'slug' => 'dashboard', 'label' => __( 'Dashboard', 'wp-user-frontend' ) ],
1962
- [ 'slug' => 'posts', 'label' => __( 'Posts', 'wp-user-frontend' ) ],
1963
- [ 'slug' => 'edit-profile', 'label' => __( 'Edit Profile', 'wp-user-frontend' ) ],
1964
- [ 'slug' => 'subscription', 'label' => __( 'Subscription', 'wp-user-frontend' ) ],
1965
- [ 'slug' => 'billing-address', 'label' => __( 'Billing Address', 'wp-user-frontend' ) ],
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1966
  ];
1967
 
1968
  return apply_filters( 'wpuf_account_sections', $account_sections );
@@ -1981,7 +2044,7 @@ function wpuf_get_account_sections_list( $post_type = 'page' ) {
1981
 
1982
  if ( $sections ) {
1983
  foreach ( $sections as $section ) {
1984
- $array[$section['slug']] = esc_attr( $section['label'] );
1985
  }
1986
  }
1987
 
@@ -2010,7 +2073,7 @@ function wpuf_get_transactions( $args = [] ) {
2010
  if ( $args['count'] ) {
2011
  return $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->prefix}wpuf_transaction" );
2012
  }
2013
-
2014
  $result = $wpdb->get_results( "SELECT * FROM {$wpdb->prefix}wpuf_transaction ORDER BY `{$args['orderby']}` {$args['order']} LIMIT {$args['offset']}, {$args['number']}", OBJECT );
2015
 
2016
  return $result;
@@ -2064,12 +2127,12 @@ function wpuf_get_pending_transactions( $args = [] ) {
2064
  'status' => 'pending',
2065
  'cost' => $info['price'],
2066
  'tax' => isset( $info['tax'] ) ? $info['tax'] : 0,
2067
- 'post_id' => ( $info['type'] == 'post' ) ? $info['item_number'] : 0,
2068
- 'pack_id' => ( $info['type'] == 'pack' ) ? $info['item_number'] : 0,
2069
  'payer_first_name' => $info['user_info']['first_name'],
2070
  'payer_last_name' => $info['user_info']['last_name'],
2071
  'payer_email' => $info['user_info']['email'],
2072
- 'payment_type' => ( $info['post_data']['wpuf_payment_method'] == 'bank' ) ? 'Bank/Manual' : ucwords( $info['post_data']['wpuf_payment_method'] ),
2073
  'transaction_id' => 0,
2074
  'created' => $info['date'],
2075
  ];
@@ -2089,59 +2152,271 @@ function wpuf_get_pending_transactions( $args = [] ) {
2089
  */
2090
  function wpuf_get_currencies() {
2091
  $currencies = [
2092
- [ 'currency' => 'AED', 'label' => __( 'United Arab Emirates Dirham', 'wp-user-frontend' ), 'symbol' => 'د.إ' ],
2093
- [ 'currency' => 'AUD', 'label' => __( 'Australian Dollars', 'wp-user-frontend' ), 'symbol' => '&#36;' ],
2094
- [ 'currency' => 'AZD', 'label' => __( 'Argentine Peso', 'wp-user-frontend' ), 'symbol' => '&#36;' ],
2095
- [ 'currency' => 'BDT', 'label' => __( 'Bangladeshi Taka', 'wp-user-frontend' ), 'symbol' => '&#2547;' ],
2096
- [ 'currency' => 'BRL', 'label' => __( 'Brazilian Real', 'wp-user-frontend' ), 'symbol' => '&#82;&#36;' ],
2097
- [ 'currency' => 'BGN', 'label' => __( 'Bulgarian Lev', 'wp-user-frontend' ), 'symbol' => '&#1083;&#1074;.' ],
2098
- [ 'currency' => 'CAD', 'label' => __( 'Canadian Dollars', 'wp-user-frontend' ), 'symbol' => '&#36;' ],
2099
- [ 'currency' => 'CLP', 'label' => __( 'Chilean Peso', 'wp-user-frontend' ), 'symbol' => '&#36;' ],
2100
- [ 'currency' => 'CNY', 'label' => __( 'Chinese Yuan', 'wp-user-frontend' ), 'symbol' => '&yen;' ],
2101
- [ 'currency' => 'COP', 'label' => __( 'Colombian Peso', 'wp-user-frontend' ), 'symbol' => '&#36;' ],
2102
- [ 'currency' => 'CZK', 'label' => __( 'Czech Koruna', 'wp-user-frontend' ), 'symbol' => '&#75;&#269;' ],
2103
- [ 'currency' => 'DKK', 'label' => __( 'Danish Krone', 'wp-user-frontend' ), 'symbol' => 'kr.' ],
2104
- [ 'currency' => 'DOP', 'label' => __( 'Dominican Peso', 'wp-user-frontend' ), 'symbol' => 'RD&#36;' ],
2105
- [ 'currency' => 'DZD', 'label' => __( 'Algerian Dinar', 'wp-user-frontend' ), 'symbol' => 'DA;' ],
2106
- [ 'currency' => 'EUR', 'label' => __( 'Euros', 'wp-user-frontend' ), 'symbol' => '&euro;' ],
2107
- [ 'currency' => 'HKD', 'label' => __( 'Hong Kong Dollar', 'wp-user-frontend' ), 'symbol' => '&#36;' ],
2108
- [ 'currency' => 'HRK', 'label' => __( 'Croatia kuna', 'wp-user-frontend' ), 'symbol' => 'Kn' ],
2109
- [ 'currency' => 'HUF', 'label' => __( 'Hungarian Forint', 'wp-user-frontend' ), 'symbol' => '&#70;&#116;' ],
2110
- [ 'currency' => 'ISK', 'label' => __( 'Icelandic krona', 'wp-user-frontend' ), 'symbol' => 'Kr.' ],
2111
- [ 'currency' => 'IDR', 'label' => __( 'Indonesia Rupiah', 'wp-user-frontend' ), 'symbol' => 'Rp' ],
2112
- [ 'currency' => 'INR', 'label' => __( 'Indian Rupee', 'wp-user-frontend' ), 'symbol' => '&#8377;' ],
2113
- [ 'currency' => 'NPR', 'label' => __( 'Nepali Rupee', 'wp-user-frontend' ), 'symbol' => 'Rs.' ],
2114
- [ 'currency' => 'ILS', 'label' => __( 'Israeli Shekel', 'wp-user-frontend' ), 'symbol' => '&#8362;' ],
2115
- [ 'currency' => 'JPY', 'label' => __( 'Japanese Yen', 'wp-user-frontend' ), 'symbol' => '&yen;' ],
2116
- [ 'currency' => 'KIP', 'label' => __( 'Lao Kip', 'wp-user-frontend' ), 'symbol' => '&#8365;' ],
2117
- [ 'currency' => 'KRW', 'label' => __( 'South Korean Won', 'wp-user-frontend' ), 'symbol' => '&#8361;' ],
2118
- [ 'currency' => 'MYR', 'label' => __( 'Malaysian Ringgits', 'wp-user-frontend' ), 'symbol' => '&#82;&#77;' ],
2119
- [ 'currency' => 'MXN', 'label' => __( 'Mexican Peso', 'wp-user-frontend' ), 'symbol' => '&#36;' ],
2120
- [ 'currency' => 'NGN', 'label' => __( 'Nigerian Naira', 'wp-user-frontend' ), 'symbol' => '&#8358;' ],
2121
- [ 'currency' => 'NOK', 'label' => __( 'Norwegian Krone', 'wp-user-frontend' ), 'symbol' => '&#107;&#114;' ],
2122
- [ 'currency' => 'NZD', 'label' => __( 'New Zealand Dollar', 'wp-user-frontend' ), 'symbol' => '&#36;' ],
2123
- [ 'currency' => 'NAD', 'label' => __( 'Namibian dollar', 'wp-user-frontend' ), 'symbol' => 'N&#36;' ],
2124
- [ 'currency' => 'OMR', 'label' => __( 'Omani Rial', 'wp-user-frontend' ), 'symbol' => 'ر.ع.' ],
2125
- [ 'currency' => 'IRR', 'label' => __( 'Iranian Rial', 'wp-user-frontend' ), 'symbol' => '' ],
2126
- [ 'currency' => 'PKR', 'label' => __( 'Pakistani Rupee', 'wp-user-frontend' ), 'symbol' => 'Rs' ],
2127
- [ 'currency' => 'PYG', 'label' => __( 'Paraguayan Guaraní', 'wp-user-frontend' ), 'symbol' => '&#8370;' ],
2128
- [ 'currency' => 'PHP', 'label' => __( 'Philippine Pesos', 'wp-user-frontend' ), 'symbol' => '&#8369;' ],
2129
- [ 'currency' => 'PLN', 'label' => __( 'Polish Zloty', 'wp-user-frontend' ), 'symbol' => '&#122;&#322;' ],
2130
- [ 'currency' => 'GBP', 'label' => __( 'Pounds Sterling', 'wp-user-frontend' ), 'symbol' => '&pound;' ],
2131
- [ 'currency' => 'RON', 'label' => __( 'Romanian Leu', 'wp-user-frontend' ), 'symbol' => 'lei' ],
2132
- [ 'currency' => 'RUB', 'label' => __( 'Russian Ruble', 'wp-user-frontend' ), 'symbol' => '&#1088;&#1091;&#1073;.' ],
2133
- [ 'currency' => 'SR', 'label' => __( 'Saudi Riyal', 'wp-user-frontend' ), 'symbol' => 'SR' ],
2134
- [ 'currency' => 'SGD', 'label' => __( 'Singapore Dollar', 'wp-user-frontend' ), 'symbol' => '&#36;' ],
2135
- [ 'currency' => 'ZAR', 'label' => __( 'South African rand', 'wp-user-frontend' ), 'symbol' => '&#82;' ],
2136
- [ 'currency' => 'SEK', 'label' => __( 'Swedish Krona', 'wp-user-frontend' ), 'symbol' => '&#107;&#114;' ],
2137
- [ 'currency' => 'CHF', 'label' => __( 'Swiss Franc', 'wp-user-frontend' ), 'symbol' => '&#67;&#72;&#70;' ],
2138
- [ 'currency' => 'TWD', 'label' => __( 'Taiwan New Dollars', 'wp-user-frontend' ), 'symbol' => '&#78;&#84;&#36;' ],
2139
- [ 'currency' => 'THB', 'label' => __( 'Thai Baht', 'wp-user-frontend' ), 'symbol' => '&#3647;' ],
2140
- [ 'currency' => 'TRY', 'label' => __( 'Turkish Lira', 'wp-user-frontend' ), 'symbol' => '&#8378;' ],
2141
- [ 'currency' => 'USD', 'label' => __( 'US Dollar', 'wp-user-frontend' ), 'symbol' => '&#36;' ],
2142
- [ 'currency' => 'VND', 'label' => __( 'Vietnamese Dong', 'wp-user-frontend' ), 'symbol' => '&#8363;' ],
2143
- [ 'currency' => 'EGP', 'label' => __( 'Egyptian Pound', 'wp-user-frontend' ), 'symbol' => 'EGP' ],
2144
- [ 'currency' => 'JOD', 'label' => __( 'Jordanian dinar', 'wp-user-frontend' ), 'symbol' => 'د.أ' ],
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2145
  ];
2146
 
2147
  return apply_filters( 'wpuf_currencies', $currencies );
@@ -2159,15 +2434,15 @@ function wpuf_get_currencies() {
2159
  function wpuf_get_currency( $type = '' ) {
2160
  $currency_code = wpuf_get_option( 'currency', 'wpuf_payment', 'USD' );
2161
 
2162
- if ( $type == 'code' ) {
2163
  return $currency_code;
2164
  }
2165
 
2166
  $currencies = wpuf_get_currencies();
2167
- $index = array_search( $currency_code, array_column( $currencies, 'currency' ) );
2168
  $currency = $currencies[ $index ];
2169
 
2170
- if ( $type == 'symbol' ) {
2171
  return $currency['symbol'];
2172
  }
2173
 
@@ -2186,19 +2461,19 @@ function get_wpuf_price_format() {
2186
  switch ( $currency_pos ) {
2187
  case 'left':
2188
  $format = '%1$s%2$s';
2189
- break;
2190
 
2191
  case 'right':
2192
  $format = '%2$s%1$s';
2193
- break;
2194
 
2195
  case 'left_space':
2196
  $format = '%1$s&nbsp;%2$s';
2197
- break;
2198
 
2199
  case 'right_space':
2200
  $format = '%2$s&nbsp;%1$s';
2201
- break;
2202
  }
2203
 
2204
  return apply_filters( 'wpuf_price_format', $format, $currency_pos );
@@ -2263,14 +2538,24 @@ function wpuf_trim_zeros( $price ) {
2263
  * @return mixed
2264
  */
2265
  function wpuf_format_price( $price, $formated = true, $args = [] ) {
2266
- extract( apply_filters( 'wpuf_price_args', wp_parse_args( $args, [
2267
- 'currency' => $formated ? wpuf_get_currency( 'symbol' ) : '',
2268
- 'decimal_separator' => wpuf_get_price_decimal_separator(),
2269
- 'thousand_separator' => $formated ? wpuf_get_price_thousand_separator() : '',
2270
- 'decimals' => wpuf_get_price_decimals(),
2271
- 'price_format' => get_wpuf_price_format(),
2272
- ] ) ) );
2273
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2274
  $negative = $price < 0;
2275
  $price = apply_filters( 'wpuf_raw_price', floatval( $negative ? $price * -1 : $price ) );
2276
  $price = apply_filters( 'wpuf_formatted_price', number_format( $price, $decimals, $decimal_separator, $thousand_separator ), $price, $decimals, $decimal_separator, $thousand_separator );
@@ -2289,7 +2574,7 @@ function wpuf_format_price( $price, $formated = true, $args = [] ) {
2289
  *
2290
  * @since 2.4.3
2291
  */
2292
- if ( !function_exists( 'array_column' ) ) {
2293
  function array_column( $input, $column_key, $index_key = null ) {
2294
  $result = [];
2295
 
@@ -2313,7 +2598,7 @@ if ( !function_exists( 'array_column' ) ) {
2313
  function wpuf_duplicate_form( $post_id ) {
2314
  $post = get_post( $post_id );
2315
 
2316
- if ( !$post ) {
2317
  return;
2318
  }
2319
 
@@ -2332,10 +2617,12 @@ function wpuf_duplicate_form( $post_id ) {
2332
  }
2333
 
2334
  // update the post title to remove confusion
2335
- wp_update_post( [
2336
- 'ID' => $form_id,
2337
- 'post_title' => $post->post_title . ' (#' . $form_id . ')',
2338
- ] );
 
 
2339
 
2340
  if ( $form_id ) {
2341
  $form_settings = wpuf_get_form_settings( $post_id );
@@ -2394,15 +2681,17 @@ function wpuf_insert_form_field( $form_id, $field = [], $field_id = null, $order
2394
  * @return int
2395
  */
2396
  function wpuf_create_sample_form( $post_title = 'Sample Form', $post_type = 'wpuf_forms', $blank = false ) {
2397
- $form_id = wp_insert_post( [
2398
- 'post_title' => $post_title,
2399
- 'post_type' => $post_type,
2400
- 'post_status' => 'publish',
2401
- 'comment_status' => 'closed',
2402
- 'post_content' => '',
2403
- ] );
2404
-
2405
- if ( !$form_id ) {
 
 
2406
  return false;
2407
  }
2408
 
@@ -2424,7 +2713,7 @@ function wpuf_create_sample_form( $post_title = 'Sample Form', $post_type = 'wpu
2424
  'placeholder' => '',
2425
  'default' => '',
2426
  'size' => '40',
2427
- 'wpuf_cond' => [ ],
2428
  ],
2429
  [
2430
  'input_type' => 'textarea',
@@ -2441,7 +2730,7 @@ function wpuf_create_sample_form( $post_title = 'Sample Form', $post_type = 'wpu
2441
  'default' => '',
2442
  'rich' => 'teeny',
2443
  'insert_image' => 'yes',
2444
- 'wpuf_cond' => [ ],
2445
  ],
2446
  ];
2447
 
@@ -2543,13 +2832,13 @@ function wpuf_create_sample_form( $post_title = 'Sample Form', $post_type = 'wpu
2543
  ];
2544
  }
2545
 
2546
- if ( !empty( $form_fields ) && !$blank ) {
2547
  foreach ( $form_fields as $order => $field ) {
2548
  wpuf_insert_form_field( $form_id, $field, false, $order );
2549
  }
2550
  }
2551
 
2552
- if ( !empty( $settings ) ) {
2553
  update_post_meta( $form_id, 'wpuf_form_settings', $settings );
2554
  }
2555
 
@@ -2604,12 +2893,13 @@ function wpuf_delete_form( $form_id, $force = true ) {
2604
  wp_delete_post( $form_id, $force );
2605
 
2606
  // delete form inputs as WP doesn't know the relationship
2607
- $wpdb->delete( $wpdb->posts,
 
2608
  [
2609
  'post_parent' => $form_id,
2610
  'post_type' => 'wpuf_input',
2611
  ]
2612
- );
2613
  }
2614
 
2615
  /**
@@ -2622,11 +2912,10 @@ function wpuf_delete_form( $form_id, $force = true ) {
2622
  * @return string $post_status
2623
  */
2624
  function wpuf_get_draft_post_status( $form_settings ) {
2625
-
2626
  $noce = isset( $_REQUEST['_wpnonce'] ) ? sanitize_key( wp_unslash( $_REQUEST['_wpnonce'] ) ) : '';
2627
 
2628
  if ( isset( $nonce ) && ! wp_verify_nonce( $noce, 'wpuf_form_add' ) ) {
2629
- return ;
2630
  }
2631
 
2632
  $post_status = 'draft';
@@ -2634,8 +2923,8 @@ function wpuf_get_draft_post_status( $form_settings ) {
2634
  $charging_enabled = $current_user->subscription()->current_pack_id();
2635
  $user_wpuf_subscription_pack = get_user_meta( get_current_user_id(), '_wpuf_subscription_pack', true );
2636
 
2637
- if ( $charging_enabled && !isset( $_POST['post_id'] ) ) {
2638
- if ( !empty( $user_wpuf_subscription_pack ) ) {
2639
  if ( $current_user->subscription()->expired() ) {
2640
  $post_status = 'pending';
2641
  }
@@ -2656,7 +2945,7 @@ function wpuf_get_draft_post_status( $form_settings ) {
2656
  * @return array
2657
  */
2658
  function wpuf_admin_page_states( $state, $post ) {
2659
- if ( 'page' != $post->post_type ) {
2660
  return $state;
2661
  }
2662
 
@@ -2665,19 +2954,19 @@ function wpuf_admin_page_states( $state, $post ) {
2665
  preg_match_all( $pattern, $post->post_content, $matches );
2666
  $matches = array_unique( $matches[0] );
2667
 
2668
- if ( !empty( $matches ) ) {
2669
  $page = '';
2670
  $shortcode = $matches[0];
2671
 
2672
- if ( '[wpuf_account]' == $shortcode ) {
2673
  $page = 'WPUF Account Page';
2674
- } elseif ( '[wpuf_edit]' == $shortcode ) {
2675
  $page = 'WPUF Post Edit Page';
2676
- } elseif ( '[wpuf-login]' == $shortcode ) {
2677
  $page = 'WPUF Login Page';
2678
- } elseif ( '[wpuf_sub_pack]' == $shortcode ) {
2679
  $page = 'WPUF Subscription Page';
2680
- } elseif ( '[wpuf_editprofile]' == $shortcode ) {
2681
  $page = 'WPUF Profile Edit Page';
2682
  } elseif ( stristr( $shortcode, '[wpuf_dashboard' ) ) {
2683
  $page = 'WPUF Dashboard Page';
@@ -2689,7 +2978,7 @@ function wpuf_admin_page_states( $state, $post ) {
2689
  $page = 'WPUF Form Page';
2690
  }
2691
 
2692
- if ( !empty( $page ) ) {
2693
  $state['wpuf'] = $page;
2694
  }
2695
  }
@@ -2765,7 +3054,7 @@ function wpuf_send_mail_to_guest( $post_id_encoded, $form_id_encoded, $charging_
2765
  'post_msg' => 'verified',
2766
  'f' => 2,
2767
  ], get_home_url()
2768
- );
2769
  } else {
2770
  $encoded_guest_url = add_query_arg(
2771
  [
@@ -2774,16 +3063,16 @@ function wpuf_send_mail_to_guest( $post_id_encoded, $form_id_encoded, $charging_
2774
  'post_msg' => 'verified',
2775
  'f' => 1,
2776
  ], get_home_url()
2777
- );
2778
  }
2779
 
2780
- $default_body = 'Hey There,' . '<br>' . '<br>' . 'We just received your guest post and now we want you to confirm your email so that we can verify the content and move on to the publishing process.' . '<br>' . '<br>' . 'Please click the link below to verify:' . '<br>' . '<br>' . '<a href="' . $encoded_guest_url . '">Publish Post</a>' . '<br>' . '<br>' . 'Regards,' . '<br>' . '<br>' . bloginfo( 'name' );
2781
  $to = isset( $_POST['guest_email'] ) ? sanitize_email( wp_unslash( $_POST['guest_email'] ) ) : '';
2782
  $guest_email_sub = wpuf_get_option( 'guest_email_subject', 'wpuf_mails', 'Please Confirm Your Email to Get the Post Published!' );
2783
  $subject = $guest_email_sub;
2784
  $guest_email_body = wpuf_get_option( 'guest_email_body', 'wpuf_mails', $default_body );
2785
 
2786
- if ( !empty( $guest_email_body ) ) {
2787
  $blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
2788
  $field_search = [ '{activation_link}', '{sitename}' ];
2789
 
@@ -2797,7 +3086,7 @@ function wpuf_send_mail_to_guest( $post_id_encoded, $form_id_encoded, $charging_
2797
  $body = $default_body;
2798
  }
2799
 
2800
- $body = get_formatted_mail_body( $body, $subject );
2801
 
2802
  wp_mail( $to, $subject, $body );
2803
  }
@@ -2812,7 +3101,7 @@ function wpuf_send_mail_to_guest( $post_id_encoded, $form_id_encoded, $charging_
2812
  function is_wpuf_post_form_builder() {
2813
  $page = isset( $_GET['page'] ) ? sanitize_text_field( wp_unslash( $_GET['page'] ) ) : '';
2814
 
2815
- return $page == 'wpuf-post-forms' ? true : false;
2816
  }
2817
 
2818
  /**
@@ -2825,7 +3114,7 @@ function is_wpuf_post_form_builder() {
2825
  function is_wpuf_profile_form_builder() {
2826
  $page = isset( $_GET['page'] ) ? sanitize_text_field( wp_unslash( $_GET['page'] ) ) : '';
2827
 
2828
- return $page == 'wpuf-profile-forms' ? true : false;
2829
  }
2830
 
2831
  /**
@@ -2838,7 +3127,7 @@ function is_wpuf_profile_form_builder() {
2838
  * @return \WPUF_User
2839
  */
2840
  function wpuf_get_user( $user = null ) {
2841
- if ( !$user ) {
2842
  $user = wp_get_current_user();
2843
  }
2844
 
@@ -2858,14 +3147,18 @@ function wpuf_set_all_terms_as_allowed() {
2858
  $allowed_term = [];
2859
 
2860
  foreach ( $subscriptions as $pack ) {
2861
- if ( !metadata_exists( 'post', $pack->ID, '_sub_allowed_term_ids' ) ) {
2862
- $cts = get_taxonomies( ['_builtin'=>true], 'objects' ); ?>
2863
- <?php foreach ( $cts as $ct ) {
 
 
2864
  if ( is_taxonomy_hierarchical( $ct->name ) ) {
2865
- $tax_terms = get_terms( [
2866
- 'taxonomy' => $ct->name,
2867
- 'hide_empty' => false,
2868
- ] );
 
 
2869
 
2870
  foreach ( $tax_terms as $tax_term ) {
2871
  $allowed_term[] = $tax_term->term_id;
@@ -2873,13 +3166,17 @@ function wpuf_set_all_terms_as_allowed() {
2873
  }
2874
  }
2875
 
2876
- $cts = get_taxonomies( ['_builtin'=>false], 'objects' ); ?>
2877
- <?php foreach ( $cts as $ct ) {
 
 
2878
  if ( is_taxonomy_hierarchical( $ct->name ) ) {
2879
- $tax_terms = get_terms( [
2880
- 'taxonomy' => $ct->name,
2881
- 'hide_empty' => false,
2882
- ] );
 
 
2883
 
2884
  foreach ( $tax_terms as $tax_term ) {
2885
  $allowed_term[] = $tax_term->term_id;
@@ -2894,7 +3191,7 @@ function wpuf_set_all_terms_as_allowed() {
2894
  }
2895
 
2896
  /**
2897
- * post submitted by form
2898
  *
2899
  * @since 2.8
2900
  *
@@ -2903,7 +3200,7 @@ function wpuf_set_all_terms_as_allowed() {
2903
  * @return List of WP_Post objects
2904
  */
2905
  function wpuf_posts_submitted_by( $form_id ) {
2906
- $settings = wpuf_get_form_settings( $form_id );
2907
  $settings['post_type'];
2908
  $args = [
2909
  'meta_key' => '_wpuf_form_id',
@@ -2917,7 +3214,7 @@ function wpuf_posts_submitted_by( $form_id ) {
2917
  }
2918
 
2919
  /**
2920
- * count post submitted by form
2921
  *
2922
  * @since 2.8
2923
  *
@@ -2950,7 +3247,7 @@ function get_formatted_mail_body( $message, $subject ) {
2950
  wpuf_load_pro_template(
2951
  'email/header.php',
2952
  [ 'subject' => $subject ]
2953
- );
2954
 
2955
  $header = ob_get_clean();
2956
  }
@@ -2961,7 +3258,7 @@ function get_formatted_mail_body( $message, $subject ) {
2961
  wpuf_load_pro_template(
2962
  'email/footer.php',
2963
  []
2964
- );
2965
 
2966
  $footer = ob_get_clean();
2967
  }
@@ -2971,13 +3268,13 @@ function get_formatted_mail_body( $message, $subject ) {
2971
  wpuf_load_pro_template(
2972
  'email/style.php',
2973
  []
2974
- );
2975
 
2976
  $css = apply_filters( 'wpuf_email_style', ob_get_clean() );
2977
 
2978
  $content = $header . '<pre>' . $message . '</pre>' . $footer;
2979
 
2980
- if ( !class_exists( 'Emogrifier' ) ) {
2981
  require_once WPUF_PRO_INCLUDES . '/libs/Emogrifier.php';
2982
  }
2983
 
@@ -3013,8 +3310,8 @@ function wpuf_select( $args = [] ) {
3013
  'chosen' => false,
3014
  'placeholder' => null,
3015
  'multiple' => false,
3016
- 'show_option_all' => __( 'All', 'wp-user-frontend', 'wp-user-frontend' ),
3017
- 'show_option_none' => __( 'None', 'wp-user-frontend', 'wp-user-frontend' ),
3018
  'data' => [],
3019
  'readonly' => false,
3020
  'disabled' => false,
@@ -3064,24 +3361,24 @@ function wpuf_select( $args = [] ) {
3064
  $class = implode( ' ', array_map( 'sanitize_html_class', explode( ' ', $args['class'] ) ) );
3065
  $output = '<select' . $disabled . $readonly . ' name="' . esc_attr( $args['name'] ) . '" id="' . esc_attr( str_replace( '-', '_', $args['id'] ) ) . '" class="wpuf-select ' . $class . '"' . $multiple . ' data-placeholder="' . $placeholder . '"' . $data_elements . '>';
3066
 
3067
- if ( !isset( $args['selected'] ) || ( is_array( $args['selected'] ) && empty( $args['selected'] ) ) || !$args['selected'] ) {
3068
  $selected = '';
3069
  }
3070
 
3071
  if ( $args['show_option_all'] ) {
3072
- if ( $args['multiple'] && !empty( $args['selected'] ) ) {
3073
- $selected = selected( true, in_array( 0, $args['selected'] ), false );
3074
  } else {
3075
  $selected = selected( $args['selected'], 0, false );
3076
  }
3077
  $output .= '<option value="all"' . $selected . '>' . esc_html( $args['show_option_all'] ) . '</option>';
3078
  }
3079
 
3080
- if ( !empty( $args['options'] ) ) {
3081
  if ( $args['show_option_none'] ) {
3082
  if ( $args['multiple'] ) {
3083
- $selected = selected( true, in_array( -1, $args['selected'] ), false );
3084
- } elseif ( isset( $args['selected'] ) && !is_array( $args['selected'] ) && !empty( $args['selected'] ) ) {
3085
  $selected = selected( $args['selected'], -1, false );
3086
  }
3087
  $output .= '<option value="-1"' . $selected . '>' . esc_html( $args['show_option_none'] ) . '</option>';
@@ -3089,8 +3386,8 @@ function wpuf_select( $args = [] ) {
3089
 
3090
  foreach ( $args['options'] as $key => $option ) {
3091
  if ( $args['multiple'] && is_array( $args['selected'] ) ) {
3092
- $selected = selected( true, in_array( (string) $key, $args['selected'] ), false );
3093
- } elseif ( isset( $args['selected'] ) && !is_array( $args['selected'] ) ) {
3094
  $selected = selected( $args['selected'], $key, false );
3095
  }
3096
 
@@ -3135,7 +3432,7 @@ function wpuf_text( $args = [] ) {
3135
 
3136
  $data = '';
3137
 
3138
- if ( !empty( $args['data'] ) ) {
3139
  foreach ( $args['data'] as $key => $value ) {
3140
  $data .= 'data-' . $key . '="' . esc_attr( $value ) . '" ';
3141
  }
@@ -3143,11 +3440,11 @@ function wpuf_text( $args = [] ) {
3143
 
3144
  $output = '<span id="wpuf-' . $args['name'] . '-wrap">';
3145
 
3146
- if ( !empty( $args['label'] ) ) {
3147
  $output .= '<label class="wpuf-label" for="' . $args['id'] . '">' . esc_html( $args['label'] ) . '</label>';
3148
  }
3149
 
3150
- if ( !empty( $args['desc'] ) ) {
3151
  $output .= '<span class="wpuf-description">' . wp_kses_post( $args['desc'] ) . '</span>';
3152
  }
3153
 
@@ -3185,7 +3482,7 @@ function wpuf_update_option( $option, $section, $value ) {
3185
  $options = array();
3186
  }
3187
 
3188
- $options[$option] = $value;
3189
 
3190
  update_option( $section, $options );
3191
  }
@@ -3202,14 +3499,15 @@ function wpuf_update_option( $option, $section, $value ) {
3202
  function wpuf_get_terms( $taxonomy = 'category' ) {
3203
  $items = [];
3204
 
3205
- $terms = get_terms( [
 
3206
  'taxonomy' => $taxonomy,
3207
  'hide_empty' => false,
3208
  ]
3209
- );
3210
 
3211
  foreach ( $terms as $key => $term ) {
3212
- $items[$term->term_id] = $term->name;
3213
  }
3214
 
3215
  return $items;
@@ -3226,9 +3524,9 @@ function wpuf_ajax_get_states_field() {
3226
  $country = isset( $_POST['country'] ) ? sanitize_text_field( wp_unslash( $_POST['country'] ) ) : '';
3227
  $cs = new CountryState();
3228
  $countries = $cs->countries();
3229
- $states = $cs->getStates( $countries[$country] );
3230
 
3231
- if ( !empty( $states ) ) {
3232
  $args = [
3233
  'name' => isset( $_POST['field_name'] ) ? sanitize_text_field( wp_unslash( $_POST['field_name'] ) ) : '',
3234
  'id' => isset( $_POST['field_name'] ) ? sanitize_text_field( wp_unslash( $_POST['field_name'] ) ) : '',
@@ -3243,8 +3541,7 @@ function wpuf_ajax_get_states_field() {
3243
  $response = 'nostates';
3244
  }
3245
 
3246
- wp_send_json( $response ) ; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
3247
-
3248
  }
3249
  add_action( 'wp_ajax_wpuf-ajax-address', 'wpuf_ajax_get_states_field' );
3250
  add_action( 'wp_ajax_nopriv_wpuf-ajax-address', 'wpuf_ajax_get_states_field' );
@@ -3255,23 +3552,19 @@ add_action( 'wp_ajax_nopriv_wpuf-ajax-address', 'wpuf_ajax_get_states_field' );
3255
  * @return void
3256
  */
3257
  function wpuf_update_billing_address() {
3258
- $nonce = isset( $_POST['_wpnonce'] ) ? sanitize_text_field( wp_unslash( $_POST['_wpnonce'] ) ) : '';
3259
-
3260
- if ( ! wp_verify_nonce( $nonce, 'wpuf-ajax-address' ) ) {
3261
- return ;
3262
- }
3263
 
3264
  ob_start();
3265
 
3266
  $user_id = get_current_user_id();
3267
- $add_line_1 = isset( $_POST['billing_add_line1'] ) ? sanitize_text_field( wp_unslash( $_POST['billing_add_line1'] ) ) : '';
3268
- $add_line_2 = isset( $_POST['billing_add_line2'] ) ? sanitize_text_field( wp_unslash( $_POST['billing_add_line2'] ) ) : '';
3269
- $city = isset( $_POST['billing_city'] ) ? sanitize_text_field( wp_unslash( $_POST['billing_city'] ) ) : '';
3270
- $state = isset( $_POST['billing_state'] ) ? sanitize_text_field( wp_unslash( $_POST['billing_state'] ) ) : '';
3271
- $zip = isset( $_POST['billing_zip'] ) ? sanitize_text_field( wp_unslash( $_POST['billing_zip'] ) ) : '';
3272
- $country = isset( $_POST['billing_country'] ) ? sanitize_text_field( wp_unslash( $_POST['billing_country'] ) ) : '';
3273
- $type = isset( $_POST['type'] ) ? sanitize_text_field( wp_unslash( $_POST['type'] ) ) : '';
3274
- $id = isset( $_POST['id'] ) ? sanitize_text_field( wp_unslash( $_POST['id'] ) ) : '';
3275
 
3276
  $address_fields = [
3277
  'add_line_1' => $add_line_1,
@@ -3325,10 +3618,10 @@ function wpuf_get_user_address( $user_id = 0 ) {
3325
  $countries_obj = new WC_Countries();
3326
  $countries_array = $countries_obj->get_countries();
3327
  $country_states_array = $countries_obj->get_states();
3328
- $woo_address['state'] = isset( $country_states_array[$woo_address['country']][$woo_address['state']] ) ? $country_states_array[$woo_address['country']][$woo_address['state']] : '';
3329
  $woo_address['state'] = strtolower( str_replace( ' ', '', $woo_address['state'] ) );
3330
 
3331
- if ( !empty( $woo_address ) ) {
3332
  $address_fields = [
3333
  'add_line_1' => $woo_address['address_1'],
3334
  'add_line_2' => $woo_address['address_2'],
@@ -3353,30 +3646,32 @@ function wpuf_settings_multiselect( $args ) {
3353
  $settings = new WeDevs_Settings_API();
3354
  $value = $settings->get_option( $args['id'], $args['section'], $args['std'] );
3355
  $value = is_array( $value ) ? (array) $value : [];
3356
- $size = isset( $args['size'] ) && !is_null( $args['size'] ) ? $args['size'] : 'regular';
3357
  $html = sprintf( '<select multiple="multiple" class="%1$s" name="%2$s[%3$s][]" id="%2$s[%3$s]">', $size, $args['section'], $args['id'] );
3358
 
3359
  foreach ( $args['options'] as $key => $label ) {
3360
- $checked = in_array( $key, $value ) ? $key : '0';
3361
  $html .= sprintf( '<option value="%s"%s>%s</option>', $key, selected( $checked, $key, false ), $label );
3362
  }
3363
 
3364
  $html .= sprintf( '</select>' );
3365
  $html .= $settings->get_field_description( $args );
3366
 
3367
- echo wp_kses( $html, [
3368
- 'p' => [],
3369
- 'select' => [
3370
- 'multiple' => [],
3371
- 'class' => [],
3372
- 'name' => [],
3373
- 'id' => [],
3374
- ],
3375
- 'option' => [
3376
- 'value' => [],
3377
- 'selected' => []
 
 
3378
  ]
3379
- ] );
3380
  }
3381
 
3382
  /**
@@ -3388,11 +3683,11 @@ function wpuf_settings_multiselect( $args ) {
3388
  */
3389
  function wpuf_show_form_schedule_message( $form_id ) {
3390
  $form_settings = wpuf_get_form_settings( $form_id );
3391
- $is_scheduled = ( isset( $form_settings['schedule_form'] ) && $form_settings['schedule_form'] == 'true' ) ? true : false;
3392
 
3393
  if ( $is_scheduled ) {
3394
- $start_time = !empty( $form_settings['schedule_start'] ) ? strtotime( $form_settings['schedule_start'] ) : 0;
3395
- $end_time = !empty( $form_settings['schedule_end'] ) ? strtotime( $form_settings['schedule_end'] ) : 0;
3396
  $current_time = current_time( 'timestamp' );
3397
 
3398
  if ( $current_time >= $start_time && $current_time <= $end_time ) {
@@ -3404,7 +3699,8 @@ function wpuf_show_form_schedule_message( $form_id ) {
3404
  echo wp_kses_post( '<div class="wpuf-message">' . $form_settings['form_pending_message'] . '</div>' );
3405
  } elseif ( $current_time > $end_time ) {
3406
  echo wp_kses_post( '<div class="wpuf-message">' . $form_settings['form_expired_message'] . '</div>' );
3407
- } ?>
 
3408
  <script>
3409
  jQuery( function($) {
3410
  $(".wpuf-submit-button").attr("disabled", "disabled");
@@ -3425,21 +3721,21 @@ add_action( 'wpuf_before_form_render', 'wpuf_show_form_schedule_message' );
3425
  */
3426
  function wpuf_show_form_limit_message( $form_id ) {
3427
  $form_settings = wpuf_get_form_settings( $form_id );
3428
- $has_limit = ( isset( $form_settings['limit_entries'] ) && $form_settings['limit_entries'] == 'true' ) ? true : false;
3429
- $post_to_check = get_post( get_the_ID() );
3430
  $is_edit_page = false;
3431
 
3432
- if ( stripos( $post_to_check->post_content, '[' . 'wpuf_edit' ) !== false ) {
3433
  $is_edit_page = true;
3434
  }
3435
 
3436
- if ( $has_limit && !$is_edit_page ) {
3437
- $limit = (int) !empty( $form_settings['limit_number'] ) ? $form_settings['limit_number'] : 0;
3438
  $form_entries = wpuf_form_posts_count( $form_id );
3439
 
3440
  if ( $limit && $limit <= $form_entries ) {
3441
  $info = $form_settings['limit_message'];
3442
- echo wp_kses_post( '<div class="wpuf-info">' . $info . '</div>');
3443
  ?>
3444
  <script>
3445
  jQuery( function($) {
@@ -3455,7 +3751,7 @@ function wpuf_show_form_limit_message( $form_id ) {
3455
  add_action( 'wpuf_before_form_render', 'wpuf_show_form_limit_message' );
3456
 
3457
  /**
3458
- * save frontend post revision
3459
  *
3460
  * @param int $post_id
3461
  * @param array $form_settings
@@ -3466,7 +3762,12 @@ function wpuf_frontend_post_revision( $post_id, $form_settings ) {
3466
  $post = get_post( $post_id );
3467
 
3468
  if ( post_type_supports( $form_settings['post_type'], 'revisions' ) ) {
3469
- $revisions = wp_get_post_revisions( $post_id, [ 'order' => 'ASC', 'posts_per_page' => 1 ] );
 
 
 
 
 
3470
  $revision = current( $revisions );
3471
 
3472
  _wp_upgrade_revisions_of_post( $post, wp_get_post_revisions( $post_id ) );
@@ -3494,7 +3795,7 @@ function wpuf_ini_get_byte( $val ) {
3494
  $byte = absint( $val );
3495
  $char = strtolower( str_replace( $byte, '', $val ) );
3496
 
3497
- switch( $char ) {
3498
  case 'g':
3499
  $byte *= GB_IN_BYTES;
3500
  break;
23
  * @author Tareq Hasan
24
  */
25
  function wpuf_show_post_status( $status ) {
26
+ if ( 'publish' === $status ) {
27
  $title = __( 'Live', 'wp-user-frontend' );
28
  $fontcolor = '#33CC33';
29
+ } elseif ( 'draft' === $status ) {
30
  $title = __( 'Offline', 'wp-user-frontend' );
31
  $fontcolor = '#bbbbbb';
32
+ } elseif ( 'pending' === $status ) {
33
  $title = __( 'Awaiting Approval', 'wp-user-frontend' );
34
  $fontcolor = '#C00202';
35
+ } elseif ( 'future' === $status ) {
36
  $title = __( 'Scheduled', 'wp-user-frontend' );
37
  $fontcolor = '#bbbbbb';
38
+ } elseif ( 'private' === $status ) {
39
  $title = __( 'Private', 'wp-user-frontend' );
40
  $fontcolor = '#bbbbbb';
41
  }
54
  * @author Tareq Hasan
55
  */
56
  function wpuf_admin_post_status( $status ) {
57
+ if ( 'publish' === $status ) {
58
  $title = __( 'Published', 'wp-user-frontend' );
59
  $fontcolor = '#009200';
60
+ } elseif ( 'draft' === $status || 'private' === $status ) {
61
  $title = __( 'Draft', 'wp-user-frontend' );
62
  $fontcolor = '#bbbbbb';
63
+ } elseif ( 'pending' === $status ) {
64
  $title = __( 'Pending', 'wp-user-frontend' );
65
  $fontcolor = '#C00202';
66
+ } elseif ( 'future' === $status ) {
67
  $title = __( 'Scheduled', 'wp-user-frontend' );
68
  $fontcolor = '#bbbbbb';
69
  }
77
  * @param <type> $post_id
78
  */
79
  function wpuf_upload_attachment( $post_id ) {
80
+ if ( ! isset( $_FILES['wpuf_post_attachments'] ) ) {
81
  return false;
82
  }
83
 
 
 
84
  $fields = (int) wpuf_get_option( 'attachment_num' );
85
 
86
  $wpuf_post_attachments = isset( $_FILES['wpuf_post_attachments'] ) ? array_map( 'sanitize_text_field', wp_unslash( $_FILES['wpuf_post_attachments'] ) ) : [];
87
 
88
  for ( $i = 0; $i < $fields; $i++ ) {
89
+ $file_name = basename( $wpuf_post_attachments['name'][ $i ] );
90
 
91
  if ( $file_name ) {
92
  if ( $file_name ) {
93
  $upload = [
94
+ 'name' => $wpuf_post_attachments['name'][ $i ],
95
+ 'type' => $wpuf_post_attachments['type'][ $i ],
96
+ 'tmp_name' => $wpuf_post_attachments['tmp_name'][ $i ],
97
+ 'error' => $wpuf_post_attachments['error'][ $i ],
98
+ 'size' => $wpuf_post_attachments['size'][ $i ],
99
  ];
100
 
101
  wp_handle_upload( $upload );
143
  * @author Tareq Hasan
144
  */
145
  function wpuf_unset_media_tab( $list ) {
146
+ if ( ! current_user_can( 'edit_posts' ) ) {
147
  unset( $list['library'] );
148
  unset( $list['gallery'] );
149
  }
166
  $post_types = get_post_types( $args );
167
 
168
  $ignore_post_types = [
169
+ 'attachment',
170
+ 'revision',
171
+ 'nav_menu_item',
172
  ];
173
 
174
  foreach ( $post_types as $key => $val ) {
175
+ if ( in_array( $val, $ignore_post_types, true ) ) {
176
+ unset( $post_types[ $key ] );
177
  }
178
  }
179
 
194
 
195
  if ( $users ) {
196
  foreach ( $users as $user ) {
197
+ $list[ $user->ID ] = $user->user_login;
198
  }
199
  }
200
 
208
  */
209
  function wpuf_get_pages( $post_type = 'page' ) {
210
  $array = [ '' => __( '-- select --', 'wp-user-frontend' ) ];
211
+ $pages = get_posts(
212
+ [
213
+ 'post_type' => $post_type,
214
+ 'numberposts' => - 1,
215
+ 'no_found_rows' => true,
216
+ 'update_post_meta_cache' => false,
217
+ 'update_post_term_cache' => false,
218
+ ]
219
+ );
220
 
221
  if ( $pages ) {
222
  foreach ( $pages as $page ) {
244
 
245
  $override = wpuf_get_option( 'override_editlink', 'wpuf_general', 'no' );
246
 
247
+ if ( $override === 'yes' ) {
248
  $url = '';
249
 
250
+ if ( 'yes' === wpuf_get_option( 'enable_post_edit', 'wpuf_dashboard', 'yes' ) ) {
251
  $edit_page = (int) wpuf_get_option( 'edit_page_id', 'wpuf_frontend_posting' );
252
  $url = get_permalink( $edit_page );
253
 
281
  *
282
  * @var array
283
  */
284
+ public $db_fields = [
285
+ 'parent' => 'parent',
286
+ 'id' => 'term_id',
287
+ ];
288
 
289
  /**
290
  * @see Walker::start_el()
300
  $cat_name = apply_filters( 'list_cats', $category->name, $category );
301
  $output .= "\t<option class=\"level-$depth\" value=\"" . $category->term_id . '"';
302
 
303
+ if ( in_array( $category->term_id, $args['selected'], true ) ) {
304
  $output .= ' selected="selected"';
305
  }
306
 
323
  class WPUF_Walker_Category_Checklist extends Walker {
324
  public $tree_type = 'category';
325
 
326
+ public $db_fields = [
327
+ 'parent' => 'parent',
328
+ 'id' => 'term_id',
329
+ ]; //TODO: decouple this
330
 
331
  public function start_lvl( &$output, $depth = 0, $args = [] ) {
332
  $indent = str_repeat( "\t", $depth );
339
  }
340
 
341
  public function start_el( &$output, $category, $depth = 0, $args = [], $current_object_id = 0 ) {
342
+ $taxonomy = $args['taxonomy'];
343
 
344
  if ( empty( $taxonomy ) ) {
345
  $taxonomy = 'category';
346
  }
347
 
348
+ if ( 'category' === $taxonomy ) {
349
  $name = 'category';
350
  } else {
351
  $name = $taxonomy;
358
  }
359
 
360
  $class = isset( $args['class'] ) ? $args['class'] : '';
361
+ $output .= "\n<li class='" . $inline_class . "' id='{$taxonomy}-{$category->term_id}'>" . '<label class="selectit"><input class="' . $class . '" value="' . $category->term_id . '" type="checkbox" name="' . $name . '[]" id="in-' . $taxonomy . '-' . $category->term_id . '"' . checked( in_array( $category->term_id, $args['selected_cats'], true ), true, false ) . disabled( empty( $args['disabled'] ), false, false ) . ' /> ' . esc_html( apply_filters( 'the_category', $category->name ) ) . '</label>';
362
  }
363
 
364
  public function end_el( &$output, $category, $depth = 0, $args = [] ) {
373
  * @param array $selected_cats
374
  *
375
  * @since 0.8
 
376
  */
377
  function wpuf_category_checklist( $post_id = 0, $selected_cats = false, $attr = [], $class = null ) {
378
  require_once ABSPATH . '/wp-admin/includes/template.php';
404
  $tax_args = [
405
  'taxonomy' => $tax,
406
  'hide_empty' => false,
407
+ $exclude['type'] => ( 'child_of' === $exclude_type ) ? $exclude['childs'] : $attr['exclude'],
408
  'orderby' => isset( $attr['orderby'] ) ? $attr['orderby'] : 'name',
409
  'order' => isset( $attr['order'] ) ? $attr['order'] : 'ASC',
410
  ];
414
 
415
  echo wp_kses_post( '<ul class="wpuf-category-checklist">' );
416
  printf( '<input type="hidden" name="%s" value="0" />', esc_attr( $tax ) );
417
+ echo wp_kses(
418
+ call_user_func_array( [ &$walker, 'walk' ], [ $categories, 0, $args ] ), [
419
+ 'li' => [
420
+ 'class' => [],
421
+ ],
422
+ 'label' => [
423
+ 'class' => [],
424
+ ],
425
+ 'input' => [
426
+ 'class' => [],
427
+ 'type' => [],
428
+ 'value' => [],
429
+ 'name' => [],
430
+ 'id' => [],
431
+ 'checked' => [],
432
+ ],
433
+ 'ul' => [
434
+ 'class' => [],
435
+ ],
436
  ]
437
+ );
438
  echo wp_kses_post( '</ul>' );
439
  }
440
 
452
  $attributes = $field_settings['exclude'];
453
  $child_ids = [];
454
 
455
+ if ( ! empty( $attributes ) ) {
456
  foreach ( $attributes as $attr ) {
457
+ $terms = get_terms(
458
+ $field_settings['name'],
459
+ array(
460
+ 'hide_empty' => false,
461
+ 'parent' => $attr,
462
+ )
463
+ );
464
 
465
  foreach ( $terms as $term ) {
466
  array_push( $child_ids, $term->term_id );
473
  }
474
 
475
  $excludes = [
476
+ 'type' => $exclude_type,
477
+ 'childs' => $child_ids,
478
  ];
479
 
480
  return $excludes;
497
  $image_sizes = [];
498
 
499
  foreach ( $image_sizes_orig as $size ) {
500
+ $image_sizes[ $size ] = $size;
501
  }
502
 
503
  return $image_sizes;
505
 
506
  function wpuf_allowed_extensions() {
507
  $extesions = [
508
+ 'images' => [
509
+ 'ext' => 'jpg,jpeg,gif,png,bmp',
510
+ 'label' => __( 'Images', 'wp-user-frontend' ),
511
+ ],
512
+ 'audio' => [
513
+ 'ext' => 'mp3,wav,ogg,wma,mka,m4a,ra,mid,midi',
514
+ 'label' => __( 'Audio', 'wp-user-frontend' ),
515
+ ],
516
+ 'video' => [
517
+ 'ext' => 'avi,divx,flv,mov,ogv,mkv,mp4,m4v,divx,mpg,mpeg,mpe',
518
+ 'label' => __( 'Videos', 'wp-user-frontend' ),
519
+ ],
520
+ 'pdf' => [
521
+ 'ext' => 'pdf',
522
+ 'label' => __( 'PDF', 'wp-user-frontend' ),
523
+ ],
524
+ 'office' => [
525
+ 'ext' => 'doc,ppt,pps,xls,mdb,docx,xlsx,pptx,odt,odp,ods,odg,odc,odb,odf,rtf,txt',
526
+ 'label' => __( 'Office Documents', 'wp-user-frontend' ),
527
+ ],
528
+ 'zip' => [
529
+ 'ext' => 'zip,gz,gzip,rar,7z',
530
+ 'label' => __( 'Zip Archives', 'wp-user-frontend' ),
531
+ ],
532
+ 'exe' => [
533
+ 'ext' => 'exe',
534
+ 'label' => __( 'Executable Files', 'wp-user-frontend' ),
535
+ ],
536
+ 'csv' => [
537
+ 'ext' => 'csv',
538
+ 'label' => __( 'CSV', 'wp-user-frontend' ),
539
+ ],
540
  ];
541
 
542
  return apply_filters( 'wpuf_allowed_extensions', $extesions );
553
  $user = wp_get_current_user();
554
 
555
  if ( is_user_logged_in() ) {
556
+ $lock = ( 'yes' === $user->wpuf_postlock ) ? 'yes' : 'no';
557
 
558
+ if ( 'yes' === $lock ) {
559
  return $user->wpuf_lock_cause;
560
  }
561
  }
590
  * @param array args
591
  */
592
  function wpuf_update_post( $args ) {
593
+ if ( ! wp_is_post_revision( $args['ID'] ) ) {
594
  // unhook this function so it doesn't loop infinitely
595
  remove_action( 'save_post', [ WPUF_Admin_Posting::init(), 'save_meta' ], 1 );
596
 
612
  * @return array
613
  */
614
  function wpuf_get_user_roles() {
615
+ if ( ! function_exists( 'wp_roles' ) ) {
616
+ require_once ABSPATH . WPINC . '/capabilities.php';
617
+ $wp_roles = wp_roles();
618
+ } else {
619
+ $wp_roles = wp_roles();
620
  }
621
 
622
  return $wp_roles->get_names();
699
  if ( is_numeric( $id_or_email ) ) {
700
  $user = get_user_by( 'id', $id_or_email );
701
  } elseif ( is_object( $id_or_email ) ) {
702
+ if ( $id_or_email->user_id !== '0' ) {
703
  $user = get_user_by( 'id', $id_or_email->user_id );
704
  } else {
705
  return $avatar;
775
 
776
  $editor = wp_get_image_editor( $file_path );
777
 
778
+ if ( ! is_wp_error( $editor ) ) {
779
  $avatar_size = wpuf_get_option( 'avatar_size', 'wpuf_profile', '100x100' );
780
  $avatar_size = explode( 'x', $avatar_size );
781
  $avatar_width = $avatar_size[0];
794
  // delete any previous avatar
795
  $prev_avatar = get_user_meta( $user_id, 'user_avatar', true );
796
 
797
+ if ( ! empty( $prev_avatar ) ) {
798
  $prev_avatar_path = str_replace( $upload_dir['baseurl'], $upload_dir['basedir'], $prev_avatar );
799
 
800
  if ( file_exists( $prev_avatar_path ) ) {
820
  $return = [];
821
 
822
  foreach ( $gateways as $id => $gate ) {
823
+ if ( 'admin' === $context ) {
824
+ $return[ $id ] = $gate['admin_label'];
825
  } else {
826
+ $return[ $id ] = [
827
  'label' => $gate['checkout_label'],
828
  'icon' => isset( $gate['icon'] ) ? $gate['icon'] : '',
829
  ];
850
  function wpuf_show_custom_fields( $content ) {
851
  global $post;
852
 
853
+ $show_custom = wpuf_get_option( 'cf_show_front', 'wpuf_frontend_posting' );
854
 
855
+ if ( 'on' !== $show_custom ) {
856
  return $content;
857
  }
858
 
860
  $form_id = get_post_meta( $post->ID, '_wpuf_form_id', true );
861
  $form_settings = wpuf_get_form_settings( $form_id );
862
 
863
+ if ( ! $form_id ) {
864
  return $content;
865
  }
866
 
872
  if ( $form_vars ) {
873
  foreach ( $form_vars as $attr ) {
874
  // get column field input fields
875
+ if ( 'column_field' === $attr['input_type'] ) {
876
  $inner_fields = $attr['inner_fields'];
877
 
878
  foreach ( $inner_fields as $column_key => $column_fields ) {
879
+ if ( ! empty( $column_fields ) ) {
880
  // ignore section break and HTML input type
881
  foreach ( $column_fields as $column_field_key => $column_field ) {
882
+ if ( isset( $column_field['show_in_post'] ) && 'yes' === $column_field['show_in_post'] ) {
883
  $meta[] = $column_field;
884
  }
885
  }
888
  continue;
889
  }
890
 
891
+ if ( isset( $attr['show_in_post'] ) && 'yes' === $attr['show_in_post'] ) {
892
  $meta[] = $attr;
893
  }
894
  }
895
 
896
+ if ( ! $meta ) {
897
  return $content;
898
  }
899
 
900
  foreach ( $meta as $attr ) {
901
  $wpuf_field = wpuf()->fields->get_field( $attr['template'] );
902
 
903
+ if ( ! isset( $attr['name'] ) ) {
904
  $attr['name'] = $attr['input_type'];
905
  }
906
 
909
 
910
  $return_for_no_cond = 0;
911
 
912
+ if ( isset( $attr['wpuf_cond']['condition_status'] ) && 'yes' === $attr['wpuf_cond']['condition_status'] ) {
913
  foreach ( $attr['wpuf_cond']['cond_field'] as $field_key => $cond_field_name ) {
914
 
915
  //check if the conditional field is a taxonomy
922
  $cond_field_value[] = $term_array->term_id;
923
  }
924
  }
925
+ $cond_field_value = isset( $post_terms[0] ) ? $post_terms[0]->term_id : '';
926
  } else {
927
  $cond_field_value = get_post_meta( $post->ID, $cond_field_name, 'true' );
928
  }
929
 
930
+ if ( isset( $attr['wpuf_cond']['cond_option'][ $field_key ] ) ) {
931
  if ( is_array( $cond_field_value ) ) {
932
  continue;
933
  } else {
934
+ if ( (string) $attr['wpuf_cond']['cond_option'][ $field_key ] !== (string) $cond_field_value ) {
935
  $return_for_no_cond = 1;
936
  } else {
937
  $return_for_no_cond = 0;
942
  }
943
  }
944
 
945
+ if ( $return_for_no_cond === 1 ) {
946
  continue;
947
  }
948
 
949
+ if ( ! count( $field_value ) ) {
950
  continue;
951
  }
952
 
953
+ if ( 'hidden' === $attr['input_type'] ) {
954
  continue;
955
  }
956
 
962
  switch ( $attr['input_type'] ) {
963
  case 'image_upload':
964
  case 'file_upload':
965
+ $image_html = '<li style="list-style-type:none;">';
966
 
967
+ if ( 'no' === $hide_label ) {
968
  $image_html .= '<label>' . $attr['label'] . ':</label> ';
969
  }
970
 
978
  }
979
 
980
  foreach ( $field_value as $attachment_id ) {
981
+ if ( 'image_upload' === $attr['input_type'] ) {
982
  $image_size = wpuf_get_option( 'insert_photo_size', 'wpuf_frontend_posting', 'thumbnail' );
983
  $thumb = wp_get_attachment_image( $attachment_id, $image_size );
984
  } else {
996
  $allowed_video_extensions = explode( ',', $wpuf_allowed_extensions['video']['ext'] );
997
  $allowed_extenstions = array_merge( $allowed_audio_extensions, $allowed_video_extensions );
998
 
999
+ if ( 'yes' === $playable && in_array( $extension, $allowed_extenstions, true ) ) {
1000
+ $is_video = in_array( $extension, $allowed_video_extensions, true );
1001
+ $is_audio = in_array( $extension, $allowed_audio_extensions, true );
1002
  $preview_width = isset( $attr['preview_width'] ) ? $attr['preview_width'] : '123';
1003
  $preview_height = isset( $attr['preview_height'] ) ? $attr['preview_height'] : '456';
1004
 
1017
  $image_html .= sprintf( '<a href="%s">%s</a> ', $full_size, $thumb );
1018
  }
1019
 
1020
+ if ( 'on' === $show_caption ) {
1021
  $post_detail = get_post( $attachment_id );
1022
 
1023
+ if ( ! empty( $post_detail->post_title ) ) {
1024
  $image_html .= '<br /><label>' . __( 'Title', 'wp-user-frontend' ) . ':</label> <span class="image_title">' . esc_html( $post_detail->post_title ) . '</span>';
1025
  }
1026
 
1027
+ if ( ! empty( $post_detail->post_excerpt ) ) {
1028
  $image_html .= '<br /><label>' . __( 'Caption', 'wp-user-frontend' ) . ':</label> <span class="image_caption">' . esc_html( $post_detail->post_excerpt ) . '</span>';
1029
  }
1030
 
1031
+ if ( ! empty( $post_detail->post_content ) ) {
1032
  $image_html .= '<br /><label>' . __( 'Description', 'wp-user-frontend' ) . ':</label> <span class="image_description">' . esc_html( $post_detail->post_content ) . '</span>';
1033
  }
1034
  }
1050
  <div>
1051
  <a class="btn btn-brand btn-sm" href="https://www.google.com/maps/dir/?api=1&amp;destination=<?php echo esc_attr( $def_lat ); ?>,<?php echo esc_attr( $def_long ); ?>" target="_blank" rel="nofollow external"><?php esc_html_e( 'Directions »', 'wp-user-frontend' ); ?></a>
1052
  </div>
1053
+ <?php
1054
  }
1055
 
1056
  $html .= ob_get_clean();
1063
 
1064
  if ( isset( $field_value[0] ) && is_array( $field_value[0] ) ) {
1065
  foreach ( $field_value[0] as $field_key => $value ) {
1066
+ if ( 'country_select' === $field_key ) {
1067
+ if ( isset( $countries[ $value ] ) ) {
1068
+ $value = $countries[ $value ];
1069
  }
1070
  }
1071
 
1072
  $address_html .= '<li>';
1073
 
1074
+ if ( 'no' === $hide_label ) {
1075
+ $address_html .= '<label>' . $attr['address'][ $field_key ]['label'] . ': </label> ';
1076
  }
1077
 
1078
  $address_html .= ' ' . $value . '</li>';
1097
  if ( $new ) {
1098
  $html .= '<li>';
1099
 
1100
+ if ( 'no' === $hide_label ) {
1101
  $html .= '<label>' . $attr['label'] . ': </label>';
1102
  }
1103
 
1112
  break;
1113
  }
1114
 
1115
+ if ( 'embed' === $attr['template'] ) {
1116
  global $wp_embed;
1117
 
1118
  $preview_width = isset( $attr['preview_width'] ) ? $attr['preview_width'] : '123';
1119
  $preview_height = isset( $attr['preview_height'] ) ? $attr['preview_height'] : '456';
1120
  $shortcode = '[embed width="' . $preview_width . '" height="' . $preview_height . '"]' . $value . '[/embed]';
1121
 
1122
+ $preview = '<li>';
1123
 
1124
+ if ( 'no' === $hide_label ) {
1125
  $preview .= sprintf( '<label>%s: </label>', $attr['label'] );
1126
  }
1127
 
1134
  break;
1135
  }
1136
 
1137
+ $open_in = 'same' === $attr['open_window'] ? '' : '_blank';
1138
 
1139
+ $link = '<li>';
1140
 
1141
+ if ( 'no' === $hide_label ) {
1142
  $link .= '<label>' . $attr['label'] . ':</label>';
1143
  }
1144
 
1152
 
1153
  $html .= '<li>';
1154
 
1155
+ if ( 'no' === $hide_label ) {
1156
  $html .= '<label>' . $attr['label'] . ':</label>';
1157
  }
1158
 
1170
 
1171
  $html .= '<li>';
1172
 
1173
+ if ( 'no' === $hide_label ) {
1174
  $html .= '<label>' . $attr['label'] . ':</label>';
1175
  }
1176
 
1182
  $filter_html = apply_filters( 'wpuf_custom_field_render', '', $value, $attr, $form_settings );
1183
  $separator = ' | ';
1184
 
1185
+ if ( ! empty( $filter_html ) ) {
1186
  $html .= $filter_html;
1187
  } elseif ( is_serialized( $value[0] ) ) {
1188
  $new = maybe_unserialize( $value[0] );
1191
  if ( $modified_value ) {
1192
  $html .= '<li>';
1193
 
1194
+ if ( 'no' === $hide_label ) {
1195
  $html .= '<label>' . $attr['label'] . ':</label>';
1196
  }
1197
 
1198
  $html .= sprintf( ' %s</li>', make_clickable( $modified_value ) );
1199
  }
1200
+ } elseif ( ( 'checkbox' === $attr['input_type'] || 'multiselect' === $attr['input_type'] ) && is_array( $value[0] ) ) {
1201
+ if ( ! empty( $value[0] ) ) {
1202
  $modified_value = implode( $separator, $value[0] );
1203
 
1204
  if ( $modified_value ) {
1205
  $html .= '<li>';
1206
 
1207
+ if ( 'no' === $hide_label ) {
1208
  $html .= '<label>' . $attr['label'] . ':</label>';
1209
  }
1210
 
1217
  if ( $new ) {
1218
  $html .= '<li>';
1219
 
1220
+ if ( 'no' === $hide_label ) {
1221
  $html .= '<label>' . $attr['label'] . ':</label>';
1222
  }
1223
 
1245
  * @param array $args
1246
  */
1247
  function wpuf_shortcode_map( $location, $post_id = null, $args = [], $meta_key = '' ) {
1248
+ if ( ! wpuf()->is_pro() || ! $location ) {
1249
  return;
1250
  }
1251
 
1258
  return;
1259
  }
1260
 
1261
+ $default = [
1262
+ 'width' => 450,
1263
+ 'height' => 250,
1264
+ 'zoom' => 12,
1265
+ ];
1266
  $args = wp_parse_args( $args, $default );
1267
 
1268
  if ( is_array( $location ) ) {
1274
  list( $def_lat, $def_long ) = explode( ',', $location );
1275
  $def_lat = $def_lat ? $def_lat : 0;
1276
  $def_long = $def_long ? $def_long : 0;
1277
+ }
1278
+ ?>
1279
 
1280
  <div class="google-map" style="margin: 10px 0; height: <?php echo esc_attr( $args['height'] ); ?>px; width: <?php echo esc_attr( $args['width'] ); ?>px;" id="wpuf-map-<?php echo esc_attr( $meta_key . $post->ID ); ?>"></div>
1281
 
1324
  function wpuf_shortcode_map_post( $meta_key, $post_id = null, $args = [] ) {
1325
  global $post;
1326
 
1327
+ if ( ! $post_id ) {
1328
  $post_id = $post->ID;
1329
  }
1330
 
1335
  function wpuf_meta_shortcode( $atts ) {
1336
  global $post;
1337
 
1338
+ $attrs = shortcode_atts(
1339
+ [
1340
+ 'name' => '',
1341
+ 'type' => 'normal',
1342
+ 'size' => 'thumbnail',
1343
+ 'height' => 250,
1344
+ 'width' => 450,
1345
+ 'zoom' => 12,
1346
+ ], $atts
1347
+ );
1348
+
1349
+ $name = $attrs['name'];
1350
+ $type = $attrs['type'];
1351
+ $size = $attrs['size'];
1352
+ $width = $attrs['width'];
1353
+ $height = $attrs['height'];
1354
+ $zoom = $attrs['zoom'];
1355
 
1356
  if ( empty( $name ) ) {
1357
  return;
1358
  }
1359
 
1360
+ if ( 'image' === $type || 'file' === $type ) {
1361
  $images = get_post_meta( $post->ID, $name, true );
1362
 
1363
  if ( ! is_array( $images ) ) {
1368
  $html = '';
1369
 
1370
  foreach ( $images as $attachment_id ) {
1371
+ if ( 'image' === $type ) {
1372
  $thumb = wp_get_attachment_image( $attachment_id, $size );
1373
  } else {
1374
  $thumb = get_post_field( 'post_title', $attachment_id );
1380
 
1381
  return $html;
1382
  }
1383
+ } elseif ( 'map' === $type ) {
1384
  ob_start();
1385
+ wpuf_shortcode_map(
1386
+ $name, $post->ID, [
1387
+ 'width' => $width,
1388
+ 'height' => $height,
1389
+ 'zoom' => $zoom,
1390
+ ]
1391
+ );
1392
 
1393
  return ob_get_clean();
1394
+ } elseif ( 'repeat' === $type ) {
1395
  return implode( '; ', get_post_meta( $post->ID, $name ) );
1396
+ } elseif ( 'normal' === $type ) {
1397
  return implode( ', ', get_post_meta( $post->ID, $name ) );
1398
  } else {
1399
  return make_clickable( implode( ', ', get_post_meta( $post->ID, $name ) ) );
1414
  function wpuf_get_option( $option, $section, $default = '' ) {
1415
  $options = get_option( $section );
1416
 
1417
+ if ( isset( $options[ $option ] ) ) {
1418
+ return $options[ $option ];
1419
  }
1420
 
1421
  return $default;
1422
  }
1423
 
1424
  /**
1425
+ * Check the current post for the existence of a short code
1426
  *
1427
  * @see http://wp.tutsplus.com/articles/quick-tip-improving-shortcodes-with-the-has_shortcode-function/
1428
  *
1431
  * @return bool
1432
  */
1433
  function wpuf_has_shortcode( $shortcode = '', $post_id = false ) {
1434
+ $post_to_check = ( false === $post_id ) ? get_post( get_the_ID() ) : get_post( $post_id );
1435
 
1436
+ if ( ! $post_to_check ) {
1437
  return false;
1438
  }
1439
 
1441
  $found = false;
1442
 
1443
  // if no short code was provided, return false
1444
+ if ( ! $shortcode ) {
1445
  return $found;
1446
  }
1447
 
1472
  $attachment_id = false;
1473
 
1474
  // If there is no url, return.
1475
+ if ( '' === $attachment_url ) {
1476
  return;
1477
  }
1478
 
1489
  $attachment_url = str_replace( $upload_dir_paths['baseurl'] . '/', '', $attachment_url );
1490
 
1491
  // Finally, run a custom database query to get the attachment ID from the modified attachment URL
1492
+ $attachment_id = $wpdb->get_var( $wpdb->prepare( "SELECT wposts.ID FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta WHERE wposts.ID = wpostmeta.post_id AND wpostmeta.meta_key = '_wp_attached_file' AND wpostmeta.meta_value = %s AND wposts.post_type = 'attachment'", $attachment_url ) );
1493
  }
1494
 
1495
  return $attachment_id;
1506
  global $wpdb;
1507
 
1508
  $taxonomy = isset( $_GET['tax'] ) ? sanitize_text_field( wp_unslash( $_GET['tax'] ) ) : '';
1509
+ $term_ids = isset( $_GET['term_ids'] ) ? sanitize_text_field( wp_unslash( $_GET['term_ids'] ) ) : '';
1510
  $tax = get_taxonomy( $taxonomy );
1511
 
1512
+ if ( ! $tax ) {
1513
  wp_die( 0 );
1514
  }
1515
 
1523
 
1524
  if ( false !== strpos( $s, ',' ) ) {
1525
  $s = explode( ',', $s );
1526
+ $s = $s[ count( $s ) - 1 ];
1527
  }
1528
 
1529
  $s = trim( $s );
1532
  wp_die();
1533
  } // require 2 chars for matching
1534
 
 
 
1535
  if ( ! empty( $term_ids ) ) {
1536
+ //phpcs:disable
1537
  $results = $wpdb->get_col( $wpdb->prepare( "SELECT t.name FROM $wpdb->term_taxonomy AS tt INNER JOIN $wpdb->terms AS t ON tt.term_id = t.term_id WHERE tt.taxonomy = %s AND t.term_id IN ($term_ids) AND t.name LIKE (%s)", $taxonomy, '%' . $wpdb->esc_like( $s ) . '%' ) );
1538
  } else {
1539
  $results = $wpdb->get_col( $wpdb->prepare( "SELECT t.name FROM $wpdb->term_taxonomy AS tt INNER JOIN $wpdb->terms AS t ON tt.term_id = t.term_id WHERE tt.taxonomy = %s AND t.name LIKE (%s)", $taxonomy, '%' . $wpdb->esc_like( $s ) . '%' ) );
1540
  }
 
 
1541
  echo esc_html( join( $results, "\n" ) );
1542
  wp_die();
1543
  }
1574
  * @param string $file file name or path to file
1575
  */
1576
  function wpuf_load_template( $file, $args = [] ) {
 
 
 
 
1577
  $child_theme_dir = get_stylesheet_directory() . '/wpuf/';
1578
  $parent_theme_dir = get_template_directory() . '/wpuf/';
1579
  $wpuf_dir = WPUF_ROOT . '/templates/';
1598
  * @param string $file file name or path to file
1599
  */
1600
  function wpuf_load_pro_template( $file, $args = [] ) {
 
 
 
 
1601
  if ( wpuf()->is_pro() ) {
1602
  $child_theme_dir = get_stylesheet_directory() . '/wpuf/';
1603
  $parent_theme_dir = get_template_directory() . '/wpuf/';
1674
  * @return array
1675
  */
1676
  function wpuf_get_form_fields( $form_id ) {
1677
+ $fields = get_children(
1678
+ [
1679
+ 'post_parent' => $form_id,
1680
+ 'post_status' => 'publish',
1681
+ 'post_type' => 'wpuf_input',
1682
+ 'numberposts' => '-1',
1683
+ 'orderby' => 'menu_order',
1684
+ 'order' => 'ASC',
1685
+ ]
1686
+ );
1687
 
1688
  $form_fields = [];
1689
 
1695
  // Add inline property for radio and checkbox fields
1696
  $inline_supported_fields = [ 'radio', 'checkbox' ];
1697
 
1698
+ if ( in_array( $field['input_type'], $inline_supported_fields, true ) ) {
1699
+ if ( ! isset( $field['inline'] ) ) {
1700
  $field['inline'] = 'no';
1701
  }
1702
  }
1704
  // Add 'selected' property
1705
  $option_based_fields = [ 'select', 'multiselect', 'radio', 'checkbox' ];
1706
 
1707
+ if ( in_array( $field['input_type'], $option_based_fields, true ) ) {
1708
+ if ( ! isset( $field['selected'] ) ) {
1709
  if ( 'select' === $field['input_type'] || 'radio' === $field['input_type'] ) {
1710
  $field['selected'] = '';
1711
  } else {
1715
  }
1716
 
1717
  // Add 'multiple' key for input_type:repeat
1718
+ if ( 'repeat' === $field['input_type'] && ! isset( $field['multiple'] ) ) {
1719
  $field['multiple'] = '';
1720
  }
1721
 
1737
  * Returns child category dropdown on ajax request
1738
  */
1739
  function wpuf_get_child_cats() {
 
1740
  $nonce = isset( $_REQUEST['_wpnonce'] ) ? sanitize_key( wp_unslash( $_REQUEST['_wpnonce'] ) ) : '';
1741
 
1742
+ $parent_cat = isset( $_POST['catID'] ) ? sanitize_text_field( wp_unslash( $_POST['catID'] ) ) : '';
1743
+ $field_attr = isset( $_POST['field_attr'] ) ? array_map( 'sanitize_text_field', wp_unslash( $_POST['field_attr'] ) ) : [];
1744
 
1745
+ check_ajax_referer( 'wpuf_nonce' );
1746
 
 
1747
  $allowed_tags = wp_kses_allowed_html( 'post' );
1748
 
1749
+ $taxonomy = $field_attr['name'];
 
1750
 
1751
  $terms = null;
1752
  $result = '';
1753
 
1754
+ if ( $parent_cat < 1 ) {
1755
  die( wp_kses( $result, $allowed_tags ) );
1756
  }
1757
 
1758
+ $terms = get_categories( 'taxonomy=' . $taxonomy . '&child_of=' . $parent_cat . '&hide_empty=0' );
1759
+
1760
+ if ( $terms ) {
1761
+ $field_attr['parent_cat'] = $parent_cat;
1762
 
1763
  if ( is_array( $terms ) ) {
1764
  foreach ( $terms as $key => $term ) {
1765
+ $terms[ $key ] = (array) $term;
1766
  }
1767
  }
1768
 
1769
+ $field_attr['form_id'] = isset( $_POST['form_id'] ) ? absint( $_POST['form_id'] ) : 0;
1770
 
1771
  $result .= taxnomy_select( '', $field_attr );
 
1772
  } else {
1773
  die( '' );
1774
  }
1782
  $exclude_type = isset( $attr['exclude_type'] ) ? $attr['exclude_type'] : 'exclude';
1783
  $exclude = isset( $attr['exclude'] ) ? $attr['exclude'] : '';
1784
 
1785
+ $dataset = sprintf(
1786
  'data-required="%s" data-type="select" data-form-id="%d"',
1787
  $attr['required'],
1788
  $attr['form_id']
1789
+ );
1790
 
1791
+ if ( 'child_of' === $exclude_type && ! empty( $exclude ) ) {
1792
  $exclude = $exclude[0];
1793
  }
1794
 
1795
+ $tax_args = [
1796
  'show_option_none' => __( '-- Select --', 'wp-user-frontend' ),
1797
  'hierarchical' => 1,
1798
  'hide_empty' => 0,
1824
  //'last_term_id' => isset( $attr['parent_cat'] ) ? $attr['parent_cat'] : '',
1825
  //'term_id' => $selected
1826
  ];
1827
+ $attr = apply_filters( 'wpuf_taxonomy_checklist_args', $attr );
1828
+ ?>
1829
  <span data-taxonomy=<?php echo json_encode( $attr ); ?>></span>
1830
  <?php
1831
  }
1852
  * @return array
1853
  */
1854
  function wpuf_get_form_notifications( $form_id ) {
1855
+ $notifications = get_post_meta( $form_id, 'notifications', true );
1856
 
1857
+ if ( ! $notifications ) {
1858
  return [];
1859
  }
1860
 
1871
  * @return array
1872
  */
1873
  function wpuf_get_form_integrations( $form_id ) {
1874
+ $integrations = get_post_meta( $form_id, 'integrations', true );
1875
 
1876
+ if ( ! $integrations ) {
1877
  return [];
1878
  }
1879
 
1893
  function wpuf_is_integration_active( $form_id, $integration_id ) {
1894
  $integrations = wpuf_get_form_integrations( $form_id );
1895
 
1896
+ if ( ! $integrations ) {
1897
  return false;
1898
  }
1899
 
1900
  foreach ( $integrations as $id => $integration ) {
1901
+ if ( $integration_id === $id && $integration->enabled === true ) {
1902
  return $integration;
1903
  }
1904
  }
1920
  /**
1921
  * Clear the buffer
1922
  *
1923
+ * Prevents ajax breakage and endless loading icon. A LIFE SAVER!!!
1924
  *
1925
  * @return void
1926
  */
1938
  function wpuf_is_license_expired() {
1939
  $remote_addr = isset( $_SERVER['REMOTE_ADDR'] ) ? sanitize_text_field( wp_unslash( $_SERVER['REMOTE_ADDR'] ) ) : '';
1940
 
1941
+ if ( in_array( $remote_addr, [ '127.0.0.1', '::1' ], true ) ) {
1942
  return false;
1943
  }
1944
 
1945
  $license_status = get_option( 'wpuf_license_status' );
1946
 
1947
  // seems like this wasn't activated at all
1948
+ if ( ! isset( $license_status->update ) ) {
1949
  return false;
1950
  }
1951
 
1990
  function wpuf_get_countries( $type = 'array' ) {
1991
  $countries = include __DIR__ . '/includes/countries-formated.php';
1992
 
1993
+ if ( 'json' === $type ) {
1994
  $countries = json_encode( $countries );
1995
  }
1996
 
2006
  */
2007
  function wpuf_get_account_sections() {
2008
  $account_sections = [
2009
+ [
2010
+ 'slug' => 'dashboard',
2011
+ 'label' => __( 'Dashboard', 'wp-user-frontend' ),
2012
+ ],
2013
+ [
2014
+ 'slug' => 'posts',
2015
+ 'label' => __( 'Posts', 'wp-user-frontend' ),
2016
+ ],
2017
+ [
2018
+ 'slug' => 'edit-profile',
2019
+ 'label' => __( 'Edit Profile', 'wp-user-frontend' ),
2020
+ ],
2021
+ [
2022
+ 'slug' => 'subscription',
2023
+ 'label' => __( 'Subscription', 'wp-user-frontend' ),
2024
+ ],
2025
+ [
2026
+ 'slug' => 'billing-address',
2027
+ 'label' => __( 'Billing Address', 'wp-user-frontend' ),
2028
+ ],
2029
  ];
2030
 
2031
  return apply_filters( 'wpuf_account_sections', $account_sections );
2044
 
2045
  if ( $sections ) {
2046
  foreach ( $sections as $section ) {
2047
+ $array[ $section['slug'] ] = esc_attr( $section['label'] );
2048
  }
2049
  }
2050
 
2073
  if ( $args['count'] ) {
2074
  return $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->prefix}wpuf_transaction" );
2075
  }
2076
+ //phpcs:ignore
2077
  $result = $wpdb->get_results( "SELECT * FROM {$wpdb->prefix}wpuf_transaction ORDER BY `{$args['orderby']}` {$args['order']} LIMIT {$args['offset']}, {$args['number']}", OBJECT );
2078
 
2079
  return $result;
2127
  'status' => 'pending',
2128
  'cost' => $info['price'],
2129
  'tax' => isset( $info['tax'] ) ? $info['tax'] : 0,
2130
+ 'post_id' => ( $info['type'] === 'post' ) ? $info['item_number'] : 0,
2131
+ 'pack_id' => ( $info['type'] === 'pack' ) ? $info['item_number'] : 0,
2132
  'payer_first_name' => $info['user_info']['first_name'],
2133
  'payer_last_name' => $info['user_info']['last_name'],
2134
  'payer_email' => $info['user_info']['email'],
2135
+ 'payment_type' => ( $info['post_data']['wpuf_payment_method'] === 'bank' ) ? 'Bank/Manual' : ucwords( $info['post_data']['wpuf_payment_method'] ),
2136
  'transaction_id' => 0,
2137
  'created' => $info['date'],
2138
  ];
2152
  */
2153
  function wpuf_get_currencies() {
2154
  $currencies = [
2155
+ [
2156
+ 'currency' => 'AED',
2157
+ 'label' => __( 'United Arab Emirates Dirham', 'wp-user-frontend' ),
2158
+ 'symbol' => 'د.إ',
2159
+ ],
2160
+ [
2161
+ 'currency' => 'AUD',
2162
+ 'label' => __( 'Australian Dollars', 'wp-user-frontend' ),
2163
+ 'symbol' => '&#36;',
2164
+ ],
2165
+ [
2166
+ 'currency' => 'AZD',
2167
+ 'label' => __( 'Argentine Peso', 'wp-user-frontend' ),
2168
+ 'symbol' => '&#36;',
2169
+ ],
2170
+ [
2171
+ 'currency' => 'BDT',
2172
+ 'label' => __( 'Bangladeshi Taka', 'wp-user-frontend' ),
2173
+ 'symbol' => '&#2547;',
2174
+ ],
2175
+ [
2176
+ 'currency' => 'BRL',
2177
+ 'label' => __( 'Brazilian Real', 'wp-user-frontend' ),
2178
+ 'symbol' => '&#82;&#36;',
2179
+ ],
2180
+ [
2181
+ 'currency' => 'BGN',
2182
+ 'label' => __( 'Bulgarian Lev', 'wp-user-frontend' ),
2183
+ 'symbol' => '&#1083;&#1074;.',
2184
+ ],
2185
+ [
2186
+ 'currency' => 'CAD',
2187
+ 'label' => __( 'Canadian Dollars', 'wp-user-frontend' ),
2188
+ 'symbol' => '&#36;',
2189
+ ],
2190
+ [
2191
+ 'currency' => 'CLP',
2192
+ 'label' => __( 'Chilean Peso', 'wp-user-frontend' ),
2193
+ 'symbol' => '&#36;',
2194
+ ],
2195
+ [
2196
+ 'currency' => 'CNY',
2197
+ 'label' => __( 'Chinese Yuan', 'wp-user-frontend' ),
2198
+ 'symbol' => '&yen;',
2199
+ ],
2200
+ [
2201
+ 'currency' => 'COP',
2202
+ 'label' => __( 'Colombian Peso', 'wp-user-frontend' ),
2203
+ 'symbol' => '&#36;',
2204
+ ],
2205
+ [
2206
+ 'currency' => 'CZK',
2207
+ 'label' => __( 'Czech Koruna', 'wp-user-frontend' ),
2208
+ 'symbol' => '&#75;&#269;',
2209
+ ],
2210
+ [
2211
+ 'currency' => 'DKK',
2212
+ 'label' => __( 'Danish Krone', 'wp-user-frontend' ),
2213
+ 'symbol' => 'kr.',
2214
+ ],
2215
+ [
2216
+ 'currency' => 'DOP',
2217
+ 'label' => __( 'Dominican Peso', 'wp-user-frontend' ),
2218
+ 'symbol' => 'RD&#36;',
2219
+ ],
2220
+ [
2221
+ 'currency' => 'DZD',
2222
+ 'label' => __( 'Algerian Dinar', 'wp-user-frontend' ),
2223
+ 'symbol' => 'DA;',
2224
+ ],
2225
+ [
2226
+ 'currency' => 'EUR',
2227
+ 'label' => __( 'Euros', 'wp-user-frontend' ),
2228
+ 'symbol' => '&euro;',
2229
+ ],
2230
+ [
2231
+ 'currency' => 'HKD',
2232
+ 'label' => __( 'Hong Kong Dollar', 'wp-user-frontend' ),
2233
+ 'symbol' => '&#36;',
2234
+ ],
2235
+ [
2236
+ 'currency' => 'HRK',
2237
+ 'label' => __( 'Croatia kuna', 'wp-user-frontend' ),
2238
+ 'symbol' => 'Kn',
2239
+ ],
2240
+ [
2241
+ 'currency' => 'HUF',
2242
+ 'label' => __( 'Hungarian Forint', 'wp-user-frontend' ),
2243
+ 'symbol' => '&#70;&#116;',
2244
+ ],
2245
+ [
2246
+ 'currency' => 'ISK',
2247
+ 'label' => __( 'Icelandic krona', 'wp-user-frontend' ),
2248
+ 'symbol' => 'Kr.',
2249
+ ],
2250
+ [
2251
+ 'currency' => 'IDR',
2252
+ 'label' => __( 'Indonesia Rupiah', 'wp-user-frontend' ),
2253
+ 'symbol' => 'Rp',
2254
+ ],
2255
+ [
2256
+ 'currency' => 'INR',
2257
+ 'label' => __( 'Indian Rupee', 'wp-user-frontend' ),
2258
+ 'symbol' => '&#8377;',
2259
+ ],
2260
+ [
2261
+ 'currency' => 'NPR',
2262
+ 'label' => __( 'Nepali Rupee', 'wp-user-frontend' ),
2263
+ 'symbol' => 'Rs.',
2264
+ ],
2265
+ [
2266
+ 'currency' => 'ILS',
2267
+ 'label' => __( 'Israeli Shekel', 'wp-user-frontend' ),
2268
+ 'symbol' => '&#8362;',
2269
+ ],
2270
+ [
2271
+ 'currency' => 'JPY',
2272
+ 'label' => __( 'Japanese Yen', 'wp-user-frontend' ),
2273
+ 'symbol' => '&yen;',
2274
+ ],
2275
+ [
2276
+ 'currency' => 'KIP',
2277
+ 'label' => __( 'Lao Kip', 'wp-user-frontend' ),
2278
+ 'symbol' => '&#8365;',
2279
+ ],
2280
+ [
2281
+ 'currency' => 'KRW',
2282
+ 'label' => __( 'South Korean Won', 'wp-user-frontend' ),
2283
+ 'symbol' => '&#8361;',
2284
+ ],
2285
+ [
2286
+ 'currency' => 'MYR',
2287
+ 'label' => __( 'Malaysian Ringgits', 'wp-user-frontend' ),
2288
+ 'symbol' => '&#82;&#77;',
2289
+ ],
2290
+ [
2291
+ 'currency' => 'MXN',
2292
+ 'label' => __( 'Mexican Peso', 'wp-user-frontend' ),
2293
+ 'symbol' => '&#36;',
2294
+ ],
2295
+ [
2296
+ 'currency' => 'NGN',
2297
+ 'label' => __( 'Nigerian Naira', 'wp-user-frontend' ),
2298
+ 'symbol' => '&#8358;',
2299
+ ],
2300
+ [
2301
+ 'currency' => 'NOK',
2302
+ 'label' => __( 'Norwegian Krone', 'wp-user-frontend' ),
2303
+ 'symbol' => '&#107;&#114;',
2304
+ ],
2305
+ [
2306
+ 'currency' => 'NZD',
2307
+ 'label' => __( 'New Zealand Dollar', 'wp-user-frontend' ),
2308
+ 'symbol' => '&#36;',
2309
+ ],
2310
+ [
2311
+ 'currency' => 'NAD',
2312
+ 'label' => __( 'Namibian dollar', 'wp-user-frontend' ),
2313
+ 'symbol' => 'N&#36;',
2314
+ ],
2315
+ [
2316
+ 'currency' => 'OMR',
2317
+ 'label' => __( 'Omani Rial', 'wp-user-frontend' ),
2318
+ 'symbol' => 'ر.ع.',
2319
+ ],
2320
+ [
2321
+ 'currency' => 'IRR',
2322
+ 'label' => __( 'Iranian Rial', 'wp-user-frontend' ),
2323
+ 'symbol' => '﷼',
2324
+ ],
2325
+ [
2326
+ 'currency' => 'PKR',
2327
+ 'label' => __( 'Pakistani Rupee', 'wp-user-frontend' ),
2328
+ 'symbol' => 'Rs',
2329
+ ],
2330
+ [
2331
+ 'currency' => 'PYG',
2332
+ 'label' => __( 'Paraguayan Guaraní', 'wp-user-frontend' ),
2333
+ 'symbol' => '&#8370;',
2334
+ ],
2335
+ [
2336
+ 'currency' => 'PHP',
2337
+ 'label' => __( 'Philippine Pesos', 'wp-user-frontend' ),
2338
+ 'symbol' => '&#8369;',
2339
+ ],
2340
+ [
2341
+ 'currency' => 'PLN',
2342
+ 'label' => __( 'Polish Zloty', 'wp-user-frontend' ),
2343
+ 'symbol' => '&#122;&#322;',
2344
+ ],
2345
+ [
2346
+ 'currency' => 'GBP',
2347
+ 'label' => __( 'Pounds Sterling', 'wp-user-frontend' ),
2348
+ 'symbol' => '&pound;',
2349
+ ],
2350
+ [
2351
+ 'currency' => 'RON',
2352
+ 'label' => __( 'Romanian Leu', 'wp-user-frontend' ),
2353
+ 'symbol' => 'lei',
2354
+ ],
2355
+ [
2356
+ 'currency' => 'RUB',
2357
+ 'label' => __( 'Russian Ruble', 'wp-user-frontend' ),
2358
+ 'symbol' => '&#1088;&#1091;&#1073;.',
2359
+ ],
2360
+ [
2361
+ 'currency' => 'SR',
2362
+ 'label' => __( 'Saudi Riyal', 'wp-user-frontend' ),
2363
+ 'symbol' => 'SR',
2364
+ ],
2365
+ [
2366
+ 'currency' => 'SGD',
2367
+ 'label' => __( 'Singapore Dollar', 'wp-user-frontend' ),
2368
+ 'symbol' => '&#36;',
2369
+ ],
2370
+ [
2371
+ 'currency' => 'ZAR',
2372
+ 'label' => __( 'South African rand', 'wp-user-frontend' ),
2373
+ 'symbol' => '&#82;',
2374
+ ],
2375
+ [
2376
+ 'currency' => 'SEK',
2377
+ 'label' => __( 'Swedish Krona', 'wp-user-frontend' ),
2378
+ 'symbol' => '&#107;&#114;',
2379
+ ],
2380
+ [
2381
+ 'currency' => 'CHF',
2382
+ 'label' => __( 'Swiss Franc', 'wp-user-frontend' ),
2383
+ 'symbol' => '&#67;&#72;&#70;',
2384
+ ],
2385
+ [
2386
+ 'currency' => 'TWD',
2387
+ 'label' => __( 'Taiwan New Dollars', 'wp-user-frontend' ),
2388
+ 'symbol' => '&#78;&#84;&#36;',
2389
+ ],
2390
+ [
2391
+ 'currency' => 'THB',
2392
+ 'label' => __( 'Thai Baht', 'wp-user-frontend' ),
2393
+ 'symbol' => '&#3647;',
2394
+ ],
2395
+ [
2396
+ 'currency' => 'TRY',
2397
+ 'label' => __( 'Turkish Lira', 'wp-user-frontend' ),
2398
+ 'symbol' => '&#8378;',
2399
+ ],
2400
+ [
2401
+ 'currency' => 'USD',
2402
+ 'label' => __( 'US Dollar', 'wp-user-frontend' ),
2403
+ 'symbol' => '&#36;',
2404
+ ],
2405
+ [
2406
+ 'currency' => 'VND',
2407
+ 'label' => __( 'Vietnamese Dong', 'wp-user-frontend' ),
2408
+ 'symbol' => '&#8363;',
2409
+ ],
2410
+ [
2411
+ 'currency' => 'EGP',
2412
+ 'label' => __( 'Egyptian Pound', 'wp-user-frontend' ),
2413
+ 'symbol' => 'EGP',
2414
+ ],
2415
+ [
2416
+ 'currency' => 'JOD',
2417
+ 'label' => __( 'Jordanian dinar', 'wp-user-frontend' ),
2418
+ 'symbol' => 'د.أ',
2419
+ ],
2420
  ];
2421
 
2422
  return apply_filters( 'wpuf_currencies', $currencies );
2434
  function wpuf_get_currency( $type = '' ) {
2435
  $currency_code = wpuf_get_option( 'currency', 'wpuf_payment', 'USD' );
2436
 
2437
+ if ( 'code' === $type ) {
2438
  return $currency_code;
2439
  }
2440
 
2441
  $currencies = wpuf_get_currencies();
2442
+ $index = array_search( $currency_code, array_column( $currencies, 'currency' ), true );
2443
  $currency = $currencies[ $index ];
2444
 
2445
+ if ( 'symbol' === $type ) {
2446
  return $currency['symbol'];
2447
  }
2448
 
2461
  switch ( $currency_pos ) {
2462
  case 'left':
2463
  $format = '%1$s%2$s';
2464
+ break;
2465
 
2466
  case 'right':
2467
  $format = '%2$s%1$s';
2468
+ break;
2469
 
2470
  case 'left_space':
2471
  $format = '%1$s&nbsp;%2$s';
2472
+ break;
2473
 
2474
  case 'right_space':
2475
  $format = '%2$s&nbsp;%1$s';
2476
+ break;
2477
  }
2478
 
2479
  return apply_filters( 'wpuf_price_format', $format, $currency_pos );
2538
  * @return mixed
2539
  */
2540
  function wpuf_format_price( $price, $formated = true, $args = [] ) {
 
 
 
 
 
 
 
2541
 
2542
+ $price_args = apply_filters(
2543
+ 'wpuf_price_args', wp_parse_args(
2544
+ $args, [
2545
+ 'currency' => $formated ? wpuf_get_currency( 'symbol' ) : '',
2546
+ 'decimal_separator' => wpuf_get_price_decimal_separator(),
2547
+ 'thousand_separator' => $formated ? wpuf_get_price_thousand_separator() : '',
2548
+ 'decimals' => wpuf_get_price_decimals(),
2549
+ 'price_format' => get_wpuf_price_format(),
2550
+ ]
2551
+ )
2552
+ );
2553
+
2554
+ $currency = $price_args['currency'];
2555
+ $decimal_separator = $price_args['decimal_separator'];
2556
+ $thousand_separator = $price_args['thousand_separator'];
2557
+ $decimals = $price_args['decimals'];
2558
+ $price_format = $price_args['price_format'];
2559
  $negative = $price < 0;
2560
  $price = apply_filters( 'wpuf_raw_price', floatval( $negative ? $price * -1 : $price ) );
2561
  $price = apply_filters( 'wpuf_formatted_price', number_format( $price, $decimals, $decimal_separator, $thousand_separator ), $price, $decimals, $decimal_separator, $thousand_separator );
2574
  *
2575
  * @since 2.4.3
2576
  */
2577
+ if ( ! function_exists( 'array_column' ) ) {
2578
  function array_column( $input, $column_key, $index_key = null ) {
2579
  $result = [];
2580
 
2598
  function wpuf_duplicate_form( $post_id ) {
2599
  $post = get_post( $post_id );
2600
 
2601
+ if ( ! $post ) {
2602
  return;
2603
  }
2604
 
2617
  }
2618
 
2619
  // update the post title to remove confusion
2620
+ wp_update_post(
2621
+ [
2622
+ 'ID' => $form_id,
2623
+ 'post_title' => $post->post_title . ' (#' . $form_id . ')',
2624
+ ]
2625
+ );
2626
 
2627
  if ( $form_id ) {
2628
  $form_settings = wpuf_get_form_settings( $post_id );
2681
  * @return int
2682
  */
2683
  function wpuf_create_sample_form( $post_title = 'Sample Form', $post_type = 'wpuf_forms', $blank = false ) {
2684
+ $form_id = wp_insert_post(
2685
+ [
2686
+ 'post_title' => $post_title,
2687
+ 'post_type' => $post_type,
2688
+ 'post_status' => 'publish',
2689
+ 'comment_status' => 'closed',
2690
+ 'post_content' => '',
2691
+ ]
2692
+ );
2693
+
2694
+ if ( ! $form_id ) {
2695
  return false;
2696
  }
2697
 
2713
  'placeholder' => '',
2714
  'default' => '',
2715
  'size' => '40',
2716
+ 'wpuf_cond' => [],
2717
  ],
2718
  [
2719
  'input_type' => 'textarea',
2730
  'default' => '',
2731
  'rich' => 'teeny',
2732
  'insert_image' => 'yes',
2733
+ 'wpuf_cond' => [],
2734
  ],
2735
  ];
2736
 
2832
  ];
2833
  }
2834
 
2835
+ if ( ! empty( $form_fields ) && ! $blank ) {
2836
  foreach ( $form_fields as $order => $field ) {
2837
  wpuf_insert_form_field( $form_id, $field, false, $order );
2838
  }
2839
  }
2840
 
2841
+ if ( ! empty( $settings ) ) {
2842
  update_post_meta( $form_id, 'wpuf_form_settings', $settings );
2843
  }
2844
 
2893
  wp_delete_post( $form_id, $force );
2894
 
2895
  // delete form inputs as WP doesn't know the relationship
2896
+ $wpdb->delete(
2897
+ $wpdb->posts,
2898
  [
2899
  'post_parent' => $form_id,
2900
  'post_type' => 'wpuf_input',
2901
  ]
2902
+ );
2903
  }
2904
 
2905
  /**
2912
  * @return string $post_status
2913
  */
2914
  function wpuf_get_draft_post_status( $form_settings ) {
 
2915
  $noce = isset( $_REQUEST['_wpnonce'] ) ? sanitize_key( wp_unslash( $_REQUEST['_wpnonce'] ) ) : '';
2916
 
2917
  if ( isset( $nonce ) && ! wp_verify_nonce( $noce, 'wpuf_form_add' ) ) {
2918
+ return;
2919
  }
2920
 
2921
  $post_status = 'draft';
2923
  $charging_enabled = $current_user->subscription()->current_pack_id();
2924
  $user_wpuf_subscription_pack = get_user_meta( get_current_user_id(), '_wpuf_subscription_pack', true );
2925
 
2926
+ if ( $charging_enabled && ! isset( $_POST['post_id'] ) ) {
2927
+ if ( ! empty( $user_wpuf_subscription_pack ) ) {
2928
  if ( $current_user->subscription()->expired() ) {
2929
  $post_status = 'pending';
2930
  }
2945
  * @return array
2946
  */
2947
  function wpuf_admin_page_states( $state, $post ) {
2948
+ if ( 'page' !== $post->post_type ) {
2949
  return $state;
2950
  }
2951
 
2954
  preg_match_all( $pattern, $post->post_content, $matches );
2955
  $matches = array_unique( $matches[0] );
2956
 
2957
+ if ( ! empty( $matches ) ) {
2958
  $page = '';
2959
  $shortcode = $matches[0];
2960
 
2961
+ if ( '[wpuf_account]' === $shortcode ) {
2962
  $page = 'WPUF Account Page';
2963
+ } elseif ( '[wpuf_edit]' === $shortcode ) {
2964
  $page = 'WPUF Post Edit Page';
2965
+ } elseif ( '[wpuf-login]' === $shortcode ) {
2966
  $page = 'WPUF Login Page';
2967
+ } elseif ( '[wpuf_sub_pack]' === $shortcode ) {
2968
  $page = 'WPUF Subscription Page';
2969
+ } elseif ( '[wpuf_editprofile]' === $shortcode ) {
2970
  $page = 'WPUF Profile Edit Page';
2971
  } elseif ( stristr( $shortcode, '[wpuf_dashboard' ) ) {
2972
  $page = 'WPUF Dashboard Page';
2978
  $page = 'WPUF Form Page';
2979
  }
2980
 
2981
+ if ( ! empty( $page ) ) {
2982
  $state['wpuf'] = $page;
2983
  }
2984
  }
3054
  'post_msg' => 'verified',
3055
  'f' => 2,
3056
  ], get_home_url()
3057
+ );
3058
  } else {
3059
  $encoded_guest_url = add_query_arg(
3060
  [
3063
  'post_msg' => 'verified',
3064
  'f' => 1,
3065
  ], get_home_url()
3066
+ );
3067
  }
3068
 
3069
+ $default_body = 'Hey There, <br> <br> We just received your guest post and now we want you to confirm your email so that we can verify the content and move on to the publishing process. <br> <br> Please click the link below to verify: <br> <br> <a href="' . $encoded_guest_url . '">Publish Post</a> <br> <br> Regards, <br> <br>' . bloginfo( 'name' );
3070
  $to = isset( $_POST['guest_email'] ) ? sanitize_email( wp_unslash( $_POST['guest_email'] ) ) : '';
3071
  $guest_email_sub = wpuf_get_option( 'guest_email_subject', 'wpuf_mails', 'Please Confirm Your Email to Get the Post Published!' );
3072
  $subject = $guest_email_sub;
3073
  $guest_email_body = wpuf_get_option( 'guest_email_body', 'wpuf_mails', $default_body );
3074
 
3075
+ if ( ! empty( $guest_email_body ) ) {
3076
  $blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
3077
  $field_search = [ '{activation_link}', '{sitename}' ];
3078
 
3086
  $body = $default_body;
3087
  }
3088
 
3089
+ $body = get_formatted_mail_body( $body, $subject );
3090
 
3091
  wp_mail( $to, $subject, $body );
3092
  }
3101
  function is_wpuf_post_form_builder() {
3102
  $page = isset( $_GET['page'] ) ? sanitize_text_field( wp_unslash( $_GET['page'] ) ) : '';
3103
 
3104
+ return 'wpuf-post-forms' === $page ? true : false;
3105
  }
3106
 
3107
  /**
3114
  function is_wpuf_profile_form_builder() {
3115
  $page = isset( $_GET['page'] ) ? sanitize_text_field( wp_unslash( $_GET['page'] ) ) : '';
3116
 
3117
+ return 'wpuf-profile-forms' === $page ? true : false;
3118
  }
3119
 
3120
  /**
3127
  * @return \WPUF_User
3128
  */
3129
  function wpuf_get_user( $user = null ) {
3130
+ if ( ! $user ) {
3131
  $user = wp_get_current_user();
3132
  }
3133
 
3147
  $allowed_term = [];
3148
 
3149
  foreach ( $subscriptions as $pack ) {
3150
+ if ( ! metadata_exists( 'post', $pack->ID, '_sub_allowed_term_ids' ) ) {
3151
+ $cts = get_taxonomies( [ '_builtin' => true ], 'objects' );
3152
+ ?>
3153
+ <?php
3154
+ foreach ( $cts as $ct ) {
3155
  if ( is_taxonomy_hierarchical( $ct->name ) ) {
3156
+ $tax_terms = get_terms(
3157
+ [
3158
+ 'taxonomy' => $ct->name,
3159
+ 'hide_empty' => false,
3160
+ ]
3161
+ );
3162
 
3163
  foreach ( $tax_terms as $tax_term ) {
3164
  $allowed_term[] = $tax_term->term_id;
3166
  }
3167
  }
3168
 
3169
+ $cts = get_taxonomies( [ '_builtin' => false ], 'objects' );
3170
+ ?>
3171
+ <?php
3172
+ foreach ( $cts as $ct ) {
3173
  if ( is_taxonomy_hierarchical( $ct->name ) ) {
3174
+ $tax_terms = get_terms(
3175
+ [
3176
+ 'taxonomy' => $ct->name,
3177
+ 'hide_empty' => false,
3178
+ ]
3179
+ );
3180
 
3181
  foreach ( $tax_terms as $tax_term ) {
3182
  $allowed_term[] = $tax_term->term_id;
3191
  }
3192
 
3193
  /**
3194
+ * Post submitted by form
3195
  *
3196
  * @since 2.8
3197
  *
3200
  * @return List of WP_Post objects
3201
  */
3202
  function wpuf_posts_submitted_by( $form_id ) {
3203
+ $settings = wpuf_get_form_settings( $form_id );
3204
  $settings['post_type'];
3205
  $args = [
3206
  'meta_key' => '_wpuf_form_id',
3214
  }
3215
 
3216
  /**
3217
+ * Count post submitted by form
3218
  *
3219
  * @since 2.8
3220
  *
3247
  wpuf_load_pro_template(
3248
  'email/header.php',
3249
  [ 'subject' => $subject ]
3250
+ );
3251
 
3252
  $header = ob_get_clean();
3253
  }
3258
  wpuf_load_pro_template(
3259
  'email/footer.php',
3260
  []
3261
+ );
3262
 
3263
  $footer = ob_get_clean();
3264
  }
3268
  wpuf_load_pro_template(
3269
  'email/style.php',
3270
  []
3271
+ );
3272
 
3273
  $css = apply_filters( 'wpuf_email_style', ob_get_clean() );
3274
 
3275
  $content = $header . '<pre>' . $message . '</pre>' . $footer;
3276
 
3277
+ if ( ! class_exists( 'Emogrifier' ) ) {
3278
  require_once WPUF_PRO_INCLUDES . '/libs/Emogrifier.php';
3279
  }
3280
 
3310
  'chosen' => false,
3311
  'placeholder' => null,
3312
  'multiple' => false,
3313
+ 'show_option_all' => __( 'All', 'wp-user-frontend' ),
3314
+ 'show_option_none' => __( 'None', 'wp-user-frontend' ),
3315
  'data' => [],
3316
  'readonly' => false,
3317
  'disabled' => false,
3361
  $class = implode( ' ', array_map( 'sanitize_html_class', explode( ' ', $args['class'] ) ) );
3362
  $output = '<select' . $disabled . $readonly . ' name="' . esc_attr( $args['name'] ) . '" id="' . esc_attr( str_replace( '-', '_', $args['id'] ) ) . '" class="wpuf-select ' . $class . '"' . $multiple . ' data-placeholder="' . $placeholder . '"' . $data_elements . '>';
3363
 
3364
+ if ( ! isset( $args['selected'] ) || ( is_array( $args['selected'] ) && empty( $args['selected'] ) ) || ! $args['selected'] ) {
3365
  $selected = '';
3366
  }
3367
 
3368
  if ( $args['show_option_all'] ) {
3369
+ if ( $args['multiple'] && ! empty( $args['selected'] ) ) {
3370
+ $selected = selected( true, in_array( 0, $args['selected'], true ), false );
3371
  } else {
3372
  $selected = selected( $args['selected'], 0, false );
3373
  }
3374
  $output .= '<option value="all"' . $selected . '>' . esc_html( $args['show_option_all'] ) . '</option>';
3375
  }
3376
 
3377
+ if ( ! empty( $args['options'] ) ) {
3378
  if ( $args['show_option_none'] ) {
3379
  if ( $args['multiple'] ) {
3380
+ $selected = selected( true, in_array( -1, $args['selected'], true ), false );
3381
+ } elseif ( isset( $args['selected'] ) && ! is_array( $args['selected'] ) && ! empty( $args['selected'] ) ) {
3382
  $selected = selected( $args['selected'], -1, false );
3383
  }
3384
  $output .= '<option value="-1"' . $selected . '>' . esc_html( $args['show_option_none'] ) . '</option>';
3386
 
3387
  foreach ( $args['options'] as $key => $option ) {
3388
  if ( $args['multiple'] && is_array( $args['selected'] ) ) {
3389
+ $selected = selected( true, in_array( (string) $key, $args['selected'], true ), false );
3390
+ } elseif ( isset( $args['selected'] ) && ! is_array( $args['selected'] ) ) {
3391
  $selected = selected( $args['selected'], $key, false );
3392
  }
3393
 
3432
 
3433
  $data = '';
3434
 
3435
+ if ( ! empty( $args['data'] ) ) {
3436
  foreach ( $args['data'] as $key => $value ) {
3437
  $data .= 'data-' . $key . '="' . esc_attr( $value ) . '" ';
3438
  }
3440
 
3441
  $output = '<span id="wpuf-' . $args['name'] . '-wrap">';
3442
 
3443
+ if ( ! empty( $args['label'] ) ) {
3444
  $output .= '<label class="wpuf-label" for="' . $args['id'] . '">' . esc_html( $args['label'] ) . '</label>';
3445
  }
3446
 
3447
+ if ( ! empty( $args['desc'] ) ) {
3448
  $output .= '<span class="wpuf-description">' . wp_kses_post( $args['desc'] ) . '</span>';
3449
  }
3450
 
3482
  $options = array();
3483
  }
3484
 
3485
+ $options[ $option ] = $value;
3486
 
3487
  update_option( $section, $options );
3488
  }
3499
  function wpuf_get_terms( $taxonomy = 'category' ) {
3500
  $items = [];
3501
 
3502
+ $terms = get_terms(
3503
+ [
3504
  'taxonomy' => $taxonomy,
3505
  'hide_empty' => false,
3506
  ]
3507
+ );
3508
 
3509
  foreach ( $terms as $key => $term ) {
3510
+ $items[ $term->term_id ] = $term->name;
3511
  }
3512
 
3513
  return $items;
3524
  $country = isset( $_POST['country'] ) ? sanitize_text_field( wp_unslash( $_POST['country'] ) ) : '';
3525
  $cs = new CountryState();
3526
  $countries = $cs->countries();
3527
+ $states = $cs->getStates( $countries[ $country ] );
3528
 
3529
+ if ( ! empty( $states ) ) {
3530
  $args = [
3531
  'name' => isset( $_POST['field_name'] ) ? sanitize_text_field( wp_unslash( $_POST['field_name'] ) ) : '',
3532
  'id' => isset( $_POST['field_name'] ) ? sanitize_text_field( wp_unslash( $_POST['field_name'] ) ) : '',
3541
  $response = 'nostates';
3542
  }
3543
 
3544
+ wp_send_json( $response ); // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
 
3545
  }
3546
  add_action( 'wp_ajax_wpuf-ajax-address', 'wpuf_ajax_get_states_field' );
3547
  add_action( 'wp_ajax_nopriv_wpuf-ajax-address', 'wpuf_ajax_get_states_field' );
3552
  * @return void
3553
  */
3554
  function wpuf_update_billing_address() {
3555
+ check_ajax_referer( 'wpuf-ajax-address' );
 
 
 
 
3556
 
3557
  ob_start();
3558
 
3559
  $user_id = get_current_user_id();
3560
+ $add_line_1 = isset( $_POST['billing_add_line1'] ) ? sanitize_text_field( wp_unslash( $_POST['billing_add_line1'] ) ) : '';
3561
+ $add_line_2 = isset( $_POST['billing_add_line2'] ) ? sanitize_text_field( wp_unslash( $_POST['billing_add_line2'] ) ) : '';
3562
+ $city = isset( $_POST['billing_city'] ) ? sanitize_text_field( wp_unslash( $_POST['billing_city'] ) ) : '';
3563
+ $state = isset( $_POST['billing_state'] ) ? sanitize_text_field( wp_unslash( $_POST['billing_state'] ) ) : '';
3564
+ $zip = isset( $_POST['billing_zip'] ) ? sanitize_text_field( wp_unslash( $_POST['billing_zip'] ) ) : '';
3565
+ $country = isset( $_POST['billing_country'] ) ? sanitize_text_field( wp_unslash( $_POST['billing_country'] ) ) : '';
3566
+ $type = isset( $_POST['type'] ) ? sanitize_text_field( wp_unslash( $_POST['type'] ) ) : '';
3567
+ $id = isset( $_POST['id'] ) ? sanitize_text_field( wp_unslash( $_POST['id'] ) ) : '';
3568
 
3569
  $address_fields = [
3570
  'add_line_1' => $add_line_1,
3618
  $countries_obj = new WC_Countries();
3619
  $countries_array = $countries_obj->get_countries();
3620
  $country_states_array = $countries_obj->get_states();
3621
+ $woo_address['state'] = isset( $country_states_array[ $woo_address['country'] ][ $woo_address['state'] ] ) ? $country_states_array[ $woo_address['country'] ][ $woo_address['state'] ] : '';
3622
  $woo_address['state'] = strtolower( str_replace( ' ', '', $woo_address['state'] ) );
3623
 
3624
+ if ( ! empty( $woo_address ) ) {
3625
  $address_fields = [
3626
  'add_line_1' => $woo_address['address_1'],
3627
  'add_line_2' => $woo_address['address_2'],
3646
  $settings = new WeDevs_Settings_API();
3647
  $value = $settings->get_option( $args['id'], $args['section'], $args['std'] );
3648
  $value = is_array( $value ) ? (array) $value : [];
3649
+ $size = isset( $args['size'] ) && ! is_null( $args['size'] ) ? $args['size'] : 'regular';
3650
  $html = sprintf( '<select multiple="multiple" class="%1$s" name="%2$s[%3$s][]" id="%2$s[%3$s]">', $size, $args['section'], $args['id'] );
3651
 
3652
  foreach ( $args['options'] as $key => $label ) {
3653
+ $checked = in_array( $key, $value, true ) ? $key : '0';
3654
  $html .= sprintf( '<option value="%s"%s>%s</option>', $key, selected( $checked, $key, false ), $label );
3655
  }
3656
 
3657
  $html .= sprintf( '</select>' );
3658
  $html .= $settings->get_field_description( $args );
3659
 
3660
+ echo wp_kses(
3661
+ $html, [
3662
+ 'p' => [],
3663
+ 'select' => [
3664
+ 'multiple' => [],
3665
+ 'class' => [],
3666
+ 'name' => [],
3667
+ 'id' => [],
3668
+ ],
3669
+ 'option' => [
3670
+ 'value' => [],
3671
+ 'selected' => [],
3672
+ ],
3673
  ]
3674
+ );
3675
  }
3676
 
3677
  /**
3683
  */
3684
  function wpuf_show_form_schedule_message( $form_id ) {
3685
  $form_settings = wpuf_get_form_settings( $form_id );
3686
+ $is_scheduled = ( isset( $form_settings['schedule_form'] ) && $form_settings['schedule_form'] === 'true' ) ? true : false;
3687
 
3688
  if ( $is_scheduled ) {
3689
+ $start_time = ! empty( $form_settings['schedule_start'] ) ? strtotime( $form_settings['schedule_start'] ) : 0;
3690
+ $end_time = ! empty( $form_settings['schedule_end'] ) ? strtotime( $form_settings['schedule_end'] ) : 0;
3691
  $current_time = current_time( 'timestamp' );
3692
 
3693
  if ( $current_time >= $start_time && $current_time <= $end_time ) {
3699
  echo wp_kses_post( '<div class="wpuf-message">' . $form_settings['form_pending_message'] . '</div>' );
3700
  } elseif ( $current_time > $end_time ) {
3701
  echo wp_kses_post( '<div class="wpuf-message">' . $form_settings['form_expired_message'] . '</div>' );
3702
+ }
3703
+ ?>
3704
  <script>
3705
  jQuery( function($) {
3706
  $(".wpuf-submit-button").attr("disabled", "disabled");
3721
  */
3722
  function wpuf_show_form_limit_message( $form_id ) {
3723
  $form_settings = wpuf_get_form_settings( $form_id );
3724
+ $has_limit = ( isset( $form_settings['limit_entries'] ) && $form_settings['limit_entries'] === 'true' ) ? true : false;
3725
+ $post_to_check = get_post( get_the_ID() );
3726
  $is_edit_page = false;
3727
 
3728
+ if ( stripos( $post_to_check->post_content, '[wpuf_edit' ) !== false ) {
3729
  $is_edit_page = true;
3730
  }
3731
 
3732
+ if ( $has_limit && ! $is_edit_page ) {
3733
+ $limit = (int) ! empty( $form_settings['limit_number'] ) ? $form_settings['limit_number'] : 0;
3734
  $form_entries = wpuf_form_posts_count( $form_id );
3735
 
3736
  if ( $limit && $limit <= $form_entries ) {
3737
  $info = $form_settings['limit_message'];
3738
+ echo wp_kses_post( '<div class="wpuf-info">' . $info . '</div>' );
3739
  ?>
3740
  <script>
3741
  jQuery( function($) {
3751
  add_action( 'wpuf_before_form_render', 'wpuf_show_form_limit_message' );
3752
 
3753
  /**
3754
+ * Save frontend post revision
3755
  *
3756
  * @param int $post_id
3757
  * @param array $form_settings
3762
  $post = get_post( $post_id );
3763
 
3764
  if ( post_type_supports( $form_settings['post_type'], 'revisions' ) ) {
3765
+ $revisions = wp_get_post_revisions(
3766
+ $post_id, [
3767
+ 'order' => 'ASC',
3768
+ 'posts_per_page' => 1,
3769
+ ]
3770
+ );
3771
  $revision = current( $revisions );
3772
 
3773
  _wp_upgrade_revisions_of_post( $post, wp_get_post_revisions( $post_id ) );
3795
  $byte = absint( $val );
3796
  $char = strtolower( str_replace( $byte, '', $val ) );
3797
 
3798
+ switch ( $char ) {
3799
  case 'g':
3800
  $byte *= GB_IN_BYTES;
3801
  break;
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: weDevs
7
- Version: 3.5.3
8
  Author URI: https://wedevs.com/?utm_source=WPUF_Author_URI
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.5.3' );
16
  define( 'WPUF_FILE', __FILE__ );
17
  define( 'WPUF_ROOT', __DIR__ );
18
  define( 'WPUF_ROOT_URI', plugins_url( '', __FILE__ ) );
@@ -310,7 +310,7 @@ final class WP_User_Frontend {
310
  require_once WPUF_ROOT . '/includes/free/admin/shortcode-button.php';
311
  require_once WPUF_ROOT . '/admin/form-builder/class-wpuf-admin-form-builder.php';
312
  require_once WPUF_ROOT . '/admin/form-builder/class-wpuf-admin-form-builder-ajax.php';
313
- include_once WPUF_ROOT . '/lib/class-weforms-upsell.php';
314
  include_once WPUF_ROOT . '/includes/class-whats-new.php';
315
  include_once WPUF_ROOT . '/includes/class-acf.php';
316
  include_once WPUF_ROOT . '/includes/class-privacy.php';
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: weDevs
7
+ Version: 3.5.4
8
  Author URI: https://wedevs.com/?utm_source=WPUF_Author_URI
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.5.4' );
16
  define( 'WPUF_FILE', __FILE__ );
17
  define( 'WPUF_ROOT', __DIR__ );
18
  define( 'WPUF_ROOT_URI', plugins_url( '', __FILE__ ) );
310
  require_once WPUF_ROOT . '/includes/free/admin/shortcode-button.php';
311
  require_once WPUF_ROOT . '/admin/form-builder/class-wpuf-admin-form-builder.php';
312
  require_once WPUF_ROOT . '/admin/form-builder/class-wpuf-admin-form-builder-ajax.php';
313
+ // include_once WPUF_ROOT . '/lib/class-weforms-upsell.php';
314
  include_once WPUF_ROOT . '/includes/class-whats-new.php';
315
  include_once WPUF_ROOT . '/includes/class-acf.php';
316
  include_once WPUF_ROOT . '/includes/class-privacy.php';