Contact Form by WPForms – Drag & Drop Form Builder for WordPress - Version 1.3.7.2

Version Description

  • Fixed: Error for some users with PHP 5.4 and below
Download this release

Release Info

Developer jaredatch
Plugin Icon 128x128 Contact Form by WPForms – Drag & Drop Form Builder for WordPress
Version 1.3.7.2
Comparing to
See all releases

Code changes from version 1.3.6.2 to 1.3.7.2

assets/css/admin-builder.css CHANGED
@@ -667,6 +667,195 @@ body {
667
  }
668
 
669
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
670
 
671
  /* Smart Tags
672
  -------------------------------------------------------------- */
@@ -690,6 +879,7 @@ body {
690
  background-color: #fff;
691
  max-height: 100px;
692
  overflow-y: scroll;
 
693
  border: 1px solid #ddd;
694
  margin: 0 0 5px 0;
695
  display: none;
667
  }
668
 
669
 
670
+ /* Bulk Add
671
+ -------------------------------------------------------------- */
672
+
673
+ #wpforms-builder .toggle-bulk-add-display {
674
+ font-size: 11px;
675
+ color: #999;
676
+ text-decoration: none;
677
+ float: right;
678
+ }
679
+
680
+ #wpforms-builder .toggle-bulk-add-display:hover {
681
+ color: #666;
682
+ text-decoration: underline;
683
+ }
684
+
685
+ #wpforms-builder .bulk-add-display {
686
+ background-color: #fff;
687
+ /*height: 122px;*/
688
+ overflow: hidden;
689
+ border: 1px solid #ddd;
690
+ margin: 0 0 5px 0;
691
+ display: none;
692
+ }
693
+
694
+ #wpforms-builder .bulk-add-display .heading {
695
+ padding: 5px 10px;
696
+ margin: 0;
697
+ border-bottom: 1px solid #eee;
698
+ font-weight: 700;
699
+ background: #f1f1f1;
700
+ font-size: 13px;
701
+ }
702
+
703
+ #wpforms-builder .bulk-add-display .heading a {
704
+ float: right;
705
+ display: inline-block;
706
+ font-weight: 400;
707
+ text-decoration: none;
708
+ font-size: 11px;
709
+ padding-top: 2px;
710
+ color: #999;
711
+ }
712
+
713
+ #wpforms-builder .bulk-add-display .heading a:hover {
714
+ text-decoration: underline;
715
+ }
716
+
717
+ #wpforms-builder .bulk-add-display ul {
718
+ margin: 0;
719
+ display: none;
720
+ }
721
+
722
+ #wpforms-builder .bulk-add-display li {
723
+ list-style: none;
724
+ margin: 0 !important;
725
+ border: none !important;
726
+ padding: 0 !important;
727
+ }
728
+
729
+ #wpforms-builder .bulk-add-display li a {
730
+ display: block;
731
+ text-decoration: none;
732
+ padding: 5px 10px;
733
+ border-bottom: 1px solid #eee;
734
+ }
735
+
736
+ #wpforms-builder .bulk-add-display li a:hover {
737
+ background-color: #f9f9f9;
738
+ text-decoration: underline;
739
+ }
740
+
741
+ #wpforms-builder .bulk-add-display textarea {
742
+ height: 85px;
743
+ margin: 0;
744
+ font-size: 12px;
745
+ font-family: Monaco, Menlo, Consolas, "Courier New", monospace;
746
+ width: 100% !important;
747
+ padding: 5px 10px !important;
748
+ display: block;
749
+ border: none !important;
750
+ }
751
+
752
+ #wpforms-builder .bulk-add-display button {
753
+ background-color: #0e6cad;
754
+ color: #fff;
755
+ border: none;
756
+ display: block;
757
+ -webkit-appearance: none;
758
+ font-size: 12px;
759
+ font-weight: 500;
760
+ padding: 5px;
761
+ cursor: pointer;
762
+ text-align: center;
763
+ width: 100%;
764
+ }
765
+
766
+ #wpforms-builder .bulk-add-display button:hover {
767
+ background-color: #0B568A;
768
+ }
769
+
770
+
771
+ /* Layout Selector
772
+ -------------------------------------------------------------- */
773
+
774
+ #wpforms-builder .toggle-layout-selector-display {
775
+ font-size: 11px;
776
+ color: #999;
777
+ text-decoration: none;
778
+ float: right;
779
+ }
780
+
781
+ #wpforms-builder .toggle-layout-selector-display:hover {
782
+ color: #666;
783
+ text-decoration: underline;
784
+ }
785
+
786
+ #wpforms-builder .layout-selector-display {
787
+ background-color: #fff;
788
+ height: 122px;
789
+ overflow: hidden;
790
+ border: 1px solid #ddd;
791
+ margin: 0 0 5px 0;
792
+ display: none;
793
+ }
794
+
795
+ #wpforms-builder .layout-selector-display .heading {
796
+ display:block;
797
+ padding: 5px 10px;
798
+ margin: 0;
799
+ border-bottom: 1px solid #eee;
800
+ font-weight: 700;
801
+ background: #f1f1f1;
802
+ font-size: 13px;
803
+ }
804
+
805
+ #wpforms-builder .layout-selector-display-layout {
806
+ width: 25%;
807
+ float: left;
808
+ padding: 10px 10px 0 10px;
809
+ cursor: pointer;
810
+ }
811
+
812
+ #wpforms-builder .layout-selector-display span {
813
+ background-color: #b1bac3;
814
+ height: 30px;
815
+ float: left;
816
+ border: 1px solid #fff;
817
+ -webkit-transition: background-color 0.2s ease-in-out;
818
+ -moz-transition: background-color 0.2s ease-in-out;
819
+ -ms-transition: background-color 0.2s ease-in-out;
820
+ -o-transition: background-color 0.2s ease-in-out;
821
+ transition: background-color 0.2s ease-in-out;
822
+ }
823
+
824
+ #wpforms-builder .layout-selector-display-layout:hover span,
825
+ #wpforms-builder .layout-selector-display-columns span:hover {
826
+ background-color: #0073aa;
827
+ }
828
+
829
+ #wpforms-builder .layout-selector-display span.one-half {
830
+ width: 50%;
831
+ }
832
+
833
+ #wpforms-builder .layout-selector-display span.one-third {
834
+ width: 33.333333%;
835
+ }
836
+
837
+ #wpforms-builder .layout-selector-display span.two-third {
838
+ width: 66.666666%;
839
+ }
840
+
841
+ #wpforms-builder .layout-selector-display span.one-fourth {
842
+ width: 25%;
843
+ }
844
+
845
+ #wpforms-builder .layout-selector-display span.two-fourth {
846
+ width: 50%;
847
+ }
848
+
849
+ #wpforms-builder .layout-selector-display-columns {
850
+ padding: 10px 10px 0 10px;
851
+ }
852
+
853
+ #wpforms-builder .layout-selector-display-columns span {
854
+ height: 70px;
855
+ cursor: pointer;
856
+ border: 2px solid #fff;
857
+ }
858
+
859
 
860
  /* Smart Tags
861
  -------------------------------------------------------------- */
879
  background-color: #fff;
880
  max-height: 100px;
881
  overflow-y: scroll;
882
+ overflow-x: hidden;
883
  border: 1px solid #ddd;
884
  margin: 0 0 5px 0;
885
  display: none;
assets/css/admin-settings.css CHANGED
@@ -371,7 +371,8 @@
371
  padding-top: 20px;
372
  }
373
 
374
- #wpforms-settings-system .system-info-textarea {
 
375
  width: 100%;
376
  height: 400px;
377
  font-family: Menlo,Monaco,monospace;
371
  padding-top: 20px;
372
  }
373
 
374
+ #wpforms-settings-system .system-info-textarea,
375
+ #wpforms-import-export .template-export-textarea {
376
  width: 100%;
377
  height: 400px;
378
  font-family: Menlo,Monaco,monospace;
assets/css/wpforms-base.css CHANGED
@@ -70,6 +70,11 @@
70
  margin: 5px 0 0 0;
71
  }
72
 
 
 
 
 
 
73
  /* Labels and sub-labels */
74
  .wpforms-container .wpforms-field-label {
75
  display: block;
@@ -430,7 +435,7 @@
430
 
431
  .wpforms-container .wpforms-page-indicator {
432
  margin: 0 0 20px 0;
433
- overflow: auto;
434
  }
435
 
436
  /** Circles theme **/
@@ -609,4 +614,4 @@
609
  .wpforms-container.inline-fields .wpforms-submit-container {
610
  width: 100%;
611
  }
612
- }
70
  margin: 5px 0 0 0;
71
  }
72
 
73
+ .wpforms-container .wpforms-field-description-before {
74
+ font-size: 0.85em;
75
+ margin: 0 0 5px 0;
76
+ }
77
+
78
  /* Labels and sub-labels */
79
  .wpforms-container .wpforms-field-label {
80
  display: block;
435
 
436
  .wpforms-container .wpforms-page-indicator {
437
  margin: 0 0 20px 0;
438
+ overflow: hidden;
439
  }
440
 
441
  /** Circles theme **/
614
  .wpforms-container.inline-fields .wpforms-submit-container {
615
  width: 100%;
616
  }
617
+ }
assets/css/wpforms-full.css CHANGED
@@ -138,6 +138,10 @@ div.wpforms-container-full .wpforms-form .wpforms-field-description {
138
  margin: 8px 0 0 0;
139
  }
140
 
 
 
 
 
141
  /* Labels and sub-labels */
142
  div.wpforms-container-full .wpforms-form .wpforms-field-label {
143
  display: block;
@@ -673,7 +677,7 @@ div.wpforms-container-full .wpforms-form .wpforms-captcha-question {
673
 
674
  div.wpforms-container-full .wpforms-form .wpforms-page-indicator {
675
  margin: 0 0 20px 0;
676
- overflow: auto;
677
  }
678
 
679
  /** Circles theme **/
@@ -858,4 +862,4 @@ div.wpforms-container-full .wpforms-form .wpforms-field-hidden {
858
  div.wpforms-container-full.inline-fields .wpforms-form .wpforms-submit-container {
859
  width: 100%;
860
  }
861
- }
138
  margin: 8px 0 0 0;
139
  }
140
 
141
+ div.wpforms-container-full .wpforms-form .wpforms-field-description-before {
142
+ margin: 0 0 8px 0;
143
+ }
144
+
145
  /* Labels and sub-labels */
146
  div.wpforms-container-full .wpforms-form .wpforms-field-label {
147
  display: block;
677
 
678
  div.wpforms-container-full .wpforms-form .wpforms-page-indicator {
679
  margin: 0 0 20px 0;
680
+ overflow: hidden;
681
  }
682
 
683
  /** Circles theme **/
862
  div.wpforms-container-full.inline-fields .wpforms-form .wpforms-submit-container {
863
  width: 100%;
864
  }
865
+ }
assets/js/admin-builder.js CHANGED
@@ -184,17 +184,6 @@
184
  */
185
  bindUIActionsPanels: function() {
186
 
187
- // Toggle Smart Tags
188
- $(document).on('click', '.toggle-smart-tag-display', function(e) {
189
- e.preventDefault();
190
- WPFormsBuilder.smartTagToggle(this);
191
- });
192
-
193
- $(document).on('click', '.smart-tags-list-display a', function(e) {
194
- e.preventDefault();
195
- WPFormsBuilder.smartTagInsert(this);
196
- });
197
-
198
  // Panel switching
199
  $(document).on('click', '#wpforms-panels-toggle button, .wpforms-panel-switch', function(e) {
200
  e.preventDefault();
@@ -207,105 +196,6 @@
207
  });
208
  },
209
 
210
- /**
211
- * Smart Tag toggling.
212
- *
213
- * @since 1.0.1
214
- */
215
- smartTagToggle: function(el) {
216
-
217
- var $this = $(el),
218
- $label = $this.closest('label');
219
-
220
- if ( $this.hasClass('smart-tag-showing') ) {
221
-
222
- // Smart tags are showing, so hide/remove them
223
- var $list = $label.next('.smart-tags-list-display');
224
- $list.slideUp(400, function() {
225
- $list.remove();
226
- });
227
- $this.find('span').text(wpforms_builder.smart_tags_show);
228
- } else {
229
-
230
- // Show all fields or narrow to specific field types
231
- var allowed = $this.data('fields'),
232
- type = $this.data('type');
233
- if ( allowed.length ) {
234
- var fields = wpf.getFields(allowed.split(','));
235
- } else {
236
- var fields = wpf.getFields();
237
- }
238
-
239
- // Create smart tags list
240
- var smartTagList = '<ul class="smart-tags-list-display">';
241
-
242
- if (type === 'fields' || type === 'all') {
243
- if (!fields) {
244
- smartTagList += '<li class="heading">'+wpforms_builder.fields_unavailable+'</li>';
245
- } else {
246
- smartTagList += '<li class="heading">'+wpforms_builder.fields_available+'</li>';
247
- for(var key in fields) {
248
- if (fields[key].label) {
249
- var label = wpf.sanitizeString(fields[key].label);
250
- } else {
251
- var label = wpforms_builder.field+' #'+fields[key].id;
252
- }
253
- smartTagList += '<li><a href="#" data-type="field" data-meta=\'' + fields[key].id + '\'>'+label+'</a></li>';
254
- }
255
- }
256
- }
257
-
258
- if (type === 'other' || type === 'all') {
259
- smartTagList += '<li class="heading">'+wpforms_builder.other+'</li>';
260
- for(var key in wpforms_builder.smart_tags) {
261
- smartTagList += '<li><a href="#" data-type="other" data-meta=\'' + key+ '\'>'+wpforms_builder.smart_tags[key]+'</a></li>';
262
- }
263
- }
264
-
265
- smartTagList += '</ul>';
266
-
267
- $label.after(smartTagList);
268
- $label.next('.smart-tags-list-display').slideDown();
269
- $this.find('span').text(wpforms_builder.smart_tags_hide);
270
- }
271
-
272
- $this.toggleClass('smart-tag-showing');
273
- },
274
-
275
- /**
276
- * Smart Tag insert.
277
- *
278
- * @since 1.0.1
279
- */
280
- smartTagInsert: function(el) {
281
-
282
- var $this = $(el),
283
- $list = $this.closest('.smart-tags-list-display'),
284
- $parent = $list.parent(),
285
- $label = $parent.find('label'),
286
- $input = $parent.find('input[type=text]'),
287
- meta = $this.data('meta'),
288
- type = $this.data('type');
289
-
290
- if ( ! $input.length ) {
291
- $input = $parent.find('textarea');
292
- }
293
-
294
- // insert smart tag
295
- if ( type === 'field' ) {
296
- $input.insertAtCaret('{field_id="'+meta+'"}');
297
- } else {
298
- $input.insertAtCaret('{'+meta+'}');
299
- }
300
-
301
- // remove list, all done!
302
- $list.slideUp(400, function() {
303
- $list.remove();
304
- });
305
-
306
- $label.find('.toggle-smart-tag-display span').text(wpforms_builder.smart_tags_show);
307
- },
308
-
309
  /**
310
  * Switch Panels.
311
  *
@@ -592,35 +482,45 @@
592
  WPFormsBuilder.fieldChoiceUpdate(list.data('field-type'),list.data('field-id'));
593
  });
594
 
595
- // Field Options group toggle
596
- $(document).on('click', '.wpforms-field-option-group-toggle', function(e) {
597
  e.preventDefault();
598
- var $this = $(this);
599
- $this.parent().toggleClass('wpforms-hide').find('.wpforms-field-option-group-inner').slideToggle();
600
- $this.find('i').toggleClass('fa-angle-down fa-angle-right');
601
  });
602
-
603
- // Field Smart Tags display toggle
604
- $(document).on('click', '.wpforms-field-option-row-default_value .toggle-smart-tags', function(e) {
605
  e.preventDefault();
606
- var $this = $(this);
607
- $this.toggleClass('smart-tags-hide');
608
- $this.parent().next('.smart-tags-list').slideToggle();
609
-
610
- if ( $this.hasClass('smart-tags-hide')) {
611
- $this.find('span').text(wpforms_builder.smart_tags_hide);
612
  } else {
613
- $this.find('span').text(wpforms_builder.smart_tags_show);
614
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
615
  });
616
 
617
- // "Default" Field Smart Tag insert
618
- $(document).on('click', '.wpforms-field-option-row-default_value .smart-tags-list a', function(e) {
619
  e.preventDefault();
620
- var $this = $(this),
621
- tag = $this.data('value'),
622
- field = $this.parent().parent().next('input[type=text]');
623
- field.val(field.val()+'{'+tag+'}');
624
  });
625
 
626
  // Display toggle for Address field hide address line 2 option
@@ -915,6 +815,20 @@
915
  $(document).on('change', '.wpforms-field-option-row-dynamic_taxonomy select, .wpforms-field-option-row-dynamic_post_type select', function(e) {
916
  WPFormsBuilder.fieldDynamicChoiceSource($(this));
917
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
918
  },
919
 
920
  /**
@@ -1400,7 +1314,7 @@
1400
  $('#wpforms-field-'+id+' .primary-input li' ).remove();
1401
  new_choice = '<li><input type="'+type+'" disabled>{label}</li>';
1402
  }
1403
- $('#wpforms-field-option-row-' + id + '-choices li').each( function( index ) {
1404
  var $this = $(this),
1405
  label = $this.find('input.label').val(),
1406
  selected = $this.find('input.default').is(':checked'),
@@ -1420,6 +1334,88 @@
1420
  });
1421
  },
1422
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1423
  /**
1424
  * Toggle fields tabs (Add Fields, Field Options.
1425
  *
@@ -1717,6 +1713,193 @@
1717
  });
1718
  },
1719
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1720
  //--------------------------------------------------------------------//
1721
  // Settings Panel
1722
  //--------------------------------------------------------------------//
@@ -1866,7 +2049,7 @@
1866
  */
1867
  notificationAdd: function() {
1868
 
1869
- var nextID = Number($('.wpforms-notifications-add').attr('data-next_id'));
1870
  namePrompt = wpforms_builder.notification_prompt,
1871
  nameField = '<input autofocus="" type="text" id="notification-name" placeholder="'+wpforms_builder.notification_ph+'">',
1872
  nameError = '<p class="error">'+wpforms_builder.notification_error+'</p>',
@@ -1883,24 +2066,26 @@
1883
  return false;
1884
  } else {
1885
  var $firstNotification = $('.wpforms-notification').first(),
1886
- $newNotification = $firstNotification.clone();
 
1887
 
1888
  $newNotification.find('.wpforms-notification-header span').text(input.val());
1889
  $newNotification.find('input, textarea, select').each(function(index, el) {
1890
  if ($(this).attr('name')) {
1891
  $(this).val('').attr('name', $(this).attr('name').replace(/\[(\d+)\]/, '['+nextID+']'));
1892
  if ($(this).is('select')) {
1893
- $(this).find('option:first').prop('selected',true);
 
1894
  } else if ( $(this).attr('type') === 'checkbox') {
1895
- $(this).prop('checked', false).val('1');
1896
  } else {
1897
- $(this).val('');
1898
  }
1899
  }
1900
  });
1901
- $newNotification.find('.wpforms-notification-header input').val(input.val());
1902
- $newNotification.find('.email-msg textarea').val('{all_fields}');
1903
- $newNotification.find('.email-recipient input').val('{admin_email}');
1904
  // Conditional logic, if present
1905
  var $conditionalLogic = $newNotification.find('.wpforms-conditional-block');
1906
  if ($conditionalLogic.length) {
@@ -1908,16 +2093,16 @@
1908
  $conditionalLogic.find('.wpforms-conditional-row').not(':first').remove();
1909
  $conditionalLogic.find('.wpforms-conditional-row').attr('data-input-name', 'settings[notifications]['+nextID+']');
1910
  $conditionalLogic.find('.wpforms-conditional-field').attr('data-groupid', '0').attr('data-ruleid', '0');
1911
- $conditionalLogic.find('.wpforms-conditional-row select').each(function(index, el) {
1912
- if ($(this).attr('name')) {
1913
- $(this).attr('name', $(this).attr('name').replace(/\[(\d+)\]\[(\d+)\]/, '[0][0]'));
1914
- }
1915
- });
1916
  $conditionalLogic.find('.wpforms-conditional-row').find('.value').empty().append('<select>');
1917
  $conditionalLogic.find('.wpforms-conditional-groups').hide();
1918
  }
1919
- $firstNotification.before( $newNotification );
1920
- $('.wpforms-notifications-add').attr('data-next_id', nextID+1);
 
 
 
 
 
1921
  }
1922
  }
1923
  });
@@ -2084,6 +2269,17 @@
2084
  */
2085
  bindUIActionsGeneral: function() {
2086
 
 
 
 
 
 
 
 
 
 
 
 
2087
  // Field map table, update key source
2088
  $(document).on('input', '.wpforms-field-map-table .key-source', function(){
2089
  var value = $(this).val(),
@@ -2126,6 +2322,106 @@
2126
  });
2127
  },
2128
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2129
  /**
2130
  * Field map table - Delete row
2131
  *
@@ -2289,4 +2585,4 @@
2289
 
2290
  WPFormsBuilder.init();
2291
 
2292
- })(jQuery);
184
  */
185
  bindUIActionsPanels: function() {
186
 
 
 
 
 
 
 
 
 
 
 
 
187
  // Panel switching
188
  $(document).on('click', '#wpforms-panels-toggle button, .wpforms-panel-switch', function(e) {
189
  e.preventDefault();
196
  });
197
  },
198
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
199
  /**
200
  * Switch Panels.
201
  *
482
  WPFormsBuilder.fieldChoiceUpdate(list.data('field-type'),list.data('field-id'));
483
  });
484
 
485
+ // Field Choices Bulk Add
486
+ $(document).on('click', '.toggle-bulk-add-display', function(e) {
487
  e.preventDefault();
488
+ WPFormsBuilder.fieldChoiceBulkAddToggle(this);
 
 
489
  });
490
+ $(document).on('click', '.toggle-bulk-add-presets', function(e) {
 
 
491
  e.preventDefault();
492
+ var $presetList = $(this).closest('.bulk-add-display').find('ul');
493
+ if ( $presetList.css('display') === 'block' ) {
494
+ $(this).text(wpforms_builder.bulk_add_presets_show);
 
 
 
495
  } else {
496
+ $(this).text(wpforms_builder.bulk_add_presets_hide);
497
  }
498
+ $presetList.slideToggle();
499
+ });
500
+ $(document).on('click', '.bulk-add-preset-insert', function(e) {
501
+ e.preventDefault();
502
+ var $this = $(this),
503
+ preset = $this.data('preset'),
504
+ $container = $this.closest('.bulk-add-display'),
505
+ $presetList = $container.find('ul'),
506
+ $presetToggle = $container.find('.toggle-bulk-add-presets'),
507
+ $textarea = $container.find('textarea');
508
+ $textarea.val('');
509
+ $textarea.insertAtCaret(wpforms_preset_choices[preset].choices.join("\n"));
510
+ $presetToggle.text(wpforms_builder.bulk_add_presets_show);
511
+ $presetList.slideUp();
512
+ });
513
+ $(document).on('click', '.bulk-add-insert', function(e) {
514
+ e.preventDefault();
515
+ WPFormsBuilder.fieldChoiceBulkAddInsert(this);
516
  });
517
 
518
+ // Field Options group toggle
519
+ $(document).on('click', '.wpforms-field-option-group-toggle', function(e) {
520
  e.preventDefault();
521
+ var $this = $(this);
522
+ $this.parent().toggleClass('wpforms-hide').find('.wpforms-field-option-group-inner').slideToggle();
523
+ $this.find('i').toggleClass('fa-angle-down fa-angle-right');
 
524
  });
525
 
526
  // Display toggle for Address field hide address line 2 option
815
  $(document).on('change', '.wpforms-field-option-row-dynamic_taxonomy select, .wpforms-field-option-row-dynamic_post_type select', function(e) {
816
  WPFormsBuilder.fieldDynamicChoiceSource($(this));
817
  });
818
+
819
+ // Toggle Layout selector
820
+ $(document).on('click', '.toggle-layout-selector-display', function(e) {
821
+ e.preventDefault();
822
+ WPFormsBuilder.fieldLayoutSelectorToggle(this);
823
+ });
824
+ $(document).on('click', '.layout-selector-display-layout', function(e) {
825
+ e.preventDefault();
826
+ WPFormsBuilder.fieldLayoutSelectorLayout(this);
827
+ });
828
+ $(document).on('click', '.layout-selector-display-columns span', function(e) {
829
+ e.preventDefault();
830
+ WPFormsBuilder.fieldLayoutSelectorInsert(this);
831
+ });
832
  },
833
 
834
  /**
1314
  $('#wpforms-field-'+id+' .primary-input li' ).remove();
1315
  new_choice = '<li><input type="'+type+'" disabled>{label}</li>';
1316
  }
1317
+ $('#wpforms-field-option-row-' + id + '-choices .choices-list li').each( function( index ) {
1318
  var $this = $(this),
1319
  label = $this.find('input.label').val(),
1320
  selected = $this.find('input.default').is(':checked'),
1334
  });
1335
  },
1336
 
1337
+ /**
1338
+ * Field choice bulk add toggling.
1339
+ *
1340
+ * @since 1.3.7
1341
+ */
1342
+ fieldChoiceBulkAddToggle: function(el) {
1343
+
1344
+ var $this = $(el),
1345
+ $label = $this.closest('label');
1346
+
1347
+ if ( $this.hasClass('bulk-add-showing') ) {
1348
+
1349
+ // Import details is showing, so hide/remove it
1350
+ var $selector = $label.next('.bulk-add-display');
1351
+ $selector.slideUp(400, function() {
1352
+ $selector.remove();
1353
+ });
1354
+ $this.find('span').text(wpforms_builder.bulk_add_show);
1355
+ } else {
1356
+
1357
+ var importOptions = '<div class="bulk-add-display">';
1358
+
1359
+ importOptions += '<p class="heading">'+wpforms_builder.bulk_add_heading+' <a href="#" class="toggle-bulk-add-presets">'+wpforms_builder.bulk_add_presets_show+'</a></p>';
1360
+ importOptions += '<ul>';
1361
+ for(var key in wpforms_preset_choices) {
1362
+ importOptions += '<li><a href="#" data-preset="'+key+'" class="bulk-add-preset-insert">'+wpforms_preset_choices[key].name+'</a></li>';
1363
+ }
1364
+ importOptions += '</ul>';
1365
+ importOptions += '<textarea placeholder="'+wpforms_builder.bulk_add_placeholder+'"></textarea>';
1366
+ importOptions += '<button class="bulk-add-insert">'+wpforms_builder.bulk_add_button+'</button>';
1367
+ importOptions += '</div>';
1368
+
1369
+ $label.after(importOptions);
1370
+ $label.next('.bulk-add-display').slideDown(400, function() {
1371
+ $(this).find('textarea').focus();
1372
+ });
1373
+ $this.find('span').text(wpforms_builder.bulk_add_hide);
1374
+ }
1375
+
1376
+ $this.toggleClass('bulk-add-showing');
1377
+ },
1378
+
1379
+ /**
1380
+ * Field choice bulk insert the new choices.
1381
+ *
1382
+ * @since 1.3.7
1383
+ */
1384
+ fieldChoiceBulkAddInsert: function(el) {
1385
+
1386
+ var $this = $(el),
1387
+ $container = $this.closest('.wpforms-field-option-row'),
1388
+ $textarea = $container.find('textarea'),
1389
+ $list = $container.find('.choices-list'),
1390
+ $choice = $list.find('li:first-of-type').clone().wrap('<div>').parent(),
1391
+ choice = '',
1392
+ fieldID = $container.data('field-id'),
1393
+ type = $list.data('field-type'),
1394
+ nextID = Number( $list.attr('data-next-id') ),
1395
+ newValues = $textarea.val().split("\n"),
1396
+ newChoices = '';
1397
+
1398
+ $this.prop('disabled', true).html($this.html()+' '+s.spinner);
1399
+ $choice.find('input.value,input.label').attr('value','');
1400
+ choice = $choice.html();
1401
+
1402
+ for(var key in newValues) {
1403
+ var value = newValues[key],
1404
+ newChoice = choice;
1405
+ value = value.trim();
1406
+ newChoice = newChoice.replace( /\[choices\]\[(\d+)\]/g ,'[choices]['+nextID+']' );
1407
+ newChoice = newChoice.replace( /data-key="(\d+)"/g ,'data-key="'+nextID+'"' );
1408
+ newChoice = newChoice.replace( /value="" class="label"/g ,'value="'+value+'" class="label"' );
1409
+ newChoices += newChoice;
1410
+ nextID++;
1411
+ }
1412
+ $list.attr('data-next-id', nextID).append(newChoices)
1413
+
1414
+ WPFormsBuilder.fieldChoiceUpdate(type, fieldID);
1415
+ $(document).trigger('wpformsFieldChoiceAdd');
1416
+ WPFormsBuilder.fieldChoiceBulkAddToggle( $container.find('.toggle-bulk-add-display') );
1417
+ },
1418
+
1419
  /**
1420
  * Toggle fields tabs (Add Fields, Field Options.
1421
  *
1713
  });
1714
  },
1715
 
1716
+ /**
1717
+ * Field layout selector toggling.
1718
+ *
1719
+ * @since 1.3.7
1720
+ */
1721
+ fieldLayoutSelectorToggle: function(el) {
1722
+
1723
+ var $this = $(el),
1724
+ $label = $this.closest('label'),
1725
+ layouts = {
1726
+ 'layout-1' : [
1727
+ {
1728
+ 'class': 'one-half',
1729
+ 'data' : 'wpforms-one-half wpforms-first'
1730
+ },
1731
+ {
1732
+ 'class': 'one-half',
1733
+ 'data' : 'wpforms-one-half'
1734
+ }
1735
+ ],
1736
+ 'layout-2' : [
1737
+ {
1738
+ 'class': 'one-third',
1739
+ 'data' : 'wpforms-one-third wpforms-first'
1740
+ },
1741
+ {
1742
+ 'class': 'one-third',
1743
+ 'data' : 'wpforms-one-third'
1744
+ },
1745
+ {
1746
+ 'class': 'one-third',
1747
+ 'data' : 'wpforms-one-third'
1748
+ }
1749
+ ],
1750
+ 'layout-3' : [
1751
+ {
1752
+ 'class': 'one-fourth',
1753
+ 'data' : 'wpforms-one-fourth wpforms-first'
1754
+ },
1755
+ {
1756
+ 'class': 'one-fourth',
1757
+ 'data' : 'wpforms-one-fourth'
1758
+ },
1759
+ {
1760
+ 'class': 'one-fourth',
1761
+ 'data' : 'wpforms-one-fourth'
1762
+ },
1763
+ {
1764
+ 'class': 'one-fourth',
1765
+ 'data' : 'wpforms-one-fourth'
1766
+ }
1767
+ ],
1768
+ 'layout-4' : [
1769
+ {
1770
+ 'class': 'one-third',
1771
+ 'data' : 'wpforms-one-third wpforms-first'
1772
+ },
1773
+ {
1774
+ 'class': 'two-third',
1775
+ 'data' : 'wpforms-two-thirds'
1776
+ }
1777
+ ],
1778
+ 'layout-5' : [
1779
+ {
1780
+ 'class': 'two-third',
1781
+ 'data' : 'wpforms-two-third wpforms-first'
1782
+ },
1783
+ {
1784
+ 'class': 'one-third',
1785
+ 'data' : 'wpforms-one-third'
1786
+ }
1787
+ ],
1788
+ 'layout-6' : [
1789
+ {
1790
+ 'class': 'one-fourth',
1791
+ 'data' : 'wpforms-one-fourth wpforms-first'
1792
+ },
1793
+ {
1794
+ 'class': 'one-fourth',
1795
+ 'data' : 'wpforms-one-fourth'
1796
+ },
1797
+ {
1798
+ 'class': 'two-fourth',
1799
+ 'data' : 'wpforms-two-fourths'
1800
+ }
1801
+ ],
1802
+ 'layout-7' : [
1803
+ {
1804
+ 'class': 'two-fourth',
1805
+ 'data' : 'wpforms-two-fourths wpforms-first'
1806
+ },
1807
+ {
1808
+ 'class': 'one-fourth',
1809
+ 'data' : 'wpforms-one-fourth'
1810
+ },
1811
+ {
1812
+ 'class': 'one-fourth',
1813
+ 'data' : 'wpforms-one-fourth'
1814
+ }
1815
+ ],
1816
+ 'layout-8' : [
1817
+ {
1818
+ 'class': 'one-fourth',
1819
+ 'data' : 'wpforms-one-fourth wpforms-first'
1820
+ },
1821
+ {
1822
+ 'class': 'two-fourth',
1823
+ 'data' : 'wpforms-two-fourths'
1824
+ },
1825
+ {
1826
+ 'class': 'one-fourth',
1827
+ 'data' : 'wpforms-one-fourth'
1828
+ }
1829
+ ]
1830
+ };
1831
+
1832
+ if ( $this.hasClass('layout-selector-showing') ) {
1833
+
1834
+ // Selector is showing, so hide/remove it
1835
+ var $selector = $label.next('.layout-selector-display');
1836
+ $selector.slideUp(400, function() {
1837
+ $selector.remove();
1838
+ });
1839
+ $this.find('span').text(wpforms_builder.layout_selector_show);
1840
+ } else {
1841
+
1842
+ // Create selector options
1843
+ var layoutOptions = '<div class="layout-selector-display">';
1844
+
1845
+ layoutOptions += '<p class="heading">'+wpforms_builder.layout_selector_layout+'</p>';
1846
+ for(var key in layouts) {
1847
+ var layout = layouts[key];
1848
+ layoutOptions += '<div class="layout-selector-display-layout">';
1849
+ for(var key in layout) {
1850
+ layoutOptions += '<span class="'+layout[key].class+'" data-classes="'+layout[key].data+'"></span>';
1851
+ }
1852
+ layoutOptions += '</div>';
1853
+ }
1854
+ layoutOptions += '</div>';
1855
+
1856
+ $label.after(layoutOptions);
1857
+ $label.next('.layout-selector-display').slideDown();
1858
+ $this.find('span').text(wpforms_builder.layout_selector_hide);
1859
+ }
1860
+
1861
+ $this.toggleClass('layout-selector-showing');
1862
+ },
1863
+
1864
+ /**
1865
+ * Field layout selector, selecting a layout.
1866
+ *
1867
+ * @since 1.3.7
1868
+ */
1869
+ fieldLayoutSelectorLayout: function(el) {
1870
+
1871
+ var $this = $(el),
1872
+ $label = $this.closest('label');
1873
+
1874
+ $this.parent().find('.layout-selector-display-layout').not($this).remove();
1875
+ $this.parent().find('.heading').text(wpforms_builder.layout_selector_column);
1876
+ $this.toggleClass('layout-selector-display-layout layout-selector-display-columns')
1877
+ },
1878
+
1879
+ /**
1880
+ * Field layout selector, insert into class field.
1881
+ *
1882
+ * @since 1.3.7
1883
+ */
1884
+ fieldLayoutSelectorInsert: function(el) {
1885
+ var $this = $(el),
1886
+ $selector = $this.closest('.layout-selector-display'),
1887
+ $parent = $selector.parent(),
1888
+ $label = $parent.find('label'),
1889
+ $input = $parent.find('input[type=text]'),
1890
+ classes = $this.data('classes');
1891
+
1892
+ $input.insertAtCaret(classes);
1893
+
1894
+ // remove list, all done!
1895
+ $selector.slideUp(400, function() {
1896
+ $selector.remove();
1897
+ });
1898
+
1899
+ $label.find('.toggle-layout-selector-display').removeClass('layout-selector-showing');
1900
+ $label.find('.toggle-layout-selector-display span').text(wpforms_builder.layout_selector_show);
1901
+ },
1902
+
1903
  //--------------------------------------------------------------------//
1904
  // Settings Panel
1905
  //--------------------------------------------------------------------//
2049
  */
2050
  notificationAdd: function() {
2051
 
2052
+ var nextID = Number($('.wpforms-notifications-add').attr('data-next-id'));
2053
  namePrompt = wpforms_builder.notification_prompt,
2054
  nameField = '<input autofocus="" type="text" id="notification-name" placeholder="'+wpforms_builder.notification_ph+'">',
2055
  nameError = '<p class="error">'+wpforms_builder.notification_error+'</p>',
2066
  return false;
2067
  } else {
2068
  var $firstNotification = $('.wpforms-notification').first(),
2069
+ $newNotification = $firstNotification.clone(),
2070
+ newNotification = '';
2071
 
2072
  $newNotification.find('.wpforms-notification-header span').text(input.val());
2073
  $newNotification.find('input, textarea, select').each(function(index, el) {
2074
  if ($(this).attr('name')) {
2075
  $(this).val('').attr('name', $(this).attr('name').replace(/\[(\d+)\]/, '['+nextID+']'));
2076
  if ($(this).is('select')) {
2077
+ $(this).find('option').prop('selected',false).attr('selected',false);
2078
+ $(this).find('option:first').prop('selected',true).attr('selected','selected');
2079
  } else if ( $(this).attr('type') === 'checkbox') {
2080
+ $(this).prop('checked', false).attr('checked', false).val('1');
2081
  } else {
2082
+ $(this).val('').attr('value','');
2083
  }
2084
  }
2085
  });
2086
+ $newNotification.find('.wpforms-notification-header input').val(input.val()).attr('value',input.val());
2087
+ $newNotification.find('.email-msg textarea').val('{all_fields}').attr('value','{all_fields}');;
2088
+ $newNotification.find('.email-recipient input').val('{admin_email}').attr('value','{admin_email}');
2089
  // Conditional logic, if present
2090
  var $conditionalLogic = $newNotification.find('.wpforms-conditional-block');
2091
  if ($conditionalLogic.length) {
2093
  $conditionalLogic.find('.wpforms-conditional-row').not(':first').remove();
2094
  $conditionalLogic.find('.wpforms-conditional-row').attr('data-input-name', 'settings[notifications]['+nextID+']');
2095
  $conditionalLogic.find('.wpforms-conditional-field').attr('data-groupid', '0').attr('data-ruleid', '0');
 
 
 
 
 
2096
  $conditionalLogic.find('.wpforms-conditional-row').find('.value').empty().append('<select>');
2097
  $conditionalLogic.find('.wpforms-conditional-groups').hide();
2098
  }
2099
+ newNotification = $newNotification.wrap('<div>').parent().html();
2100
+ newNotification = newNotification.replace( /wpforms-panel-field-notifications-(\d+)/g, 'wpforms-panel-field-notification-'+nextID );
2101
+ newNotification = newNotification.replace( /\[conditionals\]\[(\d+)\]\[(\d+)\]/g, '[conditionals][0][0]' );
2102
+
2103
+ $firstNotification.before( newNotification );
2104
+
2105
+ $('.wpforms-notifications-add').attr('data-next-id', nextID+1);
2106
  }
2107
  }
2108
  });
2269
  */
2270
  bindUIActionsGeneral: function() {
2271
 
2272
+ // Toggle Smart Tags
2273
+ $(document).on('click', '.toggle-smart-tag-display', function(e) {
2274
+ e.preventDefault();
2275
+ WPFormsBuilder.smartTagToggle(this);
2276
+ });
2277
+
2278
+ $(document).on('click', '.smart-tags-list-display a', function(e) {
2279
+ e.preventDefault();
2280
+ WPFormsBuilder.smartTagInsert(this);
2281
+ });
2282
+
2283
  // Field map table, update key source
2284
  $(document).on('input', '.wpforms-field-map-table .key-source', function(){
2285
  var value = $(this).val(),
2322
  });
2323
  },
2324
 
2325
+ /**
2326
+ * Smart Tag toggling.
2327
+ *
2328
+ * @since 1.0.1
2329
+ */
2330
+ smartTagToggle: function(el) {
2331
+
2332
+ var $this = $(el),
2333
+ $label = $this.closest('label');
2334
+
2335
+ if ( $this.hasClass('smart-tag-showing') ) {
2336
+
2337
+ // Smart tags are showing, so hide/remove them
2338
+ var $list = $label.next('.smart-tags-list-display');
2339
+ $list.slideUp(400, function() {
2340
+ $list.remove();
2341
+ });
2342
+ $this.find('span').text(wpforms_builder.smart_tags_show);
2343
+ } else {
2344
+
2345
+ // Show all fields or narrow to specific field types
2346
+ var allowed = $this.data('fields'),
2347
+ type = $this.data('type');
2348
+ if ( allowed && allowed.length ) {
2349
+ var fields = wpf.getFields(allowed.split(','));
2350
+ } else {
2351
+ var fields = wpf.getFields();
2352
+ }
2353
+
2354
+ // Create smart tags list
2355
+ var smartTagList = '<ul class="smart-tags-list-display">';
2356
+
2357
+ if (type === 'fields' || type === 'all') {
2358
+ if (!fields) {
2359
+ smartTagList += '<li class="heading">'+wpforms_builder.fields_unavailable+'</li>';
2360
+ } else {
2361
+ smartTagList += '<li class="heading">'+wpforms_builder.fields_available+'</li>';
2362
+ for(var key in fields) {
2363
+ if (fields[key].label) {
2364
+ var label = wpf.sanitizeString(fields[key].label);
2365
+ } else {
2366
+ var label = wpforms_builder.field+' #'+fields[key].id;
2367
+ }
2368
+ smartTagList += '<li><a href="#" data-type="field" data-meta=\'' + fields[key].id + '\'>'+label+'</a></li>';
2369
+ }
2370
+ }
2371
+ }
2372
+
2373
+ if (type === 'other' || type === 'all') {
2374
+ smartTagList += '<li class="heading">'+wpforms_builder.other+'</li>';
2375
+ for(var key in wpforms_builder.smart_tags) {
2376
+ smartTagList += '<li><a href="#" data-type="other" data-meta=\'' + key+ '\'>'+wpforms_builder.smart_tags[key]+'</a></li>';
2377
+ }
2378
+ }
2379
+
2380
+ smartTagList += '</ul>';
2381
+
2382
+ $label.after(smartTagList);
2383
+ $label.next('.smart-tags-list-display').slideDown();
2384
+ $this.find('span').text(wpforms_builder.smart_tags_hide);
2385
+ }
2386
+
2387
+ $this.toggleClass('smart-tag-showing');
2388
+ },
2389
+
2390
+ /**
2391
+ * Smart Tag insert.
2392
+ *
2393
+ * @since 1.0.1
2394
+ */
2395
+ smartTagInsert: function(el) {
2396
+
2397
+ var $this = $(el),
2398
+ $list = $this.closest('.smart-tags-list-display'),
2399
+ $parent = $list.parent(),
2400
+ $label = $parent.find('label'),
2401
+ $input = $parent.find('input[type=text]'),
2402
+ meta = $this.data('meta'),
2403
+ type = $this.data('type');
2404
+
2405
+ if ( ! $input.length ) {
2406
+ $input = $parent.find('textarea');
2407
+ }
2408
+
2409
+ // insert smart tag
2410
+ if ( type === 'field' ) {
2411
+ $input.insertAtCaret('{field_id="'+meta+'"}');
2412
+ } else {
2413
+ $input.insertAtCaret('{'+meta+'}');
2414
+ }
2415
+
2416
+ // remove list, all done!
2417
+ $list.slideUp(400, function() {
2418
+ $list.remove();
2419
+ });
2420
+
2421
+ $label.find('.toggle-smart-tag-display span').text(wpforms_builder.smart_tags_show);
2422
+ $label.find('.toggle-smart-tag-display').removeClass('smart-tag-showing');
2423
+ },
2424
+
2425
  /**
2426
  * Field map table - Delete row
2427
  *
2585
 
2586
  WPFormsBuilder.init();
2587
 
2588
+ })(jQuery);
assets/js/admin-settings.js CHANGED
@@ -38,6 +38,7 @@
38
  s.tabs = $('#wpforms-tabs');
39
  s.tabs_nav = $('#wpforms-tabs-nav');
40
  s.integrationFocus = WPFormsSettings.getQueryString('wpforms-integration');
 
41
 
42
  // If we have a hash and it begins with "wpforms-tab", set the proper tab to be opened.
43
  if ( s.tabs_hash && s.tabs_hash.indexOf('wpforms-tab-') >= 0 ) {
@@ -56,6 +57,10 @@
56
  $('body').animate({
57
  scrollTop: $('#wpforms-integration-'+s.integrationFocus).offset().top
58
  }, 1000);
 
 
 
 
59
  }
60
  });
61
 
@@ -151,7 +156,11 @@
151
  $this.closest('.wpforms-settings-provider-accounts-connect').slideToggle();
152
  } else {
153
  console.log(res);
154
- alert( 'Could not authenticate with the provider' );
 
 
 
 
155
  }
156
  $this.text(text);
157
  $icon.hide();
@@ -212,4 +221,4 @@
212
  }
213
 
214
  WPFormsSettings.init();
215
- })(jQuery);
38
  s.tabs = $('#wpforms-tabs');
39
  s.tabs_nav = $('#wpforms-tabs-nav');
40
  s.integrationFocus = WPFormsSettings.getQueryString('wpforms-integration');
41
+ s.jumpTo = WPFormsSettings.getQueryString('jump');
42
 
43
  // If we have a hash and it begins with "wpforms-tab", set the proper tab to be opened.
44
  if ( s.tabs_hash && s.tabs_hash.indexOf('wpforms-tab-') >= 0 ) {
57
  $('body').animate({
58
  scrollTop: $('#wpforms-integration-'+s.integrationFocus).offset().top
59
  }, 1000);
60
+ } else if ( s.jumpTo ) {
61
+ $('body').animate({
62
+ scrollTop: $('#'+s.jumpTo).offset().top
63
+ }, 1000);
64
  }
65
  });
66
 
156
  $this.closest('.wpforms-settings-provider-accounts-connect').slideToggle();
157
  } else {
158
  console.log(res);
159
+ var msg = 'Could not authenticate with the provider.';
160
+ if ( res.data.error_msg ) {
161
+ msg = msg+"\n"+res.data.error_msg;
162
+ }
163
+ alert( msg );
164
  }
165
  $this.text(text);
166
  $icon.hide();
221
  }
222
 
223
  WPFormsSettings.init();
224
+ })(jQuery);
assets/js/admin-utils.js CHANGED
@@ -96,7 +96,7 @@ var wpf = {
96
  // Preserve the order of field choices
97
  for(var key in fields) {
98
  if (fields[key].choices) {
99
- jQuery('#wpforms-field-option-row-'+fields[key].id+'-choices li').each(function(index, ele) {
100
  var choiceKey = jQuery(ele).data('key');
101
  fields[key].choices['choice_'+choiceKey] = fields[key].choices[choiceKey];
102
  fields[key].choices['choice_'+choiceKey].key = choiceKey;
@@ -353,4 +353,4 @@ var wpf = {
353
  return false
354
  }
355
  }
356
- wpf.init();
96
  // Preserve the order of field choices
97
  for(var key in fields) {
98
  if (fields[key].choices) {
99
+ jQuery('#wpforms-field-option-row-'+fields[key].id+'-choices .choices-list li').each(function(index, ele) {
100
  var choiceKey = jQuery(ele).data('key');
101
  fields[key].choices['choice_'+choiceKey] = fields[key].choices[choiceKey];
102
  fields[key].choices['choice_'+choiceKey].key = choiceKey;
353
  return false
354
  }
355
  }
356
+ wpf.init();
assets/js/wpforms.js CHANGED
@@ -60,13 +60,18 @@
60
  // Only load if jQuery validation library exists
61
  if (typeof $.fn.validate !== 'undefined') {
62
 
 
 
 
 
 
63
  // Payments: Validate method for Credit Card Number
64
  if(typeof $.fn.payment !== 'undefined') {
65
  $.validator.addMethod( "creditcard", function(value, element) {
66
  //var type = $.payment.cardType(value);
67
  var valid = $.payment.validateCardNumber(value);
68
  return this.optional(element) || valid;
69
- }, "Please enter a valid credit card number.");
70
  // @todo validate CVC and expiration
71
  }
72
 
@@ -74,7 +79,7 @@
74
  $.validator.addMethod( "extension", function(value, element, param) {
75
  param = typeof param === "string" ? param.replace( /,/g, "|" ) : "png|jpe?g|gif";
76
  return this.optional(element) || value.match( new RegExp( "\\.(" + param + ")$", "i" ) );
77
- }, $.validator.format("File type is not allowed") );
78
 
79
  // Validate method for file size
80
  $.validator.addMethod("maxsize", function(value, element, param) {
@@ -95,7 +100,7 @@
95
  }
96
  }
97
  return true;
98
- }, $.validator.format("File exceeds max size allowed"));
99
 
100
  // Validate email addresses
101
  $.validator.methods.email = function( value, element ) {
@@ -105,19 +110,22 @@
105
  // Validate confirmations
106
  $.validator.addMethod("confirm", function(value, element, param) {
107
  return $.validator.methods.equalTo.call(this, value, element, param);
108
- }, function(params, element) {
109
- return $(element).data('rule-confirm-msg');
110
- });
 
 
 
111
 
112
  // Validate 12-hour time
113
  $.validator.addMethod( "time12h", function( value, element ) {
114
  return this.optional( element ) || /^((0?[1-9]|1[012])(:[0-5]\d){1,2}(\ ?[AP]M))$/i.test( value );
115
- }, "Please enter time in 12-hour AM/PM format (eg 8:45 AM)" );
116
 
117
  // Validate 24-hour time
118
  $.validator.addMethod( "time24h", function( value, element ) {
119
  return this.optional(element) || /^(([0-1]?[0-9])|([2][0-3])):([0-5]?[0-9])(\ ?[AP]M)?$/i.test(value);
120
- }, "Please enter time in 24-hour format (eg 22:45)" );
121
 
122
  // Finally load jQuery Validation library for our forms
123
  $('.wpforms-validate').each(function() {
@@ -157,11 +165,16 @@
157
  $submit = $form.find('.wpforms-submit'),
158
  altText = $submit.data('alt-text');
159
 
160
- if (altText) {
161
- $submit.text(altText).prop('disabled', true);
 
 
 
 
 
 
 
162
  }
163
-
164
- form.submit();
165
  }
166
  }
167
  }
@@ -284,7 +297,7 @@
284
 
285
  // Payments: Update Total field(s) when latest calculation.
286
  $(document).on('change input', '.wpforms-payment-price', function(event) {
287
- WPForms.amountTotal(this);
288
  });
289
 
290
  // Payments: Restrict user input payment fields
@@ -430,27 +443,15 @@
430
  // Other functions
431
  //--------------------------------------------------------------------//
432
 
433
- /**
434
- * Google reCAPTCHA callback.
435
- *
436
- * @since 1.3.4
437
- */
438
- recaptchaCallback: function( el ) {
439
-
440
- var $this = $(el),
441
- $hidden = $this.parent().find('.wpforms-recaptcha-hidden');
442
-
443
- $hidden.val('1').valid();
444
- },
445
-
446
  /**
447
  * Payments: Calculate total.
448
  *
449
  * @since 1.2.3
450
  */
451
- amountTotal: function(el) {
452
 
453
- var $form = $(el).closest('.wpforms-form'),
 
454
  total = 0,
455
  totalFormatted = 0,
456
  totalFormattedSymbol = 0,
@@ -483,8 +484,11 @@
483
  }
484
 
485
  $form.find('.wpforms-payment-total').each(function(index, el) {
486
- if ($(this).attr('type') == 'hidden') {
487
  $(this).val(totalFormattedSymbol);
 
 
 
488
  } else {
489
  $(this).text(totalFormattedSymbol);
490
  }
@@ -555,17 +559,28 @@
555
  getCurrency: function() {
556
 
557
  var currency = {
 
558
  thousands_sep: ',',
559
  decimal_sep: '.',
560
  symbol: '$',
561
  symbol_pos: 'left'
562
  }
563
 
564
- if ( 'undefined' !== wpforms_currency) {
565
- currency.thousands_sep = wpforms_currency.thousands;
566
- currency.decimal_sep = wpforms_currency.decimal;
567
- currency.symbol = wpforms_currency.symbol;
568
- currency.symbol_pos = wpforms_currency.symbol_pos;
 
 
 
 
 
 
 
 
 
 
569
  }
570
 
571
  return currency;
@@ -724,4 +739,4 @@
724
 
725
  window.wpforms = WPForms;
726
 
727
- })(jQuery);
60
  // Only load if jQuery validation library exists
61
  if (typeof $.fn.validate !== 'undefined') {
62
 
63
+ $.validator.messages.required = wpforms_settings.val_required;
64
+ $.validator.messages.url = wpforms_settings.val_url;
65
+ $.validator.messages.email = wpforms_settings.val_email;
66
+ $.validator.messages.number = wpforms_settings.val_number;
67
+
68
  // Payments: Validate method for Credit Card Number
69
  if(typeof $.fn.payment !== 'undefined') {
70
  $.validator.addMethod( "creditcard", function(value, element) {
71
  //var type = $.payment.cardType(value);
72
  var valid = $.payment.validateCardNumber(value);
73
  return this.optional(element) || valid;
74
+ }, wpforms_settings.val_creditcard);
75
  // @todo validate CVC and expiration
76
  }
77
 
79
  $.validator.addMethod( "extension", function(value, element, param) {
80
  param = typeof param === "string" ? param.replace( /,/g, "|" ) : "png|jpe?g|gif";
81
  return this.optional(element) || value.match( new RegExp( "\\.(" + param + ")$", "i" ) );
82
+ }, wpforms_settings.val_fileextension );
83
 
84
  // Validate method for file size
85
  $.validator.addMethod("maxsize", function(value, element, param) {
100
  }
101
  }
102
  return true;
103
+ }, wpforms_settings.val_filesize);
104
 
105
  // Validate email addresses
106
  $.validator.methods.email = function( value, element ) {
110
  // Validate confirmations
111
  $.validator.addMethod("confirm", function(value, element, param) {
112
  return $.validator.methods.equalTo.call(this, value, element, param);
113
+ }, wpforms_settings.val_confirm);
114
+
115
+ // Validate required payments
116
+ $.validator.addMethod( "required-payment", function( value, element ) {
117
+ return WPForms.amountSanitize( value ) > 0;
118
+ }, wpforms_settings.val_requiredpayment );
119
 
120
  // Validate 12-hour time
121
  $.validator.addMethod( "time12h", function( value, element ) {
122
  return this.optional( element ) || /^((0?[1-9]|1[012])(:[0-5]\d){1,2}(\ ?[AP]M))$/i.test( value );
123
+ }, wpforms_settings.val_time12h );
124
 
125
  // Validate 24-hour time
126
  $.validator.addMethod( "time24h", function( value, element ) {
127
  return this.optional(element) || /^(([0-1]?[0-9])|([2][0-3])):([0-5]?[0-9])(\ ?[AP]M)?$/i.test(value);
128
+ }, wpforms_settings.val_time24h );
129
 
130
  // Finally load jQuery Validation library for our forms
131
  $('.wpforms-validate').each(function() {
165
  $submit = $form.find('.wpforms-submit'),
166
  altText = $submit.data('alt-text');
167
 
168
+ if ( WPForms.empty( $submit.get(0).recaptchaID ) && $submit.get(0).recaptchaID !== 0 ) {
169
+ // Normal form.
170
+ if (altText) {
171
+ $submit.text(altText).prop('disabled', true);
172
+ }
173
+ form.submit();
174
+ } else {
175
+ // Form contains invisible reCAPTCHA.
176
+ grecaptcha.execute( $submit.get(0).recaptchaID );
177
  }
 
 
178
  }
179
  }
180
  }
297
 
298
  // Payments: Update Total field(s) when latest calculation.
299
  $(document).on('change input', '.wpforms-payment-price', function(event) {
300
+ WPForms.amountTotal(this, true);
301
  });
302
 
303
  // Payments: Restrict user input payment fields
443
  // Other functions
444
  //--------------------------------------------------------------------//
445
 
 
 
 
 
 
 
 
 
 
 
 
 
 
446
  /**
447
  * Payments: Calculate total.
448
  *
449
  * @since 1.2.3
450
  */
451
+ amountTotal: function(el, validate) {
452
 
453
+ var validate = validate || false,
454
+ $form = $(el).closest('.wpforms-form'),
455
  total = 0,
456
  totalFormatted = 0,
457
  totalFormattedSymbol = 0,
484
  }
485
 
486
  $form.find('.wpforms-payment-total').each(function(index, el) {
487
+ if ( 'hidden' === $(this).attr('type') || 'text' === $(this).attr('type') ) {
488
  $(this).val(totalFormattedSymbol);
489
+ if ( 'text' === $(this).attr('type') && validate ) {
490
+ $(this).valid();
491
+ }
492
  } else {
493
  $(this).text(totalFormattedSymbol);
494
  }
559
  getCurrency: function() {
560
 
561
  var currency = {
562
+ code: 'USD',
563
  thousands_sep: ',',
564
  decimal_sep: '.',
565
  symbol: '$',
566
  symbol_pos: 'left'
567
  }
568
 
569
+ // Backwards compatibility.
570
+ if ( typeof wpforms_settings.currency_code !== 'undefined' ) {
571
+ currency.code = wpforms_settings.currency_code;
572
+ }
573
+ if ( typeof wpforms_settings.currency_thousands !== 'undefined' ) {
574
+ currency.thousands_sep = wpforms_settings.currency_thousands;
575
+ }
576
+ if ( typeof wpforms_settings.currency_decimal !== 'undefined' ) {
577
+ currency.decimal_sep = wpforms_settings.currency_decimal;
578
+ }
579
+ if ( typeof wpforms_settings.currency_symbol !== 'undefined' ) {
580
+ currency.symbol = wpforms_settings.currency_symbol;
581
+ }
582
+ if ( typeof wpforms_settings.currency_symbol_pos !== 'undefined' ) {
583
+ currency.symbol_pos = wpforms_settings.currency_symbol_pos;
584
  }
585
 
586
  return currency;
739
 
740
  window.wpforms = WPForms;
741
 
742
+ })(jQuery);
changelog.txt CHANGED
@@ -1,5 +1,24 @@
1
  == Changelog ==
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  = 1.3.6.2 =
4
  - Changed: Improved messaging on Entries page (Lite)
5
 
1
  == Changelog ==
2
 
3
+ = 1.3.7.2 =
4
+ - Fixed: Error for some users with PHP 5.4 and below
5
+
6
+ = 1.3.7.1
7
+ - Fixed: Issue sending form notifications using email fields that had confirmation enabled
8
+
9
+ = 1.3.7 =
10
+ - Added: Google Invisible reCAPTCHA support
11
+ - Added: Custom field validation messages (see WPForms Settings page)
12
+ - Added: Bulk add choices for Checkbox, Multiple Choice, and Dropdown fields
13
+ - Addded: Filter to allow email notifications to include empty fields, `wpforms_email_display_empty_fields`
14
+ - Added: Field CSS layout selector
15
+ - Changed: Leverage `wp_json_encode` instead of native PHP function
16
+ - Changed: Various WordPress coding standard improvements (work in progress)
17
+ - Changed: Refactored form front-end code to allow for more customizations
18
+ - Changed: Refactored text, textarea, email, number, nand ame fields to allow for more customizations (more coming next release)
19
+ - Fixed: Welcome page typo
20
+ - Fixed: SmartTag selectors getting off sync inside form builder
21
+
22
  = 1.3.6.2 =
23
  - Changed: Improved messaging on Entries page (Lite)
24
 
includes/admin/builder/class-builder.php CHANGED
@@ -89,8 +89,9 @@ class WPForms_Builder {
89
  // Load builder panels
90
  $this->load_panels();
91
 
92
- add_action( 'admin_enqueue_scripts', array( $this, 'enqueues' ) );
93
- add_action( 'wpforms_admin_page', array( $this, 'output' ) );
 
94
 
95
  // Provide hook for add-ons
96
  do_action( 'wpforms_builder_init', $this->view );
@@ -269,6 +270,13 @@ class WPForms_Builder {
269
 
270
  $strings = array(
271
  'ajax_url' => admin_url( 'admin-ajax.php' ),
 
 
 
 
 
 
 
272
  'date_select_day' => __( 'DD', 'wpforms' ),
273
  'date_select_month' => __( 'MM', 'wpforms' ),
274
  'dynamic_choice_limit' => __( 'The {source} {type} contains over {limit} items ({total}). This may make the field difficult for your vistors to use and/or cause the form to be slow.', 'wpforms' ),
@@ -292,6 +300,10 @@ class WPForms_Builder {
292
  'saving' => __( 'Saving ...', 'wpforms' ),
293
  'saved' => __( 'Saved!', 'wpforms' ),
294
  'save_exit' => __( 'Save and Exit', 'wpforms' ),
 
 
 
 
295
  'loading' => __( 'Loading', 'wpforms' ),
296
  'template_name' => !empty( $this->template['name'] ) ? $this->template['name'] : '',
297
  'template_slug' => !empty( $this->template['slug'] ) ? $this->template['slug'] : '',
@@ -337,6 +349,44 @@ class WPForms_Builder {
337
  do_action( 'wpforms_builder_enqueues', $this->view );
338
  }
339
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
340
  /**
341
  * Load the appropriate files to build the page.
342
  *
@@ -432,4 +482,4 @@ class WPForms_Builder {
432
  <?php
433
  }
434
  }
435
- new WPForms_Builder;
89
  // Load builder panels
90
  $this->load_panels();
91
 
92
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueues' ) );
93
+ add_action( 'admin_print_footer_scripts', array( $this, 'footer_scripts' ) );
94
+ add_action( 'wpforms_admin_page', array( $this, 'output' ) );
95
 
96
  // Provide hook for add-ons
97
  do_action( 'wpforms_builder_init', $this->view );
270
 
271
  $strings = array(
272
  'ajax_url' => admin_url( 'admin-ajax.php' ),
273
+ 'bulk_add_button' => __( 'Add New Choices', 'wpforms '),
274
+ 'bulk_add_show' => __( 'Bulk Add', 'wpforms' ),
275
+ 'bulk_add_hide' => __( 'Hide Bulk Add', 'wpforms' ),
276
+ 'bulk_add_heading' => __( 'Add Choices (one per line)', 'wpforms '),
277
+ 'bulk_add_placeholder' => __( "Blue\nRed\nGreen", 'wpforms '),
278
+ 'bulk_add_presets_show' => __( 'Show presets', 'wpforms '),
279
+ 'bulk_add_presets_hide' => __( 'Hide presets', 'wpforms '),
280
  'date_select_day' => __( 'DD', 'wpforms' ),
281
  'date_select_month' => __( 'MM', 'wpforms' ),
282
  'dynamic_choice_limit' => __( 'The {source} {type} contains over {limit} items ({total}). This may make the field difficult for your vistors to use and/or cause the form to be slow.', 'wpforms' ),
300
  'saving' => __( 'Saving ...', 'wpforms' ),
301
  'saved' => __( 'Saved!', 'wpforms' ),
302
  'save_exit' => __( 'Save and Exit', 'wpforms' ),
303
+ 'layout_selector_show' => __( 'Show Layouts', 'wpforms' ),
304
+ 'layout_selector_hide' => __( 'Hide Layouts', 'wpforms' ),
305
+ 'layout_selector_layout' => __( 'Select your layout', 'wpforms' ),
306
+ 'layout_selector_column' => __( 'Select your column', 'wpforms' ),
307
  'loading' => __( 'Loading', 'wpforms' ),
308
  'template_name' => !empty( $this->template['name'] ) ? $this->template['name'] : '',
309
  'template_slug' => !empty( $this->template['slug'] ) ? $this->template['slug'] : '',
349
  do_action( 'wpforms_builder_enqueues', $this->view );
350
  }
351
 
352
+ /**
353
+ * Footer javascript.
354
+ *
355
+ * @since 1.3.7
356
+ */
357
+ public function footer_scripts() {
358
+
359
+ $choices = array(
360
+ 'countries' => array(
361
+ 'name' => __( 'Countries', 'wpforms' ),
362
+ 'choices' => array_values( wpforms_countries() ),
363
+ ),
364
+ 'countries_postal' => array(
365
+ 'name' => __( 'Countries Postal Code', 'wpforms' ),
366
+ 'choices' => array_keys( wpforms_countries() ),
367
+ ),
368
+ 'states' => array(
369
+ 'name' => __( 'States', 'wpforms' ),
370
+ 'choices' => array_values( wpforms_us_states() ),
371
+ ),
372
+ 'states_postal' => array(
373
+ 'name' => __( 'States Postal Code', 'wpforms' ),
374
+ 'choices' => array_keys( wpforms_us_states() ),
375
+ ),
376
+ 'months' => array(
377
+ 'name' => __( 'Months', 'wpforms' ),
378
+ 'choices' => array_values( wpforms_months() ),
379
+ ),
380
+ 'days' => array(
381
+ 'name' => __( 'Days', 'wpforms' ),
382
+ 'choices' => array_values( wpforms_days() ),
383
+ ),
384
+ );
385
+ $choices = apply_filters( 'wpforms_builder_preset_choices', $choices );
386
+
387
+ echo '<script type="text/javascript">wpforms_preset_choices=' . wp_json_encode( $choices ) . '</script>';
388
+ }
389
+
390
  /**
391
  * Load the appropriate files to build the page.
392
  *
482
  <?php
483
  }
484
  }
485
+ new WPForms_Builder;
includes/admin/builder/panels/class-settings.php CHANGED
@@ -147,15 +147,16 @@ class WPForms_Builder_Panel_Settings extends WPForms_Builder_Panel {
147
  $this->form_data,
148
  __( 'Enable anti-spam honeypot', 'wpforms' )
149
  );
150
- $recaptcha_key = wpforms_setting( 'recaptcha-site-key', false );
151
- $recaptcha_secret = wpforms_setting( 'recaptcha-secret-key', false );
 
152
  if ( !empty( $recaptcha_key ) && !empty( $recaptcha_secret ) ) {
153
  wpforms_panel_field(
154
  'checkbox',
155
  'settings',
156
  'recaptcha',
157
  $this->form_data,
158
- __( 'Enable reCAPTCHA', 'wpforms' )
159
  );
160
  }
161
  do_action( 'wpforms_form_settings_general', $this );
@@ -237,4 +238,4 @@ class WPForms_Builder_Panel_Settings extends WPForms_Builder_Panel {
237
  do_action( 'wpforms_form_settings_panel_content', $this );
238
  }
239
  }
240
- new WPForms_Builder_Panel_Settings;
147
  $this->form_data,
148
  __( 'Enable anti-spam honeypot', 'wpforms' )
149
  );
150
+ $recaptcha_key = wpforms_setting( 'recaptcha-site-key' );
151
+ $recaptcha_secret = wpforms_setting( 'recaptcha-secret-key' );
152
+ $recaptcha_type = wpforms_setting( 'recaptcha-type' );
153
  if ( !empty( $recaptcha_key ) && !empty( $recaptcha_secret ) ) {
154
  wpforms_panel_field(
155
  'checkbox',
156
  'settings',
157
  'recaptcha',
158
  $this->form_data,
159
+ $recaptcha_type === 'invisible' ? __( 'Enable Google invisible reCAPTCHA', 'wpforms' ) : __( 'Enable Google reCAPTCHA (v2)', 'wpforms' )
160
  );
161
  }
162
  do_action( 'wpforms_form_settings_general', $this );
238
  do_action( 'wpforms_form_settings_panel_content', $this );
239
  }
240
  }
241
+ new WPForms_Builder_Panel_Settings;
includes/admin/class-welcome.php CHANGED
@@ -118,7 +118,7 @@ class WPForms_Welcome {
118
  <div class="feature-section two-col">
119
  <div class="col">
120
  <h3><?php _e( 'Creating Your First Form' , 'wpforms' ); ?></h3>
121
- <p><?php printf( __( 'WPForms make it easy to create forms in WordPress. You can follow the video tutorial on the right or read our how to <a href="%s" target="_blank" rel="noopener">create your first form guide</a>.', 'wpforms' ), ' https://wpforms.com/docs/creating-first-form/ ' ); ?>
122
  <p><?php printf( __( 'But in reality, the process is so intuitive that you can just start by going to <a href="%s">WPForms - > Add New</a>.', 'wpforms' ), admin_url( 'admin.php?page=wpforms-builder' ) ); ?>
123
  </div>
124
  <div class="col">
@@ -226,4 +226,4 @@ class WPForms_Welcome {
226
  );
227
  }
228
  }
229
- new WPForms_Welcome;
118
  <div class="feature-section two-col">
119
  <div class="col">
120
  <h3><?php _e( 'Creating Your First Form' , 'wpforms' ); ?></h3>
121
+ <p><?php printf( __( 'WPForms makes it easy to create forms in WordPress. You can follow the video tutorial on the right or read our how to <a href="%s" target="_blank" rel="noopener">create your first form guide</a>.', 'wpforms' ), ' https://wpforms.com/docs/creating-first-form/ ' ); ?>
122
  <p><?php printf( __( 'But in reality, the process is so intuitive that you can just start by going to <a href="%s">WPForms - > Add New</a>.', 'wpforms' ), admin_url( 'admin.php?page=wpforms-builder' ) ); ?>
123
  </div>
124
  <div class="col">
226
  );
227
  }
228
  }
229
+ new WPForms_Welcome;
includes/class-frontend.php CHANGED
@@ -7,7 +7,7 @@
7
  * @since 1.0.0
8
  * @license GPL-2.0+
9
  * @copyright Copyright (c) 2016, WPForms LLC
10
- */
11
  class WPForms_Frontend {
12
 
13
  /**
@@ -18,6 +18,18 @@ class WPForms_Frontend {
18
  */
19
  public $forms;
20
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  /**
22
  * Primary class constructor.
23
  *
@@ -27,19 +39,24 @@ class WPForms_Frontend {
27
 
28
  $this->forms = array();
29
 
30
- // Actions
31
- add_action( 'wpforms_frontend_output_success', array( $this, 'confirmation' ), 10, 2 );
32
- add_action( 'wpforms_frontend_output', array( $this, 'head' ), 5, 5 );
33
- add_action( 'wpforms_frontend_output', array( $this, 'page_indicator' ), 10, 5 );
34
- add_action( 'wpforms_frontend_output', array( $this, 'fields' ), 10, 5 );
35
- add_action( 'wpforms_frontend_output', array( $this, 'honeypot' ), 15, 5 );
36
- add_action( 'wpforms_frontend_output', array( $this, 'recaptcha' ), 20, 5 );
37
- add_action( 'wpforms_frontend_output', array( $this, 'foot' ), 25, 5 );
38
- add_action( 'wp_enqueue_scripts', array( $this, 'assets_header' ) );
39
- add_action( 'wp_footer', array( $this, 'assets_footer' ), 15 );
40
- add_action( 'wp_footer', array( $this, 'footer_end' ), 99 );
41
-
42
- // Register shortcode
 
 
 
 
 
43
  add_shortcode( 'wpforms', array( $this, 'shortcode' ) );
44
  }
45
 
@@ -53,78 +70,103 @@ class WPForms_Frontend {
53
  */
54
  public function output( $id, $title = false, $description = false ) {
55
 
56
- if ( empty( $id ) )
57
  return;
 
58
 
59
- // Grab the form data, if not found then we bail
60
  $form = wpforms()->form->get( (int) $id );
61
 
62
- if ( empty( $form ) )
63
  return;
 
64
 
65
- // Basic information
66
  $form_data = wpforms_decode( $form->post_content, true );
67
  $form_id = absint( $form->ID );
68
  $settings = $form_data['settings'];
69
  $action = esc_url_raw( remove_query_arg( 'wpforms' ) );
70
- $class[] = wpforms_setting( 'disable-css', '1' ) == '1' ? 'wpforms-container-full' : '';
71
- $errors = empty( wpforms()->process->errors[$form->ID] ) ? array() : wpforms()->process->errors[$form->ID];
72
  $success = false;
73
  $title = filter_var( $title, FILTER_VALIDATE_BOOLEAN );
74
  $description = filter_var( $description, FILTER_VALIDATE_BOOLEAN );
75
 
76
- // If the form does not contain any fields do not proceed
77
  if ( empty( $form_data['fields'] ) ) {
78
  echo '<!-- WPForms: no fields, form hidden -->';
79
  return;
80
  }
81
 
82
- // Before output hook
83
  do_action( 'wpforms_frontend_output_before', $form_data, $form );
84
 
85
- // Check for return hash OR error free completed form and confirmation before we continue
86
- if ( !empty( $_GET['wpforms_return'] ) ) {
 
87
  $success = wpforms()->process->validate_return_hash( $_GET['wpforms_return'] );
88
  if ( $success ) {
89
- $form_data = wpforms()->form->get( $success, array( 'content_only' => true ) );
 
 
 
90
  }
91
- } elseif ( !empty( $_POST['wpforms']['id'] ) && $form->ID == $_POST['wpforms']['id'] && empty( $errors ) ) {
 
92
  $success = true;
93
  }
94
- if ( $success && !empty( $form_data ) ) {
95
 
 
 
 
96
  do_action( 'wpforms_frontend_output_success', $form_data );
97
-
98
- // Debug
99
  wpforms_debug_data( $_POST );
100
-
101
  return;
102
  }
103
 
104
  // Allow filter to return early if some condition is not met.
105
- if ( ! apply_filters( 'wpforms_frontend_load', true, $form_data, $form ) ) {
106
  return;
107
  }
108
 
109
- // Prep the form action URL, allow filter
110
- if ( !empty( $settings['confirmation_type'] ) && 'message' == $settings['confirmation_type'] && !empty( $settings['confirmation_message_scroll'] ) ) {
 
 
 
 
 
 
 
 
111
  $action .= '#wpforms-' . $form_id;
112
  }
113
- $action = apply_filters( 'wpforms_frontend_form_action', $action, $form_data, $form );
114
 
115
- // Allow form container classes to be filtered
116
- $class = array_map( 'sanitize_html_class', apply_filters( 'wpforms_frontend_container_class', $class, $form_data ) );
117
 
118
- if ( !empty( $form_data['settings']['form_class'] ) ) {
119
- $class = array_merge( $class, array_map('sanitize_html_class', explode( ' ', $form_data['settings']['form_class'] ) ) );
 
 
120
  }
 
121
 
122
  // Begin to build the output
123
- echo '<div class="wpforms-container ' . implode( ' ', $class ) . '" id="wpforms-' . $form_id . '">';
 
 
 
 
124
 
125
- echo '<form method="post" enctype="multipart/form-data" id="wpforms-form-' . $form_id . '" action="' . $action . '" class="wpforms-validate wpforms-form" data-formid="' . $form_id . '">';
 
 
 
 
 
126
 
127
- do_action( 'wpforms_frontend_output', $form_data, $form, $title, $description, $errors );
128
 
129
  echo '</form>';
130
 
@@ -133,9 +175,10 @@ class WPForms_Frontend {
133
  // After output hook
134
  do_action( 'wpforms_frontend_output_after', $form_data, $form );
135
 
136
- $this->forms[$form_id] = $form_data;
 
137
 
138
- // Debug
139
  wpforms_debug_data( $form_data );
140
  }
141
 
@@ -144,29 +187,32 @@ class WPForms_Frontend {
144
  *
145
  * @since 1.0.0
146
  * @param array $form_data
147
- * @param mixed $title
148
- * @param mixed $description
149
  */
150
  function confirmation( $form_data ) {
151
 
152
- if ( !empty( $form_data['settings']['confirmation_type'] ) && 'message' == $form_data['settings']['confirmation_type'] ) {
153
-
154
- // Load confirmatiom specific asssets
155
- $this->assets_confirmation();
156
-
157
- $complete = !empty( $_POST['wpforms']['complete'] ) ? $_POST['wpforms']['complete'] : array();
158
- $entry_id = !empty( $_POST['wpforms']['entry_id'] ) ? $_POST['wpforms']['entry_id'] : 0;
159
- $message = apply_filters( 'wpforms_process_smart_tags', $form_data['settings']['confirmation_message'], $form_data, $complete, $entry_id );
160
- $message = apply_filters( 'wpforms_frontend_confirmation_message', $message, $form_data );
161
-
162
- $class = wpforms_setting( 'disable-css', '1' ) == '1' ? 'wpforms-confirmation-container-full' : 'wpforms-confirmation-container';
163
 
164
- echo '<div class="' . $class . '" id="wpforms-confirmation-' . absint( $form_data['id'] ) . '">';
165
-
166
- echo wpautop( $message );
167
-
168
- echo '</div>';
169
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
170
  }
171
 
172
  /**
@@ -174,334 +220,375 @@ class WPForms_Frontend {
174
  *
175
  * @since 1.0.0
176
  * @param array $form_data
177
- * @param object $form
178
  * @param mixed $title
179
  * @param mixed $description
 
180
  */
181
- public function head( $form_data, $form, $title, $description, $errors ) {
182
 
183
- // Output title and/or desc
184
- if ( !empty( $title ) || !empty( $description ) ) {
185
 
 
 
186
  echo '<div class="wpforms-head-container">';
187
 
188
- if ( !empty( $title ) && !empty( $form->post_title ) ) {
189
- echo '<div class="wpforms-title">' . esc_html( $form->post_title ) . '</div>';
190
  }
191
 
192
- if ( !empty( $description ) && !empty( $form->post_excerpt ) ) {
193
- echo '<div class="wpforms-description">' . $form->post_excerpt . '</div>';
194
  }
195
 
196
  echo '</div>';
197
  }
198
 
199
- // Output errors if they exist
200
- if ( !empty( $errors['header'] ) ) {
201
-
202
- echo '<div class="wpforms-error-container">';
203
-
204
- $allow = array(
205
- 'a' => array(
206
- 'href' => array(),
207
- 'title' => array()
208
- ),
209
- 'br' => array(),
210
- 'em' => array(),
211
- 'strong' => array(),
212
- 'p' => array(),
213
- );
214
- echo wp_kses( $errors['header'], $allow );
215
-
216
- echo '</div>';
217
  }
218
  }
219
 
220
  /**
221
- * Page Indictor
222
- *
223
- * This displays if the form contains pagebreaks and is configured to show
224
- * a page indicator in the top pagebreak settings.
225
  *
226
- * @since 1.2.1
227
  * @param array $form_data
228
- * @param object $form
229
  * @param mixed $title
230
  * @param mixed $description
231
  * @param array $errors
232
  */
233
- public function page_indicator( $form_data, $form, $title, $description, $errors ) {
234
-
235
- $pagebreak_top = wpforms_get_pagebreak( $form_data, 'top' );
236
 
237
- if ( empty( $pagebreak_top['indicator'] ) || 'none' == apply_filters( 'wpforms_frontend_indicator_theme', $pagebreak_top['indicator'], $form_data ) ) {
 
238
  return;
239
  }
240
 
241
- $pagebreak = array(
242
- 'indicator' => sanitize_html_class( $pagebreak_top['indicator'] ),
243
- 'color' => wpforms_sanitize_hex_color( $pagebreak_top['indicator_color'] ),
244
- 'pages' => wpforms_get_pagebreak( $form_data, 'pages' ),
245
- );
246
- $p = 1;
247
 
248
- printf('<div class="wpforms-page-indicator %s" data-indicator="%s" data-indicator-color="%s">',
249
- $pagebreak['indicator'],
250
- $pagebreak['indicator'],
251
- $pagebreak['color']
252
- );
 
253
 
254
- if ( 'circles' == $pagebreak['indicator'] ) {
255
-
256
- // Circles theme
257
- foreach ( $pagebreak['pages'] as $page ) {
258
- $class = ( 1 === $p ) ? 'active' : '';
259
- $bg = ( 1 === $p ) ? 'style="background-color:' . $pagebreak['color'] . '"' : '';
260
- printf( '<div class="wpforms-page-indicator-page %s wpforms-page-indicator-page-%d">', $class, $p );
261
- printf( '<span class="wpforms-page-indicator-page-number" %s>%d</span>', $bg, $p );
262
- if ( !empty( $page['title'] ) ) {
263
- printf( '<span class="wpforms-page-indicator-page-title">%s<span>', esc_html( $page['title'] ) );
264
- }
265
- echo '</div>';
266
- $p++;
267
- }
268
 
269
- } elseif ( 'connector' == $pagebreak['indicator'] ) {
270
-
271
- // Connector theme
272
- foreach ( $pagebreak['pages'] as $page ) {
273
- $class = ( 1=== $p ) ? 'active ' : '';
274
- $bg = ( 1=== $p ) ? 'style="background-color:' . $pagebreak['color'] . '"' : '';
275
- $border = ( 1=== $p ) ? 'style="border-top-color:' . $pagebreak['color'] . '"' : '';
276
- $width = 100/(count($pagebreak['pages'])) . '%';
277
- printf( '<div class="wpforms-page-indicator-page %s wpforms-page-indicator-page-%d" style="width:%s;">', $class, $p, $width );
278
- printf( '<span class="wpforms-page-indicator-page-number" %s>%d<span class="wpforms-page-indicator-page-triangle" %s></span></span>', $bg, $p, $border );
279
- if ( !empty( $page['title'] ) ) {
280
- printf( '<span class="wpforms-page-indicator-page-title">%s<span>', esc_html( $page['title'] ) );
281
- }
282
- echo '</div>';
283
- $p++;
284
- }
285
 
286
- } elseif ( 'progress' == $pagebreak['indicator'] ) {
287
-
288
- // Progress theme
289
- $p1 = !empty( $pagebreak['pages'][0]['title'] ) ? esc_html( $pagebreak['pages'][0]['title'] ) : '';
290
- $sep = empty( $p1 ) ? 'style="display:none;"' : '';
291
- $width = 100/(count($pagebreak['pages'])) . '%';
292
- $prog = 'style="width:' . $width . ';background-color:' . $pagebreak['color'] . ';"';
293
- $names = '';
294
- $step = __( 'Step', 'wpforms' );
295
- $of = __( 'of', 'wpforms' );
296
-
297
- foreach ( $pagebreak['pages'] as $page ) {
298
- if ( !empty( $page['title'] ) ) {
299
- $names .= sprintf( 'data-page-%d-title="%s" ', $p, esc_attr( $page['title'] ) );
300
- }
301
- $p++;
302
  }
303
- printf( '<span class="wpforms-page-indicator-page-title" %s>%s</span>', $names, $p1 );
304
- printf( '<span class="wpforms-page-indicator-page-title-sep" %s> - </span>', $sep );
305
- printf( '<span class="wpforms-page-indicator-steps">%s <span class="wpforms-page-indicator-steps-current">1</span> %s %d</span>', $step, $of, count( $pagebreak['pages'] ) );
306
- printf( '<div class="wpforms-page-indicator-page-progress-wrap"><div class="wpforms-page-indicator-page-progress" %s></div></div>', $prog );
307
- }
308
 
309
- do_action( 'wpforms_frontend_indicator', $pagebreak, $form_data );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
310
 
311
  echo '</div>';
312
  }
313
 
314
  /**
315
- * Form field area.
 
316
  *
317
- * @since 1.0.0
 
318
  * @param array $form_data
319
- * @param object $form
320
- * @param mixed $title
321
- * @param mixed $description
322
  */
323
- public function fields( $form_data, $form, $title, $description, $errors ) {
324
-
325
- if ( empty( $form_data['fields'] ) )
326
- return;
327
-
328
- $fields = $form_data['fields'];
329
- $pagebreak = wpforms_has_pagebreak( $form_data );
330
- $page = 0;
331
-
332
- // Form fields area
333
- echo '<div class="wpforms-field-container">';
 
 
 
 
 
334
 
335
- // Pagebreak, begin first page
336
- if ( $pagebreak ) {
337
- $pbt = wpforms_get_pagebreak( $form_data, 'top');
338
- $pbt_css = !empty( $pbt['css'] ) ? wpforms_sanitize_classes( $pbt['css'] ) : '';
339
- echo '<div class="wpforms-page wpforms-page-1 ' . $pbt_css . '">';
 
 
 
 
 
340
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
341
 
342
- // Loop through all the fields we have
343
- foreach ( $fields as $field ) {
344
-
345
- if ( $field['type'] == 'pagebreak' ) {
346
- if ( !empty( $field['position'] ) && 'top' == $field['position'] ) {
347
- continue;
348
- } else {
349
- $page++;
350
- $form_data['page_total'] = $pagebreak;
351
- $form_data['page_current'] = $page;
352
- }
353
- }
354
 
355
- $field = apply_filters( 'wpforms_field_data', $field, $form_data );
 
356
 
357
- if ( ! $fields ) {
358
- continue;
359
- }
360
 
361
- // Basic generic attributes for easy filtering
362
- $field_atts = array(
363
- 'field_class' => array(
364
- 'wpforms-field',
365
- 'wpforms-field-' . sanitize_html_class( $field['type'] ),
366
- ),
367
- 'field_id' => array(
368
- 'wpforms-' . absint( $form_data['id'] ) . '-field_' . absint( $field['id'] ) . '-container',
369
- ),
370
- 'field_style' => '',
371
- 'label_class' => array(
372
- 'wpforms-field-label',
373
- ),
374
- 'label_id' => '',
375
- 'description_class' => array(
376
- 'wpforms-field-description'
377
- ),
378
- 'description_id' => array(),
379
- 'input_id' => array(
380
- 'wpforms-' . absint( $form_data['id'] ) . '-field_' . absint( $field['id'] ),
381
- ),
382
- 'input_class' => array(),
383
- 'input_data' => array(),
384
- );
385
 
386
- // Check user defined classes
387
- if ( !empty( $field['css'] ) ) {
388
- $user_classes = explode( ' ', str_replace('.', '', $field['css'] ) );
389
- foreach( $user_classes as $user_class ) {
390
- $field_atts['field_class'][] = sanitize_html_class( $user_class );
391
- }
392
- }
393
- // Check input columns
394
- if ( !empty( $field['input_columns'] ) ) {
395
- if ( '2' == $field['input_columns'] ) {
396
- $field_atts['field_class'][] = 'wpforms-list-2-columns';
397
- } elseif ( '3' == $field['input_columns'] ) {
398
- $field_atts['field_class'][] = 'wpforms-list-3-columns';
399
- }
400
- }
401
- // Check size
402
- if ( !empty( $field['size'] ) ) {
403
- $field_atts['input_class'][] = 'wpforms-field-' . sanitize_html_class( $field['size'] );
404
- }
405
- // Check if required
406
- if ( !empty( $field['required'] ) ) {
407
- $field_atts['input_class'][] = 'wpforms-field-required';
408
- }
409
- // Check if there are errors
410
- if ( !empty( wpforms()->process->errors[$form_data['id']][$field['id']] ) ) {
411
- $field_atts['input_class'][] = 'wpforms-error';
412
- }
413
 
414
- $field_atts = apply_filters( 'wpforms_field_atts', $field_atts, $field, $form_data );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
415
 
416
- echo '<div class="' . implode( ' ', $field_atts['field_class'] ) . '" id="' . implode( ' ', $field_atts['field_id'] ) . '" data-field-id="' .absint( $field['id'] ) . '" style="' . esc_html( $field_atts['field_style'] ) . '">';
 
 
 
 
 
417
 
418
- // Display label if we have one
419
- if ( !empty( $field['label'] ) ) {
420
 
421
- // Check special flat that allows fields to disable labels on front-end
422
- if ( empty( $field['label_disable'] ) ) {
423
 
424
- // If user has decided to hide the label, hide it using a special
425
- // CSS class in an attempt to keep it readable by screen readers
426
- if ( !empty( $field['label_hide'] ) ) {
427
- $field_atts['label_class'][] = 'wpforms-label-hide';
428
- }
 
 
 
429
 
430
- $label_class = !empty( $field_atts['label_class'] ) ? ' class="' . implode( ' ', $field_atts['label_class'] ) . '"' : '';
431
- $label_id = !empty( $field_atts['label_id'] ) ? ' id="' . $field_atts['label_id'] . '"' : '';
432
 
433
- echo '<label for="wpforms-' . absint( $form_data['id'] ) . '-field_' . absint( $field['id'] ) . '"' . $label_class . $label_id . '>';
 
 
 
 
434
 
435
- echo esc_html( $field['label'] );
 
 
 
 
 
 
 
436
 
437
- if ( !empty( $field['required'] ) ) {
438
- echo apply_filters( 'wpforms_field_required_label', ' <span class="wpforms-required-label">*</span>' );
439
- }
440
 
441
- echo '</label>';
 
 
 
442
 
443
- }
444
- }
445
 
446
- // Trigger the method to output this field type
447
- do_action( "wpforms_display_field_{$field['type']}", $field, $field_atts, $form_data );
 
 
 
 
448
 
449
- // Display errors if we have one
450
- if ( !empty( wpforms()->process->errors[$form_data['id']][$field['id']] ) ) {
 
 
 
 
 
 
451
 
452
- $error = wpforms()->process->errors[$form_data['id']][$field['id']];
453
 
454
- // For some advanced fields with multiple inputs (such
455
- // as address or name fields) we handle the displaying
456
- // the error within the field class. In these instances
457
- // the field error container will be an array. So below
458
- // we only show the error message for normal fields.
459
- if ( !is_array( $error ) ) {
460
- echo '<label id="wpforms-field_' . intval( $field['id'] ) . '-error" class="wpforms-error" for="wpforms-field_' . intval( $field['id'] ) . '">' . esc_html( wpforms()->process->errors[$form_data['id']][$field['id']] ) . '</label>';
461
- }
462
- }
463
 
464
- // Display description if we have one
465
- if ( !empty( $field['description'] ) ) {
 
 
 
466
 
467
- echo '<div class="' . implode( ' ', $field_atts['description_class'] ) . '" id="' . implode( ' ', $field_atts['description_id'] ) . '">';
 
 
 
 
 
 
 
468
 
469
- echo apply_filters( 'wpforms_process_smart_tags', $field['description'], $form_data );
 
470
 
471
- echo '</div>';
472
- }
 
 
473
 
474
- echo '</div>';
 
 
 
 
 
 
475
 
476
- // Pagebreak, end current page and begin the next
477
- if ( $field['type'] == 'pagebreak' && $page != $pagebreak ) {
478
- $next = $page+1;
479
- $last = $next == $pagebreak ? 'last' : '';
480
- $css = !empty( $field['css'] ) ? wpforms_sanitize_classes( $field['css'] ) : '';
481
- printf ('</div><div class="wpforms-page wpforms-page-%s %s %s" style="display:none;">', $next, $last, $css );
482
- }
483
- }
484
 
485
- // Pagebreak, end last page
486
- if ( $pagebreak ) {
487
-
488
- // If we don't have a bottom pagebreak, the form is pre-v1.2.1
489
- // and this is for backwards compatibility.
490
- $pbb = wpforms_get_pagebreak( $form_data, 'bottom' );
491
- if ( ! $pbb ) {
492
- $prev = !empty( $form_data['settings']['pagebreak_prev'] ) ? esc_html( $form_data['settings']['pagebreak_prev'] ) : __('Previous', 'wpforms' );
493
- echo '<div class="wpforms-field wpforms-field-pagebreak">';
494
- printf(
495
- '<button class="wpforms-page-button wpforms-page-prev" data-action="prev" data-page="%d" data-formid="%d">%s</button>',
496
- $page+1,
497
- $form_data['id'],
498
- $prev
499
- );
500
- echo '</div>';
501
- }
502
 
503
- echo '</div>';
504
- }
 
 
 
 
 
 
505
 
506
  echo '</div>';
507
  }
@@ -511,20 +598,22 @@ class WPForms_Frontend {
511
  *
512
  * @since 1.0.0
513
  * @param array $form_data
514
- * @param object $form
515
  * @param mixed $title
516
  * @param mixed $description
 
517
  */
518
- public function honeypot( $form_data, $form, $title, $description, $errors ) {
519
 
520
- if ( empty( $form_data['settings']['honeypot'] ) || '1' != $form_data['settings']['honeypot'] )
521
  return;
 
522
 
523
  $names = array( 'Name', 'Phone', 'Comment', 'Message', 'Email', 'Website' );
524
 
525
  echo '<div class="wpforms-field wpforms-field-hp" id="wpform-field-hp">';
526
 
527
- echo '<label for="wpforms-field_hp" class="wpforms-field-label">' . esc_html( $names[ array_rand( $names ) ] ) . '</label>';
528
 
529
  echo '<input type="text" name="wpforms[hp]" id="wpforms-field_hp" class="wpforms-field-medium">';
530
 
@@ -532,47 +621,50 @@ class WPForms_Frontend {
532
  }
533
 
534
  /**
535
- * reCAPTCHA output if configured.
536
  *
537
  * @since 1.0.0
538
  * @param array $form_data
539
- * @param object $form
540
  * @param mixed $title
541
  * @param mixed $description
 
542
  */
543
- public function recaptcha( $form_data, $form, $title, $description, $errors ) {
544
 
545
- // Check that recaptcha is configured in the settings
546
- $site_key = wpforms_setting( 'recaptcha-site-key', '' );
547
- $secret_key = wpforms_setting( 'recaptcha-secret-key', '' );
548
- if ( empty( $site_key ) || empty( $secret_key ) )
549
  return;
 
550
 
551
- // Check that the recaptcha is configured for the specific form
552
- if ( !isset( $form_data['settings']['recaptcha'] ) || '1' != $form_data['settings']['recaptcha'] )
553
  return;
 
554
 
555
- $pages = wpforms_has_pagebreak( $form_data );
556
- $d = '';
557
- $datas = apply_filters( 'wpforms_frontend_recaptcha', array(), $form_data );
558
-
 
 
559
 
560
- if ( $pages ) {
561
- echo '<div class="wpforms-recaptcha-container" style="display:none;">';
562
- } else {
563
- echo '<div class="wpforms-recaptcha-container">';
564
  }
565
 
566
- foreach( $datas as $key => $data ) {
567
- $d .= 'data-' . $key . '="' . esc_attr( $data ) . '" ';
568
- }
569
 
570
- echo '<div class="g-recaptcha" ' . $d . '></div>';
571
 
572
- echo '<input type="text" name="g-recaptcha-hidden" class="wpforms-recaptcha-hidden" style="position:absolute !important;clip:rect(0,0,0,0);height:1px;width:1px;border:0;overflow:hidden;padding:0;margin;" required>';
 
 
573
 
574
- if ( !empty( wpforms()->process->errors[$form_data['id']]['recaptcha'] ) ) {
575
- echo '<label id="wpforms-field_recaptcah-error" class="wpforms-error">' . esc_html( wpforms()->process->errors[$form_data['id']]['recaptcha'] ) . '</label>';
576
  }
577
 
578
  echo '</div>';
@@ -583,66 +675,58 @@ class WPForms_Frontend {
583
  *
584
  * @since 1.0.0
585
  * @param array $form_data
586
- * @param object $form
587
  * @param mixed $title
588
  * @param mixed $description
 
589
  */
590
- public function foot( $form_data, $form, $title, $description, $errors ) {
591
-
592
- $settings = $form_data['settings'];
593
- $submit = apply_filters( 'wpforms_field_submit' , esc_html( $settings['submit_text'] ), $form_data );
594
- $submit_process = '';
595
- $submit_classes = array();
596
- $visible = wpforms_has_pagebreak( $form_data ) ? 'style="display:none;"' : '';
597
-
598
- // Check for submit button alt-text
599
- if ( !empty( $settings['submit_text_processing'] ) ) {
600
- $submit_process = 'data-alt-text="' . esc_attr( $settings['submit_text_processing'] ) .'"';
 
601
  }
602
 
603
- // Check user defined submit button classes
604
- if ( !empty( $settings['submit_class'] ) ) {
605
- $user_classes = explode( ' ', str_replace('.', '', $settings['submit_class'] ) );
606
- foreach( $user_classes as $user_class ) {
607
- $submit_classes[] = sanitize_html_class( $user_class );
608
- }
609
  }
610
 
611
- // Output errors if they exist
612
- if ( !empty( $errors['footer'] ) ) {
613
-
614
- echo '<div class="wpforms-error-container">';
615
-
616
- $allow = array(
617
- 'a' => array(
618
- 'href' => array(),
619
- 'title' => array()
620
- ),
621
- 'br' => array(),
622
- 'em' => array(),
623
- 'strong' => array(),
624
- 'p' => array(),
625
- );
626
- echo wp_kses( $errors['footer'], $allow );
627
-
628
- echo '</div>';
629
  }
630
 
631
- // Submit button area
632
  echo '<div class="wpforms-submit-container" ' . $visible . '>';
633
 
634
- echo '<input type="hidden" name="wpforms[id]" value="' . $form->ID . '">';
635
 
636
  echo '<input type="hidden" name="wpforms[author]" value="' . absint( get_the_author_meta( 'ID' ) ) . '">';
637
 
 
 
 
 
 
 
638
  printf(
639
  '<button type="submit" name="wpforms[submit]" class="wpforms-submit %s" id="wpforms-submit-%d" value="wpforms-submit" %s>%s</button>',
640
- implode( ' ', $submit_classes ),
641
- $form->ID,
642
- $submit_process,
643
  $submit
644
  );
645
 
 
 
646
  echo '</div>';
647
  }
648
 
@@ -669,14 +753,13 @@ class WPForms_Frontend {
669
  */
670
  public function assets_header() {
671
 
672
- if ( !is_singular() ) {
673
  return;
674
  }
675
 
676
  global $post;
677
 
678
  if ( has_shortcode( $post->post_content, 'wpforms' ) ) {
679
-
680
  $this->assets_css();
681
  }
682
  }
@@ -690,7 +773,7 @@ class WPForms_Frontend {
690
 
691
  do_action( 'wpforms_frontend_css', $this->forms );
692
 
693
- // jquery date/time library CSS
694
  if ( $this->assets_global() || true == wpforms_has_field_type( 'date-time', $this->forms, true ) ) :
695
  wp_enqueue_style(
696
  'wpforms-jquery-timepicker',
@@ -706,7 +789,7 @@ class WPForms_Frontend {
706
  );
707
  endif;
708
 
709
- // Load CSS per global setting
710
  if ( wpforms_setting( 'disable-css', '1' ) == '1' ) {
711
  wp_enqueue_style(
712
  'wpforms-full',
@@ -734,7 +817,7 @@ class WPForms_Frontend {
734
 
735
  do_action( 'wpforms_frontend_js', $this->forms );
736
 
737
- // Load jquery validation library - http://jqueryvalidation.org/
738
  wp_enqueue_script(
739
  'wpforms-validation',
740
  WPFORMS_PLUGIN_URL . 'assets/js/jquery.validate.min.js',
@@ -743,7 +826,7 @@ class WPForms_Frontend {
743
  true
744
  );
745
 
746
- // Load jquery date/time libraries
747
  if ( $this->assets_global() || true == wpforms_has_field_type( 'date-time', $this->forms, true ) ) :
748
  wp_enqueue_script(
749
  'wpforms-flatpickr',
@@ -761,7 +844,7 @@ class WPForms_Frontend {
761
  );
762
  endif;
763
 
764
- // Load jquery input mask library - https://github.com/RobinHerbots/jquery.inputmask
765
  if ( $this->assets_global() || true == wpforms_has_field_type( array( 'phone', 'address' ), $this->forms, true ) ) :
766
  wp_enqueue_script(
767
  'wpforms-maskedinput',
@@ -772,7 +855,7 @@ class WPForms_Frontend {
772
  );
773
  endif;
774
 
775
- // Load CC payment library - https://github.com/stripe/jquery.payment/
776
  if ( $this->assets_global() || true == wpforms_has_field_type( 'credit-card', $this->forms, true ) ) :
777
  wp_enqueue_script(
778
  'wpforms-payment',
@@ -783,7 +866,7 @@ class WPForms_Frontend {
783
  );
784
  endif;
785
 
786
- // Load base JS
787
  wp_enqueue_script(
788
  'wpforms',
789
  WPFORMS_PLUGIN_URL . 'assets/js/wpforms.js',
@@ -792,43 +875,61 @@ class WPForms_Frontend {
792
  true
793
  );
794
 
795
- // If we have payment fields then include currency details
796
- $payment_fields = array( 'credit-card', 'payment-single', 'payment-multiple', 'payment-select', 'payment-total' );
797
- if ( ( $this->assets_global() || true == wpforms_has_field_type( $payment_fields , $this->forms, true ) ) && function_exists( 'wpforms_get_currencies' ) ) :
798
- $currency = wpforms_setting( 'currency', 'USD' );
799
- $currencies = wpforms_get_currencies();
800
- wp_localize_script(
801
- 'wpforms',
802
- 'wpforms_currency',
803
- array(
804
- 'code' => $currency,
805
- 'thousands' => $currencies[$currency]['thousands_separator'],
806
- 'decimal' => $currencies[$currency]['decimal_separator'],
807
- 'symbol' => $currencies[$currency]['symbol'],
808
- 'symbol_pos' => $currencies[$currency]['symbol_pos']
809
- )
810
- );
811
- endif;
812
 
813
- // Load reCAPTCHA support if form supports it
814
  $site_key = wpforms_setting( 'recaptcha-site-key' );
815
  $secret_key = wpforms_setting( 'recaptcha-secret-key' );
816
- if ( !empty( $site_key ) && !empty( $secret_key ) ) {
817
- $reCAPTCHA_api = apply_filters( 'wpforms_frontend_recaptcha_url', 'https://www.google.com/recaptcha/api.js?onload=wpformsRecaptcha&render=explicit' );
 
818
  wp_enqueue_script(
819
  'wpforms-recaptcha',
820
- $reCAPTCHA_api,
821
  array( 'jquery' ),
822
  '2.0.0',
823
  true
824
  );
825
- $reCAPTCHA_init = 'var wpformsRecaptcha = function(){
826
- jQuery(".g-recaptcha").each(function(index, el) {
827
- grecaptcha.render(el, {sitekey : \'' . $site_key . '\',callback:function(){wpforms.recaptchaCallback(el);}});
828
- });
829
- };';
830
- wp_add_inline_script( 'wpforms-recaptcha', $reCAPTCHA_init );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
831
  }
 
 
 
 
 
 
 
832
  }
833
 
834
  /**
@@ -838,7 +939,7 @@ class WPForms_Frontend {
838
  */
839
  public function assets_confirmation() {
840
 
841
- // Base CSS only
842
  if ( wpforms_setting( 'disable-css', '1' ) == '1' ) {
843
  wp_enqueue_style(
844
  'wpforms-full',
@@ -848,7 +949,7 @@ class WPForms_Frontend {
848
  );
849
  }
850
 
851
- // Special confirmation JS
852
  wp_enqueue_script(
853
  'wpforms-confirmation',
854
  WPFORMS_PLUGIN_URL . 'assets/js/wpforms-confirmation.js',
@@ -867,8 +968,9 @@ class WPForms_Frontend {
867
  */
868
  public function assets_footer() {
869
 
870
- if ( empty( $this->forms ) && ! $this->assets_global() )
871
  return;
 
872
 
873
  $this->assets_css();
874
  $this->assets_js();
@@ -883,8 +985,9 @@ class WPForms_Frontend {
883
  */
884
  public function footer_end() {
885
 
886
- if ( empty( $this->forms ) && ! $this->assets_global() )
887
  return;
 
888
 
889
  do_action( 'wpforms_wp_footer_end', $this->forms );
890
  }
@@ -912,4 +1015,4 @@ class WPForms_Frontend {
912
 
913
  return $output;
914
  }
915
- }
7
  * @since 1.0.0
8
  * @license GPL-2.0+
9
  * @copyright Copyright (c) 2016, WPForms LLC
10
+ */
11
  class WPForms_Frontend {
12
 
13
  /**
18
  */
19
  public $forms;
20
 
21
+ /**
22
+ * Contains information for multipage forms.
23
+ *
24
+ * Forms that do not contain pages return false, otherwise returns an array
25
+ * that contains the number of total pages and page counter used when
26
+ * displaying pagebreak fields.
27
+ *
28
+ * @since 1.3.7
29
+ * @var array
30
+ */
31
+ public $pages = false;
32
+
33
  /**
34
  * Primary class constructor.
35
  *
39
 
40
  $this->forms = array();
41
 
42
+ // Actions.
43
+ add_action( 'wpforms_frontend_output_success', array( $this, 'confirmation' ), 10, 2 );
44
+ add_action( 'wpforms_frontend_output', array( $this, 'head' ), 5, 5 );
45
+ add_action( 'wpforms_frontend_output', array( $this, 'fields' ), 10, 5 );
46
+ add_action( 'wpforms_display_field_before', array( $this, 'field_container_open' ), 5, 2 );
47
+ add_action( 'wpforms_display_field_before', array( $this, 'field_label' ), 15, 2 );
48
+ add_action( 'wpforms_display_field_before', array( $this, 'field_description' ), 20, 2 );
49
+ add_action( 'wpforms_display_field_after', array( $this, 'field_error' ), 3, 2 );
50
+ add_action( 'wpforms_display_field_after', array( $this, 'field_description' ), 5, 2 );
51
+ add_action( 'wpforms_display_field_after', array( $this, 'field_container_close' ), 15, 2 );
52
+ add_action( 'wpforms_frontend_output', array( $this, 'honeypot' ), 15, 5 );
53
+ add_action( 'wpforms_frontend_output', array( $this, 'recaptcha' ), 20, 5 );
54
+ add_action( 'wpforms_frontend_output', array( $this, 'foot' ), 25, 5 );
55
+ add_action( 'wp_enqueue_scripts', array( $this, 'assets_header' ) );
56
+ add_action( 'wp_footer', array( $this, 'assets_footer' ), 15 );
57
+ add_action( 'wp_footer', array( $this, 'footer_end' ), 99 );
58
+
59
+ // Register shortcode.
60
  add_shortcode( 'wpforms', array( $this, 'shortcode' ) );
61
  }
62
 
70
  */
71
  public function output( $id, $title = false, $description = false ) {
72
 
73
+ if ( empty( $id ) ) {
74
  return;
75
+ }
76
 
77
+ // Grab the form data, if not found then we bail.
78
  $form = wpforms()->form->get( (int) $id );
79
 
80
+ if ( empty( $form ) ) {
81
  return;
82
+ }
83
 
84
+ // Basic information.
85
  $form_data = wpforms_decode( $form->post_content, true );
86
  $form_id = absint( $form->ID );
87
  $settings = $form_data['settings'];
88
  $action = esc_url_raw( remove_query_arg( 'wpforms' ) );
89
+ $classes = wpforms_setting( 'disable-css', '1' ) == '1' ? array( 'wpforms-container-full' ) : array();
90
+ $errors = empty( wpforms()->process->errors[ $form_id ] ) ? array() : wpforms()->process->errors[ $form_id ];
91
  $success = false;
92
  $title = filter_var( $title, FILTER_VALIDATE_BOOLEAN );
93
  $description = filter_var( $description, FILTER_VALIDATE_BOOLEAN );
94
 
95
+ // If the form does not contain any fields do not proceed.
96
  if ( empty( $form_data['fields'] ) ) {
97
  echo '<!-- WPForms: no fields, form hidden -->';
98
  return;
99
  }
100
 
101
+ // Before output hook.
102
  do_action( 'wpforms_frontend_output_before', $form_data, $form );
103
 
104
+ // Check for return hash _or_ error free completed form.
105
+ if ( ! empty( $_GET['wpforms_return'] ) ) {
106
+ // Return hash check.
107
  $success = wpforms()->process->validate_return_hash( $_GET['wpforms_return'] );
108
  if ( $success ) {
109
+ $args = array(
110
+ 'content_only' => true,
111
+ );
112
+ $form_data = wpforms()->form->get( $success, $args );
113
  }
114
+ } elseif ( ! empty( $_POST['wpforms']['id'] ) && $form_id === absint( $_POST['wpforms']['id'] ) && empty( $errors ) ) {
115
+ // Completed form check.
116
  $success = true;
117
  }
 
118
 
119
+ // Detect successful form submit, if found provide hook for
120
+ // confirmation messages/actions and then stop.
121
+ if ( $success && ! empty( $form_data ) ) {
122
  do_action( 'wpforms_frontend_output_success', $form_data );
 
 
123
  wpforms_debug_data( $_POST );
 
124
  return;
125
  }
126
 
127
  // Allow filter to return early if some condition is not met.
128
+ if ( ! apply_filters( 'wpforms_frontend_load', true, $form_data, null ) ) {
129
  return;
130
  }
131
 
132
+ // All checks have passed, so calculate multipage details for the form.
133
+ $pages = wpforms_get_pagebreak_details( $form_data );
134
+ if ( $pages ) {
135
+ $this->pages = $pages;
136
+ } else {
137
+ $this->pages = false;
138
+ }
139
+
140
+ // Add the hash for confirmation scrolling if enabled.
141
+ if ( ! empty( $settings['confirmation_type'] ) && 'message' === $settings['confirmation_type'] && ! empty( $settings['confirmation_message_scroll'] ) ) {
142
  $action .= '#wpforms-' . $form_id;
143
  }
 
144
 
145
+ // Allow final action to be customized - 3rd param ($form) has been deprecated.
146
+ $action = apply_filters( 'wpforms_frontend_form_action', $action, $form_data, null );
147
 
148
+ // Allow form container classes to be filtered and user defined classes.
149
+ $classes = apply_filters( 'wpforms_frontend_container_class', $classes, $form_data );
150
+ if ( ! empty( $settings['form_class'] ) ) {
151
+ $classes = array_merge( $classes, explode( ' ', $settings['form_class'] ) );
152
  }
153
+ $classes = wpforms_sanitize_classes( $classes, true );
154
 
155
  // Begin to build the output
156
+ printf(
157
+ '<div class="wpforms-container %s" id="wpforms-%d">',
158
+ $classes,
159
+ $form_id
160
+ );
161
 
162
+ printf(
163
+ '<form method="post" enctype="multipart/form-data" id="wpforms-form-%d" action="%s" class="wpforms-validate wpforms-form" data-formid="%d">',
164
+ $form_id,
165
+ $action,
166
+ $form_id
167
+ );
168
 
169
+ do_action( 'wpforms_frontend_output', $form_data, null, $title, $description, $errors );
170
 
171
  echo '</form>';
172
 
175
  // After output hook
176
  do_action( 'wpforms_frontend_output_after', $form_data, $form );
177
 
178
+ // Add form to class property that tracks all forms in a page.
179
+ $this->forms[ $form_id ] = $form_data;
180
 
181
+ // Optional debug information if WPFORMS_DEBUG is defined.
182
  wpforms_debug_data( $form_data );
183
  }
184
 
187
  *
188
  * @since 1.0.0
189
  * @param array $form_data
 
 
190
  */
191
  function confirmation( $form_data ) {
192
 
193
+ $settings = $form_data['settings'];
 
 
 
 
 
 
 
 
 
 
194
 
195
+ // Only display if a confirmation message has been configured.
196
+ if ( empty( $settings['confirmation_type'] ) || 'message' !== $settings['confirmation_type'] ) {
197
+ return;
 
 
198
  }
199
+
200
+ // Load confirmatiom specific asssets.
201
+ $this->assets_confirmation();
202
+
203
+ $form_id = absint( $form_data['id'] );
204
+ $complete = ! empty( $_POST['wpforms']['complete'] ) ? $_POST['wpforms']['complete'] : array();
205
+ $entry_id = ! empty( $_POST['wpforms']['entry_id'] ) ? $_POST['wpforms']['entry_id'] : 0;
206
+ $message = apply_filters( 'wpforms_process_smart_tags', $settings['confirmation_message'], $form_data, $complete, $entry_id );
207
+ $message = apply_filters( 'wpforms_frontend_confirmation_message', $message, $form_data );
208
+ $class = wpforms_setting( 'disable-css', '1' ) == '1' ? 'wpforms-confirmation-container-full' : 'wpforms-confirmation-container';
209
+
210
+ printf(
211
+ '<div class="%s" id="wpforms-confirmation-%d">%s</div>',
212
+ $class,
213
+ $form_id,
214
+ wpautop( $message )
215
+ );
216
  }
217
 
218
  /**
220
  *
221
  * @since 1.0.0
222
  * @param array $form_data
223
+ * @param null $deprecated Deprecated in v1.3.7, previously was $form object.
224
  * @param mixed $title
225
  * @param mixed $description
226
+ * @param array $errors
227
  */
228
+ public function head( $form_data, $deprecated, $title, $description, $errors ) {
229
 
230
+ $settings = $form_data['settings'];
 
231
 
232
+ // Output title and/or description.
233
+ if ( ! empty( $title ) || ! empty( $description ) ) {
234
  echo '<div class="wpforms-head-container">';
235
 
236
+ if ( ! empty( $title ) && ! empty( $settings['form_title'] ) ) {
237
+ echo '<div class="wpforms-title">' . esc_html( $settings['form_title'] ) . '</div>';
238
  }
239
 
240
+ if ( ! empty( $description ) && ! empty( $settings['form_desc'] ) ) {
241
+ echo '<div class="wpforms-description">' . $settings['form_desc'] . '</div>';
242
  }
243
 
244
  echo '</div>';
245
  }
246
 
247
+ // Output header errors if they exist.
248
+ if ( ! empty( $errors['header'] ) ) {
249
+ echo '<div class="wpforms-error-container">' . wpforms_sanitize_error( $errors['header'] ) . '</div>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
250
  }
251
  }
252
 
253
  /**
254
+ * Form field area.
 
 
 
255
  *
256
+ * @since 1.0.0
257
  * @param array $form_data
258
+ * @param null $deprecated Deprecated in v1.3.7, previously was $form object.
259
  * @param mixed $title
260
  * @param mixed $description
261
  * @param array $errors
262
  */
263
+ public function fields( $form_data, $deprecated, $title, $description, $errors ) {
 
 
264
 
265
+ // Obviously we need to have form fields to proceed.
266
+ if ( empty( $form_data['fields'] ) ) {
267
  return;
268
  }
269
 
270
+ // Form fields area.
271
+ echo '<div class="wpforms-field-container">';
 
 
 
 
272
 
273
+ /**
274
+ * Core actions on this hook:
275
+ * Priority / Description
276
+ * 20 Pagebreak markup (open first page)
277
+ */
278
+ do_action( 'wpforms_display_fields_before', $form_data );
279
 
280
+ // Loop through all the fields we have.
281
+ foreach ( $form_data['fields'] as $field ) {
 
 
 
 
 
 
 
 
 
 
 
 
282
 
283
+ $field = apply_filters( 'wpforms_field_data', $field, $form_data );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
284
 
285
+ if ( empty( $field ) ) {
286
+ continue;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
287
  }
 
 
 
 
 
288
 
289
+ // Get field attributes. Deprecated; Customizations should use
290
+ // field properties instead.
291
+ $attributes = $this->get_field_attributes( $field, $form_data );
292
+
293
+ // Get field properties.
294
+ $properties = $this->get_field_properties( $field, $form_data, $attributes );
295
+
296
+ // Add properties to the field so it's available everywhere.
297
+ $field['properties'] = $properties;
298
+
299
+ /**
300
+ * Core actions on this hook:
301
+ * Priority / Description
302
+ * 5 Field opening container markup.
303
+ * 15 Field label.
304
+ * 20 Field description (depending on position).
305
+ */
306
+ do_action( 'wpforms_display_field_before', $field, $form_data );
307
+
308
+ /**
309
+ * Individual field classes use this hook to display the actual
310
+ * field form elements.
311
+ * See `field_display` methods in /includes/fields.
312
+ */
313
+ do_action( "wpforms_display_field_{$field['type']}", $field, $attributes, $form_data );
314
+
315
+ /**
316
+ * Core actions on this hook:
317
+ * Priority / Description
318
+ * 3 Field error messages.
319
+ * 5 Field description (depending on position).
320
+ * 15 Field closing container markup.
321
+ * 20 Pagebreak markup (close previous page, open next)
322
+ */
323
+ do_action( 'wpforms_display_field_after', $field, $form_data );
324
+
325
+ } // End foreach().
326
+
327
+ /**
328
+ * Core actions on this hook:
329
+ * Priority / Description
330
+ * 5 Pagebreak markup (close last page)
331
+ */
332
+ do_action( 'wpforms_display_fields_after', $form_data );
333
 
334
  echo '</div>';
335
  }
336
 
337
  /**
338
+ * Return base attributes for a specific field. This is deprecated and
339
+ * exists for backwards-compatibility purposes. Use field proprties instead.
340
  *
341
+ * @since 1.3.7
342
+ * @param array $field
343
  * @param array $form_data
344
+ * @return array
 
 
345
  */
346
+ public function get_field_attributes( $field, $form_data ) {
347
+
348
+ $form_id = absint( $form_data['id'] );
349
+ $field_id = absint( $field['id'] );
350
+ $attributes = array(
351
+ 'field_class' => array( 'wpforms-field', 'wpforms-field-' . sanitize_html_class( $field['type'] ) ),
352
+ 'field_id' => array( sprintf( 'wpforms-%d-field_%d-container', $form_id, $field_id ) ),
353
+ 'field_style' => '',
354
+ 'label_class' => array( 'wpforms-field-label' ),
355
+ 'label_id' => '',
356
+ 'description_class' => array( 'wpforms-field-description' ),
357
+ 'description_id' => array(),
358
+ 'input_id' => array( sprintf( 'wpforms-%d-field_%d', $form_id, $field_id ) ),
359
+ 'input_class' => array(),
360
+ 'input_data' => array(),
361
+ );
362
 
363
+ // Check user field defined classes.
364
+ if ( ! empty( $field['css'] ) ) {
365
+ $attributes['field_class'] = array_merge( $attributes['field_class'] , wpforms_sanitize_classes( $field['css'], true ) );
366
+ }
367
+ // Check for input column layouts.
368
+ if ( ! empty( $field['input_columns'] ) ) {
369
+ if ( '2' == $field['input_columns'] ) {
370
+ $attributes['field_class'][] = 'wpforms-list-2-columns';
371
+ } elseif ( '3' == $field['input_columns'] ) {
372
+ $attributes['field_class'][] = 'wpforms-list-3-columns';
373
  }
374
+ }
375
+ // Check label visibility.
376
+ if ( ! empty( $field['label_hide'] ) ) {
377
+ $attributes['label_class'][] = 'wpforms-label-hide';
378
+ }
379
+ // Check size.
380
+ if ( ! empty( $field['size'] ) ) {
381
+ $attributes['input_class'][] = 'wpforms-field-' . sanitize_html_class( $field['size'] );
382
+ }
383
+ // Check if required.
384
+ if ( ! empty( $field['required'] ) ) {
385
+ $attributes['input_class'][] = 'wpforms-field-required';
386
+ }
387
 
388
+ // Check if there are errors.
389
+ if ( ! empty( wpforms()->process->errors[ $form_id ][ $field_id ] ) ) {
390
+ $attributes['input_class'][] = 'wpforms-error';
391
+ }
 
 
 
 
 
 
 
 
392
 
393
+ // This filter is deprecated, filter the properties (below) instead.
394
+ $attributes = apply_filters( 'wpforms_field_atts', $attributes, $field, $form_data );
395
 
396
+ return $attributes;
397
+ }
 
398
 
399
+ /**
400
+ * Return base properties for a specific field.
401
+ *
402
+ * @since 1.3.7
403
+ * @param array $field
404
+ * @param array $form_data
405
+ * @param array $attributes
406
+ * @return array
407
+ */
408
+ function get_field_properties( $field, $form_data, $attributes = array() ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
409
 
410
+ // This filter is for backwards compatibility purposes.
411
+ $types = array( 'text', 'textarea', 'number', 'email', 'hidden', 'url', 'html', 'divider' );
412
+ if ( in_array( $field['type'], $types, true ) ) {
413
+ $field = apply_filters( "wpforms_{$field['type']}_field_display", $field, $attributes, $form_data );
414
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
415
 
416
+ $form_id = absint( $form_data['id'] );
417
+ $field_id = absint( $field['id'] );
418
+ $properties = array(
419
+ 'container' => array(
420
+ 'attr' => array(),
421
+ 'class' => $attributes['field_class'],
422
+ 'data' => array(),
423
+ 'id' => implode( '', array_slice( $attributes['field_id'], 0 ) ),
424
+ ),
425
+ 'label' => array(
426
+ 'attr' => array(
427
+ 'for' => sprintf( 'wpforms-%d-field_%d', $form_id, $field_id ),
428
+ ),
429
+ 'class' => $attributes['label_class'],
430
+ 'data' => array(),
431
+ 'disabled' => ! empty( $field['label_disable'] ) ? true : false,
432
+ 'hidden' => ! empty( $field['label_hide'] ) ? true : false,
433
+ 'id' => $attributes['label_id'],
434
+ 'required' => ! empty( $field['required'] ) ? true : false,
435
+ 'value' => ! empty( $field['label'] ) ? $field['label'] : '',
436
+ ),
437
+ 'inputs' => array(
438
+ 'primary' => array(
439
+ 'attr' => array(
440
+ 'name' => "wpforms[fields][{$field_id}]",
441
+ 'value' => isset( $field['default_value'] ) ? apply_filters( 'wpforms_process_smart_tags', $field['default_value'], $form_data ) : '',
442
+ 'placeholder' => isset( $field['placeholder'] ) ? $field['placeholder'] : '',
443
+ ),
444
+ 'class' => $attributes['input_class'],
445
+ 'data' => $attributes['input_data'],
446
+ 'id' => implode( array_slice( $attributes['input_id'], 0 ) ),
447
+ 'required' => ! empty( $field['required'] ) ? 'required' : '',
448
+ ),
449
+ ),
450
+ 'error' => array(
451
+ 'attr' => array(
452
+ 'for' => sprintf( 'wpforms-%d-field_%d', $form_id, $field_id ),
453
+ ),
454
+ 'class' => array( 'wpforms-error' ),
455
+ 'data' => array(),
456
+ 'id' => '',
457
+ 'value' => ! empty( wpforms()->process->errors[ $form_id ][ $field_id ] ) ? wpforms()->process->errors[ $form_id ][ $field_id ] : '',
458
+ ),
459
+ 'description' => array(
460
+ 'attr' => array(),
461
+ 'class' => $attributes['description_class'],
462
+ 'data' => array(),
463
+ 'id' => implode( '', array_slice( $attributes['description_id'], 0 ) ),
464
+ 'position' => 'after',
465
+ 'value' => ! empty( $field['description'] ) ? apply_filters( 'wpforms_process_smart_tags', $field['description'], $form_data ) : '',
466
+ ),
467
+ );
468
 
469
+ // Dynamic value support.
470
+ if ( apply_filters( 'wpforms_frontend_dynamic_values', false ) ) {
471
+ if ( empty( $properties['inputs']['primary']['attr']['value'] ) && ! empty( $_GET[ "f$field_id}" ] ) ) {
472
+ $properties['inputs']['primary']['attr']['value'] = sanitize_text_field( $_GET[ "f{$field_id}" ] );
473
+ }
474
+ }
475
 
476
+ $properties = apply_filters( "wpforms_field_properties_{$field['type']}", $properties, $field, $form_data );
477
+ $properties = apply_filters( 'wpforms_field_properties', $properties, $field, $form_data );
478
 
479
+ return $properties;
480
+ }
481
 
482
+ /**
483
+ * Display the opening container markup for each field.
484
+ *
485
+ * @since 1.3.7
486
+ * @param array $field
487
+ * @param array $form_data
488
+ */
489
+ public function field_container_open( $field, $form_data ) {
490
 
491
+ $container = $field['properties']['container'];
492
+ $container['data']['field-id'] = absint( $field['id'] );
493
 
494
+ printf(
495
+ '<div %s>',
496
+ wpforms_html_attributes( $container['id'], $container['class'], $container['data'], $container['attr'] )
497
+ );
498
+ }
499
 
500
+ /**
501
+ * Display the label for each field.
502
+ *
503
+ * @since 1.3.7
504
+ * @param array $field
505
+ * @param array $form_data
506
+ */
507
+ public function field_label( $field, $form_data ) {
508
 
509
+ $label = $field['properties']['label'];
 
 
510
 
511
+ // If the label is empty or disabled don't proceed.
512
+ if ( empty( $label['value'] ) || $label['disabled'] ) {
513
+ return;
514
+ }
515
 
516
+ $required = $label['required'] ? apply_filters( 'wpforms_field_required_label', ' <span class="wpforms-required-label">*</span>' ) : '';
 
517
 
518
+ printf( '<label %s>%s%s</label>',
519
+ wpforms_html_attributes( $label['id'], $label['class'], $label['data'], $label['attr'] ),
520
+ esc_html( $label['value'] ),
521
+ $required
522
+ );
523
+ }
524
 
525
+ /**
526
+ * Display any errors for each field.
527
+ *
528
+ * @since 1.3.7
529
+ * @param array $field
530
+ * @param array $form_data
531
+ */
532
+ public function field_error( $field, $form_data ) {
533
 
534
+ $error = $field['properties']['error'];
535
 
536
+ // If there are no errors don't proceed.
537
+ // Advanced fields with multiple inputs (address, name, etc) errors
538
+ // will be an array and are handled within the respective field class.
539
+ if ( empty( $error['value'] ) || is_array( $error['value'] ) ) {
540
+ return;
541
+ }
 
 
 
542
 
543
+ printf( '<label %s>%s</label>',
544
+ wpforms_html_attributes( $error['id'], $error['class'], $error['data'], $error['attr'] ),
545
+ esc_html( $error['value'] )
546
+ );
547
+ }
548
 
549
+ /**
550
+ * Display the description for each field.
551
+ *
552
+ * @since 1.3.7
553
+ * @param array $field
554
+ * @param array $form_data
555
+ */
556
+ public function field_description( $field, $form_data ) {
557
 
558
+ $action = current_action();
559
+ $description = $field['properties']['description'];
560
 
561
+ // If the description is empty don't proceed.
562
+ if ( empty( $description['value'] ) ) {
563
+ return;
564
+ }
565
 
566
+ // Determine positioning.
567
+ if ( 'wpforms_display_field_before' === $action && 'before' !== $description['position'] ) {
568
+ return;
569
+ }
570
+ if ( 'wpforms_display_field_after' === $action && 'after' !== $description['position'] ) {
571
+ return;
572
+ }
573
 
574
+ if ( 'before' === $description['position'] ) {
575
+ $description['class'][] = 'wpforms-field-description-before';
576
+ }
 
 
 
 
 
577
 
578
+ printf( '<div %s>%s</div>',
579
+ wpforms_html_attributes( $description['id'], $description['class'], $description['data'], $description['attr'] ),
580
+ $description['value']
581
+ );
582
+ }
 
 
 
 
 
 
 
 
 
 
 
 
583
 
584
+ /**
585
+ * Display the closing container markup for each field.
586
+ *
587
+ * @since 1.3.7
588
+ * @param array $field
589
+ * @param array $form_data
590
+ */
591
+ public function field_container_close( $field, $form_data ) {
592
 
593
  echo '</div>';
594
  }
598
  *
599
  * @since 1.0.0
600
  * @param array $form_data
601
+ * @param null $deprecated Deprecated in v1.3.7, previously was $form object.
602
  * @param mixed $title
603
  * @param mixed $description
604
+ * @param array $errors
605
  */
606
+ public function honeypot( $form_data, $deprecated, $title, $description, $errors ) {
607
 
608
+ if ( empty( $form_data['settings']['honeypot'] ) || '1' != $form_data['settings']['honeypot'] ) {
609
  return;
610
+ }
611
 
612
  $names = array( 'Name', 'Phone', 'Comment', 'Message', 'Email', 'Website' );
613
 
614
  echo '<div class="wpforms-field wpforms-field-hp" id="wpform-field-hp">';
615
 
616
+ echo '<label for="wpforms-field_hp" class="wpforms-field-label">' . $names[ array_rand( $names ) ] . '</label>';
617
 
618
  echo '<input type="text" name="wpforms[hp]" id="wpforms-field_hp" class="wpforms-field-medium">';
619
 
621
  }
622
 
623
  /**
624
+ * Google reCAPTCHA output if configured.
625
  *
626
  * @since 1.0.0
627
  * @param array $form_data
628
+ * @param null $deprecated Deprecated in v1.3.7, previously was $form object.
629
  * @param mixed $title
630
  * @param mixed $description
631
+ * @param array $errors
632
  */
633
+ public function recaptcha( $form_data, $deprecated, $title, $description, $errors ) {
634
 
635
+ // Check that recaptcha is configured in the settings.
636
+ $site_key = wpforms_setting( 'recaptcha-site-key' );
637
+ $secret_key = wpforms_setting( 'recaptcha-secret-key' );
638
+ if ( ! $site_key || ! $secret_key ) {
639
  return;
640
+ }
641
 
642
+ // Check that the recaptcha is configured for the specific form.
643
+ if ( ! isset( $form_data['settings']['recaptcha'] ) || '1' != $form_data['settings']['recaptcha'] ) {
644
  return;
645
+ }
646
 
647
+ $type = wpforms_setting( 'recaptcha-type', 'v2' );
648
+ $visible = $this->pages ? 'style="display:none;"' : '';
649
+ $data = array(
650
+ 'sitekey' => trim( sanitize_text_field( $site_key ) ),
651
+ );
652
+ $data = apply_filters( 'wpforms_frontend_recaptcha', $data, $form_data );
653
 
654
+ if ( 'invisible' === $type ){
655
+ $data['size'] = 'invisible';
 
 
656
  }
657
 
658
+ echo '<div class="wpforms-recaptcha-container" ' . $visible . '>';
 
 
659
 
660
+ echo '<div ' . wpforms_html_attributes( '', array( 'g-recaptcha' ), $data ) . '></div>';
661
 
662
+ if ( 'invisible' !== $type ) {
663
+ echo '<input type="text" name="g-recaptcha-hidden" class="wpforms-recaptcha-hidden" style="position:absolute!important;clip:rect(0,0,0,0)!important;height:1px!important;width:1px!important;border:0!important;overflow:hidden!important;padding:0!important;margin:0!important;" required>';
664
+ }
665
 
666
+ if ( ! empty( $errors['recaptcha'] ) ) {
667
+ echo '<label id="wpforms-field_recaptcah-error" class="wpforms-error">' . esc_html( $errors['recaptcha'] ) . '</label>';
668
  }
669
 
670
  echo '</div>';
675
  *
676
  * @since 1.0.0
677
  * @param array $form_data
678
+ * @param null $deprecated Deprecated in v1.3.7, previously was $form object.
679
  * @param mixed $title
680
  * @param mixed $description
681
+ * @param array $errors
682
  */
683
+ public function foot( $form_data, $deprecated, $title, $description, $errors ) {
684
+
685
+ $form_id = absint( $form_data['id'] );
686
+ $settings = $form_data['settings'];
687
+ $submit = apply_filters( 'wpforms_field_submit', $settings['submit_text'], $form_data );
688
+ $process = '';
689
+ $classes = '';
690
+ $visible = $this->pages ? 'style="display:none;"' : '';
691
+
692
+ // Check for submit button alt-text.
693
+ if ( ! empty( $settings['submit_text_processing'] ) ) {
694
+ $process = 'data-alt-text="' . esc_attr( $settings['submit_text_processing'] ) . '"';
695
  }
696
 
697
+ // Check user defined submit button classes.
698
+ if ( ! empty( $settings['submit_class'] ) ) {
699
+ $classes = wpforms_sanitize_classes( $settings['submit_class'] );
 
 
 
700
  }
701
 
702
+ // Output footer errors if they exist.
703
+ if ( ! empty( $errors['footer'] ) ) {
704
+ echo '<div class="wpforms-error-container">' . wpforms_sanitize_error( $errors['footer'] ) . '</div>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
705
  }
706
 
707
+ // Submit button area.
708
  echo '<div class="wpforms-submit-container" ' . $visible . '>';
709
 
710
+ echo '<input type="hidden" name="wpforms[id]" value="' . $form_id . '">';
711
 
712
  echo '<input type="hidden" name="wpforms[author]" value="' . absint( get_the_author_meta( 'ID' ) ) . '">';
713
 
714
+ if ( is_singular() ) {
715
+ echo '<input type="hidden" name="wpforms[post_id]" value="' . get_the_ID() . '">';
716
+ }
717
+
718
+ do_action( 'wpforms_display_submit_before', $form_data );
719
+
720
  printf(
721
  '<button type="submit" name="wpforms[submit]" class="wpforms-submit %s" id="wpforms-submit-%d" value="wpforms-submit" %s>%s</button>',
722
+ $classes,
723
+ $form_id,
724
+ $process,
725
  $submit
726
  );
727
 
728
+ do_action( 'wpforms_display_submit_after', $form_data );
729
+
730
  echo '</div>';
731
  }
732
 
753
  */
754
  public function assets_header() {
755
 
756
+ if ( ! is_singular() ) {
757
  return;
758
  }
759
 
760
  global $post;
761
 
762
  if ( has_shortcode( $post->post_content, 'wpforms' ) ) {
 
763
  $this->assets_css();
764
  }
765
  }
773
 
774
  do_action( 'wpforms_frontend_css', $this->forms );
775
 
776
+ // jQuery date/time library CSS.
777
  if ( $this->assets_global() || true == wpforms_has_field_type( 'date-time', $this->forms, true ) ) :
778
  wp_enqueue_style(
779
  'wpforms-jquery-timepicker',
789
  );
790
  endif;
791
 
792
+ // Load CSS per global setting.
793
  if ( wpforms_setting( 'disable-css', '1' ) == '1' ) {
794
  wp_enqueue_style(
795
  'wpforms-full',
817
 
818
  do_action( 'wpforms_frontend_js', $this->forms );
819
 
820
+ // Load jQuery validation library - http://jqueryvalidation.org/.
821
  wp_enqueue_script(
822
  'wpforms-validation',
823
  WPFORMS_PLUGIN_URL . 'assets/js/jquery.validate.min.js',
826
  true
827
  );
828
 
829
+ // Load jQuery date/time libraries.
830
  if ( $this->assets_global() || true == wpforms_has_field_type( 'date-time', $this->forms, true ) ) :
831
  wp_enqueue_script(
832
  'wpforms-flatpickr',
844
  );
845
  endif;
846
 
847
+ // Load jQuery input mask library - https://github.com/RobinHerbots/jquery.inputmask.
848
  if ( $this->assets_global() || true == wpforms_has_field_type( array( 'phone', 'address' ), $this->forms, true ) ) :
849
  wp_enqueue_script(
850
  'wpforms-maskedinput',
855
  );
856
  endif;
857
 
858
+ // Load CC payment library - https://github.com/stripe/jquery.payment/.
859
  if ( $this->assets_global() || true == wpforms_has_field_type( 'credit-card', $this->forms, true ) ) :
860
  wp_enqueue_script(
861
  'wpforms-payment',
866
  );
867
  endif;
868
 
869
+ // Load base JS.
870
  wp_enqueue_script(
871
  'wpforms',
872
  WPFORMS_PLUGIN_URL . 'assets/js/wpforms.js',
875
  true
876
  );
877
 
878
+ // Load reCAPTCHA support if form supports it.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
879
 
 
880
  $site_key = wpforms_setting( 'recaptcha-site-key' );
881
  $secret_key = wpforms_setting( 'recaptcha-secret-key' );
882
+ $type = wpforms_setting( 'recaptcha-type', 'v2' );
883
+ if ( $site_key && $secret_key ) {
884
+ $recaptcha_api = apply_filters( 'wpforms_frontend_recaptcha_url', 'https://www.google.com/recaptcha/api.js?onload=wpformsRecaptchaLoad&render=explicit' );
885
  wp_enqueue_script(
886
  'wpforms-recaptcha',
887
+ $recaptcha_api,
888
  array( 'jquery' ),
889
  '2.0.0',
890
  true
891
  );
892
+ if ( 'invisible' === $type ) {
893
+ $recaptch_inline = 'var wpformsRecaptchaLoad = function(){jQuery(".g-recaptcha").each(function(index, el){var recaptchaID = grecaptcha.render(el,{callback:function(){wpformsRecaptchaCallback(el);}},true);jQuery(el).closest("form").find("button[type=submit]").get(0).recaptchaID = recaptchaID;});};';
894
+ $recaptch_inline .= 'var wpformsRecaptchaCallback = function(el){var $form = jQuery(el).closest("form");$form.find("button[type=submit]").get(0).recaptchaID = false;$form.submit();};';
895
+ } else {
896
+ $recaptch_inline = 'var wpformsRecaptchaLoad = function(){jQuery(".g-recaptcha").each(function(index, el){grecaptcha.render(el,{callback:function(){wpformsRecaptchaCallback(el);}},true);});};';
897
+ $recaptch_inline .= 'var wpformsRecaptchaCallback = function(el){jQuery(el).parent().find(".wpforms-recaptcha-hidden").val("1").valid();};';
898
+ }
899
+ wp_add_inline_script( 'wpforms-recaptcha', $recaptch_inline );
900
+ }
901
+
902
+ // Define base strings.
903
+ $strings = array(
904
+ 'val_required' => wpforms_setting( 'validation-required', __( 'This field is required.', 'wpforms' ) ),
905
+ 'val_url' => wpforms_setting( 'validation-url', __( 'Please enter a valid URL.', 'wpforms' ) ),
906
+ 'val_email' => wpforms_setting( 'validation-email', __( 'Please enter a valid email address.', 'wpforms' ) ),
907
+ 'val_number' => wpforms_setting( 'validation-number', __( 'Please enter a valid number.', 'wpforms' ) ),
908
+ 'val_confirm' => wpforms_setting( 'validation-confirm', __( 'Field values do not match.', 'wpforms' ) ),
909
+ 'val_fileextension' => wpforms_setting( 'validation-fileextension', __( 'File type is not allowed.', 'wpforms' ) ),
910
+ 'val_filesize' => wpforms_setting( 'validation-filesize', __( 'File exceeds max size allowed.', 'wpforms' ) ),
911
+ 'val_time12h' => wpforms_setting( 'validation-time12h', __( 'Please enter time in 12-hour AM/PM format (eg 8:45 AM).', 'wpforms' ) ),
912
+ 'val_time24h' => wpforms_setting( 'validation-time24h', __( 'Please enter time in 24-hour format (eg 22:45).', 'wpforms' ) ),
913
+ 'val_requiredpayment' => wpforms_setting( 'validation-requiredpayment', __( 'Payment is required.', 'wpforms' ) ),
914
+ 'val_creditcard' => wpforms_setting( 'validation-creditcard', __( 'Please enter a valid credit card number.', 'wpforms' ) ),
915
+ );
916
+ // Include payment related strings if needed.
917
+ if ( function_exists( 'wpforms_get_currencies' ) ) {
918
+ $currency = wpforms_setting( 'currency', 'USD' );
919
+ $currencies = wpforms_get_currencies();
920
+ $strings['currency_code'] = $currency;
921
+ $strings['currency_thousands'] = $currencies[ $currency ]['thousands_separator'];
922
+ $strings['currency_decimal'] = $currencies[ $currency ]['decimal_separator'];
923
+ $strings['currency_symbol'] = $currencies[ $currency ]['symbol'];
924
+ $strings['currency_symbol_pos'] = $currencies[ $currency ]['symbol_pos'];
925
  }
926
+ $strings = apply_filters( 'wpforms_frontend_strings', $strings );
927
+ // Load the necessary strings.
928
+ wp_localize_script(
929
+ 'wpforms',
930
+ 'wpforms_settings',
931
+ $strings
932
+ );
933
  }
934
 
935
  /**
939
  */
940
  public function assets_confirmation() {
941
 
942
+ // Base CSS only.
943
  if ( wpforms_setting( 'disable-css', '1' ) == '1' ) {
944
  wp_enqueue_style(
945
  'wpforms-full',
949
  );
950
  }
951
 
952
+ // Special confirmation JS.
953
  wp_enqueue_script(
954
  'wpforms-confirmation',
955
  WPFORMS_PLUGIN_URL . 'assets/js/wpforms-confirmation.js',
968
  */
969
  public function assets_footer() {
970
 
971
+ if ( empty( $this->forms ) && ! $this->assets_global() ) {
972
  return;
973
+ }
974
 
975
  $this->assets_css();
976
  $this->assets_js();
985
  */
986
  public function footer_end() {
987
 
988
+ if ( empty( $this->forms ) && ! $this->assets_global() ) {
989
  return;
990
+ }
991
 
992
  do_action( 'wpforms_wp_footer_end', $this->forms );
993
  }
1015
 
1016
  return $output;
1017
  }
1018
+ }
includes/class-preview.php CHANGED
@@ -171,7 +171,7 @@ class WPForms_Preview {
171
 
172
  // Create the custom preview page
173
  $content = '<p>' . __( 'This is the WPForms preview page. All your form previews will be handled on this page.', 'wpforms' ) . '</p>';
174
- $content .= '<p>' . __( 'The page is set to private, so it is not publically accessible. Please do not delete this page :) .', 'wpforms' ) . '</p>';
175
  $args = array(
176
  'post_type' => 'page',
177
  'post_name' => 'wpforms-preview',
@@ -258,7 +258,7 @@ class WPForms_Preview {
258
  // Customize the page content
259
  $title = sanitize_text_field( $form['settings']['form_title'] );
260
  $shortcode = '[wpforms id="' . absint( $form['id'] ) . '"]';
261
- $content = __( 'This is a preview of your form. This page is not publically accessible.', 'wpforms' );
262
  if ( !empty( $_GET['new_window'] ) ) {
263
  $content .= ' <a href="javascript:window.close();">' . __( 'Close this window', 'wpforms' ) . '.</a>';
264
  }
@@ -286,4 +286,4 @@ class WPForms_Preview {
286
  }
287
  }
288
  }
289
- }
171
 
172
  // Create the custom preview page
173
  $content = '<p>' . __( 'This is the WPForms preview page. All your form previews will be handled on this page.', 'wpforms' ) . '</p>';
174
+ $content .= '<p>' . __( 'The page is set to private, so it is not publicly accessible. Please do not delete this page :) .', 'wpforms' ) . '</p>';
175
  $args = array(
176
  'post_type' => 'page',
177
  'post_name' => 'wpforms-preview',
258
  // Customize the page content
259
  $title = sanitize_text_field( $form['settings']['form_title'] );
260
  $shortcode = '[wpforms id="' . absint( $form['id'] ) . '"]';
261
+ $content = __( 'This is a preview of your form. This page is not publicly accessible.', 'wpforms' );
262
  if ( !empty( $_GET['new_window'] ) ) {
263
  $content .= ' <a href="javascript:window.close();">' . __( 'Close this window', 'wpforms' ) . '.</a>';
264
  }
286
  }
287
  }
288
  }
289
+ }
includes/emails/class-emails.php CHANGED
@@ -416,21 +416,23 @@ class WPForms_WP_Emails {
416
  $x = 1;
417
  foreach( $this->fields as $field ) {
418
 
419
- if ( !empty( $field['value'] ) && false !== $field['value'] ) {
420
-
421
- $field_name = !empty( $field['name'] ) ? $field['name'] : __( 'Field ID #', 'wpforms' ) . absint( $field['id'] );
422
 
423
- $field_item = $field_template;
424
- if ( $x === 1 ) {
425
- $field_item = str_replace( 'border-top:1px solid #dddddd;', '', $field_item );
426
- }
427
- $field_item = str_replace( '{field_name}', $field_name, $field_item );
428
- $field_value = apply_filters( 'wpforms_html_field_value', stripslashes( wp_specialchars_decode( $field['value'] ) ), $field, $this->form_data, 'email-html' );
429
- $field_item = str_replace( '{field_value}', $field_value, $field_item );
430
 
431
- $message .= wpautop( $field_item );
432
- $x++;
 
433
  }
 
 
 
 
 
 
434
  }
435
 
436
  } else {
@@ -438,14 +440,16 @@ class WPForms_WP_Emails {
438
  // Plain Text emails ---------------------------------------------//
439
  foreach ( $this->fields as $field ) {
440
 
441
- if ( !empty( $field['value'] ) && false !== $field['value'] ) {
 
 
442
 
443
- $field_name = !empty( $field['name'] ) ? $field['name'] : __( 'Field ID #', 'wpforms' ) . absint( $field['id'] );
 
444
 
445
- $message .= "--- " . wp_specialchars_decode( $field_name ) . " ---\r\n";
446
- $field_value = stripslashes( wp_specialchars_decode( $field['value'] ) ) . "\r\n\r\n";
447
- $message .= apply_filters( 'wpforms_plaintext_field_value', $field_value, $field, $this->form_data );
448
- }
449
  }
450
  }
451
 
416
  $x = 1;
417
  foreach( $this->fields as $field ) {
418
 
419
+ if ( ! apply_filters( 'wpforms_email_display_empty_fields', false ) && ( empty( $field['value'] ) && '0' !== $field['value'] ) ) {
420
+ continue;
421
+ }
422
 
423
+ $field_val = empty( $field['value'] ) && '0' !== $field['value'] ? '<em>' . __( '(empty)', 'wpforms' ) . '</em>' : $field['value'];
424
+ $field_name = !empty( $field['name'] ) ? $field['name'] : __( 'Field ID #', 'wpforms' ) . absint( $field['id'] );
 
 
 
 
 
425
 
426
+ $field_item = $field_template;
427
+ if ( $x === 1 ) {
428
+ $field_item = str_replace( 'border-top:1px solid #dddddd;', '', $field_item );
429
  }
430
+ $field_item = str_replace( '{field_name}', $field_name, $field_item );
431
+ $field_value = apply_filters( 'wpforms_html_field_value', stripslashes( wp_specialchars_decode( $field_val ) ), $field, $this->form_data, 'email-html' );
432
+ $field_item = str_replace( '{field_value}', $field_value, $field_item );
433
+
434
+ $message .= wpautop( $field_item );
435
+ $x++;
436
  }
437
 
438
  } else {
440
  // Plain Text emails ---------------------------------------------//
441
  foreach ( $this->fields as $field ) {
442
 
443
+ if ( ! apply_filters( 'wpforms_email_display_empty_fields', false ) && ( empty( $field['value'] ) && '0' !== $field['value'] ) ) {
444
+ continue;
445
+ }
446
 
447
+ $field_val = empty( $field['value'] ) && '0' !== $field['value'] ? __( '(empty)', 'wpforms' ) : $field['value'];
448
+ $field_name = !empty( $field['name'] ) ? $field['name'] : __( 'Field ID #', 'wpforms' ) . absint( $field['id'] );
449
 
450
+ $message .= "--- " . wp_specialchars_decode( $field_name ) . " ---\r\n";
451
+ $field_value = stripslashes( wp_specialchars_decode( $field_val ) ) . "\r\n\r\n";
452
+ $message .= apply_filters( 'wpforms_plaintext_field_value', $field_value, $field, $this->form_data );
 
453
  }
454
  }
455
 
includes/fields/class-base.php CHANGED
@@ -7,7 +7,7 @@
7
  * @since 1.0.0
8
  * @license GPL-2.0+
9
  * @copyright Copyright (c) 2016, WPForms LLC
10
- */
11
  abstract class WPForms_Field {
12
 
13
  /**
@@ -42,13 +42,21 @@ abstract class WPForms_Field {
42
  */
43
  public $order = 20;
44
 
 
 
 
 
 
 
 
 
45
  /**
46
  * Field group the field belongs to.
47
  *
48
  * @since 1.0.0
49
  * @var string
50
  */
51
- public $group = 'standard';
52
 
53
  /**
54
  * Placeholder to hold default value(s) for some field types.
@@ -78,6 +86,7 @@ abstract class WPForms_Field {
78
  * Primary class constructor.
79
  *
80
  * @since 1.0.0
 
81
  */
82
  public function __construct( $init = true ) {
83
 
@@ -101,16 +110,16 @@ abstract class WPForms_Field {
101
  add_action( "wpforms_builder_fields_previews_{$this->type}", array( $this, 'field_preview' ), 10 );
102
 
103
  // AJAX Add new field
104
- add_action( "wp_ajax_wpforms_new_field_{$this->type}", array( $this,'field_new' ) );
105
 
106
- // Display fields on front-end
107
  add_action( "wpforms_display_field_{$this->type}", array( $this, 'field_display' ), 10, 3 );
108
 
109
  // Validation on submit
110
- add_action( "wpforms_process_validate_{$this->type}", array( $this, 'validate'), 10, 3 );
111
 
112
  // Format
113
- add_action( "wpforms_process_format_{$this->type}", array( $this, 'format'), 10, 3 );
114
  }
115
 
116
  /**
@@ -131,7 +140,7 @@ abstract class WPForms_Field {
131
  public function field_button( $fields ) {
132
 
133
  // Add field information to fields array
134
- $fields[$this->group]['fields'][] = array(
135
  'order' => $this->order,
136
  'name' => $this->name,
137
  'type' => $this->type,
@@ -145,6 +154,7 @@ abstract class WPForms_Field {
145
  * Creates the field options panel. Used by subclasses.
146
  *
147
  * @since 1.0.0
 
148
  */
149
  public function field_options( $field ) {
150
  }
@@ -153,6 +163,7 @@ abstract class WPForms_Field {
153
  * Creates the field preview. Used by subclasses.
154
  *
155
  * @since 1.0.0
 
156
  */
157
  public function field_preview( $field ) {
158
  }
@@ -173,13 +184,13 @@ abstract class WPForms_Field {
173
  public function field_element( $option, $field, $args = array(), $echo = true ) {
174
 
175
  $id = (int) $field['id'];
176
- $class = !empty( $args['class'] ) ? sanitize_html_class( $args['class'] ) : '';
177
- $slug = !empty( $args['slug'] ) ? sanitize_title( $args['slug'] ) : '';
178
  $data = '';
179
 
180
- if ( !empty( $args['data'] ) ) {
181
  foreach ( $args['data'] as $key => $val ) {
182
- $data .= ' data-' . $key . '="' . $val . '"';
183
  }
184
  }
185
 
@@ -193,10 +204,10 @@ abstract class WPForms_Field {
193
  // Label
194
  case 'label':
195
  $output = sprintf( '<label for="wpforms-field-option-%d-%s">%s', $id, $slug, esc_html( $args['value'] ) );
196
- if ( isset( $args['tooltip'] ) && !empty( $args['tooltip'] ) ) {
197
- $output .= sprintf( ' <i class="fa fa-question-circle wpforms-help-tooltip" title="%s"></i>', esc_attr( $args['tooltip'] ) );
198
  }
199
- if ( isset( $args['after_tooltip'] ) && !empty( $args['after_tooltip'] ) ) {
200
  $output .= $args['after_tooltip'];
201
  }
202
  $output .= '</label>';
@@ -204,10 +215,10 @@ abstract class WPForms_Field {
204
 
205
  // Text input
206
  case 'text':
207
- $type = !empty( $args['type'] ) ? esc_attr( $args['type'] ) : 'text';
208
- $placeholder = !empty( $args['placeholder'] ) ? esc_attr( $args['placeholder'] ) : '';
209
- $before = !empty( $args['before'] ) ? '<span class="before-input">' . esc_html( $args['before'] ) . '</span>' : '';
210
- if ( !empty( $before ) ) {
211
  $class .= ' has-before';
212
  }
213
  $output = sprintf( '%s<input type="%s" class="%s" id="wpforms-field-option-%d-%s" name="fields[%d][%s]" value="%s" placeholder="%s" %s>', $before, $type, $class, $id, $slug, $id, $slug, esc_attr( $args['value'] ), $placeholder, $data );
@@ -215,18 +226,18 @@ abstract class WPForms_Field {
215
 
216
  // Textarea
217
  case 'textarea':
218
- $rows = !empty( $args['rows'] ) ? (int) $args['rows'] : '3';
219
  $output = sprintf( '<textarea class="%s" id="wpforms-field-option-%d-%s" name="fields[%d][%s]" rows="%d" %s>%s</textarea>', $class, $id, $slug, $id, $slug, $rows, $data, $args['value'] );
220
  break;
221
 
222
  // Checkbox
223
  case 'checkbox':
224
  $checked = checked( '1', $args['value'], false );
225
- $desc = !empty( $args['desc'] ) ? $args['desc'] : '';
226
  $output = sprintf( '<input type="checkbox" class="%s" id="wpforms-field-option-%d-%s" name="fields[%d][%s]" value="1" %s %s>', $class, $id, $slug, $id, $slug, $checked, $data );
227
  $output .= sprintf( '<label for="wpforms-field-option-%d-%s" class="inline">%s', $id, $slug, $args['desc'] );
228
- if ( isset( $args['tooltip'] ) && !empty( $args['tooltip'] ) ) {
229
- $output .= sprintf( ' <i class="fa fa-question-circle wpforms-help-tooltip" title="%s"></i>', esc_attr( $args['tooltip'] ) );
230
  }
231
  $output .= '</label>';
232
  break;
@@ -246,15 +257,15 @@ abstract class WPForms_Field {
246
  $options = $args['options'];
247
  $value = isset( $args['value'] ) ? $args['value'] : '';
248
  $output = sprintf( '<select class="%s" id="wpforms-field-option-%d-%s" name="fields[%d][%s]" %s>', $class, $id, $slug, $id, $slug, $data );
249
- foreach ( $options as $key => $option ) {
250
- $output .= sprintf( '<option value="%s" %s>%s</option>', esc_attr( $key ), selected( $key, $value, false ), $option );
251
- }
252
  $output .= '</select>';
253
  break;
254
- }
255
 
256
  if ( $echo ) {
257
- echo $output;
258
  } else {
259
  return $output;
260
  }
@@ -274,16 +285,16 @@ abstract class WPForms_Field {
274
 
275
  switch ( $option ) {
276
 
277
- //----------------------------------------------------------------//
278
  // Basic Fields
279
- //----------------------------------------------------------------//
280
 
281
  // Basic Options markup ------------------------------------------//
282
 
283
  case 'basic-options':
284
- $markup = !empty( $args['markup'] ) ? $args['markup'] : 'open';
285
- $class = !empty( $args['class'] ) ? esc_html( $args['class'] ) : '';
286
- if ( $markup == 'open' ) {
287
  $output = sprintf( '<div class="wpforms-field-option-group wpforms-field-option-group-basic" id="wpforms-field-option-basic-%d">', $field['id'] );
288
  $output .= sprintf( '<a href="#" class="wpforms-field-option-group-toggle">%s <span>(ID #%d)</span> <i class="fa fa-angle-down"></i></a>', $this->name, $field['id'] );
289
  $output .= sprintf( '<div class="wpforms-field-option-group-inner %s">', $class );
@@ -295,7 +306,7 @@ abstract class WPForms_Field {
295
  // Field Label ---------------------------------------------------//
296
 
297
  case 'label':
298
- $value = !empty( $field['label'] ) ? esc_attr( $field['label'] ) : '';
299
  $tooltip = __( 'Enter text for the form field label. Field labels are recommended and can be hidden in the Advanced Settings.', 'wpforms' );
300
  $output = $this->field_element( 'label', $field, array( 'slug' => 'label', 'value' => __( 'Label', 'wpforms' ), 'tooltip' => $tooltip ), false );
301
  $output .= $this->field_element( 'text', $field, array( 'slug' => 'label', 'value' => $value ), false );
@@ -305,7 +316,7 @@ abstract class WPForms_Field {
305
  // Field Description ---------------------------------------------//
306
 
307
  case 'description':
308
- $value = !empty( $field['description'] ) ? esc_attr( $field['description'] ) : '';
309
  $tooltip = __( 'Enter text for the form field description.', 'wpforms' );
310
  $output = $this->field_element( 'label', $field, array( 'slug' => 'description', 'value' => __( 'Description', 'wpforms' ), 'tooltip' => $tooltip ), false );
311
  $output .= $this->field_element( 'textarea', $field, array( 'slug' => 'description', 'value' => $value ), false );
@@ -315,7 +326,7 @@ abstract class WPForms_Field {
315
  // Field Required toggle -----------------------------------------//
316
 
317
  case 'required':
318
- $default = !empty( $args['default'] ) ? $args['default'] : '0';
319
  $value = isset( $field['required'] ) ? $field['required'] : $default;
320
  $tooltip = __( 'Check this option to mark the field required. A form will not submit unless all required fields are provided.', 'wpforms' );
321
  $output = $this->field_element( 'checkbox', $field, array( 'slug' => 'required', 'value' => $value, 'desc' => __( 'Required', 'wpforms' ), 'tooltip' => $tooltip ), false );
@@ -326,14 +337,14 @@ abstract class WPForms_Field {
326
 
327
  case 'meta':
328
  $output = sprintf( '<label>%s</label>', 'Type' );
329
- $output .= sprintf( '<p class="meta">%s <span class="id">(ID #%d)</span></p>', $this->name, $field['id']);
330
  $output = $this->field_element( 'row', $field, array( 'slug' => 'meta', 'content' => $output ), false );
331
  break;
332
 
333
  // Code Block ----------------------------------------------------//
334
 
335
  case 'code':
336
- $value = !empty( $field['code'] ) ? esc_attr( $field['code'] ) : '';
337
  $tooltip = __( 'Enter code for the form field.', 'wpforms' );
338
  $output = $this->field_element( 'label', $field, array( 'slug' => 'code', 'value' => __( 'Code', 'wpforms' ), 'tooltip' => $tooltip ), false );
339
  $output .= $this->field_element( 'textarea', $field, array( 'slug' => 'code', 'value' => $value ), false );
@@ -345,27 +356,29 @@ abstract class WPForms_Field {
345
  case 'choices':
346
 
347
  $tooltip = __( 'Add choices for the form field.', 'wpforms' );
348
- $dynamic = !empty( $field['dynamic_choices'] ) ? esc_html( $field['dynamic_choices'] ) : '';
349
- $values = !empty( $field['choices'] ) ? $field['choices'] : $this->defaults;
350
- $class = !empty( $field['show_values'] ) && $field['show_values'] == '1' ? 'show-values' : '';
351
- $class .= !empty( $dynamic ) ? ' wpforms-hidden' : '';
 
352
 
353
  // Field option label
354
  $option_label = $this->field_element(
355
  'label',
356
  $field,
357
  array(
358
- 'slug' => 'choices',
359
- 'value' => __( 'Choices', 'wpforms' ),
360
- 'tooltip' => $tooltip
 
361
  ),
362
  false
363
  );
364
 
365
  // Field option choices inputs
366
- $option_choices = sprintf( '<ul data-next-id="%s" class="%s" data-field-id="%d" data-field-type="%s">', max( array_keys( $values ) ) +1, $class, $field['id'], $this->type );
367
  foreach ( $values as $key => $value ) {
368
- $default = !empty( $value['default'] ) ? $value['default'] : '';
369
  $option_choices .= sprintf( '<li data-key="%d">', $key );
370
  $option_choices .= sprintf( '<input type="radio" name="fields[%s][choices][%s][default]" class="default" value="1" %s>', $field['id'], $key, checked( '1', $default, false ) );
371
  $option_choices .= '<span class="move"><i class="fa fa-bars"></i></span>';
@@ -380,16 +393,16 @@ abstract class WPForms_Field {
380
  // Field option dynamic status
381
  $source_name = '';
382
  $type_name = '';
383
- $status_visibility = !empty( $dynamic ) && !empty( $field['dynamic_' . $dynamic ] ) ? '' : 'wpforms-hidden';
384
 
385
- if ( 'post_type' == $dynamic && !empty( $field['dynamic_' . $dynamic ] ) ) {
386
 
387
  $type_name = __( 'post type', 'wpforms' );
388
  $source = $field['dynamic_' . $dynamic ];
389
  $pt = get_post_type_object( $source );
390
  $source_name = $pt->labels->name;
391
 
392
- } elseif ( 'taxonomy' == $dynamic && !empty( $field['dynamic_' . $dynamic ] ) ) {
393
 
394
  $type_name = __( 'taxonomy', 'wpforms' );
395
  $source = $field['dynamic_' . $dynamic ];
@@ -417,7 +430,7 @@ abstract class WPForms_Field {
417
  case 'choices_payments':
418
 
419
  $tooltip = __( 'Add choices for the form field.', 'wpforms' );
420
- $values = !empty( $field['choices'] ) ? $field['choices'] : $this->defaults;
421
 
422
  // Field option label
423
  $option_label = $this->field_element(
@@ -434,9 +447,9 @@ abstract class WPForms_Field {
434
  // Field option choices inputs
435
  $option_choices = sprintf( '<ul data-next-id="%s" data-field-id="%d" data-field-type="%s">', max( array_keys( $values ) ) +1, $field['id'], $this->type );
436
  foreach ( $values as $key => $value ) {
437
- $default = !empty( $value['default'] ) ? $value['default'] : '';
438
  $placeholder = wpforms_format_amount( 0 );
439
- $amount = !empty( $value['value'] ) ? wpforms_format_amount( wpforms_sanitize_amount( $value['value'] ) ) : $placeholder;
440
  $option_choices .= sprintf( '<li data-key="%d">', $key );
441
  $option_choices .= sprintf( '<input type="radio" name="fields[%s][choices][%s][default]" class="default" value="1" %s>', $field['id'], $key, checked( '1', $default, false ) );
442
  $option_choices .= '<span class="move"><i class="fa fa-bars"></i></span>';
@@ -459,18 +472,17 @@ abstract class WPForms_Field {
459
  );
460
  break;
461
 
462
- //----------------------------------------------------------------//
463
  // Advanced Fields
464
- //----------------------------------------------------------------//
465
 
466
  // Default value -------------------------------------------------//
467
 
468
  case 'default_value':
469
- $value = !empty( $field['default_value'] ) ? esc_attr( $field['default_value'] ) : '';
470
  $tooltip = __( 'Enter text for the default form field value.', 'wpforms' );
471
- $toggle = '<a href="#" class="toggle-smart-tags"><i class="fa fa-tags"></i> <span>' . __( 'Show Smart Tags', 'wpforms' ) . '</span></a>';
472
  $output = $this->field_element( 'label', $field, array( 'slug' => 'default_value', 'value' => __( 'Default Value', 'wpforms' ), 'tooltip' => $tooltip, 'after_tooltip' => $toggle ), false );
473
- $output .= wpforms()->smart_tags->get( 'list' );
474
  $output .= $this->field_element( 'text', $field, array( 'slug' => 'default_value', 'value' => $value ), false );
475
  $output = $this->field_element( 'row', $field, array( 'slug' => 'default_value', 'content' => $output ), false );
476
  break;
@@ -478,11 +490,11 @@ abstract class WPForms_Field {
478
  // Size ----------------------------------------------------------//
479
 
480
  case 'size':
481
- $value = !empty( $field['size'] ) ? esc_attr( $field['size'] ) : 'medium';
482
  $tooltip = __( 'Select the default form field size.', 'wpforms' );
483
  $options = array(
484
  'small' => __( 'Small', 'wpforms' ),
485
- 'medium' => __( 'Medium', 'wpforms'),
486
  'large' => __( 'Large', 'wpforms' ),
487
  );
488
  $output = $this->field_element( 'label', $field, array( 'slug' => 'size', 'value' => __( 'Field Size', 'wpforms' ), 'tooltip' => $tooltip ), false );
@@ -493,10 +505,10 @@ abstract class WPForms_Field {
493
  // Advanced Options markup ---------------------------------------//
494
 
495
  case 'advanced-options':
496
- $markup = !empty( $args['markup'] ) ? $args['markup'] : 'open';
497
  if ( $markup == 'open' ) {
498
  $override = apply_filters( 'wpforms_advanced_options_override', false );
499
- $override = !empty( $override ) ? 'style="display:' . $override . ';"' : '';
500
  $output = sprintf( '<div class="wpforms-field-option-group wpforms-field-option-group-advanced wpforms-hide" id="wpforms-field-option-advanced-%d" %s>', $field['id'], $override );
501
  $output .= sprintf( '<a href="#" class="wpforms-field-option-group-toggle">%s <i class="fa fa-angle-right"></i></a>', __( 'Advanced Options', 'wpforms' ) );
502
  $output .= '<div class="wpforms-field-option-group-inner">';
@@ -508,7 +520,7 @@ abstract class WPForms_Field {
508
  // Placeholder ---------------------------------------------------//
509
 
510
  case 'placeholder':
511
- $value = !empty( $field['placeholder'] ) ? esc_attr( $field['placeholder'] ) : '';
512
  $tooltip = __( 'Enter text for the form field placeholder.', 'wpforms' );
513
  $output = $this->field_element( 'label', $field, array( 'slug' => 'placeholder', 'value' => __( 'Placeholder Text', 'wpforms' ), 'tooltip' => $tooltip ), false );
514
  $output .= $this->field_element( 'text', $field, array( 'slug' => 'placeholder', 'value' => $value ), false );
@@ -518,10 +530,11 @@ abstract class WPForms_Field {
518
  // CSS classes ---------------------------------------------------//
519
 
520
  case 'css':
521
- $value = !empty( $field['css'] ) ? esc_attr( $field['css'] ) : '';
522
  $tooltip = __( 'Enter CSS class names for the form field container. Class names should be separated with spaces.', 'wpforms' );
 
523
  // Build output
524
- $output = $this->field_element( 'label', $field, array( 'slug' => 'css', 'value' => __( 'CSS Classes', 'wpforms' ), 'tooltip' => $tooltip ), false );
525
  $output .= $this->field_element( 'text', $field, array( 'slug' => 'css', 'value' => $value ), false );
526
  $output = $this->field_element( 'row', $field, array( 'slug' => 'css', 'content' => $output ), false );
527
  break;
@@ -549,7 +562,7 @@ abstract class WPForms_Field {
549
  // Input Columns -------------------------------------------------//
550
 
551
  case 'input_columns':
552
- $value = !empty( $field['input_columns'] ) ? esc_attr( $field['input_columns'] ) : '';
553
  $tooltip = __( 'Select the layout for displaying field choices.', 'wpforms' );
554
  $options = array(
555
  '' => __( 'One Column', 'wpforms' ),
@@ -564,7 +577,7 @@ abstract class WPForms_Field {
564
  // Dynamic Choices -----------------------------------------------//
565
 
566
  case 'dynamic_choices':
567
- $value = !empty( $field['dynamic_choices'] ) ? esc_attr( $field['dynamic_choices'] ) : '';
568
  $tooltip = __( 'Select auto-populate method to use.', 'wpforms' );
569
  $options = array(
570
  '' => __( 'Off', 'wpforms' ),
@@ -581,9 +594,9 @@ abstract class WPForms_Field {
581
  case 'dynamic_choices_source':
582
 
583
  $output = '';
584
- $type = !empty( $field['dynamic_choices'] ) ? esc_attr( $field['dynamic_choices'] ) : '';
585
 
586
- if ( !empty( $type ) ) {
587
 
588
  if ( 'post_type' == $type ) {
589
 
@@ -601,10 +614,10 @@ abstract class WPForms_Field {
601
  $tooltip = sprintf( __( 'Select %s to use for auto-populating field choices.', 'wpforms' ), $type_name );
602
  $label = sprintf( __( 'Dynamic %s Source', 'wpforms' ), $type_name );
603
  $options = array();
604
- $source = !empty( $field['dynamic_' . $type ] ) ? esc_attr( $field['dynamic_' . $type] ) : '';
605
 
606
  foreach ( $items as $key => $item ) {
607
- $options[$key] = $item->labels->name;
608
  }
609
 
610
  // Field option label
@@ -637,30 +650,30 @@ abstract class WPForms_Field {
637
  $field,
638
  array(
639
  'slug' => 'dynamic_' . $type,
640
- 'content' => $option_label . $option_input
641
  ),
642
  false
643
  );
644
- }
645
  break;
646
- }
647
 
648
  if ( $echo ) {
649
 
650
- if ( in_array( $option, array( 'basic-options', 'advanced-options' ) ) ) {
651
 
652
- if ( $markup == 'open')
653
  do_action( "wpforms_field_options_before_{$option}", $field, $this );
 
654
 
655
- echo $output;
656
 
657
- if ( $markup == 'close')
658
  do_action( "wpforms_field_options_after_{$option}", $field, $this );
659
-
660
  } else {
661
- echo $output;
662
  }
663
-
664
  } else {
665
  return $output;
666
  }
@@ -682,18 +695,18 @@ abstract class WPForms_Field {
682
  switch ( $option ) {
683
 
684
  case 'label':
685
- $label = isset( $field['label'] ) && !empty( $field['label'] ) ? esc_html( $field['label'] ) : '';
686
  $output = sprintf( '<label class="label-title"><span class="text">%s</span><span class="required">*</span></label>', $label );
687
  break;
688
 
689
  case 'description';
690
- $description = isset( $field['description'] ) && !empty( $field['description'] ) ? $field['description'] : '';
691
  $output = sprintf( '<div class="description">%s</div>', $description );
692
  break;
693
  }
694
 
695
  if ( $echo ) {
696
- echo $output;
697
  } else {
698
  return $output;
699
  }
@@ -710,19 +723,22 @@ abstract class WPForms_Field {
710
  check_ajax_referer( 'wpforms-builder', 'nonce' );
711
 
712
  // Check for permissions
713
- if ( !current_user_can( apply_filters( 'wpforms_manage_cap', 'manage_options' ) ) )
714
- die( __( 'You do no have permission.', 'wpforms' ) );
 
715
 
716
  // Check for form ID
717
- if ( !isset( $_POST['id'] ) || empty( $_POST['id'] ) )
718
- die( __( 'No form ID found', 'wpforms' ) );
 
719
 
720
  // Check for field type to add
721
- if ( !isset( $_POST['type'] ) || empty( $_POST['type'] ) )
722
- die( __( 'No field type found', 'wpforms' ) );
 
723
 
724
  // Grab field data
725
- $field_args = !empty( $_POST['defaults'] ) ? (array) $_POST['defaults'] : array();
726
  $field_type = esc_attr( $_POST['type'] );
727
  $field_id = wpforms()->form->next_field_id( $_POST['id'] );
728
  $field = array(
@@ -737,7 +753,7 @@ abstract class WPForms_Field {
737
  $field_class = apply_filters( 'wpforms_field_new_class', '', $field );
738
 
739
  // Field types that default to required
740
- if ( !empty( $field_required ) ) {
741
  $field_required = 'required';
742
  $field['required'] = '1';
743
  }
@@ -773,15 +789,66 @@ abstract class WPForms_Field {
773
  }
774
 
775
  /**
776
- * Field display on the form front-end.
777
  *
778
  * @since 1.0.0
779
  * @param array $field
 
780
  * @param array $form_data
781
  */
782
  public function field_display( $field, $field_atts, $form_data ) {
783
  }
784
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
785
  /**
786
  * Validates field on form submit.
787
  *
@@ -793,9 +860,8 @@ abstract class WPForms_Field {
793
  public function validate( $field_id, $field_submit, $form_data ) {
794
 
795
  // Basic required check - If field is marked as required, check for entry data
796
- if ( !empty( $form_data['fields'][$field_id]['required'] ) && empty( $field_submit ) && '0' != $field_submit ) {
797
-
798
- wpforms()->process->errors[$form_data['id']][$field_id] = apply_filters( 'wpforms_required_label', __( 'This field is required', 'wpforms' ) );
799
  }
800
  }
801
 
@@ -814,16 +880,16 @@ abstract class WPForms_Field {
814
  $field_submit = implode( "\r\n", $field_submit );
815
  }
816
 
817
- $name = !empty( $form_data['fields'][$field_id]['label'] ) ? sanitize_text_field( $form_data['fields'][$field_id]['label'] ) : '';
818
 
819
  // Hack to keep line breaks
820
  $value = implode( "\n", array_map( 'sanitize_text_field', explode( "\n", $field_submit ) ) );
821
 
822
- wpforms()->process->fields[$field_id] = array(
823
  'name' => $name,
824
  'value' => $value,
825
  'id' => absint( $field_id ),
826
  'type' => $this->type,
827
  );
828
  }
829
- }
7
  * @since 1.0.0
8
  * @license GPL-2.0+
9
  * @copyright Copyright (c) 2016, WPForms LLC
10
+ */
11
  abstract class WPForms_Field {
12
 
13
  /**
42
  */
43
  public $order = 20;
44
 
45
+ /**
46
+ * Field version number, used to introduce new features and capabilities.
47
+ *
48
+ * @since 1.3.7
49
+ * @var integer
50
+ */
51
+ public $version = 1;
52
+
53
  /**
54
  * Field group the field belongs to.
55
  *
56
  * @since 1.0.0
57
  * @var string
58
  */
59
+ public $group = 'standard';
60
 
61
  /**
62
  * Placeholder to hold default value(s) for some field types.
86
  * Primary class constructor.
87
  *
88
  * @since 1.0.0
89
+ * @param bool $init
90
  */
91
  public function __construct( $init = true ) {
92
 
110
  add_action( "wpforms_builder_fields_previews_{$this->type}", array( $this, 'field_preview' ), 10 );
111
 
112
  // AJAX Add new field
113
+ add_action( "wp_ajax_wpforms_new_field_{$this->type}", array( $this, 'field_new' ) );
114
 
115
+ // Display field input elements on front-end
116
  add_action( "wpforms_display_field_{$this->type}", array( $this, 'field_display' ), 10, 3 );
117
 
118
  // Validation on submit
119
+ add_action( "wpforms_process_validate_{$this->type}", array( $this, 'validate' ), 10, 3 );
120
 
121
  // Format
122
+ add_action( "wpforms_process_format_{$this->type}", array( $this, 'format' ), 10, 3 );
123
  }
124
 
125
  /**
140
  public function field_button( $fields ) {
141
 
142
  // Add field information to fields array
143
+ $fields[ $this->group ]['fields'][] = array(
144
  'order' => $this->order,
145
  'name' => $this->name,
146
  'type' => $this->type,
154
  * Creates the field options panel. Used by subclasses.
155
  *
156
  * @since 1.0.0
157
+ * @param array $field
158
  */
159
  public function field_options( $field ) {
160
  }
163
  * Creates the field preview. Used by subclasses.
164
  *
165
  * @since 1.0.0
166
+ * @param array $field
167
  */
168
  public function field_preview( $field ) {
169
  }
184
  public function field_element( $option, $field, $args = array(), $echo = true ) {
185
 
186
  $id = (int) $field['id'];
187
+ $class = ! empty( $args['class'] ) ? sanitize_html_class( $args['class'] ) : '';
188
+ $slug = ! empty( $args['slug'] ) ? sanitize_title( $args['slug'] ) : '';
189
  $data = '';
190
 
191
+ if ( ! empty( $args['data'] ) ) {
192
  foreach ( $args['data'] as $key => $val ) {
193
+ $data .= ' data-' . $key . '="' . $val . '"';
194
  }
195
  }
196
 
204
  // Label
205
  case 'label':
206
  $output = sprintf( '<label for="wpforms-field-option-%d-%s">%s', $id, $slug, esc_html( $args['value'] ) );
207
+ if ( isset( $args['tooltip'] ) && ! empty( $args['tooltip'] ) ) {
208
+ $output .= ' ' . sprintf( '<i class="fa fa-question-circle wpforms-help-tooltip" title="%s"></i>', esc_attr( $args['tooltip'] ) );
209
  }
210
+ if ( isset( $args['after_tooltip'] ) && ! empty( $args['after_tooltip'] ) ) {
211
  $output .= $args['after_tooltip'];
212
  }
213
  $output .= '</label>';
215
 
216
  // Text input
217
  case 'text':
218
+ $type = ! empty( $args['type'] ) ? esc_attr( $args['type'] ) : 'text';
219
+ $placeholder = ! empty( $args['placeholder'] ) ? esc_attr( $args['placeholder'] ) : '';
220
+ $before = ! empty( $args['before'] ) ? '<span class="before-input">' . esc_html( $args['before'] ) . '</span>' : '';
221
+ if ( ! empty( $before ) ) {
222
  $class .= ' has-before';
223
  }
224
  $output = sprintf( '%s<input type="%s" class="%s" id="wpforms-field-option-%d-%s" name="fields[%d][%s]" value="%s" placeholder="%s" %s>', $before, $type, $class, $id, $slug, $id, $slug, esc_attr( $args['value'] ), $placeholder, $data );
226
 
227
  // Textarea
228
  case 'textarea':
229
+ $rows = ! empty( $args['rows'] ) ? (int) $args['rows'] : '3';
230
  $output = sprintf( '<textarea class="%s" id="wpforms-field-option-%d-%s" name="fields[%d][%s]" rows="%d" %s>%s</textarea>', $class, $id, $slug, $id, $slug, $rows, $data, $args['value'] );
231
  break;
232
 
233
  // Checkbox
234
  case 'checkbox':
235
  $checked = checked( '1', $args['value'], false );
236
+ $desc = ! empty( $args['desc'] ) ? $args['desc'] : '';
237
  $output = sprintf( '<input type="checkbox" class="%s" id="wpforms-field-option-%d-%s" name="fields[%d][%s]" value="1" %s %s>', $class, $id, $slug, $id, $slug, $checked, $data );
238
  $output .= sprintf( '<label for="wpforms-field-option-%d-%s" class="inline">%s', $id, $slug, $args['desc'] );
239
+ if ( isset( $args['tooltip'] ) && ! empty( $args['tooltip'] ) ) {
240
+ $output .= ' ' . sprintf( '<i class="fa fa-question-circle wpforms-help-tooltip" title="%s"></i>', esc_attr( $args['tooltip'] ) );
241
  }
242
  $output .= '</label>';
243
  break;
257
  $options = $args['options'];
258
  $value = isset( $args['value'] ) ? $args['value'] : '';
259
  $output = sprintf( '<select class="%s" id="wpforms-field-option-%d-%s" name="fields[%d][%s]" %s>', $class, $id, $slug, $id, $slug, $data );
260
+ foreach ( $options as $key => $option ) {
261
+ $output .= sprintf( '<option value="%s" %s>%s</option>', esc_attr( $key ), selected( $key, $value, false ), $option );
262
+ }
263
  $output .= '</select>';
264
  break;
265
+ } // End switch().
266
 
267
  if ( $echo ) {
268
+ echo $output; // WPCS: XSS ok.
269
  } else {
270
  return $output;
271
  }
285
 
286
  switch ( $option ) {
287
 
288
+ // --------------------------------------------------------------//
289
  // Basic Fields
290
+ // --------------------------------------------------------------//
291
 
292
  // Basic Options markup ------------------------------------------//
293
 
294
  case 'basic-options':
295
+ $markup = ! empty( $args['markup'] ) ? $args['markup'] : 'open';
296
+ $class = ! empty( $args['class'] ) ? esc_html( $args['class'] ) : '';
297
+ if ( 'open' === $markup ) {
298
  $output = sprintf( '<div class="wpforms-field-option-group wpforms-field-option-group-basic" id="wpforms-field-option-basic-%d">', $field['id'] );
299
  $output .= sprintf( '<a href="#" class="wpforms-field-option-group-toggle">%s <span>(ID #%d)</span> <i class="fa fa-angle-down"></i></a>', $this->name, $field['id'] );
300
  $output .= sprintf( '<div class="wpforms-field-option-group-inner %s">', $class );
306
  // Field Label ---------------------------------------------------//
307
 
308
  case 'label':
309
+ $value = ! empty( $field['label'] ) ? esc_attr( $field['label'] ) : '';
310
  $tooltip = __( 'Enter text for the form field label. Field labels are recommended and can be hidden in the Advanced Settings.', 'wpforms' );
311
  $output = $this->field_element( 'label', $field, array( 'slug' => 'label', 'value' => __( 'Label', 'wpforms' ), 'tooltip' => $tooltip ), false );
312
  $output .= $this->field_element( 'text', $field, array( 'slug' => 'label', 'value' => $value ), false );
316
  // Field Description ---------------------------------------------//
317
 
318
  case 'description':
319
+ $value = ! empty( $field['description'] ) ? esc_attr( $field['description'] ) : '';
320
  $tooltip = __( 'Enter text for the form field description.', 'wpforms' );
321
  $output = $this->field_element( 'label', $field, array( 'slug' => 'description', 'value' => __( 'Description', 'wpforms' ), 'tooltip' => $tooltip ), false );
322
  $output .= $this->field_element( 'textarea', $field, array( 'slug' => 'description', 'value' => $value ), false );
326
  // Field Required toggle -----------------------------------------//
327
 
328
  case 'required':
329
+ $default = ! empty( $args['default'] ) ? $args['default'] : '0';
330
  $value = isset( $field['required'] ) ? $field['required'] : $default;
331
  $tooltip = __( 'Check this option to mark the field required. A form will not submit unless all required fields are provided.', 'wpforms' );
332
  $output = $this->field_element( 'checkbox', $field, array( 'slug' => 'required', 'value' => $value, 'desc' => __( 'Required', 'wpforms' ), 'tooltip' => $tooltip ), false );
337
 
338
  case 'meta':
339
  $output = sprintf( '<label>%s</label>', 'Type' );
340
+ $output .= sprintf( '<p class="meta">%s <span class="id">(ID #%d)</span></p>', $this->name, $field['id'] );
341
  $output = $this->field_element( 'row', $field, array( 'slug' => 'meta', 'content' => $output ), false );
342
  break;
343
 
344
  // Code Block ----------------------------------------------------//
345
 
346
  case 'code':
347
+ $value = ! empty( $field['code'] ) ? esc_attr( $field['code'] ) : '';
348
  $tooltip = __( 'Enter code for the form field.', 'wpforms' );
349
  $output = $this->field_element( 'label', $field, array( 'slug' => 'code', 'value' => __( 'Code', 'wpforms' ), 'tooltip' => $tooltip ), false );
350
  $output .= $this->field_element( 'textarea', $field, array( 'slug' => 'code', 'value' => $value ), false );
356
  case 'choices':
357
 
358
  $tooltip = __( 'Add choices for the form field.', 'wpforms' );
359
+ $toggle = '<a href="#" class="toggle-bulk-add-display"><i class="fa fa-download"></i> <span>' . __( 'Bulk Add', 'wpforms' ) . '</span></a>';
360
+ $dynamic = ! empty( $field['dynamic_choices'] ) ? esc_html( $field['dynamic_choices'] ) : '';
361
+ $values = ! empty( $field['choices'] ) ? $field['choices'] : $this->defaults;
362
+ $class = ! empty( $field['show_values'] ) && $field['show_values'] == '1' ? 'show-values' : '';
363
+ $class .= ! empty( $dynamic ) ? ' wpforms-hidden' : '';
364
 
365
  // Field option label
366
  $option_label = $this->field_element(
367
  'label',
368
  $field,
369
  array(
370
+ 'slug' => 'choices',
371
+ 'value' => __( 'Choices', 'wpforms' ),
372
+ 'tooltip' => $tooltip,
373
+ 'after_tooltip' => $toggle,
374
  ),
375
  false
376
  );
377
 
378
  // Field option choices inputs
379
+ $option_choices = sprintf( '<ul data-next-id="%s" class="choices-list %s" data-field-id="%d" data-field-type="%s">', max( array_keys( $values ) ) +1, $class, $field['id'], $this->type );
380
  foreach ( $values as $key => $value ) {
381
+ $default = ! empty( $value['default'] ) ? $value['default'] : '';
382
  $option_choices .= sprintf( '<li data-key="%d">', $key );
383
  $option_choices .= sprintf( '<input type="radio" name="fields[%s][choices][%s][default]" class="default" value="1" %s>', $field['id'], $key, checked( '1', $default, false ) );
384
  $option_choices .= '<span class="move"><i class="fa fa-bars"></i></span>';
393
  // Field option dynamic status
394
  $source_name = '';
395
  $type_name = '';
396
+ $status_visibility = ! empty( $dynamic ) && ! empty( $field['dynamic_' . $dynamic ] ) ? '' : 'wpforms-hidden';
397
 
398
+ if ( 'post_type' == $dynamic && ! empty( $field['dynamic_' . $dynamic ] ) ) {
399
 
400
  $type_name = __( 'post type', 'wpforms' );
401
  $source = $field['dynamic_' . $dynamic ];
402
  $pt = get_post_type_object( $source );
403
  $source_name = $pt->labels->name;
404
 
405
+ } elseif ( 'taxonomy' == $dynamic && ! empty( $field['dynamic_' . $dynamic ] ) ) {
406
 
407
  $type_name = __( 'taxonomy', 'wpforms' );
408
  $source = $field['dynamic_' . $dynamic ];
430
  case 'choices_payments':
431
 
432
  $tooltip = __( 'Add choices for the form field.', 'wpforms' );
433
+ $values = ! empty( $field['choices'] ) ? $field['choices'] : $this->defaults;
434
 
435
  // Field option label
436
  $option_label = $this->field_element(
447
  // Field option choices inputs
448
  $option_choices = sprintf( '<ul data-next-id="%s" data-field-id="%d" data-field-type="%s">', max( array_keys( $values ) ) +1, $field['id'], $this->type );
449
  foreach ( $values as $key => $value ) {
450
+ $default = ! empty( $value['default'] ) ? $value['default'] : '';
451
  $placeholder = wpforms_format_amount( 0 );
452
+ $amount = ! empty( $value['value'] ) ? wpforms_format_amount( wpforms_sanitize_amount( $value['value'] ) ) : $placeholder;
453
  $option_choices .= sprintf( '<li data-key="%d">', $key );
454
  $option_choices .= sprintf( '<input type="radio" name="fields[%s][choices][%s][default]" class="default" value="1" %s>', $field['id'], $key, checked( '1', $default, false ) );
455
  $option_choices .= '<span class="move"><i class="fa fa-bars"></i></span>';
472
  );
473
  break;
474
 
475
+ // ---------------------------------------------------------------//
476
  // Advanced Fields
477
+ // ---------------------------------------------------------------//
478
 
479
  // Default value -------------------------------------------------//
480
 
481
  case 'default_value':
482
+ $value = ! empty( $field['default_value'] ) ? esc_attr( $field['default_value'] ) : '';
483
  $tooltip = __( 'Enter text for the default form field value.', 'wpforms' );
484
+ $toggle = '<a href="#" class="toggle-smart-tag-display" data-type="other"><i class="fa fa-tags"></i> <span>' . __( 'Show Smart Tags', 'wpforms' ) . '</span></a>';
485
  $output = $this->field_element( 'label', $field, array( 'slug' => 'default_value', 'value' => __( 'Default Value', 'wpforms' ), 'tooltip' => $tooltip, 'after_tooltip' => $toggle ), false );
 
486
  $output .= $this->field_element( 'text', $field, array( 'slug' => 'default_value', 'value' => $value ), false );
487
  $output = $this->field_element( 'row', $field, array( 'slug' => 'default_value', 'content' => $output ), false );
488
  break;
490
  // Size ----------------------------------------------------------//
491
 
492
  case 'size':
493
+ $value = ! empty( $field['size'] ) ? esc_attr( $field['size'] ) : 'medium';
494
  $tooltip = __( 'Select the default form field size.', 'wpforms' );
495
  $options = array(
496
  'small' => __( 'Small', 'wpforms' ),
497
+ 'medium' => __( 'Medium', 'wpforms' ),
498
  'large' => __( 'Large', 'wpforms' ),
499
  );
500
  $output = $this->field_element( 'label', $field, array( 'slug' => 'size', 'value' => __( 'Field Size', 'wpforms' ), 'tooltip' => $tooltip ), false );
505
  // Advanced Options markup ---------------------------------------//
506
 
507
  case 'advanced-options':
508
+ $markup = ! empty( $args['markup'] ) ? $args['markup'] : 'open';
509
  if ( $markup == 'open' ) {
510
  $override = apply_filters( 'wpforms_advanced_options_override', false );
511
+ $override = ! empty( $override ) ? 'style="display:' . $override . ';"' : '';
512
  $output = sprintf( '<div class="wpforms-field-option-group wpforms-field-option-group-advanced wpforms-hide" id="wpforms-field-option-advanced-%d" %s>', $field['id'], $override );
513
  $output .= sprintf( '<a href="#" class="wpforms-field-option-group-toggle">%s <i class="fa fa-angle-right"></i></a>', __( 'Advanced Options', 'wpforms' ) );
514
  $output .= '<div class="wpforms-field-option-group-inner">';
520
  // Placeholder ---------------------------------------------------//
521
 
522
  case 'placeholder':
523
+ $value = ! empty( $field['placeholder'] ) ? esc_attr( $field['placeholder'] ) : '';
524
  $tooltip = __( 'Enter text for the form field placeholder.', 'wpforms' );
525
  $output = $this->field_element( 'label', $field, array( 'slug' => 'placeholder', 'value' => __( 'Placeholder Text', 'wpforms' ), 'tooltip' => $tooltip ), false );
526
  $output .= $this->field_element( 'text', $field, array( 'slug' => 'placeholder', 'value' => $value ), false );
530
  // CSS classes ---------------------------------------------------//
531
 
532
  case 'css':
533
+ $value = ! empty( $field['css'] ) ? esc_attr( $field['css'] ) : '';
534
  $tooltip = __( 'Enter CSS class names for the form field container. Class names should be separated with spaces.', 'wpforms' );
535
+ $toggle = '<a href="#" class="toggle-layout-selector-display"><i class="fa fa-th-large"></i> <span>' . __( 'Show Layouts', 'wpforms' ) . '</span></a>';
536
  // Build output
537
+ $output = $this->field_element( 'label', $field, array( 'slug' => 'css', 'value' => __( 'CSS Classes', 'wpforms' ), 'tooltip' => $tooltip, 'after_tooltip' => $toggle ), false );
538
  $output .= $this->field_element( 'text', $field, array( 'slug' => 'css', 'value' => $value ), false );
539
  $output = $this->field_element( 'row', $field, array( 'slug' => 'css', 'content' => $output ), false );
540
  break;
562
  // Input Columns -------------------------------------------------//
563
 
564
  case 'input_columns':
565
+ $value = ! empty( $field['input_columns'] ) ? esc_attr( $field['input_columns'] ) : '';
566
  $tooltip = __( 'Select the layout for displaying field choices.', 'wpforms' );
567
  $options = array(
568
  '' => __( 'One Column', 'wpforms' ),
577
  // Dynamic Choices -----------------------------------------------//
578
 
579
  case 'dynamic_choices':
580
+ $value = ! empty( $field['dynamic_choices'] ) ? esc_attr( $field['dynamic_choices'] ) : '';
581
  $tooltip = __( 'Select auto-populate method to use.', 'wpforms' );
582
  $options = array(
583
  '' => __( 'Off', 'wpforms' ),
594
  case 'dynamic_choices_source':
595
 
596
  $output = '';
597
+ $type = ! empty( $field['dynamic_choices'] ) ? esc_attr( $field['dynamic_choices'] ) : '';
598
 
599
+ if ( ! empty( $type ) ) {
600
 
601
  if ( 'post_type' == $type ) {
602
 
614
  $tooltip = sprintf( __( 'Select %s to use for auto-populating field choices.', 'wpforms' ), $type_name );
615
  $label = sprintf( __( 'Dynamic %s Source', 'wpforms' ), $type_name );
616
  $options = array();
617
+ $source = ! empty( $field['dynamic_' . $type ] ) ? esc_attr( $field['dynamic_' . $type] ) : '';
618
 
619
  foreach ( $items as $key => $item ) {
620
+ $options[ $key ] = $item->labels->name;
621
  }
622
 
623
  // Field option label
650
  $field,
651
  array(
652
  'slug' => 'dynamic_' . $type,
653
+ 'content' => $option_label . $option_input,
654
  ),
655
  false
656
  );
657
+ } // End if().
658
  break;
659
+ } // End switch().
660
 
661
  if ( $echo ) {
662
 
663
+ if ( in_array( $option, array( 'basic-options', 'advanced-options' ), true ) ) {
664
 
665
+ if ( 'open' === $markup ) {
666
  do_action( "wpforms_field_options_before_{$option}", $field, $this );
667
+ }
668
 
669
+ echo $output; // WPCS: XSS ok.
670
 
671
+ if ( 'close' === $markup ) {
672
  do_action( "wpforms_field_options_after_{$option}", $field, $this );
673
+ }
674
  } else {
675
+ echo $output; // WPCS: XSS ok.
676
  }
 
677
  } else {
678
  return $output;
679
  }
695
  switch ( $option ) {
696
 
697
  case 'label':
698
+ $label = isset( $field['label'] ) && ! empty( $field['label'] ) ? esc_html( $field['label'] ) : '';
699
  $output = sprintf( '<label class="label-title"><span class="text">%s</span><span class="required">*</span></label>', $label );
700
  break;
701
 
702
  case 'description';
703
+ $description = isset( $field['description'] ) && ! empty( $field['description'] ) ? $field['description'] : '';
704
  $output = sprintf( '<div class="description">%s</div>', $description );
705
  break;
706
  }
707
 
708
  if ( $echo ) {
709
+ echo $output; // WPCS: XSS ok.
710
  } else {
711
  return $output;
712
  }
723
  check_ajax_referer( 'wpforms-builder', 'nonce' );
724
 
725
  // Check for permissions
726
+ if ( ! current_user_can( apply_filters( 'wpforms_manage_cap', 'manage_options' ) ) ) {
727
+ die( esc_html__( 'You do no have permission.', 'wpforms' ) );
728
+ }
729
 
730
  // Check for form ID
731
+ if ( ! isset( $_POST['id'] ) || empty( $_POST['id'] ) ) {
732
+ die( esc_html__( 'No form ID found', 'wpforms' ) );
733
+ }
734
 
735
  // Check for field type to add
736
+ if ( ! isset( $_POST['type'] ) || empty( $_POST['type'] ) ) {
737
+ die( esc_html__( 'No field type found', 'wpforms' ) );
738
+ }
739
 
740
  // Grab field data
741
+ $field_args = ! empty ( $_POST['defaults'] ) ? (array) $_POST['defaults'] : array();
742
  $field_type = esc_attr( $_POST['type'] );
743
  $field_id = wpforms()->form->next_field_id( $_POST['id'] );
744
  $field = array(
753
  $field_class = apply_filters( 'wpforms_field_new_class', '', $field );
754
 
755
  // Field types that default to required
756
+ if ( ! empty( $field_required ) ) {
757
  $field_required = 'required';
758
  $field['required'] = '1';
759
  }
789
  }
790
 
791
  /**
792
+ * Display the field input elements on the frontend.
793
  *
794
  * @since 1.0.0
795
  * @param array $field
796
+ * @param array $field_atts
797
  * @param array $form_data
798
  */
799
  public function field_display( $field, $field_atts, $form_data ) {
800
  }
801
 
802
+ /**
803
+ * Display field input errors if present.
804
+ *
805
+ * @since 1.3.7
806
+ * @param tring $key
807
+ * @param array $field
808
+ */
809
+ public function field_display_error( $key, $field ) {
810
+
811
+ // Need an error.
812
+ if ( empty( $field['properties']['error']['value'][ $key ] ) ) {
813
+ return;
814
+ }
815
+
816
+ printf(
817
+ '<label class="wpforms-error" for="%s">%s</label>',
818
+ esc_attr( $field['properties']['inputs'][ $key ]['id'] ),
819
+ esc_html( $field['properties']['error']['value'][ $key ] )
820
+ );
821
+ }
822
+
823
+ /**
824
+ * Display field input sublabel if present.
825
+ *
826
+ * @since 1.3.7
827
+ * @param tring $key
828
+ * @param array $field
829
+ */
830
+ public function field_display_sublabel( $key, $position, $field ) {
831
+
832
+ // Need a sublabel value.
833
+ if ( empty( $field['properties']['inputs'][ $key ]['sublabel']['value'] ) ) {
834
+ return;
835
+ }
836
+
837
+ $pos = ! empty( $field['properties']['inputs'][ $key ]['sublabel']['position'] ) ? $field['properties']['inputs'][ $key ]['sublabel']['position'] : 'after';
838
+ $hidden = ! empty( $field['properties']['inputs'][ $key ]['sublabel']['hidden'] ) ? 'wpforms-sublabel-hide' : '';
839
+
840
+ if ( $pos !== $position ) {
841
+ return;
842
+ }
843
+
844
+ printf(
845
+ '<label for="%s" class="wpforms-field-sublabel %s">%s</label>',
846
+ esc_attr( $field['properties']['inputs'][ $key ]['id'] ),
847
+ $hidden,
848
+ $field['properties']['inputs'][ $key ]['sublabel']['value']
849
+ );
850
+ }
851
+
852
  /**
853
  * Validates field on form submit.
854
  *
860
  public function validate( $field_id, $field_submit, $form_data ) {
861
 
862
  // Basic required check - If field is marked as required, check for entry data
863
+ if ( ! empty( $form_data['fields'][ $field_id ]['required'] ) && empty( $field_submit ) && '0' != $field_submit ) {
864
+ wpforms()->process->errors[ $form_data['id'] ][ $field_id ] = apply_filters( 'wpforms_required_label', __( 'This field is required', 'wpforms' ) );
 
865
  }
866
  }
867
 
880
  $field_submit = implode( "\r\n", $field_submit );
881
  }
882
 
883
+ $name = ! empty( $form_data['fields'][ $field_id ]['label'] ) ? sanitize_text_field( $form_data['fields'][ $field_id ]['label'] ) : '';
884
 
885
  // Hack to keep line breaks
886
  $value = implode( "\n", array_map( 'sanitize_text_field', explode( "\n", $field_submit ) ) );
887
 
888
+ wpforms()->process->fields[ $field_id ] = array(
889
  'name' => $name,
890
  'value' => $value,
891
  'id' => absint( $field_id ),
892
  'type' => $this->type,
893
  );
894
  }
895
+ }
includes/fields/class-email.php CHANGED
@@ -7,7 +7,7 @@
7
  * @since 1.0.0
8
  * @license GPL-2.0+
9
  * @copyright Copyright (c) 2016, WPForms LLC
10
- */
11
  class WPForms_Field_Email extends WPForms_Field {
12
 
13
  /**
@@ -17,12 +17,15 @@ class WPForms_Field_Email extends WPForms_Field {
17
  */
18
  public function init() {
19
 
20
- // Define field type information
21
  $this->name = __( 'Email', 'wpforms' );
22
  $this->type = 'email';
23
  $this->icon = 'fa-envelope-o';
24
  $this->order = 17;
25
 
 
 
 
26
  // Set field to default to required
27
  add_filter( 'wpforms_field_new_required', array( $this, 'default_required' ), 10, 2 );
28
 
@@ -30,6 +33,144 @@ class WPForms_Field_Email extends WPForms_Field {
30
  add_filter( 'wpforms_builder_field_option_class', array( $this, 'field_option_class' ), 10, 2 );
31
  }
32
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  /**
34
  * Field options panel inside the builder.
35
  *
@@ -38,24 +179,27 @@ class WPForms_Field_Email extends WPForms_Field {
38
  */
39
  public function field_options( $field ) {
40
 
41
- //--------------------------------------------------------------------//
42
- // Basic field options
43
- //--------------------------------------------------------------------//
44
 
45
- // Options open markup
46
- $this->field_option( 'basic-options', $field, array( 'markup' => 'open' ) );
 
 
 
47
 
48
- // Label
49
  $this->field_option( 'label', $field );
50
 
51
- // Description
52
  $this->field_option( 'description', $field );
53
 
54
- // Required toggle
55
  $this->field_option( 'required', $field );
56
 
57
- // Confirmation toggle
58
- $confirm_check = $this->field_element(
59
  'checkbox',
60
  $field,
61
  array(
@@ -66,80 +210,77 @@ class WPForms_Field_Email extends WPForms_Field {
66
  ),
67
  false
68
  );
69
- $this->field_element( 'row', $field, array( 'slug' => 'confirmation', 'content' => $confirm_check ) );
 
 
 
 
70
 
71
- // Options close markup
72
- $this->field_option( 'basic-options', $field, array( 'markup' => 'close' ) );
 
 
 
73
 
74
- //--------------------------------------------------------------------//
75
- // Advanced field options
76
- //--------------------------------------------------------------------//
77
 
78
- // Options open markup
79
- $this->field_option( 'advanced-options', $field, array( 'markup' => 'open' ) );
 
 
 
80
 
81
- // Size
82
  $this->field_option( 'size', $field );
83
 
84
- // Placeholder
85
  $this->field_option( 'placeholder', $field );
86
 
87
  // Confirmation Placeholder
88
- $confirm_placehlder_label = $this->field_element(
89
  'label',
90
  $field,
91
  array(
92
  'slug' => 'confirmation_placeholder',
93
  'value' => __( 'Confirmation Placeholder Text', 'wpforms' ),
94
- 'tooltip' => __( 'Enter text for the confirmation field placeholder.', 'wpforms' )
95
  ),
96
  false
97
  );
98
- $confirm_placehlder_text = $this->field_element(
99
  'text',
100
  $field,
101
  array(
102
  'slug' => 'confirmation_placeholder',
103
- 'value' => !empty( $field['confirmation_placeholder'] ) ? esc_attr( $field['confirmation_placeholder'] ) : '',
104
  ),
105
  false
106
  );
107
- $this->field_element( 'row', $field, array( 'slug' => 'confirmation_placeholder', 'content' => $confirm_placehlder_label . $confirm_placehlder_text ) );
 
 
 
 
108
 
109
- // Hide Label
110
  $this->field_option( 'label_hide', $field );
111
 
112
- // Hide Sub-labels
113
  $this->field_option( 'sublabel_hide', $field );
114
 
115
- // Default value
116
  $this->field_option( 'default_value', $field );
117
 
118
- // Custom CSS classes
119
  $this->field_option( 'css', $field );
120
 
121
- // Options close markup
122
- $this->field_option( 'advanced-options', $field, array( 'markup' => 'close' ) );
123
- }
124
-
125
- /**
126
- * Add class to field options wrapper to indicate if field confirmation is enabled.
127
- *
128
- * @since 1.3.0
129
- * @param string $class
130
- * @param array $field
131
- * @return string
132
- */
133
- function field_option_class( $class, $field ) {
134
-
135
- if ( 'email' == $field['type'] ) {
136
- if ( isset( $field['confirmation'] ) ) {
137
- $class = 'wpforms-confirm-enabled';
138
- } else {
139
- $class = 'wpforms-confirm-disabled';
140
- }
141
- }
142
- return $class;
143
  }
144
 
145
  /**
@@ -150,28 +291,31 @@ class WPForms_Field_Email extends WPForms_Field {
150
  */
151
  public function field_preview( $field ) {
152
 
153
- $placeholder = !empty( $field['placeholder'] ) ? esc_attr( $field['placeholder'] ) : '';
154
- $confirm = !empty( $field['confirmation'] ) ? 'enabled' : 'disabled';
155
- $confirm_placeholder = !empty( $field['confirmation_placeholder'] ) ? esc_attr( $field['confirmation_placeholder'] ) : '';
 
156
 
157
- // Label
158
  $this->field_preview_option( 'label', $field );
 
159
 
160
- printf( '<div class="wpforms-confirm wpforms-confirm-%s">', $confirm );
161
 
162
- echo '<div class="wpforms-confirm-primary">';
163
- printf( '<input type="email" placeholder="%s" class="primary-input" disabled>', $placeholder );
164
- printf( '<label class="wpforms-sub-label">%s</label>', __( 'Email' , 'wpforms') );
165
- echo '</div>';
166
 
167
- echo '<div class="wpforms-confirm-confirmation">';
168
- printf( '<input type="email" placeholder="%s" class="secondary-input" disabled>', $confirm_placeholder );
169
- printf( '<label class="wpforms-sub-label">%s</label>', __( 'Confirm Email' , 'wpforms') );
170
- echo '</div>';
171
 
172
- echo '</div>';
173
 
174
- // Description
 
175
  $this->field_preview_option( 'description', $field );
176
  }
177
 
@@ -180,102 +324,57 @@ class WPForms_Field_Email extends WPForms_Field {
180
  *
181
  * @since 1.0.0
182
  * @param array $field
 
183
  * @param array $form_data
184
  */
185
- public function field_display( $field, $field_atts, $form_data ) {
186
-
187
- // Setup and sanitize the necessary data
188
- $field = apply_filters( 'wpforms_email_field_display', $field, $field_atts, $form_data );
189
- $field_placeholder = !empty( $field['placeholder']) ? esc_attr( $field['placeholder'] ) : '';
190
- $field_required = !empty( $field['required'] ) ? ' required' : '';
191
- $field_class = implode( ' ', array_map( 'sanitize_html_class', $field_atts['input_class'] ) );
192
- $field_id = implode( ' ', array_map( 'sanitize_html_class', $field_atts['input_id'] ) );
193
- $field_sublabel = !empty( $field['sublabel_hide'] ) ? 'wpforms-sublabel-hide' : '';
194
- $field_value = !empty( $field['default_value'] ) ? esc_attr( apply_filters( 'wpforms_process_smart_tags', $field['default_value'], $form_data ) ) : '';
195
- $field_data = '';
196
- $confirmation = !empty( $field['confirmation'] ) ? true : false;
197
- $confirmation_placeholder = !empty( $field['confirmation_placeholder']) ? esc_attr( $field['confirmation_placeholder'] ) : '';
198
- $form_id = $form_data['id'];
199
-
200
- if ( !empty( $field_atts['input_data'] ) ) {
201
- foreach ( $field_atts['input_data'] as $key => $val ) {
202
- $field_data .= ' data-' . $key . '="' . $val . '"';
203
- }
204
- }
205
 
206
- // Normal field
207
- if ( ! $confirmation ) :
208
-
209
- // Primary email field
210
- printf(
211
- '<input type="email" name="wpforms[fields][%d]" id="%s" class="%s" value="%s" placeholder="%s" %s %s>',
212
- $field['id'],
213
- $field_id,
214
- $field_class,
215
- $field_value,
216
- $field_placeholder,
217
- $field_required,
218
- $field_data
219
- );
220
 
221
- // Field confirmation enabled
222
- else:
223
 
224
- printf( '<div class="wpforms-field-row %s">', $field_class );
 
 
 
 
225
 
226
- // Primary email field
227
- echo '<div class="wpforms-field-row-block wpforms-one-half wpforms-first">';
228
 
229
- $primary_class = 'wpforms-field-email-primary';
230
- $primary_class .= !empty( $field_required ) ? ' wpforms-field-required' : '';
231
- $primary_class .= !empty( wpforms()->process->errors[$form_id][$field['id']]['primary'] ) ? ' wpforms-error' : '';
232
 
233
- printf(
234
- '<input type="email" name="wpforms[fields][%d][primary]" id="%s" class="%s" value="" placeholder="%s" %s>',
235
- $field['id'],
236
- $field_id,
237
- $primary_class,
238
- $field_placeholder,
239
- $field_required
240
  );
241
-
242
- if ( !empty( wpforms()->process->errors[$form_id][$field['id']]['primary'] ) ) {
243
- printf( '<label id="wpforms-%d-field_%d-error" class="wpforms-error" for="wpforms-field_%d">%s</label>', $form_id, $field['id'], $field['id'], esc_html( wpforms()->process->errors[$form_id][$field['id']]['primary'] ) );
244
- }
245
-
246
- printf( '<label for="wpforms-%d-field_%d" class="wpforms-field-sublabel %s">%s</label>', $form_id, $field['id'], $field_sublabel, __( 'Email', 'wpforms' ) );
247
-
248
  echo '</div>';
249
 
250
- // Secondary email field for confirmation
251
- echo '<div class="wpforms-field-row-block wpforms-one-half">';
252
-
253
- $confirmation_class = 'wpforms-field-email-confirmation';
254
- $confirmation_class .= !empty( $field_required ) ? ' wpforms-field-required' : '';
255
- $confirmation_class .= !empty( wpforms()->process->errors[$form_id][$field['id']]['confirmation'] ) ? ' wpforms-error' : '';
256
-
257
- printf(
258
- '<input type="email" name="wpforms[fields][%d][confirmation]" id="%s" class="%s" value="" placeholder="%s" data-rule-confirm-msg="%s" data-rule-confirm="#%s" %s>',
259
- $field['id'],
260
- "wpforms-{$form_id}-field_{$field['id']}-confirmation",
261
- $confirmation_class,
262
- $confirmation_placeholder,
263
- esc_attr( apply_filters( 'wpforms_email_confirmation_msg', __( 'Email does not match.', 'wpforms') ) ),
264
- $field_id,
265
- $field_required
266
  );
267
-
268
- if ( !empty( wpforms()->process->errors[$form_id][$field['id']]['confirmation'] ) ) {
269
- printf( '<label id="wpforms-%d-field_%d-confirmation-error" class="wpforms-error" for="wpforms-field_%d-confirmation">%s</label>', $form_id, $field['id'], $field['id'], esc_html( wpforms()->process->errors[$form_id][$field['id']]['confirmation'] ) );
270
- }
271
-
272
- printf( '<label for="wpforms-%d-field_%d-confirmation" class="wpforms-field-sublabel %s">%s</label>', $form_id, $field['id'], $field_sublabel, __( 'Confirm Email', 'wpforms' ) );
273
-
274
  echo '</div>';
275
 
276
  echo '</div>';
277
 
278
- endif;
279
  }
280
 
281
  /**
@@ -288,36 +387,24 @@ class WPForms_Field_Email extends WPForms_Field {
288
  */
289
  public function format( $field_id, $field_submit, $form_data ) {
290
 
291
- if ( empty( $form_data['fields'][$field_id]['confirmation'] ) ) {
292
- $value = sanitize_text_field( $field_submit );
 
293
  } else {
294
- $value = sanitize_text_field( $field_submit['primary'] );
295
  }
296
 
297
- $name = !empty( $form_data['fields'][$field_id]['label'] ) ? sanitize_text_field( $form_data['fields'][$field_id]['label'] ) : '';
298
 
299
- wpforms()->process->fields[$field_id] = array(
300
- 'name' => $name,
301
- 'value' => $value,
 
302
  'id' => absint( $field_id ),
303
  'type' => $this->type,
304
  );
305
  }
306
 
307
- /**
308
- * Field should default to being required.
309
- *
310
- * @since 1.0.9
311
- * @param bool $required
312
- * @param array $field
313
- * @return bool
314
- */
315
- public function default_required( $required, $field ) {
316
 
317
- if ( $field['type'] == 'email' ) {
318
- return true;
319
- }
320
- return $required;
321
- }
322
  }
323
- new WPForms_Field_Email;
7
  * @since 1.0.0
8
  * @license GPL-2.0+
9
  * @copyright Copyright (c) 2016, WPForms LLC
10
+ */
11
  class WPForms_Field_Email extends WPForms_Field {
12
 
13
  /**
17
  */
18
  public function init() {
19
 
20
+ // Define field type information.
21
  $this->name = __( 'Email', 'wpforms' );
22
  $this->type = 'email';
23
  $this->icon = 'fa-envelope-o';
24
  $this->order = 17;
25
 
26
+ // Define additional field properties.
27
+ add_filter( 'wpforms_field_properties_email' , array( $this, 'field_properties' ), 5, 3 );
28
+
29
  // Set field to default to required
30
  add_filter( 'wpforms_field_new_required', array( $this, 'default_required' ), 10, 2 );
31
 
33
  add_filter( 'wpforms_builder_field_option_class', array( $this, 'field_option_class' ), 10, 2 );
34
  }
35
 
36
+ /**
37
+ * Define additional field properties.
38
+ *
39
+ * @since 1.3.7
40
+ * @param array $properties
41
+ * @param array $field
42
+ * @param array $form_data
43
+ * @return array
44
+ */
45
+ public function field_properties( $properties, $field, $form_data ) {
46
+
47
+ if ( empty( $field['confirmation'] ) ) {
48
+ return $properties;
49
+ }
50
+
51
+ $form_id = absint( $form_data['id'] );
52
+ $field_id = absint( $field['id'] );
53
+
54
+ // Email confirmation setting enabled.
55
+ $props = array(
56
+ 'inputs' => array(
57
+ 'primary' => array(
58
+ 'block' => array(
59
+ 'wpforms-field-row-block',
60
+ 'wpforms-one-half',
61
+ 'wpforms-first',
62
+ ),
63
+ 'class' => array(
64
+ 'wpforms-field-email-primary'
65
+ ),
66
+ 'sublabel' => array(
67
+ 'hidden' => ! empty( $field['sublabel_hide'] ),
68
+ 'value' => __( 'Email', 'wpforms' ),
69
+ ),
70
+ ),
71
+ 'secondary' => array(
72
+ 'attr' => array(
73
+ 'name' => "wpforms[fields][{$field_id}][secondary]",
74
+ 'value' => '',
75
+ 'placeholder' => ! empty( $field['confirmation_placeholder'] ) ? $field['confirmation_placeholder'] : '',
76
+ ),
77
+ 'block' => array(
78
+ 'wpforms-field-row-block',
79
+ 'wpforms-one-half',
80
+ ),
81
+ 'class' => array(
82
+ 'wpforms-field-email-secondary'
83
+ ),
84
+ 'data' => array(
85
+ 'rule-confirm-msg' => __( 'Email does not match.', 'wpforms' ),
86
+ 'rule-confirm' => '#' . $properties['inputs']['primary']['id'],
87
+ ),
88
+ 'id' => "wpforms-{$form_id}-field_{$field_id}-secondary",
89
+ 'required' => ! empty( $field['required'] ) ? 'required' : '',
90
+ 'sublabel' => array(
91
+ 'hidden' => ! empty( $field['sublabel_hide'] ),
92
+ 'value' => __( 'Confirm Email', 'wpforms' ),
93
+ ),
94
+ 'value' => '',
95
+ ),
96
+ ),
97
+ );
98
+ $properties = array_merge_recursive( $properties, $props );
99
+
100
+ // Input Primary: adjust name.
101
+ $properties['inputs']['primary']['attr']['name'] = "wpforms[fields][{$field_id}][primary]";
102
+
103
+ // Input Primary: remove size and error classes.
104
+ $properties['inputs']['primary']['class'] = array_diff(
105
+ $properties['inputs']['primary']['class'],
106
+ array(
107
+ 'wpforms-field-' . sanitize_html_class( $field['size'] ),
108
+ 'wpforms-error',
109
+ )
110
+ );
111
+
112
+ // Input Primary: add error class if needed.
113
+ if ( ! empty( $properties['error']['value']['primary'] ) ) {
114
+ $properties['inputs']['primary']['class'][] = 'wpforms-error';
115
+ }
116
+
117
+ // Input Secondary: add error class if needed.
118
+ if ( ! empty( $properties['error']['value']['secondary'] ) ) {
119
+ $properties['inputs']['secondary']['class'][] = 'wpforms-error';
120
+ }
121
+
122
+ // Input Secondary: add required class if needed.
123
+ if ( ! empty( $field['required'] ) ) {
124
+ $properties['inputs']['secondary']['class'][] = 'wpforms-field-required';
125
+ }
126
+
127
+ // Input Secondary: dynamic value support.
128
+ if ( apply_filters( 'wpforms_frontend_dynamic_values', false ) ) {
129
+ if ( empty( $properties['inputs']['secondary']['attr']['value'] ) && ! empty( $_GET[ "f{$field_id}-secondary" ] ) ) {
130
+ $properties['inputs']['secondary']['attr']['value'] = sanitize_text_field( $_GET[ "f{$field_id}-secondary" ] );
131
+ }
132
+ }
133
+
134
+ return $properties;
135
+ }
136
+
137
+ /**
138
+ * Field should default to being required.
139
+ *
140
+ * @since 1.0.9
141
+ * @param bool $required
142
+ * @param array $field
143
+ * @return bool
144
+ */
145
+ public function default_required( $required, $field ) {
146
+
147
+ if ( 'email' === $field['type'] ) {
148
+ return true;
149
+ }
150
+ return $required;
151
+ }
152
+
153
+ /**
154
+ * Add class to field options wrapper to indicate if field confirmation is
155
+ * enabled.
156
+ *
157
+ * @since 1.3.0
158
+ * @param string $class
159
+ * @param array $field
160
+ * @return string
161
+ */
162
+ function field_option_class( $class, $field ) {
163
+
164
+ if ( 'email' === $field['type'] ) {
165
+ if ( isset( $field['confirmation'] ) ) {
166
+ $class = 'wpforms-confirm-enabled';
167
+ } else {
168
+ $class = 'wpforms-confirm-disabled';
169
+ }
170
+ }
171
+ return $class;
172
+ }
173
+
174
  /**
175
  * Field options panel inside the builder.
176
  *
179
  */
180
  public function field_options( $field ) {
181
 
182
+ // -------------------------------------------------------------------//
183
+ // Basic field options.
184
+ // -------------------------------------------------------------------//
185
 
186
+ // Options open markup.
187
+ $args = array(
188
+ 'markup' => 'open',
189
+ );
190
+ $this->field_option( 'basic-options', $field, $args );
191
 
192
+ // Label.
193
  $this->field_option( 'label', $field );
194
 
195
+ // Description.
196
  $this->field_option( 'description', $field );
197
 
198
+ // Required toggle.
199
  $this->field_option( 'required', $field );
200
 
201
+ // Confirmation toggle.
202
+ $fld = $this->field_element(
203
  'checkbox',
204
  $field,
205
  array(
210
  ),
211
  false
212
  );
213
+ $args = array(
214
+ 'slug' => 'confirmation',
215
+ 'content' => $fld,
216
+ );
217
+ $this->field_element( 'row', $field, $args );
218
 
219
+ // Options close markup.
220
+ $args = array(
221
+ 'markup' => 'close',
222
+ );
223
+ $this->field_option( 'basic-options', $field, $args );
224
 
225
+ // -------------------------------------------------------------------//
226
+ // Advanced field options.
227
+ // -------------------------------------------------------------------//
228
 
229
+ // Options open markup.
230
+ $args = array(
231
+ 'markup' => 'open',
232
+ );
233
+ $this->field_option( 'advanced-options', $field, $args );
234
 
235
+ // Size.
236
  $this->field_option( 'size', $field );
237
 
238
+ // Placeholder.
239
  $this->field_option( 'placeholder', $field );
240
 
241
  // Confirmation Placeholder
242
+ $lbl = $this->field_element(
243
  'label',
244
  $field,
245
  array(
246
  'slug' => 'confirmation_placeholder',
247
  'value' => __( 'Confirmation Placeholder Text', 'wpforms' ),
248
+ 'tooltip' => __( 'Enter text for the confirmation field placeholder.', 'wpforms' ),
249
  ),
250
  false
251
  );
252
+ $fld = $this->field_element(
253
  'text',
254
  $field,
255
  array(
256
  'slug' => 'confirmation_placeholder',
257
+ 'value' => ! empty( $field['confirmation_placeholder'] ) ? esc_attr( $field['confirmation_placeholder'] ) : '',
258
  ),
259
  false
260
  );
261
+ $args = array(
262
+ 'slug' => 'confirmation_placeholder',
263
+ 'content' => $lbl . $fld,
264
+ );
265
+ $this->field_element( 'row', $field, $args );
266
 
267
+ // Hide Label.
268
  $this->field_option( 'label_hide', $field );
269
 
270
+ // Hide sub-labels.
271
  $this->field_option( 'sublabel_hide', $field );
272
 
273
+ // Default value.
274
  $this->field_option( 'default_value', $field );
275
 
276
+ // Custom CSS classes.
277
  $this->field_option( 'css', $field );
278
 
279
+ // Options close markup.
280
+ $args = array(
281
+ 'markup' => 'close',
282
+ );
283
+ $this->field_option( 'advanced-options', $field, $args );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
284
  }
285
 
286
  /**
291
  */
292
  public function field_preview( $field ) {
293
 
294
+ // Define data.
295
+ $placeholder = ! empty( $field['placeholder'] ) ? esc_attr( $field['placeholder'] ) : '';
296
+ $confirm_placeholder = ! empty( $field['confirmation_placeholder'] ) ? esc_attr( $field['confirmation_placeholder'] ) : '';
297
+ $confirm = ! empty( $field['confirmation'] ) ? 'enabled' : 'disabled';
298
 
299
+ // Label.
300
  $this->field_preview_option( 'label', $field );
301
+ ?>
302
 
303
+ <div class="wpforms-confirm wpforms-confirm-<?php echo $confirm; ?>">
304
 
305
+ <div class="wpforms-confirm-primary">
306
+ <input type="email" placeholder="<?php echo $placeholder; ?>" class="primary-input" disabled>
307
+ <label class="wpforms-sub-label"><?php esc_html_e( 'Email' , 'wpforms' ); ?></label>
308
+ </div>
309
 
310
+ <div class="wpforms-confirm-confirmation">
311
+ <input type="email" placeholder="<?php echo $confirm_placeholder; ?>" class="secondary-input" disabled>
312
+ <label class="wpforms-sub-label"><?php esc_html_e( 'Confirm Email' , 'wpforms' ); ?></label>
313
+ </div>
314
 
315
+ </div>
316
 
317
+ <?php
318
+ // Description.
319
  $this->field_preview_option( 'description', $field );
320
  }
321
 
324
  *
325
  * @since 1.0.0
326
  * @param array $field
327
+ * @param array $deprecated
328
  * @param array $form_data
329
  */
330
+ public function field_display( $field, $deprecated, $form_data ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
331
 
332
+ // Define data.
333
+ $form_id = absint( $form_data['id'] );
334
+ $confirmation = ! empty( $field['confirmation'] );
335
+ $primary = $field['properties']['inputs']['primary'];
336
+ $secondary = ! empty( $field['properties']['inputs']['secondary'] ) ? $field['properties']['inputs']['secondary'] : '';
 
 
 
 
 
 
 
 
 
337
 
338
+ // Standard email field.
339
+ if ( ! $confirmation ) {
340
 
341
+ // Primary field.
342
+ printf( '<input type="email" %s %s>',
343
+ wpforms_html_attributes( $primary['id'], $primary['class'], $primary['data'], $primary['attr'] ),
344
+ $primary['required']
345
+ );
346
 
347
+ // Confirmation email field configuration.
348
+ } else {
349
 
350
+ // Row wrapper.
351
+ echo '<div class="wpforms-field-row wpforms-field-' . sanitize_html_class( $field['size'] ) . '">';
 
352
 
353
+ // Primary field.
354
+ echo '<div ' . wpforms_html_attributes( false, $primary['block'] ) . '>';
355
+ $this->field_display_sublabel( 'primary', 'before', $field );
356
+ printf( '<input type="email" %s %s>',
357
+ wpforms_html_attributes( $primary['id'], $primary['class'], $primary['data'], $primary['attr'] ),
358
+ $primary['required']
 
359
  );
360
+ $this->field_display_sublabel( 'primary', 'after', $field );
361
+ $this->field_display_error( 'primary', $field );
 
 
 
 
 
362
  echo '</div>';
363
 
364
+ // Secondary field.
365
+ echo '<div ' . wpforms_html_attributes( false, $secondary['block'] ) . '>';
366
+ $this->field_display_sublabel( 'secondary', 'before', $field );
367
+ printf( '<input type="email" %s %s>',
368
+ wpforms_html_attributes( $secondary['id'], $secondary['class'], $secondary['data'], $secondary['attr'] ),
369
+ $secondary['required']
 
 
 
 
 
 
 
 
 
 
370
  );
371
+ $this->field_display_sublabel( 'secondary', 'after', $field );
372
+ $this->field_display_error( 'secondary', $field );
 
 
 
 
 
373
  echo '</div>';
374
 
375
  echo '</div>';
376
 
377
+ } // End if().
378
  }
379
 
380
  /**
387
  */
388
  public function format( $field_id, $field_submit, $form_data ) {
389
 
390
+ // Define data.
391
+ if ( is_array( $field_submit ) ) {
392
+ $value = ! empty( $field_submit['primary'] ) ? $field_submit['primary'] : '';
393
  } else {
394
+ $value = ! empty( $field_submit ) ? $field_submit : '';
395
  }
396
 
397
+ $name = ! empty( $form_data['fields'][ $field_id ] ['label'] ) ? $form_data['fields'][ $field_id ]['label'] : '';
398
 
399
+ // Set final field details.
400
+ wpforms()->process->fields[ $field_id ] = array(
401
+ 'name' => sanitize_text_field( $name ),
402
+ 'value' => sanitize_text_field( $value ),
403
  'id' => absint( $field_id ),
404
  'type' => $this->type,
405
  );
406
  }
407
 
 
 
 
 
 
 
 
 
 
408
 
 
 
 
 
 
409
  }
410
+ new WPForms_Field_Email;
includes/fields/class-name.php CHANGED
@@ -7,7 +7,7 @@
7
  * @since 1.0.0
8
  * @license GPL-2.0+
9
  * @copyright Copyright (c) 2016, WPForms LLC
10
- */
11
  class WPForms_Field_Name extends WPForms_Field {
12
 
13
  /**
@@ -23,10 +23,172 @@ class WPForms_Field_Name extends WPForms_Field {
23
  $this->icon = 'fa-user';
24
  $this->order = 15;
25
 
 
 
 
26
  // Set field to default to required
27
  add_filter( 'wpforms_field_new_required', array( $this, 'default_required' ), 10, 2 );
28
  }
29
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  /**
31
  * Field options panel inside the builder.
32
  *
@@ -35,41 +197,83 @@ class WPForms_Field_Name extends WPForms_Field {
35
  */
36
  public function field_options( $field ) {
37
 
38
- //--------------------------------------------------------------------//
39
- // Basic field options
40
- //--------------------------------------------------------------------//
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
 
42
- $this->field_option( 'basic-options', $field, array( 'markup' => 'open' ) );
43
- $this->field_option( 'label', $field );
44
 
45
- // Format option
46
- $format = !empty( $field['format'] ) ? esc_attr( $field['format'] ) : 'first-last';
47
- $tooltip = __( 'Select format to use for the name form field', 'wpforms' );
48
- $options = array(
49
- 'simple' => __( 'Simple', 'wpforms' ),
50
- 'first-last' => __( 'First Last', 'wpforms' ),
51
- 'first-middle-last' => __( 'First Middle Last', 'wpforms' ),
52
  );
53
- $output = $this->field_element( 'label', $field, array( 'slug' => 'format', 'value' => __( 'Format', 'wpforms' ), 'tooltip' => $tooltip ), false );
54
- $output .= $this->field_element( 'select', $field, array( 'slug' => 'format', 'value' => $format, 'options' => $options ), false );
55
- $this->field_element( 'row', $field, array( 'slug' => 'format', 'content' => $output ) );
56
 
57
- $this->field_option( 'description', $field );
58
- $this->field_option( 'required', $field );
59
- $this->field_option( 'basic-options', $field, array( 'markup' => 'close' ) );
60
 
61
- //--------------------------------------------------------------------//
62
- // Advanced field options
63
- //--------------------------------------------------------------------//
 
 
64
 
65
- $this->field_option( 'advanced-options', $field, array( 'markup' => 'open' ) );
66
- $this->field_option( 'size', $field );
67
 
68
  echo '<div class="format-selected-' . $format . ' format-selected">';
69
 
70
  // Simple
71
- $simple_placeholder = !empty( $field['simple_placeholder'] ) ? esc_attr( $field['simple_placeholder'] ) : '';
72
- $simple_default = !empty( $field['simple_default'] ) ? esc_attr( $field['simple_default'] ) : '';
73
  printf( '<div class="wpforms-clear wpforms-field-option-row wpforms-field-option-row-simple" id="wpforms-field-option-row-%d-simple" data-subfield="simple" data-field-id="%d">', $field['id'], $field['id'] );
74
  $this->field_element( 'label', $field, array( 'slug' => 'simple_placeholder', 'value' => __( 'Name', 'wpforms' ), 'tooltip' => __( 'Name field advanced options.', 'wpforms' ) ) );
75
  echo '<div class="placeholder">';
@@ -83,8 +287,8 @@ class WPForms_Field_Name extends WPForms_Field {
83
  echo '</div>';
84
 
85
  // First
86
- $first_placeholder = !empty( $field['first_placeholder'] ) ? esc_attr( $field['first_placeholder'] ) : '';
87
- $first_default = !empty( $field['first_default'] ) ? esc_attr( $field['first_default'] ) : '';
88
  printf( '<div class="wpforms-clear wpforms-field-option-row wpforms-field-option-row-first" id="wpforms-field-option-row-%d-first" data-subfield="first-name" data-field-id="%d">', $field['id'], $field['id'] );
89
  $this->field_element( 'label', $field, array( 'slug' => 'first_placeholder', 'value' => __( 'First Name', 'wpforms' ), 'tooltip' => __( 'First name field advanced options.', 'wpforms' ) ) );
90
  echo '<div class="placeholder">';
@@ -98,8 +302,8 @@ class WPForms_Field_Name extends WPForms_Field {
98
  echo '</div>';
99
 
100
  // Middle
101
- $middle_placeholder = !empty( $field['middle_placeholder'] ) ? esc_attr( $field['middle_placeholder'] ) : '';
102
- $middle_default = !empty( $field['middle_default'] ) ? esc_attr( $field['middle_default'] ) : '';
103
  printf( '<div class="wpforms-clear wpforms-field-option-row wpforms-field-option-row-middle" id="wpforms-field-option-row-%d-middle" data-subfield="middle-name" data-field-id="%d">', $field['id'], $field['id'] );
104
  $this->field_element( 'label', $field, array( 'slug' => 'middle_placeholder', 'value' => __( 'Middle Name', 'wpforms' ), 'tooltip' => __( 'Middle name field advanced options.', 'wpforms' ) ) );
105
  echo '<div class="placeholder">';
@@ -113,8 +317,8 @@ class WPForms_Field_Name extends WPForms_Field {
113
  echo '</div>';
114
 
115
  // Last
116
- $last_placeholder = !empty( $field['last_placeholder'] ) ? esc_attr( $field['last_placeholder'] ) : '';
117
- $last_default = !empty( $field['last_default'] ) ? esc_attr( $field['last_default'] ) : '';
118
  printf( '<div class="wpforms-clear wpforms-field-option-row wpforms-field-option-row-last" id="wpforms-field-option-row-%d-last" data-subfield="last-name" data-field-id="%d">', $field['id'], $field['id'] );
119
  $this->field_element( 'label', $field, array( 'slug' => 'last_placeholder', 'value' => __( 'Last Name', 'wpforms' ), 'tooltip' => __( 'Last name field advanced options.', 'wpforms' ) ) );
120
  echo '<div class="placeholder">';
@@ -129,10 +333,20 @@ class WPForms_Field_Name extends WPForms_Field {
129
 
130
  echo '</div>';
131
 
132
- $this->field_option( 'label_hide', $field );
133
- $this->field_option( 'sublabel_hide', $field );
134
- $this->field_option( 'css', $field );
135
- $this->field_option( 'advanced-options', $field, array( 'markup' => 'close' ) );
 
 
 
 
 
 
 
 
 
 
136
  }
137
 
138
  /**
@@ -143,32 +357,42 @@ class WPForms_Field_Name extends WPForms_Field {
143
  */
144
  public function field_preview( $field ) {
145
 
146
- $simple_placeholder = !empty( $field['simple_placeholder'] ) ? esc_attr( $field['simple_placeholder'] ) : '';
147
- $first_placeholder = !empty( $field['first_placeholder'] ) ? esc_attr( $field['first_placeholder'] ) : '';
148
- $middle_placeholder = !empty( $field['middle_placeholder'] ) ? esc_attr( $field['middle_placeholder'] ) : '';
149
- $last_placeholder = !empty( $field['last_placeholder'] ) ? esc_attr( $field['last_placeholder'] ) : '';
150
- $format = !empty( $field['format'] ) ? $field['format'] : 'first-last';
 
151
 
 
152
  $this->field_preview_option( 'label', $field );
 
153
 
154
- echo '<div class="format-selected-' . $format . ' format-selected">';
155
- echo '<div class="wpforms-simple">';
156
- printf( '<input type="text" placeholder="%s" class="primary-input" disabled>', $simple_placeholder );
157
- echo '</div>';
158
- echo '<div class="wpforms-first-name">';
159
- printf( '<input type="text" placeholder="%s" class="primary-input" disabled>', $first_placeholder );
160
- printf( '<label class="wpforms-sub-label">%s</label>', __( 'First' , 'wpforms') );
161
- echo '</div>';
162
- echo '<div class="wpforms-middle-name">';
163
- printf( '<input type="text" placeholder="%s" class="primary-input" disabled>', $middle_placeholder );
164
- printf( '<label class="wpforms-sub-label">%s</label>', __( 'Middle', 'wpforms' ) );
165
- echo '</div>';
166
- echo '<div class="wpforms-last-name">';
167
- printf( '<input type="text" placeholder="%s" class="primary-input" disabled>', $last_placeholder );
168
- printf( '<label class="wpforms-sub-label">%s</label>', __( 'Last', 'wpforms' ) );
169
- echo '</div>';
170
- echo '</div>';
171
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
172
  $this->field_preview_option( 'description', $field );
173
  }
174
 
@@ -181,116 +405,66 @@ class WPForms_Field_Name extends WPForms_Field {
181
  */
182
  public function field_display( $field, $field_atts, $form_data ) {
183
 
184
- // Setup and sanitize the necessary data
185
- $field = apply_filters( 'wpforms_address_field_display', $field, $field_atts, $form_data );
186
- $field_required = !empty( $field['required'] ) ? ' required' : '';
187
- $field_format = !empty( $field['format'] ) ? $field['format'] : 'us';
188
- $field_class = implode( ' ', array_map( 'sanitize_html_class', $field_atts['input_class'] ) );
189
- $field_id = implode( ' ', array_map( 'sanitize_html_class', $field_atts['input_id'] ) );
190
- $field_sublabel = !empty( $field['sublabel_hide'] ) ? 'wpforms-sublabel-hide' : '';
191
- $simple_placeholder = !empty( $field['simple_placeholder'] ) ? esc_attr( $field['simple_placeholder'] ) : '';
192
- $simple_default = !empty( $field['simple_default'] ) ? esc_attr( apply_filters( 'wpforms_process_smart_tags', $field['simple_default'], $form_data ) ) : '';
193
- $first_placeholder = !empty( $field['first_placeholder'] ) ? esc_attr( $field['first_placeholder'] ) : '';
194
- $first_default = !empty( $field['first_default'] ) ? esc_attr( apply_filters( 'wpforms_process_smart_tags', $field['first_default'], $form_data ) ) : '';
195
- $middle_placeholder = !empty( $field['middle_placeholder'] ) ? esc_attr( $field['middle_placeholder'] ) : '';
196
- $middle_default = !empty( $field['middle_default'] ) ? esc_attr( apply_filters( 'wpforms_process_smart_tags', $field['middle_default'], $form_data ) ) : '';
197
- $last_placeholder = !empty( $field['last_placeholder'] ) ? esc_attr( $field['last_placeholder'] ) : '';
198
- $last_default = !empty( $field['last_default'] ) ? esc_attr( apply_filters( 'wpforms_process_smart_tags', $field['last_default'], $form_data ) ) : '';
199
- $form_id = $form_data['id'];
200
-
201
- // Simple name format
202
- if ( 'simple' == $field_format ) :
203
-
204
- printf(
205
- '<input type="text" name="wpforms[fields][%d]" id="%s" class="%s" placeholder="%s" value="%s" %s>',
206
- $field['id'],
207
- $field_id,
208
- $field_class,
209
- $simple_placeholder,
210
- $simple_default,
211
- $field_required
212
  );
213
 
214
- // Expanded formats
215
- else:
216
-
217
- $columns = ( 'first-last' == $field_format ? 'one-half' : 'two-fifths' );
218
-
219
- printf( '<div class="wpforms-field-row %s">', $field_class );
220
-
221
- // First name
222
- printf( '<div class="wpforms-field-row-block wpforms-%s wpforms-first">', $columns );
223
 
224
- $first_class = 'wpforms-field-name-first';
225
- $first_class .= !empty( $field_required ) ? ' wpforms-field-required' : '';
226
- $first_class .= !empty( wpforms()->process->errors[$form_id][$field['id']]['first'] ) ? ' wpforms-error' : '';
227
 
228
- printf(
229
- '<input type="text" name="wpforms[fields][%d][first]" id="%s" class="%s" placeholder="%s" value="%s" %s>',
230
- $field['id'],
231
- "wpforms-{$form_id}-field_{$field['id']}",
232
- $first_class,
233
- $first_placeholder,
234
- $first_default,
235
- $field_required
236
  );
237
-
238
- if ( !empty( wpforms()->process->errors[$form_id][$field['id']]['first'] ) ) {
239
- printf( '<label id="wpforms-%d-field_%d-error" class="wpforms-error" for="wpforms-field_%d">%s</label>', $form_id, $field['id'], $field['id'], esc_html( wpforms()->process->errors[$form_id][$field['id']]['first'] ) );
240
- }
241
-
242
- printf( '<label for="wpforms-%d-field_%d" class="wpforms-field-sublabel %s">%s</label>', $form_id, $field['id'], $field_sublabel, __( 'First', 'wpforms' ) );
243
-
244
  echo '</div>';
245
 
246
- // Middle name
247
- if ( 'first-middle-last' == $field_format ) :
248
-
249
- echo '<div class="wpforms-field-row-block wpforms-one-fifth">';
250
-
251
- printf(
252
- '<input type="text" name="wpforms[fields][%d][middle]" id="%s" class="%s" placeholder="%s" value="%s">',
253
- $field['id'],
254
- "wpforms-{$form_id}-field_{$field['id']}-middle",
255
- 'wpforms-field-name-middle',
256
- $middle_placeholder,
257
- $middle_default
258
  );
259
-
260
- printf( '<label for="wpforms-%d-field_%d-middle" class="wpforms-field-sublabel %s">%s</label>', $form_id, $field['id'], $field_sublabel, __( 'Middle', 'wpforms' ) );
261
-
262
  echo '</div>';
263
-
264
- endif;
265
-
266
- // Last name
267
- printf( '<div class="wpforms-field-row-block wpforms-%s">', $columns );
268
-
269
- $last_class = 'wpforms-field-name-last';
270
- $last_class .= !empty( $field_required ) ? ' wpforms-field-required' : '';
271
- $last_class .= !empty( wpforms()->process->errors[$form_id][$field['id']]['last'] ) ? ' wpforms-error' : '';
272
-
273
- printf(
274
- '<input type="text" name="wpforms[fields][%d][last]" id="%s" class="%s" placeholder="%s" value="%s" %s>',
275
- $field['id'],
276
- "wpforms-{$form_id}-field_{$field['id']}-last",
277
- $last_class,
278
- $last_placeholder,
279
- $last_default,
280
- $field_required
281
  );
282
-
283
- if ( !empty( wpforms()->process->errors[$form_id][$field['id']]['last'] ) ) {
284
- printf( '<label id="wpforms-%d-field_%d-error" class="wpforms-error" for="wpforms-field_%d">%s</label>', $form_id, $field['id'], $field['id'], esc_html( wpforms()->process->errors[$form_id][$field['id']]['last'] ) );
285
- }
286
-
287
- printf( '<label for="wpforms-%d-field_%d-last" class="wpforms-field-sublabel %s">%s</label>', $form_id, $field['id'], $field_sublabel, __( 'Last', 'wpforms' ) );
288
-
289
  echo '</div>';
290
 
291
  echo '</div>';
292
 
293
- endif;
294
  }
295
 
296
  /**
@@ -303,23 +477,23 @@ class WPForms_Field_Name extends WPForms_Field {
303
  */
304
  public function validate( $field_id, $field_submit, $form_data ) {
305
 
306
- // Extended validation needed for the different name fields
307
- if ( !empty( $form_data['fields'][$field_id]['required'] ) ) {
308
 
309
  $form_id = $form_data['id'];
310
- $format = $form_data['fields'][$field_id]['format'];
311
  $required = apply_filters( 'wpforms_required_label', __( 'This field is required', 'wpforms' ) );
312
 
313
- if ( 'simple' == $format && empty( $field_submit ) ) {
314
- wpforms()->process->errors[$form_id][$field_id] = $required;
315
  }
316
 
317
- if ( ( 'first-last' == $format || 'first-middle-last' == $format ) && empty( $field_submit['first'] ) ) {
318
- wpforms()->process->errors[$form_id][$field_id]['first'] = $required;
319
  }
320
 
321
- if ( ( 'first-last' == $format || 'first-middle-last' == $format ) && empty( $field_submit['last'] ) ) {
322
- wpforms()->process->errors[$form_id][$field_id]['last'] = $required;
323
  }
324
  }
325
  }
@@ -334,20 +508,20 @@ class WPForms_Field_Name extends WPForms_Field {
334
  */
335
  public function format( $field_id, $field_submit, $form_data ) {
336
 
337
- $name = !empty( $form_data['fields'][$field_id]['label'] ) ? $form_data['fields'][$field_id]['label'] : '';
338
- $first = !empty( $field_submit['first'] ) ? $field_submit['first'] : '';
339
- $middle = !empty( $field_submit['middle'] ) ? $field_submit['middle'] : '';
340
- $last = !empty( $field_submit['last'] ) ? $field_submit['last'] : '';
 
341
 
342
  if ( is_array( $field_submit ) ) {
343
- $value = array( $first, $middle, $last );
344
- $value = array_filter( $value );
345
- $value = implode( ' ', $value );
346
  } else {
347
  $value = $field_submit;
348
  }
349
 
350
- wpforms()->process->fields[$field_id] = array(
 
351
  'name' => sanitize_text_field( $name ),
352
  'value' => sanitize_text_field( $value ),
353
  'id' => absint( $field_id ),
@@ -357,21 +531,5 @@ class WPForms_Field_Name extends WPForms_Field {
357
  'last' => sanitize_text_field( $last ),
358
  );
359
  }
360
-
361
- /**
362
- * Name fields should default to being required.
363
- *
364
- * @since 1.0.8
365
- * @param bool $required
366
- * @param array $field
367
- * @return bool
368
- */
369
- public function default_required( $required, $field ) {
370
-
371
- if ( $field['type'] == 'name' ) {
372
- return true;
373
- }
374
- return $required;
375
- }
376
  }
377
- new WPForms_Field_Name;
7
  * @since 1.0.0
8
  * @license GPL-2.0+
9
  * @copyright Copyright (c) 2016, WPForms LLC
10
+ */
11
  class WPForms_Field_Name extends WPForms_Field {
12
 
13
  /**
23
  $this->icon = 'fa-user';
24
  $this->order = 15;
25
 
26
+ // Define additional field properties.
27
+ add_filter( 'wpforms_field_properties_name' , array( $this, 'field_properties' ), 5, 3 );
28
+
29
  // Set field to default to required
30
  add_filter( 'wpforms_field_new_required', array( $this, 'default_required' ), 10, 2 );
31
  }
32
 
33
+ /**
34
+ * Define additional field properties.
35
+ *
36
+ * @since 1.3.7
37
+ * @param array $properties
38
+ * @param array $field
39
+ * @param array $form_data
40
+ * @return array
41
+ */
42
+ public function field_properties( $properties, $field, $form_data ) {
43
+
44
+ $format = ! empty( $field['format'] ) ? esc_attr( $field['format'] ) : 'first-last';
45
+
46
+ // Simple format.
47
+ if ( 'simple' === $format ) {
48
+ $properties['inputs']['primary']['attr']['placeholder'] = ! empty( $field['simple_placeholder'] ) ? $field['simple_placeholder'] : '';
49
+ $properties['inputs']['primary']['attr']['value'] = ! empty( $field['simple_default'] ) ? apply_filters( 'wpforms_process_smart_tags', $field['simple_default'], $form_data ) : '';
50
+
51
+ return $properties;
52
+ }
53
+
54
+ // Expanded formats.
55
+ // Remove primary for expanded formats since we have first, middle, last.
56
+ unset( $properties['inputs']['primary'] );
57
+
58
+ $form_id = absint( $form_data['id'] );
59
+ $field_id = absint( $field['id'] );
60
+ $dynamic = apply_filters( 'wpforms_frontend_dynamic_values', false );
61
+
62
+ $props = array(
63
+ 'inputs' => array(
64
+ 'first' => array(
65
+ 'attr' => array(
66
+ 'name' => "wpforms[fields][{$field_id}][first]",
67
+ 'value' => ! empty( $field['first_default'] ) ? apply_filters( 'wpforms_process_smart_tags', $field['first_default'], $form_data ) : '',
68
+ 'placeholder' => ! empty( $field['first_placeholder'] ) ? $field['first_placeholder'] : '',
69
+ ),
70
+ 'block' => array(
71
+ 'wpforms-field-row-block',
72
+ 'wpforms-first',
73
+ ),
74
+ 'class' => array(
75
+ 'wpforms-field-name-first',
76
+ ),
77
+ 'data' => array(),
78
+ 'id' => "wpforms-{$form_id}-field_{$field_id}",
79
+ 'required' => ! empty( $field['required'] ) ? 'required' : '',
80
+ 'sublabel' => array(
81
+ 'hidden' => ! empty( $field['sublabel_hide'] ),
82
+ 'value' => __( 'First', 'wpforms' ),
83
+ ),
84
+ 'value' => '',
85
+ ),
86
+ 'middle' => array(
87
+ 'attr' => array(
88
+ 'name' => "wpforms[fields][{$field_id}][middle]",
89
+ 'value' => ! empty( $field['middle_default'] ) ? apply_filters( 'wpforms_process_smart_tags', $field['middle_default'], $form_data ) : '',
90
+ 'placeholder' => ! empty( $field['middle_placeholder'] ) ? $field['middle_placeholder'] : '',
91
+ ),
92
+ 'block' => array(
93
+ 'wpforms-field-row-block',
94
+ 'wpforms-one-fifth',
95
+ ),
96
+ 'class' => array(
97
+ 'wpforms-field-name-middle',
98
+ ),
99
+ 'data' => array(),
100
+ 'id' => "wpforms-{$form_id}-field_{$field_id}-middle",
101
+ 'sublabel' => array(
102
+ 'hidden' => ! empty( $field['sublabel_hide'] ),
103
+ 'value' => __( 'Middle', 'wpforms' ),
104
+ ),
105
+ 'value' => '',
106
+ ),
107
+ 'last' => array(
108
+ 'attr' => array(
109
+ 'name' => "wpforms[fields][{$field_id}][last]",
110
+ 'value' => ! empty( $field['last_default'] ) ? apply_filters( 'wpforms_process_smart_tags', $field['last_default'], $form_data ) : '',
111
+ 'placeholder' => ! empty( $field['last_placeholder'] ) ? $field['last_placeholder'] : '',
112
+ ),
113
+ 'block' => array(
114
+ 'wpforms-field-row-block',
115
+
116
+ ),
117
+ 'class' => array(
118
+ 'wpforms-field-name-last',
119
+ ),
120
+ 'data' => array(),
121
+ 'id' => "wpforms-{$form_id}-field_{$field_id}-last",
122
+ 'required' => ! empty( $field['required'] ) ? 'required' : '',
123
+ 'sublabel' => array(
124
+ 'hidden' => ! empty( $field['sublabel_hide'] ),
125
+ 'value' => __( 'Last', 'wpforms' ),
126
+ ),
127
+ 'value' => '',
128
+ ),
129
+ ),
130
+ );
131
+ $properties = array_merge_recursive( $properties, $props );
132
+
133
+ // Input First: add error class if needed.
134
+ if ( ! empty( $properties['error']['value']['first'] ) ) {
135
+ $properties['inputs']['first']['class'][] = 'wpforms-error';
136
+ }
137
+
138
+ // Input First: add required class if needed.
139
+ if ( ! empty( $field['required'] ) ) {
140
+ $properties['inputs']['first']['class'][] = 'wpforms-field-required';
141
+ }
142
+
143
+ // Input First: add column class.
144
+ $properties['inputs']['first']['block'][] = 'first-last' === $format ? 'wpforms-one-half' : 'wpforms-two-fifths';
145
+
146
+ // Input First: dynamic value support.
147
+ if ( $dynamic ) {
148
+ if ( empty( $properties['inputs']['first']['attr']['value'] ) && ! empty( $_GET[ "f{$field_id}-first" ] ) ) {
149
+ $properties['inputs']['first']['attr']['value'] = sanitize_text_field( $_GET[ "f{$field_id}-first" ] );
150
+ }
151
+ }
152
+
153
+ // Input Last: add error class if needed.
154
+ if ( ! empty( $properties['error']['value']['last'] ) ) {
155
+ $properties['inputs']['last']['class'][] = 'wpforms-error';
156
+ }
157
+
158
+ // Input Last: add required class if needed.
159
+ if ( ! empty( $field['required'] ) ) {
160
+ $properties['inputs']['last']['class'][] = 'wpforms-field-required';
161
+ }
162
+
163
+ // Input Last: add column class.
164
+ $properties['inputs']['last']['block'][] = 'first-last' === $format ? 'wpforms-one-half' : 'wpforms-two-fifths';
165
+
166
+ // Input Last: dynamic value support.
167
+ if ( $dynamic ) {
168
+ if ( empty( $properties['inputs']['last']['attr']['value'] ) && ! empty( $_GET[ "f{$field_id}-last" ] ) ) {
169
+ $properties['inputs']['last']['attr']['value'] = sanitize_text_field( $_GET[ "f{$field_id}-last" ] );
170
+ }
171
+ }
172
+
173
+ return $properties;
174
+ }
175
+
176
+ /**
177
+ * Name fields should default to being required.
178
+ *
179
+ * @since 1.0.8
180
+ * @param bool $required
181
+ * @param array $field
182
+ * @return bool
183
+ */
184
+ public function default_required( $required, $field ) {
185
+
186
+ if ( 'name' === $field['type'] ) {
187
+ return true;
188
+ }
189
+ return $required;
190
+ }
191
+
192
  /**
193
  * Field options panel inside the builder.
194
  *
197
  */
198
  public function field_options( $field ) {
199
 
200
+ // Define data.
201
+ $format = ! empty( $field['format'] ) ? esc_attr( $field['format'] ) : 'first-last';
202
+
203
+ // -------------------------------------------------------------------//
204
+ // Basic field options.
205
+ // -------------------------------------------------------------------//
206
+
207
+ // Options open markup.
208
+ $args = array(
209
+ 'markup' => 'open',
210
+ );
211
+ $this->field_option( 'basic-options', $field, $args );
212
+
213
+ // Label.
214
+ $this->field_option( 'label', $field );
215
+
216
+ // Format.
217
+ $lbl = $this->field_element(
218
+ 'label',
219
+ $field,
220
+ array(
221
+ 'slug' => 'format',
222
+ 'value' => __( 'Format', 'wpforms' ),
223
+ 'tooltip' => __( 'Select format to use for the name form field', 'wpforms' ),
224
+ ),
225
+ false
226
+ );
227
+ $fld = $this->field_element(
228
+ 'select',
229
+ $field,
230
+ array(
231
+ 'slug' => 'format',
232
+ 'value' => $format,
233
+ 'options' => array(
234
+ 'simple' => __( 'Simple', 'wpforms' ),
235
+ 'first-last' => __( 'First Last', 'wpforms' ),
236
+ 'first-middle-last' => __( 'First Middle Last', 'wpforms' ),
237
+ ),
238
+ ),
239
+ false
240
+ );
241
+ $args = array(
242
+ 'slug' => 'format',
243
+ 'content' => $lbl . $fld,
244
+ );
245
+ $this->field_element( 'row', $field, $args );
246
+
247
+ // Description.
248
+ $this->field_option( 'description', $field );
249
 
250
+ // Required toggle.
251
+ $this->field_option( 'required', $field );
252
 
253
+ // Options close markup.
254
+ $args = array(
255
+ 'markup' => 'close',
 
 
 
 
256
  );
257
+ $this->field_option( 'basic-options', $field, $args );
 
 
258
 
259
+ // -------------------------------------------------------------------//
260
+ // Advanced field options.
261
+ // -------------------------------------------------------------------//
262
 
263
+ // Options open markup.
264
+ $args = array(
265
+ 'markup' => 'open',
266
+ );
267
+ $this->field_option( 'advanced-options', $field, $args );
268
 
269
+ // Size.
270
+ $this->field_option( 'size', $field );
271
 
272
  echo '<div class="format-selected-' . $format . ' format-selected">';
273
 
274
  // Simple
275
+ $simple_placeholder = ! empty( $field['simple_placeholder'] ) ? esc_attr( $field['simple_placeholder'] ) : '';
276
+ $simple_default = ! empty( $field['simple_default'] ) ? esc_attr( $field['simple_default'] ) : '';
277
  printf( '<div class="wpforms-clear wpforms-field-option-row wpforms-field-option-row-simple" id="wpforms-field-option-row-%d-simple" data-subfield="simple" data-field-id="%d">', $field['id'], $field['id'] );
278
  $this->field_element( 'label', $field, array( 'slug' => 'simple_placeholder', 'value' => __( 'Name', 'wpforms' ), 'tooltip' => __( 'Name field advanced options.', 'wpforms' ) ) );
279
  echo '<div class="placeholder">';
287
  echo '</div>';
288
 
289
  // First
290
+ $first_placeholder = ! empty( $field['first_placeholder'] ) ? esc_attr( $field['first_placeholder'] ) : '';
291
+ $first_default = ! empty( $field['first_default'] ) ? esc_attr( $field['first_default'] ) : '';
292
  printf( '<div class="wpforms-clear wpforms-field-option-row wpforms-field-option-row-first" id="wpforms-field-option-row-%d-first" data-subfield="first-name" data-field-id="%d">', $field['id'], $field['id'] );
293
  $this->field_element( 'label', $field, array( 'slug' => 'first_placeholder', 'value' => __( 'First Name', 'wpforms' ), 'tooltip' => __( 'First name field advanced options.', 'wpforms' ) ) );
294
  echo '<div class="placeholder">';
302
  echo '</div>';
303
 
304
  // Middle
305
+ $middle_placeholder = ! empty( $field['middle_placeholder'] ) ? esc_attr( $field['middle_placeholder'] ) : '';
306
+ $middle_default = ! empty( $field['middle_default'] ) ? esc_attr( $field['middle_default'] ) : '';
307
  printf( '<div class="wpforms-clear wpforms-field-option-row wpforms-field-option-row-middle" id="wpforms-field-option-row-%d-middle" data-subfield="middle-name" data-field-id="%d">', $field['id'], $field['id'] );
308
  $this->field_element( 'label', $field, array( 'slug' => 'middle_placeholder', 'value' => __( 'Middle Name', 'wpforms' ), 'tooltip' => __( 'Middle name field advanced options.', 'wpforms' ) ) );
309
  echo '<div class="placeholder">';
317
  echo '</div>';
318
 
319
  // Last
320
+ $last_placeholder = ! empty( $field['last_placeholder'] ) ? esc_attr( $field['last_placeholder'] ) : '';
321
+ $last_default = ! empty( $field['last_default'] ) ? esc_attr( $field['last_default'] ) : '';
322
  printf( '<div class="wpforms-clear wpforms-field-option-row wpforms-field-option-row-last" id="wpforms-field-option-row-%d-last" data-subfield="last-name" data-field-id="%d">', $field['id'], $field['id'] );
323
  $this->field_element( 'label', $field, array( 'slug' => 'last_placeholder', 'value' => __( 'Last Name', 'wpforms' ), 'tooltip' => __( 'Last name field advanced options.', 'wpforms' ) ) );
324
  echo '<div class="placeholder">';
333
 
334
  echo '</div>';
335
 
336
+ // Hide Label.
337
+ $this->field_option( 'label_hide', $field );
338
+
339
+ // Hide sub-labels.
340
+ $this->field_option( 'sublabel_hide', $field );
341
+
342
+ // Custom CSS classes.
343
+ $this->field_option( 'css', $field );
344
+
345
+ // Options close markup.
346
+ $args = array(
347
+ 'markup' => 'close',
348
+ );
349
+ $this->field_option( 'advanced-options', $field, $args );
350
  }
351
 
352
  /**
357
  */
358
  public function field_preview( $field ) {
359
 
360
+ // Define data.
361
+ $simple_placeholder = ! empty( $field['simple_placeholder'] ) ? esc_attr( $field['simple_placeholder'] ) : '';
362
+ $first_placeholder = ! empty( $field['first_placeholder'] ) ? esc_attr( $field['first_placeholder'] ) : '';
363
+ $middle_placeholder = ! empty( $field['middle_placeholder'] ) ? esc_attr( $field['middle_placeholder'] ) : '';
364
+ $last_placeholder = ! empty( $field['last_placeholder'] ) ? esc_attr( $field['last_placeholder'] ) : '';
365
+ $format = ! empty( $field['format'] ) ? esc_attr( $field['format'] ) : 'first-last';
366
 
367
+ // Label.
368
  $this->field_preview_option( 'label', $field );
369
+ ?>
370
 
371
+ <div class="format-selected-<?php echo $format; ?> format-selected">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
372
 
373
+ <div class="wpforms-simple">
374
+ <input type="text" placeholder="<?php echo $simple_placeholder; ?>" class="primary-input" disabled>
375
+ </div>
376
+
377
+ <div class="wpforms-first-name">
378
+ <input type="text" placeholder="<?php echo $first_placeholder; ?>" class="primary-input" disabled>
379
+ <label class="wpforms-sub-label"><?php esc_html_e( 'First', 'wpforms' ); ?></label>
380
+ </div>
381
+
382
+ <div class="wpforms-middle-name">
383
+ <input type="text" placeholder="<?php echo $middle_placeholder; ?>" class="primary-input" disabled>
384
+ <label class="wpforms-sub-label"><?php esc_html_e( 'Middle', 'wpforms' ); ?></label>
385
+ </div>
386
+
387
+ <div class="wpforms-last-name">
388
+ <input type="text" placeholder="<?php echo $last_placeholder; ?>" class="primary-input" disabled>
389
+ <label class="wpforms-sub-label"><?php esc_html_e( 'Last', 'wpforms' ); ?></label>
390
+ </div>
391
+
392
+ </div>
393
+
394
+ <?php
395
+ // Description.
396
  $this->field_preview_option( 'description', $field );
397
  }
398
 
405
  */
406
  public function field_display( $field, $field_atts, $form_data ) {
407
 
408
+ // Define data.
409
+ $form_id = absint( $form_data['id'] );
410
+ $format = ! empty( $field['format'] ) ? esc_attr( $field['format'] ) : 'first-last';
411
+ $primary = ! empty( $field['properties']['inputs']['primary'] ) ? $field['properties']['inputs']['primary'] : '';
412
+ $first = ! empty( $field['properties']['inputs']['first'] ) ? $field['properties']['inputs']['first'] : '';
413
+ $middle = ! empty( $field['properties']['inputs']['middle'] ) ? $field['properties']['inputs']['middle'] : '';
414
+ $last = ! empty( $field['properties']['inputs']['last'] ) ? $field['properties']['inputs']['last'] : '';
415
+
416
+ // Simple format.
417
+ if ( 'simple' === $format ) {
418
+
419
+ // Primary field (Simple).
420
+ printf( '<input type="text" %s %s>',
421
+ wpforms_html_attributes( $primary['id'], $primary['class'], $primary['data'], $primary['attr'] ),
422
+ $primary['required']
 
 
 
 
 
 
 
 
 
 
 
 
 
423
  );
424
 
425
+ // Expanded formats.
426
+ } else {
 
 
 
 
 
 
 
427
 
428
+ // Row wrapper.
429
+ echo '<div class="wpforms-field-row wpforms-field-' . sanitize_html_class( $field['size'] ) . '">';
 
430
 
431
+ // First name.
432
+ echo '<div ' . wpforms_html_attributes( false, $first['block'] ) . '>';
433
+ $this->field_display_sublabel( 'first', 'before', $field );
434
+ printf( '<input type="text" %s %s>',
435
+ wpforms_html_attributes( $first['id'], $first['class'], $first['data'], $first['attr'] ),
436
+ $first['required']
 
 
437
  );
438
+ $this->field_display_sublabel( 'first', 'after', $field );
439
+ $this->field_display_error( 'first', $field );
 
 
 
 
 
440
  echo '</div>';
441
 
442
+ // Middle name.
443
+ if ( 'first-middle-last' === $format ) {
444
+ echo '<div ' . wpforms_html_attributes( false, $middle['block'] ) . '>';
445
+ $this->field_display_sublabel( 'middle', 'before', $field );
446
+ printf( '<input type="text" %s>',
447
+ wpforms_html_attributes( $middle['id'], $middle['class'], $middle['data'], $middle['attr'] )
 
 
 
 
 
 
448
  );
449
+ $this->field_display_sublabel( 'middle', 'after', $field );
450
+ $this->field_display_error( 'middle', $field );
 
451
  echo '</div>';
452
+ }
453
+
454
+ // Last name.
455
+ echo '<div ' . wpforms_html_attributes( false, $last['block'] ) . '>';
456
+ $this->field_display_sublabel( 'last', 'before', $field );
457
+ printf( '<input type="text" %s %s>',
458
+ wpforms_html_attributes( $last['id'], $last['class'], $last['data'], $last['attr'] ),
459
+ $last['required']
 
 
 
 
 
 
 
 
 
 
460
  );
461
+ $this->field_display_sublabel( 'last', 'after', $field );
462
+ $this->field_display_error( 'last', $field );
 
 
 
 
 
463
  echo '</div>';
464
 
465
  echo '</div>';
466
 
467
+ } // End if();
468
  }
469
 
470
  /**
477
  */
478
  public function validate( $field_id, $field_submit, $form_data ) {
479
 
480
+ // Extended validation needed for the different name fields.
481
+ if ( ! empty( $form_data['fields'][ $field_id ]['required'] ) ) {
482
 
483
  $form_id = $form_data['id'];
484
+ $format = $form_data['fields'][ $field_id ]['format'];
485
  $required = apply_filters( 'wpforms_required_label', __( 'This field is required', 'wpforms' ) );
486
 
487
+ if ( 'simple' === $format && empty( $field_submit ) ) {
488
+ wpforms()->process->errors[ $form_id ][ $field_id ] = $required;
489
  }
490
 
491
+ if ( ( 'first-last' === $format || 'first-middle-last' === $format ) && empty( $field_submit['first'] ) ) {
492
+ wpforms()->process->errors[ $form_id ][ $field_id ]['first'] = $required;
493
  }
494
 
495
+ if ( ( 'first-last' === $format || 'first-middle-last' === $format ) && empty( $field_submit['last'] ) ) {
496
+ wpforms()->process->errors[ $form_id ][ $field_id ]['last'] = $required;
497
  }
498
  }
499
  }
508
  */
509
  public function format( $field_id, $field_submit, $form_data ) {
510
 
511
+ // Define data.
512
+ $name = ! empty( $form_data['fields'][ $field_id ]['label'] ) ? $form_data['fields'][ $field_id ]['label'] : '';
513
+ $first = ! empty( $field_submit['first'] ) ? $field_submit['first'] : '';
514
+ $middle = ! empty( $field_submit['middle'] ) ? $field_submit['middle'] : '';
515
+ $last = ! empty( $field_submit['last'] ) ? $field_submit['last'] : '';
516
 
517
  if ( is_array( $field_submit ) ) {
518
+ $value = implode( ' ', array_filter( array( $first, $middle, $last ) ) );
 
 
519
  } else {
520
  $value = $field_submit;
521
  }
522
 
523
+ // Set final field details.
524
+ wpforms()->process->fields[ $field_id ] = array(
525
  'name' => sanitize_text_field( $name ),
526
  'value' => sanitize_text_field( $value ),
527
  'id' => absint( $field_id ),
531
  'last' => sanitize_text_field( $last ),
532
  );
533
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
534
  }
535
+ new WPForms_Field_Name;
includes/fields/class-number.php CHANGED
@@ -7,7 +7,7 @@
7
  * @since 1.0.0
8
  * @license GPL-2.0+
9
  * @copyright Copyright (c) 2016, WPForms LLC
10
- */
11
  class WPForms_Field_Number extends WPForms_Field {
12
 
13
  /**
@@ -17,7 +17,7 @@ class WPForms_Field_Number extends WPForms_Field {
17
  */
18
  public function init() {
19
 
20
- // Define field type information
21
  $this->name = __( 'Numbers', 'wpforms' );
22
  $this->type = 'number';
23
  $this->icon = 'fa-hashtag';
@@ -32,28 +32,61 @@ class WPForms_Field_Number extends WPForms_Field {
32
  */
33
  public function field_options( $field ) {
34
 
35
- //--------------------------------------------------------------------//
36
- // Basic field options
37
- //--------------------------------------------------------------------//
38
-
39
- //$this->field_option( 'meta', $field );
40
- $this->field_option( 'basic-options', $field, array( 'markup' => 'open' ) );
41
- $this->field_option( 'label', $field );
42
- $this->field_option( 'description', $field );
43
- $this->field_option( 'required', $field );
44
- $this->field_option( 'basic-options', $field, array( 'markup' => 'close' ) );
45
-
46
- //--------------------------------------------------------------------//
47
- // Advanced field options
48
- //--------------------------------------------------------------------//
49
-
50
- $this->field_option( 'advanced-options', $field, array( 'markup' => 'open' ) );
51
- $this->field_option( 'size', $field );
52
- $this->field_option( 'placeholder', $field );
53
- $this->field_option( 'label_hide', $field );
54
- $this->field_option( 'default_value', $field );
55
- $this->field_option( 'css', $field );
56
- $this->field_option( 'advanced-options', $field, array( 'markup' => 'close' ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
  }
58
 
59
  /**
@@ -64,12 +97,16 @@ class WPForms_Field_Number extends WPForms_Field {
64
  */
65
  public function field_preview( $field ) {
66
 
67
- $placeholder = !empty( $field['placeholder'] ) ? esc_attr( $field['placeholder'] ) : '';
 
68
 
 
69
  $this->field_preview_option( 'label', $field );
70
 
71
- printf( '<input type="text" placeholder="%s" class="primary-input" disabled>', $placeholder );
 
72
 
 
73
  $this->field_preview_option( 'description', $field );
74
  }
75
 
@@ -78,35 +115,18 @@ class WPForms_Field_Number extends WPForms_Field {
78
  *
79
  * @since 1.0.0
80
  * @param array $field
 
81
  * @param array $form_data
82
  */
83
- public function field_display( $field, $field_atts, $form_data ) {
84
-
85
- // Setup and sanitize the necessary data
86
- $field = apply_filters( 'wpforms_number_field_display', $field, $field_atts, $form_data );
87
- $field_placeholder = !empty( $field['placeholder']) ? esc_attr( $field['placeholder'] ) : '';
88
- $field_required = !empty( $field['required'] ) ? ' required' : '';
89
- $field_class = implode( ' ', array_map( 'sanitize_html_class', $field_atts['input_class'] ) );
90
- $field_id = implode( ' ', array_map( 'sanitize_html_class', $field_atts['input_id'] ) );
91
- $field_value = !empty( $field['default_value'] ) ? esc_attr( apply_filters( 'wpforms_process_smart_tags', $field['default_value'], $form_data ) ) : '';
92
- $field_data = '';
93
-
94
- if ( !empty( $field_atts['input_data'] ) ) {
95
- foreach ( $field_atts['input_data'] as $key => $val ) {
96
- $field_data .= ' data-' . $key . '="' . $val . '"';
97
- }
98
- }
99
 
100
- // Primary text field
101
- printf(
102
- '<input type="number" name="wpforms[fields][%d]" id="%s" class="%s" value="%s" placeholder="%s" %s %s>',
103
- $field['id'],
104
- $field_id,
105
- $field_class,
106
- $field_value,
107
- $field_placeholder,
108
- $field_required,
109
- $field_data
110
  );
111
  }
112
 
@@ -128,13 +148,13 @@ class WPForms_Field_Number extends WPForms_Field {
128
  $field_submit = preg_replace( '/[^0-9.]/', '', $field_submit );
129
 
130
  // Basic required check - If field is marked as required, check for entry data
131
- if ( !empty( $form_data['fields'][$field_id]['required'] ) && empty( $field_submit ) && '0' != $field_submit ) {
132
- wpforms()->process->errors[$form_id][$field_id] = apply_filters( 'wpforms_required_label', __('This field is required', 'wpforms' ) );
133
  }
134
 
135
- // Check that email is valid format
136
- if ( !empty( $field_submit ) && !is_numeric( $field_submit ) ) {
137
- wpforms()->process->errors[$form_id][$field_id] = apply_filters( 'wpforms_valid_number_label', __('Please enter a valid number.', 'wpforms' ) );
138
  }
139
  }
140
 
@@ -148,17 +168,17 @@ class WPForms_Field_Number extends WPForms_Field {
148
  */
149
  public function format( $field_id, $field_submit, $form_data ) {
150
 
151
- $name = !empty( $form_data['fields'][$field_id]['label'] ) ? sanitize_text_field( $form_data['fields'][$field_id]['label'] ) : '';
152
-
153
- // Remove non-numerical characters
154
  $value = preg_replace( '/[^0-9.]/', '', $field_submit );
155
 
156
- wpforms()->process->fields[$field_id] = array(
157
- 'name' => $name,
158
- 'value' => $value,
 
159
  'id' => absint( $field_id ),
160
  'type' => $this->type,
161
  );
162
  }
163
  }
164
- new WPForms_Field_Number;
7
  * @since 1.0.0
8
  * @license GPL-2.0+
9
  * @copyright Copyright (c) 2016, WPForms LLC
10
+ */
11
  class WPForms_Field_Number extends WPForms_Field {
12
 
13
  /**
17
  */
18
  public function init() {
19
 
20
+ // Define field type information.
21
  $this->name = __( 'Numbers', 'wpforms' );
22
  $this->type = 'number';
23
  $this->icon = 'fa-hashtag';
32
  */
33
  public function field_options( $field ) {
34
 
35
+ // -------------------------------------------------------------------//
36
+ // Basic field options.
37
+ // -------------------------------------------------------------------//
38
+
39
+ // Options open markup.
40
+ $args = array(
41
+ 'markup' => 'open',
42
+ );
43
+ $this->field_option( 'basic-options', $field, $args );
44
+
45
+ // Label.
46
+ $this->field_option( 'label', $field );
47
+
48
+ // Description.
49
+ $this->field_option( 'description', $field );
50
+
51
+ // Required toggle.
52
+ $this->field_option( 'required', $field );
53
+
54
+ // Options close markup.
55
+ $args = array(
56
+ 'markup' => 'close',
57
+ );
58
+ $this->field_option( 'basic-options', $field, $args );
59
+
60
+ // -------------------------------------------------------------------//
61
+ // Advanced field options.
62
+ // -------------------------------------------------------------------//
63
+
64
+ // Options open markup.
65
+ $args = array(
66
+ 'markup' => 'open',
67
+ );
68
+ $this->field_option( 'advanced-options', $field, $args );
69
+
70
+ // Size.
71
+ $this->field_option( 'size', $field );
72
+
73
+ // Placeholder.
74
+ $this->field_option( 'placeholder', $field );
75
+
76
+ // Hide label.
77
+ $this->field_option( 'label_hide', $field );
78
+
79
+ // Default value.
80
+ $this->field_option( 'default_value', $field );
81
+
82
+ // Custom CSS classes.
83
+ $this->field_option( 'css', $field );
84
+
85
+ // Options close markup.
86
+ $args = array(
87
+ 'markup' => 'close',
88
+ );
89
+ $this->field_option( 'advanced-options', $field, $args );
90
  }
91
 
92
  /**
97
  */
98
  public function field_preview( $field ) {
99
 
100
+ // Define data.
101
+ $placeholder = ! empty( $field['placeholder'] ) ? esc_attr( $field['placeholder'] ) : '';
102
 
103
+ // Label.
104
  $this->field_preview_option( 'label', $field );
105
 
106
+ // Primary input.
107
+ echo '<input type="text" placeholder="' . $placeholder . '" class="primary-input" disabled>';
108
 
109
+ // Description.
110
  $this->field_preview_option( 'description', $field );
111
  }
112
 
115
  *
116
  * @since 1.0.0
117
  * @param array $field
118
+ * @param array $deprecated
119
  * @param array $form_data
120
  */
121
+ public function field_display( $field, $deprecated, $form_data ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
122
 
123
+ // Define data.
124
+ $primary = $field['properties']['inputs']['primary'];
125
+
126
+ // Primary field.
127
+ printf( '<input type="number" %s %s>',
128
+ wpforms_html_attributes( $primary['id'], $primary['class'], $primary['data'], $primary['attr'] ),
129
+ $primary['required']
 
 
 
130
  );
131
  }
132
 
148
  $field_submit = preg_replace( '/[^0-9.]/', '', $field_submit );
149
 
150
  // Basic required check - If field is marked as required, check for entry data
151
+ if ( ! empty( $form_data['fields'][ $field_id ]['required'] ) && empty( $field_submit ) && '0' != $field_submit ) {
152
+ wpforms()->process->errors[ $form_id ][ $field_id ] = apply_filters( 'wpforms_required_label', __( 'This field is required', 'wpforms' ) );
153
  }
154
 
155
+ // Check if value is numeric.
156
+ if ( ! empty( $field_submit ) && ! is_numeric( $field_submit ) ) {
157
+ wpforms()->process->errors[ $form_id ][ $field_id ] = apply_filters( 'wpforms_valid_number_label', __( 'Please enter a valid number.', 'wpforms' ) );
158
  }
159
  }
160
 
168
  */
169
  public function format( $field_id, $field_submit, $form_data ) {
170
 
171
+ // Define data.
172
+ $name = ! empty( $form_data['fields'][ $field_id ]['label'] ) ? $form_data['fields'][ $field_id ]['label'] : '';
 
173
  $value = preg_replace( '/[^0-9.]/', '', $field_submit );
174
 
175
+ // Set final field details.
176
+ wpforms()->process->fields[ $field_id ] = array(
177
+ 'name' => sanitize_text_field( $name ),
178
+ 'value' => sanitize_text_field( $value ),
179
  'id' => absint( $field_id ),
180
  'type' => $this->type,
181
  );
182
  }
183
  }
184
+ new WPForms_Field_Number;
includes/fields/class-text.php CHANGED
@@ -7,7 +7,7 @@
7
  * @since 1.0.0
8
  * @license GPL-2.0+
9
  * @copyright Copyright (c) 2016, WPForms LLC
10
- */
11
  class WPForms_Field_Text extends WPForms_Field {
12
 
13
  /**
@@ -17,7 +17,7 @@ class WPForms_Field_Text extends WPForms_Field {
17
  */
18
  public function init() {
19
 
20
- // Define field type information
21
  $this->name = __( 'Single Line Text', 'wpforms' );
22
  $this->type = 'text';
23
  $this->icon = 'fa-text-width';
@@ -32,28 +32,61 @@ class WPForms_Field_Text extends WPForms_Field {
32
  */
33
  public function field_options( $field ) {
34
 
35
- //--------------------------------------------------------------------//
36
- // Basic field options
37
- //--------------------------------------------------------------------//
38
-
39
- //$this->field_option( 'meta', $field );
40
- $this->field_option( 'basic-options', $field, array( 'markup' => 'open' ) );
41
- $this->field_option( 'label', $field );
42
- $this->field_option( 'description', $field );
43
- $this->field_option( 'required', $field );
44
- $this->field_option( 'basic-options', $field, array( 'markup' => 'close' ) );
45
-
46
- //--------------------------------------------------------------------//
47
- // Advanced field options
48
- //--------------------------------------------------------------------//
49
-
50
- $this->field_option( 'advanced-options', $field, array( 'markup' => 'open' ) );
51
- $this->field_option( 'size', $field );
52
- $this->field_option( 'placeholder', $field );
53
- $this->field_option( 'label_hide', $field );
54
- $this->field_option( 'default_value', $field );
55
- $this->field_option( 'css', $field );
56
- $this->field_option( 'advanced-options', $field, array( 'markup' => 'close' ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
  }
58
 
59
  /**
@@ -64,12 +97,16 @@ class WPForms_Field_Text extends WPForms_Field {
64
  */
65
  public function field_preview( $field ) {
66
 
67
- $placeholder = !empty( $field['placeholder'] ) ? esc_attr( $field['placeholder'] ) : '';
 
68
 
 
69
  $this->field_preview_option( 'label', $field );
70
 
71
- printf( '<input type="text" placeholder="%s" class="primary-input" disabled>', $placeholder );
 
72
 
 
73
  $this->field_preview_option( 'description', $field );
74
  }
75
 
@@ -78,36 +115,19 @@ class WPForms_Field_Text extends WPForms_Field {
78
  *
79
  * @since 1.0.0
80
  * @param array $field
 
81
  * @param array $form_data
82
  */
83
- public function field_display( $field, $field_atts, $form_data ) {
84
-
85
- // Setup and sanitize the necessary data
86
- $field = apply_filters( 'wpforms_text_field_display', $field, $field_atts, $form_data );
87
- $field_placeholder = !empty( $field['placeholder']) ? esc_attr( $field['placeholder'] ) : '';
88
- $field_required = !empty( $field['required'] ) ? ' required' : '';
89
- $field_class = implode( ' ', array_map( 'sanitize_html_class', $field_atts['input_class'] ) );
90
- $field_id = implode( ' ', array_map( 'sanitize_html_class', $field_atts['input_id'] ) );
91
- $field_value = !empty( $field['default_value'] ) ? esc_attr( apply_filters( 'wpforms_process_smart_tags', $field['default_value'], $form_data ) ) : '';
92
- $field_data = '';
93
-
94
- if ( !empty( $field_atts['input_data'] ) ) {
95
- foreach ( $field_atts['input_data'] as $key => $val ) {
96
- $field_data .= ' data-' . $key . '="' . $val . '"';
97
- }
98
- }
99
-
100
- // Primary text field
101
- printf(
102
- '<input type="text" name="wpforms[fields][%d]" id="%s" class="%s" value="%s" placeholder="%s" %s %s>',
103
- $field['id'],
104
- $field_id,
105
- $field_class,
106
- $field_value,
107
- $field_placeholder,
108
- $field_required,
109
- $field_data
110
  );
111
  }
112
  }
113
- new WPForms_Field_Text;
7
  * @since 1.0.0
8
  * @license GPL-2.0+
9
  * @copyright Copyright (c) 2016, WPForms LLC
10
+ */
11
  class WPForms_Field_Text extends WPForms_Field {
12
 
13
  /**
17
  */
18
  public function init() {
19
 
20
+ // Define field type information.
21
  $this->name = __( 'Single Line Text', 'wpforms' );
22
  $this->type = 'text';
23
  $this->icon = 'fa-text-width';
32
  */
33
  public function field_options( $field ) {
34
 
35
+ // -------------------------------------------------------------------//
36
+ // Basic field options.
37
+ // -------------------------------------------------------------------//
38
+
39
+ // Options open markup.
40
+ $args = array(
41
+ 'markup' => 'open',
42
+ );
43
+ $this->field_option( 'basic-options', $field, $args );
44
+
45
+ // Label.
46
+ $this->field_option( 'label', $field );
47
+
48
+ // Description.
49
+ $this->field_option( 'description', $field );
50
+
51
+ // Required toggle.
52
+ $this->field_option( 'required', $field );
53
+
54
+ // Options close markup.
55
+ $args = array(
56
+ 'markup' => 'close',
57
+ );
58
+ $this->field_option( 'basic-options', $field, $args );
59
+
60
+ // --------------------------------------------------------------------//
61
+ // Advanced field options.
62
+ // --------------------------------------------------------------------//
63
+
64
+ // Options open markup.
65
+ $args = array(
66
+ 'markup' => 'open',
67
+ );
68
+ $this->field_option( 'advanced-options', $field, $args );
69
+
70
+ // Size.
71
+ $this->field_option( 'size', $field );
72
+
73
+ // Placeholder.
74
+ $this->field_option( 'placeholder', $field );
75
+
76
+ // Hide label.
77
+ $this->field_option( 'label_hide', $field );
78
+
79
+ // Default value.
80
+ $this->field_option( 'default_value', $field );
81
+
82
+ // Custom CSS classes.
83
+ $this->field_option( 'css', $field );
84
+
85
+ // Options close markup.
86
+ $args = array(
87
+ 'markup' => 'close',
88
+ );
89
+ $this->field_option( 'advanced-options', $field, $args );
90
  }
91
 
92
  /**
97
  */
98
  public function field_preview( $field ) {
99
 
100
+ // Define data.
101
+ $placeholder = ! empty( $field['placeholder'] ) ? esc_attr( $field['placeholder'] ) : '';
102
 
103
+ // Label.
104
  $this->field_preview_option( 'label', $field );
105
 
106
+ // Primary input.
107
+ echo '<input type="text" placeholder="' . $placeholder . '" class="primary-input" disabled>';
108
 
109
+ // Description.
110
  $this->field_preview_option( 'description', $field );
111
  }
112
 
115
  *
116
  * @since 1.0.0
117
  * @param array $field
118
+ * @param array $deprecated
119
  * @param array $form_data
120
  */
121
+ public function field_display( $field, $deprecated, $form_data ) {
122
+
123
+ // Define data.
124
+ $primary = $field['properties']['inputs']['primary'];
125
+
126
+ // Primary field.
127
+ printf( '<input type="text" %s %s>',
128
+ wpforms_html_attributes( $primary['id'], $primary['class'], $primary['data'], $primary['attr'] ),
129
+ $primary['required']
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
130
  );
131
  }
132
  }
133
+ new WPForms_Field_Text;
includes/fields/class-textarea.php CHANGED
@@ -7,7 +7,7 @@
7
  * @since 1.0.0
8
  * @license GPL-2.0+
9
  * @copyright Copyright (c) 2016, WPForms LLC
10
- */
11
  class WPForms_Field_Textarea extends WPForms_Field {
12
 
13
  /**
@@ -32,27 +32,58 @@ class WPForms_Field_Textarea extends WPForms_Field {
32
  */
33
  public function field_options( $field ) {
34
 
35
- //--------------------------------------------------------------------//
36
- // Basic field options
37
- //--------------------------------------------------------------------//
38
-
39
- $this->field_option( 'basic-options', $field, array( 'markup' => 'open' ) );
40
- $this->field_option( 'meta', $field );
41
- $this->field_option( 'label', $field );
42
- $this->field_option( 'description', $field );
43
- $this->field_option( 'required', $field );
44
- $this->field_option( 'basic-options', $field, array( 'markup' => 'close' ) );
45
-
46
- //--------------------------------------------------------------------//
47
- // Advanced field options
48
- //--------------------------------------------------------------------//
49
-
50
- $this->field_option( 'advanced-options', $field, array( 'markup' => 'open' ) );
51
- $this->field_option( 'size', $field );
52
- $this->field_option( 'placeholder', $field );
53
- $this->field_option( 'label_hide', $field );
54
- $this->field_option( 'css', $field );
55
- $this->field_option( 'advanced-options', $field, array( 'markup' => 'close' ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
  }
57
 
58
  /**
@@ -62,13 +93,17 @@ class WPForms_Field_Textarea extends WPForms_Field {
62
  * @param array $field
63
  */
64
  public function field_preview( $field ) {
65
-
66
- $placeholder = !empty( $field['placeholder'] ) ? esc_attr( $field['placeholder'] ) : '';
67
-
 
 
68
  $this->field_preview_option( 'label', $field );
69
-
70
- printf( '<textarea placeholder="%s" class="primary-input" disabled></textarea>', $placeholder );
71
-
 
 
72
  $this->field_preview_option( 'description', $field );
73
  }
74
 
@@ -77,36 +112,32 @@ class WPForms_Field_Textarea extends WPForms_Field {
77
  *
78
  * @since 1.0.0
79
  * @param array $field
 
80
  * @param array $form_data
81
  */
82
- public function field_display( $field, $field_atts, $form_data ) {
83
-
84
- // Setup and sanitize the necessary data
85
- $field = apply_filters( 'wpforms_textarea_field_display', $field, $field_atts, $form_data );
86
- $field_placeholder = !empty( $field['placeholder']) ? esc_attr( $field['placeholder'] ) : '';
87
- $field_required = !empty( $field['required'] ) ? ' required' : '';
88
- $field_class = implode( ' ', array_map( 'sanitize_html_class', $field_atts['input_class'] ) );
89
- $field_id = implode( ' ', array_map( 'sanitize_html_class', $field_atts['input_id'] ) );
90
- $field_value = !empty( $field['default_value'] ) ? esc_attr( apply_filters( 'wpforms_process_smart_tags', $field['default_value'], $form_data ) ) : '';
91
- $field_data = '';
92
-
93
- if ( !empty( $field_atts['input_data'] ) ) {
94
- foreach ( $field_atts['input_data'] as $key => $val ) {
95
- $field_data .= ' data-' . $key . '="' . $val . '"';
96
  }
97
  }
98
 
99
- // Primary textarea field
100
- printf(
101
- '<textarea name="wpforms[fields][%d]" id="%s" class="%s" placeholder="%s" %s %s>%s</textarea>',
102
- $field['id'],
103
- $field_id,
104
- $field_class,
105
- $field_placeholder,
106
- $field_required,
107
- $field_data,
108
- $field_value
109
  );
110
  }
111
  }
112
- new WPForms_Field_Textarea;
7
  * @since 1.0.0
8
  * @license GPL-2.0+
9
  * @copyright Copyright (c) 2016, WPForms LLC
10
+ */
11
  class WPForms_Field_Textarea extends WPForms_Field {
12
 
13
  /**
32
  */
33
  public function field_options( $field ) {
34
 
35
+ // -------------------------------------------------------------------//
36
+ // Basic field options.
37
+ // -------------------------------------------------------------------//
38
+
39
+ // Options open markup.
40
+ $args = array(
41
+ 'markup' => 'open',
42
+ );
43
+ $this->field_option( 'basic-options', $field, $args );
44
+
45
+ // Label.
46
+ $this->field_option( 'label', $field );
47
+
48
+ // Description
49
+ $this->field_option( 'description', $field );
50
+
51
+ // Required toggle.
52
+ $this->field_option( 'required', $field );
53
+
54
+ // Options close markup.
55
+ $args = array(
56
+ 'markup' => 'close',
57
+ );
58
+ $this->field_option( 'basic-options', $field, $args );
59
+
60
+ // -------------------------------------------------------------------//
61
+ // Advanced field options.
62
+ // -------------------------------------------------------------------//
63
+
64
+ // Options open markup.
65
+ $args = array(
66
+ 'markup' => 'open',
67
+ );
68
+ $this->field_option( 'advanced-options', $field, $args );
69
+
70
+ // Size.
71
+ $this->field_option( 'size', $field );
72
+
73
+ // Placeholder.
74
+ $this->field_option( 'placeholder', $field );
75
+
76
+ // Hide label.
77
+ $this->field_option( 'label_hide', $field );
78
+
79
+ // Custom CSS classes.
80
+ $this->field_option( 'css', $field );
81
+
82
+ // Options close markup.
83
+ $args = array(
84
+ 'markup' => 'close',
85
+ );
86
+ $this->field_option( 'advanced-options', $field, $args );
87
  }
88
 
89
  /**
93
  * @param array $field
94
  */
95
  public function field_preview( $field ) {
96
+
97
+ // Define data.
98
+ $placeholder = ! empty( $field['placeholder'] ) ? esc_attr( $field['placeholder'] ) : '';
99
+
100
+ // Label.
101
  $this->field_preview_option( 'label', $field );
102
+
103
+ // Primary input.
104
+ echo '<textarea placeholder="' . $placeholder . '" class="primary-input" disabled></textarea>';
105
+
106
+ // Description.
107
  $this->field_preview_option( 'description', $field );
108
  }
109
 
112
  *
113
  * @since 1.0.0
114
  * @param array $field
115
+ * @param array $deprecated
116
  * @param array $form_data
117
  */
118
+ public function field_display( $field, $deprecated, $form_data ) {
119
+
120
+ // Define data.
121
+ $primary = $field['properties']['inputs']['primary'];
122
+ $value = '';
123
+
124
+ if ( ! empty( $primary['attr']['value'] ) ) {
125
+ $value = $primary['attr']['value'];
126
+ unset( $primary['attr']['value'] );
127
+ if ( function_exists( 'sanitize_textarea_field' ) ) {
128
+ $value = sanitize_textarea_field( $value );
129
+ } else {
130
+ $value = sanitize_text_field( $value );
 
131
  }
132
  }
133
 
134
+ // Primary field.
135
+ printf(
136
+ '<textarea %s %s>%s</textarea>',
137
+ wpforms_html_attributes( $primary['id'], $primary['class'], $primary['data'], $primary['attr'] ),
138
+ $primary['required'],
139
+ $value
 
 
 
 
140
  );
141
  }
142
  }
143
+ new WPForms_Field_Textarea;
includes/functions.php CHANGED
@@ -51,7 +51,7 @@ function wpforms_encode( $data = false ) {
51
  if( empty( $data ) )
52
  return false;
53
 
54
- return wp_slash( json_encode( $data ) );
55
  }
56
 
57
  /**
@@ -105,7 +105,7 @@ function wpforms_object_to_array( $object ) {
105
  *
106
  * @since 1.0.0
107
  * @return mixed
108
- */
109
  function wpforms_setting( $key, $default = false, $option = 'wpforms_settings' ) {
110
 
111
  $options = get_option( $option, false );
@@ -208,51 +208,162 @@ function wpforms_get_pagebreak( $form = false, $type = false ) {
208
 
209
  $form_data = '';
210
 
211
- if ( is_object( $form ) && !empty( $form->post_content ) ) {
212
  $form_data = wpforms_decode( $form->post_content );
213
  } elseif ( is_array( $form ) ) {
214
  $form_data = $form;
215
  }
216
 
217
- if ( empty( $form_data['fields'] ) )
218
  return false;
 
219
 
220
  $fields = $form_data['fields'];
221
  $pages = array();
 
222
  foreach ( $fields as $field ) {
223
- if ( $field['type'] == 'pagebreak' ) {
224
- $position = !empty( $field['position'] ) ? $field['position'] : false;
225
- if ( $type == 'pages' && $position != 'bottom' ) {
226
  $pages[] = $field;
227
- } elseif ( $position == $type ) {
228
  return $field;
229
  }
230
  }
231
  }
232
 
233
- if ( !empty( $pages ) ) {
234
  return $pages;
235
  }
 
236
  return false;
237
  }
238
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
239
  /**
240
  * Sanitizes string of CSS classes.
241
  *
242
  * @since 1.2.1
243
  * @param string $classes
 
244
  * @return string
245
  */
246
- function wpforms_sanitize_classes( $classes ) {
 
 
 
247
 
248
- $css = array();
249
- if ( !empty( $classes ) ) {
250
- $the_classes = explode( ' ', str_replace('.', '', $classes ) );
251
- foreach( $the_classes as $class ) {
 
 
 
252
  $css[] = sanitize_html_class( $class );
253
  }
254
  }
255
- return implode( ' ', $css );
 
 
 
 
256
  }
257
 
258
  /**
@@ -496,6 +607,12 @@ function wpforms_us_states() {
496
  return apply_filters( 'wpforms_us_states', $states );
497
  }
498
 
 
 
 
 
 
 
499
  function wpforms_countries() {
500
 
501
  $countries = array(
@@ -759,6 +876,51 @@ function wpforms_countries() {
759
  return apply_filters( 'wpforms_countries', $countries );
760
  }
761
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
762
  /**
763
  * Lookup user IP.
764
  *
@@ -802,6 +964,27 @@ function wpforms_sanitize_hex_color( $color ) {
802
  }
803
  }
804
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
805
 
806
  /**
807
  * Detect if we should use a light or dark color based on the color given.
51
  if( empty( $data ) )
52
  return false;
53
 
54
+ return wp_slash( wp_json_encode( $data ) );
55
  }
56
 
57
  /**
105
  *
106
  * @since 1.0.0
107
  * @return mixed
108
+ */
109
  function wpforms_setting( $key, $default = false, $option = 'wpforms_settings' ) {
110
 
111
  $options = get_option( $option, false );
208
 
209
  $form_data = '';
210
 
211
+ if ( is_object( $form ) && ! empty( $form->post_content ) ) {
212
  $form_data = wpforms_decode( $form->post_content );
213
  } elseif ( is_array( $form ) ) {
214
  $form_data = $form;
215
  }
216
 
217
+ if ( empty( $form_data['fields'] ) ) {
218
  return false;
219
+ }
220
 
221
  $fields = $form_data['fields'];
222
  $pages = array();
223
+
224
  foreach ( $fields as $field ) {
225
+ if ( 'pagebreak' === $field['type'] ) {
226
+ $position = ! empty( $field['position'] ) ? $field['position'] : false;
227
+ if ( 'pages' === $type && 'bottom' !== $position ) {
228
  $pages[] = $field;
229
+ } elseif ( $position === $type ) {
230
  return $field;
231
  }
232
  }
233
  }
234
 
235
+ if ( ! empty( $pages ) ) {
236
  return $pages;
237
  }
238
+
239
  return false;
240
  }
241
 
242
+ /**
243
+ * Returns information about pages if the form has multiple pages.
244
+ *
245
+ * @since 1.3.7
246
+ * @param mixed $form
247
+ * @return mixed false or an array
248
+ */
249
+ function wpforms_get_pagebreak_details( $form = false ) {
250
+
251
+ $form_data = '';
252
+ $details = array();
253
+ $pages = 1;
254
+
255
+ if ( is_object( $form ) && ! empty( $form->post_content ) ) {
256
+ $form_data = wpforms_decode( $form->post_content );
257
+ } elseif ( is_array( $form ) ) {
258
+ $form_data = $form;
259
+ }
260
+
261
+ if ( empty( $form_data['fields'] ) ) {
262
+ return false;
263
+ }
264
+
265
+ foreach ( $form_data['fields'] as $field ) {
266
+ if ( 'pagebreak' === $field['type'] ) {
267
+ if ( empty( $field['position'] ) ) {
268
+ $pages++;
269
+ $details['total'] = $pages;
270
+ $details['pages'][] = $field;
271
+ } elseif ( 'top' === $field['position'] ) {
272
+ $details['top'] = $field;
273
+ } elseif ( 'bottom' === $field['position'] ) {
274
+ $details['bottom'] = $field;
275
+ }
276
+ }
277
+ }
278
+
279
+ if ( ! empty( $details ) ) {
280
+ if ( empty( $details['top'] ) ) {
281
+ $details['top'] = array();
282
+ }
283
+ if ( empty( $details['bottom'] ) ) {
284
+ $details['bottom'] = array();
285
+ }
286
+ $details['current'] = 1;
287
+ return $details;
288
+ } else {
289
+ return false;
290
+ }
291
+ }
292
+
293
+ /**
294
+ * Formats, sanitizes, and returns/echos HTML element ID, classes, attributes,
295
+ * and data attributes.
296
+ *
297
+ * @since 1.3.7
298
+ * @param string $id
299
+ * @param array $class
300
+ * @param array $datas
301
+ * @param array $atts
302
+ * @param bool $echo
303
+ * @return string
304
+ */
305
+ function wpforms_html_attributes( $id = '', $class = array(), $datas = array(), $atts = array(), $echo = false ) {
306
+
307
+ $output = '';
308
+ $id = trim( $id );
309
+
310
+ if ( ! empty( $id ) ) {
311
+ $output = 'id="' . sanitize_html_class( $id ) . '" ';
312
+ }
313
+
314
+ if ( ! empty( $class ) ) {
315
+ $output .= 'class="' . wpforms_sanitize_classes( $class, true ) . '" ';
316
+ }
317
+
318
+ if ( ! empty( $datas ) ) {
319
+ foreach ( $datas as $data => $val ) {
320
+ $output .= 'data-' . sanitize_html_class( $data ) . '="' . esc_attr( $val ) . '" ';
321
+ }
322
+ }
323
+
324
+ if ( ! empty( $atts ) ) {
325
+ foreach ( $atts as $att => $val ) {
326
+ if ( '0' == $val || ! empty( $val ) ) {
327
+ $output .= sanitize_html_class( $att ) . '="' . esc_attr( $val ) . '" ';
328
+ }
329
+ }
330
+ }
331
+
332
+ if ( $echo ) {
333
+ echo trim( $output );
334
+ } else {
335
+ return trim( $output );
336
+ }
337
+ }
338
+
339
  /**
340
  * Sanitizes string of CSS classes.
341
  *
342
  * @since 1.2.1
343
  * @param string $classes
344
+ * @param bool $convert True will convert strings to array and vice versa.
345
  * @return string
346
  */
347
+ function wpforms_sanitize_classes( $classes, $convert = false ) {
348
+
349
+ $array = false;
350
+ $css = array();
351
 
352
+ if ( ! empty( $classes ) ) {
353
+ if ( is_array( $classes ) ) {
354
+ $array = true;
355
+ } else {
356
+ $classes = explode( ' ', trim( $classes ) );
357
+ }
358
+ foreach ( $classes as $class ) {
359
  $css[] = sanitize_html_class( $class );
360
  }
361
  }
362
+ if ( $array ) {
363
+ return $convert ? implode( ' ', $css ) : $css;
364
+ } else {
365
+ return $convert ? $css : implode( ' ', $css );
366
+ }
367
  }
368
 
369
  /**
607
  return apply_filters( 'wpforms_us_states', $states );
608
  }
609
 
610
+ /**
611
+ * Countries.
612
+ *
613
+ * @since 1.0.0
614
+ * @return array
615
+ */
616
  function wpforms_countries() {
617
 
618
  $countries = array(
876
  return apply_filters( 'wpforms_countries', $countries );
877
  }
878
 
879
+ /**
880
+ * Calendar Months
881
+ *
882
+ * @since 1.3.7
883
+ * @return array
884
+ */
885
+ function wpforms_months() {
886
+
887
+ $months = array(
888
+ 'Jan' => 'January',
889
+ 'Feb' => 'February',
890
+ 'Mar' => 'March',
891
+ 'Apr' => 'April',
892
+ 'May' => 'May',
893
+ 'Jun' => 'June',
894
+ 'Jul' => 'July',
895
+ 'Aug' => 'August',
896
+ 'Sep' => 'September',
897
+ 'Oct' => 'October',
898
+ 'Nov' => 'November',
899
+ 'Dec' => 'December',
900
+ );
901
+ return apply_filters( 'wpforms_months', $months );
902
+ }
903
+
904
+ /**
905
+ * Calendar Days
906
+ *
907
+ * @since 1.3.7
908
+ * @return array
909
+ */
910
+ function wpforms_days() {
911
+
912
+ $days = array(
913
+ 'Sun' => 'Sunday',
914
+ 'Mon' => 'Monday',
915
+ 'Tue' => 'Tuesday',
916
+ 'Wed' => 'Wednesday',
917
+ 'Thu' => 'Thursday',
918
+ 'Fri' => 'Friday',
919
+ 'Sat' => 'Saturday',
920
+ );
921
+ return apply_filters( 'wpforms_days', $days );
922
+ }
923
+
924
  /**
925
  * Lookup user IP.
926
  *
964
  }
965
  }
966
 
967
+ /**
968
+ * Sanitizes error message, primarily used during form frontend output.
969
+ *
970
+ * @since 1.3.7
971
+ * @param string $error
972
+ * @return string
973
+ */
974
+ function wpforms_sanitize_error( $error = '' ) {
975
+
976
+ $allow = array(
977
+ 'a' => array(
978
+ 'href' => array(),
979
+ 'title' => array(),
980
+ ),
981
+ 'br' => array(),
982
+ 'em' => array(),
983
+ 'strong' => array(),
984
+ 'p' => array(),
985
+ );
986
+ return wp_kses( $error, $allow );
987
+ }
988
 
989
  /**
990
  * Detect if we should use a light or dark color based on the color given.
includes/providers/class-base.php CHANGED
@@ -706,18 +706,20 @@ abstract class WPForms_Provider {
706
 
707
  $output .= sprintf( '<select name="providers[%s][%s][list_id]">', $this->slug, $connection_id );
708
 
709
- foreach ( $lists as $list ) {
710
- $output .= sprintf(
711
- '<option value="%s" %s>%s</option>',
712
- esc_attr( $list['id'] ),
713
- selected( $selected, $list['id'], false ),
714
- esc_attr( $list['name'] )
715
- );
716
- }
 
 
717
 
718
  $output .= '</select>';
719
 
720
- $output .='</div>';
721
 
722
  return $output;
723
  }
@@ -1198,7 +1200,10 @@ abstract class WPForms_Provider {
1198
 
1199
  if ( is_wp_error( $auth ) ) {
1200
 
1201
- wp_send_json_error( array( 'error' => 'Could not connect to the provider.' ) );
 
 
 
1202
 
1203
  } else {
1204
 
@@ -1310,4 +1315,4 @@ abstract class WPForms_Provider {
1310
 
1311
  return new WP_Error( $this->slug . '-error', $message );
1312
  }
1313
- }
706
 
707
  $output .= sprintf( '<select name="providers[%s][%s][list_id]">', $this->slug, $connection_id );
708
 
709
+ if ( ! empty( $lists ) ) {
710
+ foreach ( $lists as $list ) {
711
+ $output .= sprintf(
712
+ '<option value="%s" %s>%s</option>',
713
+ esc_attr( $list['id'] ),
714
+ selected( $selected, $list['id'], false ),
715
+ esc_attr( $list['name'] )
716
+ );
717
+ }
718
+ }
719
 
720
  $output .= '</select>';
721
 
722
+ $output .= '</div>';
723
 
724
  return $output;
725
  }
1200
 
1201
  if ( is_wp_error( $auth ) ) {
1202
 
1203
+ wp_send_json_error( array(
1204
+ 'error' => 'Could not connect to the provider.',
1205
+ 'error_msg' => $auth->get_error_message(),
1206
+ ) );
1207
 
1208
  } else {
1209
 
1315
 
1316
  return new WP_Error( $this->slug . '-error', $message );
1317
  }
1318
+ }
includes/templates/class-base.php CHANGED
@@ -40,7 +40,7 @@ abstract class WPForms_Template {
40
  * @since 1.0.0
41
  * @var string
42
  */
43
- public $includes;
44
 
45
  /**
46
  * URL of the icon to display in the admin area.
@@ -48,7 +48,7 @@ abstract class WPForms_Template {
48
  * @since 1.0.0
49
  * @var string
50
  */
51
- public $icon;
52
 
53
  /**
54
  * Array of data that is assigned to the post_content on form creation.
40
  * @since 1.0.0
41
  * @var string
42
  */
43
+ public $includes = '';
44
 
45
  /**
46
  * URL of the icon to display in the admin area.
48
  * @since 1.0.0
49
  * @var string
50
  */
51
+ public $icon = '';
52
 
53
  /**
54
  * Array of data that is assigned to the post_content on form creation.
languages/wpforms.pot CHANGED
@@ -2,9 +2,9 @@
2
  # This file is distributed under the same license as the WPForms package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: WPForms 1.3.5\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wpforms\n"
7
- "POT-Creation-Date: 2017-02-22 22:15: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"
@@ -12,7 +12,7 @@ msgstr ""
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
14
 
15
- #: includes/admin/ajax-actions.php:24 includes/fields/class-base.php:714
16
  msgid "You do no have permission."
17
  msgstr ""
18
 
@@ -40,15 +40,47 @@ msgstr ""
40
  msgid "Error updating form template"
41
  msgstr ""
42
 
43
- #: includes/admin/ajax-actions.php:243 includes/fields/class-base.php:387
44
  msgid "post type"
45
  msgstr ""
46
 
47
- #: includes/admin/ajax-actions.php:262 includes/fields/class-base.php:394
48
  msgid "taxonomy"
49
  msgstr ""
50
 
51
- #: includes/admin/builder/class-builder.php:271
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  #: pro/includes/fields/class-date-time.php:229
53
  #: pro/includes/fields/class-date-time.php:231
54
  #: pro/includes/fields/class-date-time.php:452
@@ -56,7 +88,7 @@ msgstr ""
56
  msgid "DD"
57
  msgstr ""
58
 
59
- #: includes/admin/builder/class-builder.php:272
60
  #: pro/includes/fields/class-date-time.php:228
61
  #: pro/includes/fields/class-date-time.php:232
62
  #: pro/includes/fields/class-date-time.php:433
@@ -65,219 +97,261 @@ msgstr ""
65
  msgid "MM"
66
  msgstr ""
67
 
68
- #: includes/admin/builder/class-builder.php:273
69
  msgid ""
70
  "The {source} {type} contains over {limit} items ({total}). This may make the "
71
  "field difficult for your vistors to use and/or cause the form to be slow."
72
  msgstr ""
73
 
74
- #: includes/admin/builder/class-builder.php:274
75
  #: includes/admin/class-editor.php:96
76
  #: pro/includes/admin/entries/class-entries.php:994
77
  msgid "Cancel"
78
  msgstr ""
79
 
80
- #: includes/admin/builder/class-builder.php:275
81
  msgid "OK"
82
  msgstr ""
83
 
84
- #: includes/admin/builder/class-builder.php:276
85
  #: includes/admin/class-editor.php:70
86
  msgid "Close"
87
  msgstr ""
88
 
89
- #: includes/admin/builder/class-builder.php:277
90
  msgid ""
91
  "Due to form changes, conditional logic rules have been removed or updated:"
92
  msgstr ""
93
 
94
- #: includes/admin/builder/class-builder.php:278
95
  #: pro/includes/admin/entries/class-entries-table.php:176
96
  msgid "Field"
97
  msgstr ""
98
 
99
- #: includes/admin/builder/class-builder.php:279
100
  msgid "Field Locked"
101
  msgstr ""
102
 
103
- #: includes/admin/builder/class-builder.php:280
104
  msgid "This field cannot be deleted or duplicated."
105
  msgstr ""
106
 
107
- #: includes/admin/builder/class-builder.php:281
108
  msgid "Available Fields"
109
  msgstr ""
110
 
111
- #: includes/admin/builder/class-builder.php:282
112
  msgid "No fields available"
113
  msgstr ""
114
 
115
- #: includes/admin/builder/class-builder.php:283
116
  msgid "Heads up!"
117
  msgstr ""
118
 
119
- #: includes/admin/builder/class-builder.php:285
120
  msgid "No email fields"
121
  msgstr ""
122
 
123
- #: includes/admin/builder/class-builder.php:286
124
  msgid "Are you sure you want to delete this notification?"
125
  msgstr ""
126
 
127
- #: includes/admin/builder/class-builder.php:287
128
  msgid "Enter a notification name"
129
  msgstr ""
130
 
131
- #: includes/admin/builder/class-builder.php:288
132
  msgid "Eg: User Confirmation"
133
  msgstr ""
134
 
135
- #: includes/admin/builder/class-builder.php:289
136
  msgid "You must provide a notification name"
137
  msgstr ""
138
 
139
- #: includes/admin/builder/class-builder.php:290
140
  msgid ""
141
  "Form must contain one notification. To disable all notifications use the "
142
  "setting Notifications dropdown setting."
143
  msgstr ""
144
 
145
- #: includes/admin/builder/class-builder.php:291
146
- #: lite/includes/admin/class-settings.php:131
147
- #: pro/includes/admin/class-settings.php:135
148
  msgid "Saving ..."
149
  msgstr ""
150
 
151
- #: includes/admin/builder/class-builder.php:292
152
  msgid "Saved!"
153
  msgstr ""
154
 
155
- #: includes/admin/builder/class-builder.php:293
156
  msgid "Save and Exit"
157
  msgstr ""
158
 
159
- #: includes/admin/builder/class-builder.php:294
160
- #: includes/admin/builder/class-builder.php:357
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
161
  msgid "Loading"
162
  msgstr ""
163
 
164
- #: includes/admin/builder/class-builder.php:300
165
  msgid "Use Template"
166
  msgstr ""
167
 
168
- #: includes/admin/builder/class-builder.php:301
169
  msgid ""
170
  "Changing templates on an existing form will DELETE existing form fields. Are "
171
  "you sure you want apply the new template?"
172
  msgstr ""
173
 
174
- #: includes/admin/builder/class-builder.php:302
175
  msgid ""
176
  "You are almost done. To embed this form on your site, please paste the "
177
  "following shortcode inside a post or page."
178
  msgstr ""
179
 
180
- #: includes/admin/builder/class-builder.php:303
181
  msgid "Or you can follow the instructions in this video."
182
  msgstr ""
183
 
184
- #: includes/admin/builder/class-builder.php:304
185
- #: includes/admin/builder/class-builder.php:407
186
  msgid "Exit"
187
  msgstr ""
188
 
189
- #: includes/admin/builder/class-builder.php:306
190
  msgid "If you exit without saving, your changes will be lost."
191
  msgstr ""
192
 
193
- #: includes/admin/builder/class-builder.php:307
194
  msgid "Are you sure you want to delete this field?"
195
  msgstr ""
196
 
197
- #: includes/admin/builder/class-builder.php:308
198
  msgid "Are you sure you want to duplicate this field?"
199
  msgstr ""
200
 
201
- #: includes/admin/builder/class-builder.php:309
202
  msgid "(copy)"
203
  msgstr ""
204
 
205
- #: includes/admin/builder/class-builder.php:310
206
  msgid "Please enter a form title."
207
  msgstr ""
208
 
209
- #: includes/admin/builder/class-builder.php:311
210
  msgid "This item must contain at least one choice."
211
  msgstr ""
212
 
213
- #: includes/admin/builder/class-builder.php:312
214
- #: includes/fields/class-base.php:239 includes/fields/class-base.php:570
215
- #: lite/wpforms-lite.php:78 pro/wpforms-pro.php:263
216
  msgid "Off"
217
  msgstr ""
218
 
219
- #: includes/admin/builder/class-builder.php:313
220
- #: includes/fields/class-base.php:239 lite/wpforms-lite.php:77
221
- #: pro/wpforms-pro.php:262
222
  msgid "On"
223
  msgstr ""
224
 
225
- #: includes/admin/builder/class-builder.php:314
226
  #: includes/templates/class-suggestion.php:59
227
  msgid "Other"
228
  msgstr ""
229
 
230
- #: includes/admin/builder/class-builder.php:315 includes/class-frontend.php:492
231
- #: pro/includes/fields/class-page-break.php:144
 
232
  msgid "Previous"
233
  msgstr ""
234
 
235
- #: includes/admin/builder/class-builder.php:318
236
- #: includes/admin/builder/functions.php:246 includes/fields/class-base.php:471
237
  msgid "Show Smart Tags"
238
  msgstr ""
239
 
240
- #: includes/admin/builder/class-builder.php:319
241
  msgid "Hide Smart Tags"
242
  msgstr ""
243
 
244
- #: includes/admin/builder/class-builder.php:320
245
  msgid "-- Select Field --"
246
  msgstr ""
247
 
248
- #: includes/admin/builder/class-builder.php:321
249
- #: pro/includes/class-provider.php:945
250
  msgid "-- Select Choice --"
251
  msgstr ""
252
 
253
- #: includes/admin/builder/class-builder.php:380
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
254
  msgid "Now editing"
255
  msgstr ""
256
 
257
- #: includes/admin/builder/class-builder.php:390
258
  #: pro/includes/admin/entries/class-entries.php:512
259
  msgid "Preview Form"
260
  msgstr ""
261
 
262
- #: includes/admin/builder/class-builder.php:392
263
  #: includes/admin/overview/class-overview-table.php:159
264
  msgid "Preview"
265
  msgstr ""
266
 
267
- #: includes/admin/builder/class-builder.php:395
268
  msgid "Embed Form"
269
  msgstr ""
270
 
271
- #: includes/admin/builder/class-builder.php:397
272
  msgid "Embed"
273
  msgstr ""
274
 
275
- #: includes/admin/builder/class-builder.php:400
276
  msgid "Save Form"
277
  msgstr ""
278
 
279
- #: includes/admin/builder/class-builder.php:402
280
- #: pro/includes/admin/class-settings.php:451
281
  msgid "Save"
282
  msgstr ""
283
 
@@ -329,40 +403,98 @@ msgid "You don't have any fields yet. Add some!"
329
  msgstr ""
330
 
331
  #: includes/admin/builder/panels/class-fields.php:252
332
- #: includes/fields/class-base.php:750
333
  msgid "Duplicate Field"
334
  msgstr ""
335
 
336
  #: includes/admin/builder/panels/class-fields.php:254
337
- #: includes/fields/class-base.php:751
338
  msgid "Delete Field"
339
  msgstr ""
340
 
341
  #: includes/admin/builder/panels/class-fields.php:256
342
- #: includes/fields/class-base.php:752
343
  msgid "Click to edit. Drag to reorder."
344
  msgstr ""
345
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
346
  #: includes/admin/builder/panels/class-settings.php:21
347
- #: includes/admin/class-menu.php:81 lite/includes/admin/class-settings.php:398
348
- #: pro/includes/admin/class-settings.php:709
349
  msgid "Settings"
350
  msgstr ""
351
 
352
  #: includes/admin/builder/panels/class-settings.php:57
353
  #: includes/admin/builder/panels/class-settings.php:87
354
- #: lite/includes/admin/class-settings.php:152
355
- #: pro/includes/admin/class-settings.php:156
356
  msgid "General"
357
  msgstr ""
358
 
359
  #: includes/admin/builder/panels/class-settings.php:58 lite/wpforms-lite.php:63
360
- #: lite/wpforms-lite.php:73 pro/wpforms-pro.php:249 pro/wpforms-pro.php:258
361
  msgid "Notifications"
362
  msgstr ""
363
 
364
  #: includes/admin/builder/panels/class-settings.php:59
365
- #: includes/admin/builder/panels/class-settings.php:176
366
  msgid "Confirmation"
367
  msgstr ""
368
 
@@ -422,45 +554,49 @@ msgstr ""
422
  msgid "Enable anti-spam honeypot"
423
  msgstr ""
424
 
425
- #: includes/admin/builder/panels/class-settings.php:158
426
- msgid "Enable reCAPTCHA"
 
 
 
 
427
  msgstr ""
428
 
429
- #: includes/admin/builder/panels/class-settings.php:183
430
  msgid "Confirmation Type"
431
  msgstr ""
432
 
433
- #: includes/admin/builder/panels/class-settings.php:187
434
  #: includes/templates/class-suggestion.php:74 lite/wpforms-lite.php:191
435
- #: pro/wpforms-pro.php:382
436
  msgid "Message"
437
  msgstr ""
438
 
439
- #: includes/admin/builder/panels/class-settings.php:188
440
  msgid "Show Page"
441
  msgstr ""
442
 
443
- #: includes/admin/builder/panels/class-settings.php:189
444
  msgid "Go to URL (Redirect)"
445
  msgstr ""
446
 
447
- #: includes/admin/builder/panels/class-settings.php:198
448
  msgid "Confirmation Message"
449
  msgstr ""
450
 
451
- #: includes/admin/builder/panels/class-settings.php:200
452
  msgid "Thanks for contacting us! We will be in touch with you shortly."
453
  msgstr ""
454
 
455
- #: includes/admin/builder/panels/class-settings.php:211
456
  msgid "Automatically scroll to the confirmation message"
457
  msgstr ""
458
 
459
- #: includes/admin/builder/panels/class-settings.php:224
460
  msgid "Confirmation Page"
461
  msgstr ""
462
 
463
- #: includes/admin/builder/panels/class-settings.php:232
464
  msgid "Confirmation Redirect URL"
465
  msgstr ""
466
 
@@ -529,12 +665,13 @@ msgid ""
529
  "a>?"
530
  msgstr ""
531
 
532
- #. #-#-#-#-# wpforms.pot (WPForms 1.3.5) #-#-#-#-#
533
  #. Plugin Name of the plugin/theme
534
- #. #-#-#-#-# wpforms.pot (WPForms 1.3.5) #-#-#-#-#
535
  #. Author of the plugin/theme
536
  #: includes/admin/class-menu.php:36 includes/admin/class-menu.php:37
537
- #: includes/admin/class-menu.php:48 includes/integrations.php:34
 
538
  msgid "WPForms"
539
  msgstr ""
540
 
@@ -548,7 +685,7 @@ msgstr ""
548
 
549
  #: includes/admin/class-menu.php:59
550
  #: includes/admin/overview/class-overview.php:148
551
- #: pro/includes/class-provider.php:1084
552
  msgid "Add New"
553
  msgstr ""
554
 
@@ -558,7 +695,7 @@ msgstr ""
558
 
559
  #: includes/admin/class-menu.php:69
560
  #: includes/admin/overview/class-overview-table.php:152
561
- #: pro/includes/admin/entries/class-entries.php:411 pro/wpforms-pro.php:202
562
  msgid "Entries"
563
  msgstr ""
564
 
@@ -566,11 +703,15 @@ msgstr ""
566
  msgid "WPForms Settings"
567
  msgstr ""
568
 
569
- #: includes/admin/class-menu.php:90
 
 
 
 
570
  msgid "WPForms Addons"
571
  msgstr ""
572
 
573
- #: includes/admin/class-menu.php:91
574
  msgid "Addons"
575
  msgstr ""
576
 
@@ -608,7 +749,7 @@ msgstr ""
608
 
609
  #: includes/admin/class-welcome.php:121
610
  msgid ""
611
- "WPForms make it easy to create forms in WordPress. You can follow the video "
612
  "tutorial on the right or read our how to <a href=\"%s\" target=\"_blank\" "
613
  "rel=\"noopener\">create your first form guide</a>."
614
  msgstr ""
@@ -634,13 +775,13 @@ msgid "See all Features"
634
  msgstr ""
635
 
636
  #: includes/admin/overview/class-overview-table.php:53
637
- #: includes/fields/class-name.php:21 includes/fields/class-name.php:74
638
  #: includes/templates/class-contact.php:32
 
639
  #: includes/templates/class-suggestion.php:32
640
  #: pro/includes/templates/class-donation.php:35
641
  #: pro/includes/templates/class-order.php:35
642
  #: pro/includes/templates/class-request-quote.php:32
643
- #: pro/includes/templates/class-subscribe.php:35
644
  msgid "Name"
645
  msgstr ""
646
 
@@ -722,12 +863,57 @@ msgstr ""
722
  msgid "Forms Overview"
723
  msgstr ""
724
 
725
- #: includes/class-frontend.php:294
726
- msgid "Step"
 
727
  msgstr ""
728
 
729
- #: includes/class-frontend.php:295
730
- msgid "of"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
731
  msgstr ""
732
 
733
  #: includes/class-logging.php:38
@@ -765,8 +951,8 @@ msgstr ""
765
 
766
  #: includes/class-preview.php:174
767
  msgid ""
768
- "The page is set to private, so it is not publically accessible. Please do "
769
- "not delete this page :) ."
770
  msgstr ""
771
 
772
  #: includes/class-preview.php:179
@@ -774,7 +960,7 @@ msgid "WPForms Preview"
774
  msgstr ""
775
 
776
  #: includes/class-preview.php:261
777
- msgid "This is a preview of your form. This page is not publically accessible."
778
  msgstr ""
779
 
780
  #: includes/class-preview.php:263
@@ -806,7 +992,7 @@ msgid "WPForms honeypot field triggered."
806
  msgstr ""
807
 
808
  #: includes/class-process.php:340 lite/wpforms-lite.php:55
809
- #: pro/wpforms-pro.php:242
810
  msgid "New %s Entry"
811
  msgstr ""
812
 
@@ -897,7 +1083,7 @@ msgstr ""
897
  msgid "Lost Password URL"
898
  msgstr ""
899
 
900
- #: includes/class-widget.php:127 pro/includes/admin/class-settings.php:534
901
  msgid "No forms"
902
  msgstr ""
903
 
@@ -915,7 +1101,13 @@ msgid ""
915
  "reached"
916
  msgstr ""
917
 
918
- #: includes/emails/class-emails.php:421 includes/emails/class-emails.php:443
 
 
 
 
 
 
919
  msgid "Field ID #"
920
  msgstr ""
921
 
@@ -923,67 +1115,69 @@ msgstr ""
923
  msgid "Sent from <a href=\"%s\" style=\"color:#bbbbbb;\">%s</a>"
924
  msgstr ""
925
 
926
- #: includes/fields/class-base.php:299
927
  msgid ""
928
  "Enter text for the form field label. Field labels are recommended and can be "
929
  "hidden in the Advanced Settings."
930
  msgstr ""
931
 
932
- #: includes/fields/class-base.php:300
933
  msgid "Label"
934
  msgstr ""
935
 
936
- #: includes/fields/class-base.php:309
937
  msgid "Enter text for the form field description."
938
  msgstr ""
939
 
940
- #: includes/fields/class-base.php:310
941
  msgid "Description"
942
  msgstr ""
943
 
944
- #: includes/fields/class-base.php:320
945
  msgid ""
946
  "Check this option to mark the field required. A form will not submit unless "
947
  "all required fields are provided."
948
  msgstr ""
949
 
950
- #: includes/fields/class-base.php:321
 
 
951
  msgid "Required"
952
  msgstr ""
953
 
954
- #: includes/fields/class-base.php:337
955
  msgid "Enter code for the form field."
956
  msgstr ""
957
 
958
- #: includes/fields/class-base.php:338
959
  msgid "Code"
960
  msgstr ""
961
 
962
- #: includes/fields/class-base.php:347 includes/fields/class-base.php:419
963
  msgid "Add choices for the form field."
964
  msgstr ""
965
 
966
- #: includes/fields/class-base.php:359
967
  msgid "Choices"
968
  msgstr ""
969
 
970
- #: includes/fields/class-base.php:401
971
  msgid ""
972
  "Choices are dynamically populated from the <span class=\"dynamic-name\">%s</"
973
  "span> <span class=\"dynamic-type\">%s</span>"
974
  msgstr ""
975
 
976
- #: includes/fields/class-base.php:428
977
  msgid "Items"
978
  msgstr ""
979
 
980
- #: includes/fields/class-base.php:470
981
  msgid "Enter text for the default form field value."
982
  msgstr ""
983
 
984
- #: includes/fields/class-base.php:472 includes/fields/class-name.php:81
985
- #: includes/fields/class-name.php:96 includes/fields/class-name.php:111
986
- #: includes/fields/class-name.php:126 pro/includes/fields/class-address.php:117
987
  #: pro/includes/fields/class-address.php:133
988
  #: pro/includes/fields/class-address.php:151
989
  #: pro/includes/fields/class-address.php:166
@@ -992,128 +1186,128 @@ msgstr ""
992
  msgid "Default Value"
993
  msgstr ""
994
 
995
- #: includes/fields/class-base.php:482
996
  msgid "Select the default form field size."
997
  msgstr ""
998
 
999
- #: includes/fields/class-base.php:484
1000
  msgid "Small"
1001
  msgstr ""
1002
 
1003
- #: includes/fields/class-base.php:485
1004
  msgid "Medium"
1005
  msgstr ""
1006
 
1007
- #: includes/fields/class-base.php:486
1008
  msgid "Large"
1009
  msgstr ""
1010
 
1011
- #: includes/fields/class-base.php:488
1012
  msgid "Field Size"
1013
  msgstr ""
1014
 
1015
- #: includes/fields/class-base.php:501
1016
  msgid "Advanced Options"
1017
  msgstr ""
1018
 
1019
- #: includes/fields/class-base.php:512
1020
  msgid "Enter text for the form field placeholder."
1021
  msgstr ""
1022
 
1023
- #: includes/fields/class-base.php:513
1024
  msgid "Placeholder Text"
1025
  msgstr ""
1026
 
1027
- #: includes/fields/class-base.php:522
1028
  msgid ""
1029
  "Enter CSS class names for the form field container. Class names should be "
1030
  "separated with spaces."
1031
  msgstr ""
1032
 
1033
- #: includes/fields/class-base.php:524
1034
  msgid "CSS Classes"
1035
  msgstr ""
1036
 
1037
- #: includes/fields/class-base.php:533
1038
  msgid "Check this option to hide the form field label."
1039
  msgstr ""
1040
 
1041
- #: includes/fields/class-base.php:535
1042
  msgid "Hide Label"
1043
  msgstr ""
1044
 
1045
- #: includes/fields/class-base.php:543
1046
  msgid "Check this option to hide the form field sub-label."
1047
  msgstr ""
1048
 
1049
- #: includes/fields/class-base.php:545
1050
  msgid "Hide Sub-Labels"
1051
  msgstr ""
1052
 
1053
- #: includes/fields/class-base.php:553
1054
  msgid "Select the layout for displaying field choices."
1055
  msgstr ""
1056
 
1057
- #: includes/fields/class-base.php:555
1058
  msgid "One Column"
1059
  msgstr ""
1060
 
1061
- #: includes/fields/class-base.php:556
1062
  msgid "Two Columns"
1063
  msgstr ""
1064
 
1065
- #: includes/fields/class-base.php:557
1066
  msgid "Three Columns"
1067
  msgstr ""
1068
 
1069
- #: includes/fields/class-base.php:559
1070
  msgid "Choice Layout"
1071
  msgstr ""
1072
 
1073
- #: includes/fields/class-base.php:568
1074
  msgid "Select auto-populate method to use."
1075
  msgstr ""
1076
 
1077
- #: includes/fields/class-base.php:571 includes/fields/class-base.php:590
1078
  msgid "Post Type"
1079
  msgstr ""
1080
 
1081
- #: includes/fields/class-base.php:572 includes/fields/class-base.php:596
1082
  msgid "Taxonomy"
1083
  msgstr ""
1084
 
1085
- #: includes/fields/class-base.php:574
1086
  msgid "Dynamic Choices"
1087
  msgstr ""
1088
 
1089
- #: includes/fields/class-base.php:601
1090
  msgid "Select %s to use for auto-populating field choices."
1091
  msgstr ""
1092
 
1093
- #: includes/fields/class-base.php:602
1094
  msgid "Dynamic %s Source"
1095
  msgstr ""
1096
 
1097
- #: includes/fields/class-base.php:718
1098
  msgid "No form ID found"
1099
  msgstr ""
1100
 
1101
- #: includes/fields/class-base.php:722
1102
  msgid "No field type found"
1103
  msgstr ""
1104
 
1105
- #: includes/fields/class-base.php:798 includes/fields/class-name.php:311
1106
- #: includes/fields/class-number.php:132
1107
  #: pro/includes/fields/class-address.php:624
1108
  #: pro/includes/fields/class-date-time.php:532
1109
- #: pro/includes/fields/class-file-upload.php:356
1110
  #: pro/includes/fields/class-password.php:296
1111
  #: pro/includes/fields/class-password.php:304
1112
  #: pro/includes/fields/class-password.php:309
1113
  #: pro/includes/fields/class-payment-dropdown.php:208
1114
  #: pro/includes/fields/class-payment-multiple.php:175
1115
  #: pro/includes/fields/class-payment-single.php:189
1116
- #: pro/includes/fields/class-url.php:126
1117
  msgid "This field is required"
1118
  msgstr ""
1119
 
@@ -1145,81 +1339,96 @@ msgstr ""
1145
  msgid "Show Values"
1146
  msgstr ""
1147
 
1148
- #: includes/fields/class-checkbox.php:164 includes/fields/class-radio.php:164
1149
- #: includes/fields/class-select.php:170
1150
- msgid "(empty)"
1151
- msgstr ""
1152
-
1153
  #: includes/fields/class-checkbox.php:181 includes/fields/class-radio.php:181
1154
  msgid ""
1155
  "Showing the first 20 choices.<br> All %d choices will be displayed when "
1156
  "viewing the form."
1157
  msgstr ""
1158
 
1159
- #: includes/fields/class-email.php:21 includes/fields/class-email.php:164
1160
- #: includes/fields/class-email.php:246
1161
- #: lite/includes/admin/class-settings.php:236
1162
- #: pro/includes/admin/class-settings.php:301
 
 
 
1163
  #: pro/includes/templates/class-donation.php:42
1164
  #: pro/includes/templates/class-order.php:42
1165
  #: pro/includes/templates/class-request-quote.php:46
1166
- #: pro/includes/templates/class-subscribe.php:42
1167
  msgid "Email"
1168
  msgstr ""
1169
 
1170
- #: includes/fields/class-email.php:64
 
 
 
 
 
 
 
 
1171
  msgid "Enable Email Confirmation"
1172
  msgstr ""
1173
 
1174
- #: includes/fields/class-email.php:65
1175
  msgid "Check this option ask the user to provide their email address twice."
1176
  msgstr ""
1177
 
1178
- #: includes/fields/class-email.php:93 pro/includes/fields/class-password.php:91
 
1179
  msgid "Confirmation Placeholder Text"
1180
  msgstr ""
1181
 
1182
- #: includes/fields/class-email.php:94 pro/includes/fields/class-password.php:92
 
1183
  msgid "Enter text for the confirmation field placeholder."
1184
  msgstr ""
1185
 
1186
- #: includes/fields/class-email.php:169 includes/fields/class-email.php:272
1187
- msgid "Confirm Email"
 
1188
  msgstr ""
1189
 
1190
- #: includes/fields/class-email.php:263
1191
- msgid "Email does not match."
 
 
 
 
 
 
1192
  msgstr ""
1193
 
1194
- #: includes/fields/class-name.php:47
 
 
 
 
 
 
 
 
1195
  msgid "Select format to use for the name form field"
1196
  msgstr ""
1197
 
1198
- #: includes/fields/class-name.php:49
1199
  msgid "Simple"
1200
  msgstr ""
1201
 
1202
- #: includes/fields/class-name.php:50
1203
  msgid "First Last"
1204
  msgstr ""
1205
 
1206
- #: includes/fields/class-name.php:51
1207
  msgid "First Middle Last"
1208
  msgstr ""
1209
 
1210
- #: includes/fields/class-name.php:53 pro/includes/fields/class-date-time.php:56
1211
- #: pro/includes/fields/class-date-time.php:132
1212
- #: pro/includes/fields/class-date-time.php:168
1213
- #: pro/includes/fields/class-phone.php:50
1214
- msgid "Format"
1215
- msgstr ""
1216
-
1217
- #: includes/fields/class-name.php:74
1218
  msgid "Name field advanced options."
1219
  msgstr ""
1220
 
1221
- #: includes/fields/class-name.php:77 includes/fields/class-name.php:92
1222
- #: includes/fields/class-name.php:107 includes/fields/class-name.php:122
1223
  #: pro/includes/fields/class-address.php:113
1224
  #: pro/includes/fields/class-address.php:129
1225
  #: pro/includes/fields/class-address.php:147
@@ -1231,53 +1440,34 @@ msgstr ""
1231
  msgid "Placeholder"
1232
  msgstr ""
1233
 
1234
- #: includes/fields/class-name.php:89
1235
  msgid "First Name"
1236
  msgstr ""
1237
 
1238
- #: includes/fields/class-name.php:89
1239
  msgid "First name field advanced options."
1240
  msgstr ""
1241
 
1242
- #: includes/fields/class-name.php:104
1243
  msgid "Middle Name"
1244
  msgstr ""
1245
 
1246
- #: includes/fields/class-name.php:104
1247
  msgid "Middle name field advanced options."
1248
  msgstr ""
1249
 
1250
- #: includes/fields/class-name.php:119
1251
  msgid "Last Name"
1252
  msgstr ""
1253
 
1254
- #: includes/fields/class-name.php:119
1255
  msgid "Last name field advanced options."
1256
  msgstr ""
1257
 
1258
- #: includes/fields/class-name.php:160 includes/fields/class-name.php:242
1259
- #: pro/includes/class-provider.php:447
1260
- msgid "First"
1261
- msgstr ""
1262
-
1263
- #: includes/fields/class-name.php:164 includes/fields/class-name.php:260
1264
- #: pro/includes/class-provider.php:459
1265
- msgid "Middle"
1266
- msgstr ""
1267
-
1268
- #: includes/fields/class-name.php:168 includes/fields/class-name.php:287
1269
- #: pro/includes/class-provider.php:471
1270
- msgid "Last"
1271
- msgstr ""
1272
-
1273
  #: includes/fields/class-number.php:21
1274
  msgid "Numbers"
1275
  msgstr ""
1276
 
1277
- #: includes/fields/class-number.php:137
1278
- msgid "Please enter a valid number."
1279
- msgstr ""
1280
-
1281
  #: includes/fields/class-radio.php:21
1282
  msgid "Multiple Choice"
1283
  msgstr ""
@@ -1346,6 +1536,360 @@ msgstr ""
1346
  msgid "Would you like to display the forms description?"
1347
  msgstr ""
1348
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1349
  #: includes/templates/class-blank.php:20
1350
  msgid "Blank Form"
1351
  msgstr ""
@@ -1358,11 +1902,11 @@ msgstr ""
1358
 
1359
  #: includes/templates/class-blank.php:32
1360
  #: includes/templates/class-contact.php:63
 
1361
  #: includes/templates/class-suggestion.php:88
1362
  #: pro/includes/templates/class-donation.php:65
1363
  #: pro/includes/templates/class-order.php:99
1364
  #: pro/includes/templates/class-request-quote.php:69
1365
- #: pro/includes/templates/class-subscribe.php:50
1366
  msgid "Sending..."
1367
  msgstr ""
1368
 
@@ -1387,6 +1931,26 @@ msgstr ""
1387
  msgid "Comment or Message"
1388
  msgstr ""
1389
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1390
  #: includes/templates/class-suggestion.php:20
1391
  msgid "Suggestion Form"
1392
  msgstr ""
@@ -1457,232 +2021,292 @@ msgid ""
1457
  "from the WPForms team!"
1458
  msgstr ""
1459
 
1460
- #: lite/includes/admin/class-settings.php:132
1461
- #: pro/includes/admin/class-settings.php:136
1462
  msgid "Are you sure you want to disconnect this account?"
1463
  msgstr ""
1464
 
1465
- #: lite/includes/admin/class-settings.php:133
1466
- #: pro/includes/admin/class-settings.php:137
1467
  msgid "Upload or Choose Your Image"
1468
  msgstr ""
1469
 
1470
- #: lite/includes/admin/class-settings.php:134
1471
- #: pro/includes/admin/class-settings.php:138
1472
  msgid "Use Image"
1473
  msgstr ""
1474
 
1475
- #: lite/includes/admin/class-settings.php:153
1476
- msgid "System Information"
 
1477
  msgstr ""
1478
 
1479
- #: lite/includes/admin/class-settings.php:176
1480
- #: pro/includes/admin/class-settings.php:183
1481
- #: pro/includes/admin/class-settings.php:403
 
 
 
 
 
1482
  msgid "Settings check failed."
1483
  msgstr ""
1484
 
1485
- #: lite/includes/admin/class-settings.php:197
1486
- #: pro/includes/admin/class-settings.php:204
1487
  msgid "General settings updated."
1488
  msgstr ""
1489
 
1490
- #: lite/includes/admin/class-settings.php:213
1491
- #: pro/includes/admin/class-settings.php:278
1492
  msgid "Include Form Styling"
1493
  msgstr ""
1494
 
1495
- #: lite/includes/admin/class-settings.php:217
1496
- #: pro/includes/admin/class-settings.php:282
1497
  msgid "Base and form theme styling"
1498
  msgstr ""
1499
 
1500
- #: lite/includes/admin/class-settings.php:218
1501
- #: pro/includes/admin/class-settings.php:283
1502
  msgid "Base styling only"
1503
  msgstr ""
1504
 
1505
- #: lite/includes/admin/class-settings.php:219
1506
- #: pro/includes/admin/class-settings.php:284
1507
- #: pro/includes/fields/class-page-break.php:58
1508
  msgid "None"
1509
  msgstr ""
1510
 
1511
- #: lite/includes/admin/class-settings.php:221
1512
- #: pro/includes/admin/class-settings.php:286
1513
  msgid "Determines which CSS files to load for the site."
1514
  msgstr ""
1515
 
1516
- #: lite/includes/admin/class-settings.php:226
1517
- #: pro/includes/admin/class-settings.php:291
1518
  msgid "Load Assets Globally"
1519
  msgstr ""
1520
 
1521
- #: lite/includes/admin/class-settings.php:230
1522
- #: pro/includes/admin/class-settings.php:295
1523
  msgid ""
1524
  "Check this if you would like to load WPForms assets site-wide. Only check if "
1525
  "your site is having compatibility issues or instructed to by support."
1526
  msgstr ""
1527
 
1528
- #: lite/includes/admin/class-settings.php:241
1529
- #: pro/includes/admin/class-settings.php:306
1530
  msgid "Email Template"
1531
  msgstr ""
1532
 
1533
- #: lite/includes/admin/class-settings.php:245
1534
- #: pro/includes/admin/class-settings.php:310
1535
  msgid "Default HTML template"
1536
  msgstr ""
1537
 
1538
- #: lite/includes/admin/class-settings.php:246
1539
- #: pro/includes/admin/class-settings.php:311
1540
  msgid "Plain Text"
1541
  msgstr ""
1542
 
1543
- #: lite/includes/admin/class-settings.php:248
1544
- #: pro/includes/admin/class-settings.php:313
1545
  msgid "Determines how email notifications will be formatted."
1546
  msgstr ""
1547
 
1548
- #: lite/includes/admin/class-settings.php:253
1549
- #: pro/includes/admin/class-settings.php:318
1550
  msgid "Email Header Image "
1551
  msgstr ""
1552
 
1553
- #: lite/includes/admin/class-settings.php:265
1554
- #: pro/includes/admin/class-settings.php:330
1555
  msgid "Upload Image"
1556
  msgstr ""
1557
 
1558
- #: lite/includes/admin/class-settings.php:267
1559
- #: pro/includes/admin/class-settings.php:332
1560
  msgid ""
1561
  "Upload or choose a logo to be displayed at the top of email notifications."
1562
  msgstr ""
1563
 
1564
- #: lite/includes/admin/class-settings.php:268
1565
- #: pro/includes/admin/class-settings.php:333
1566
  msgid "Recommended size is 300x100 or smaller for best support on all devices."
1567
  msgstr ""
1568
 
1569
- #: lite/includes/admin/class-settings.php:274
1570
- #: pro/includes/admin/class-settings.php:339
1571
  msgid "Email Background Color"
1572
  msgstr ""
1573
 
1574
- #: lite/includes/admin/class-settings.php:278
1575
- #: pro/includes/admin/class-settings.php:343
1576
  msgid "Customize the background color of the HTML email template."
1577
  msgstr ""
1578
 
1579
- #: lite/includes/admin/class-settings.php:283
1580
- #: pro/includes/admin/class-settings.php:348
1581
  msgid "Email Carbon Copy"
1582
  msgstr ""
1583
 
1584
- #: lite/includes/admin/class-settings.php:287
1585
- #: pro/includes/admin/class-settings.php:352
1586
- msgid ""
1587
- "Check this if you would like to enable the ability to CC: email addresses in "
1588
- "the form notification settings."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1589
  msgstr ""
1590
 
1591
- #: lite/includes/admin/class-settings.php:293
1592
- #: pro/includes/admin/class-settings.php:358
1593
- msgid "reCAPTCHA"
1594
  msgstr ""
1595
 
1596
- #: lite/includes/admin/class-settings.php:294
1597
- #: pro/includes/admin/class-settings.php:359
1598
- msgid ""
1599
- "reCAPTCHA is a free anti-spam service from Google. Its helps protect your "
1600
- "website from spam and abuse while letting real people pass through with "
1601
- "ease. <a href=\"http://www.google.com/recaptcha/intro/index.html\" target="
1602
- "\"_blank\" rel=\"noopener\">Visit reCAPTCHA</a> to learn more and sign up "
1603
- "for a free account or <a href=\"https://wpforms.com/docs/setup-captcha-"
1604
- "wpforms/\" target=\"_blank\" rel=\"noopener\">read our walk through</a> for "
1605
- "step-by-step directions."
1606
  msgstr ""
1607
 
1608
- #: lite/includes/admin/class-settings.php:299
1609
- #: pro/includes/admin/class-settings.php:364
1610
- msgid "reCAPTCHA Site key"
1611
  msgstr ""
1612
 
1613
- #: lite/includes/admin/class-settings.php:307
1614
- #: pro/includes/admin/class-settings.php:372
1615
- msgid "reCAPTCHA Secret key"
1616
  msgstr ""
1617
 
1618
- #: lite/includes/admin/class-settings.php:316
1619
- #: pro/includes/admin/class-settings.php:381
1620
- msgid "Save General Settings"
 
 
 
1621
  msgstr ""
1622
 
1623
- #: lite/includes/admin/class-settings.php:428
1624
- #: lite/includes/admin/class-settings.php:432
1625
- #: pro/includes/admin/class-settings.php:739
1626
- #: pro/includes/admin/class-settings.php:743
1627
  #: pro/includes/admin/entries/class-entries.php:1105
1628
  #: pro/includes/admin/entries/class-entries.php:1427
1629
  msgid "M j, Y @ g:ia"
1630
  msgstr ""
1631
 
1632
- #: lite/wpforms-lite.php:86 pro/wpforms-pro.php:270
1633
  msgid "Default Notification"
1634
  msgstr ""
1635
 
1636
- #: lite/wpforms-lite.php:94 pro/wpforms-pro.php:285
1637
  msgid "Send To Email Address"
1638
  msgstr ""
1639
 
1640
- #: lite/wpforms-lite.php:97 pro/wpforms-pro.php:288
1641
  msgid ""
1642
  "Enter the email address to receive form entry notifications. For multiple "
1643
  "notifications, separate email addresses with a comma."
1644
  msgstr ""
1645
 
1646
- #: lite/wpforms-lite.php:113 pro/wpforms-pro.php:304
1647
  msgid "CC"
1648
  msgstr ""
1649
 
1650
- #: lite/wpforms-lite.php:129 pro/wpforms-pro.php:320
1651
  msgid "Email Subject"
1652
  msgstr ""
1653
 
1654
- #: lite/wpforms-lite.php:131 pro/wpforms-pro.php:322
1655
  msgid "New Entry: "
1656
  msgstr ""
1657
 
1658
- #: lite/wpforms-lite.php:144 pro/wpforms-pro.php:335
1659
  msgid "From Name"
1660
  msgstr ""
1661
 
1662
- #: lite/wpforms-lite.php:160 pro/wpforms-pro.php:351
1663
  msgid "From Email"
1664
  msgstr ""
1665
 
1666
- #: lite/wpforms-lite.php:176 pro/wpforms-pro.php:367
1667
  msgid "Reply-To"
1668
  msgstr ""
1669
 
1670
- #: lite/wpforms-lite.php:201 pro/wpforms-pro.php:392
1671
  msgid ""
1672
  "To display all form fields, use the <code>{all_fields}</code> Smart Tag."
1673
  msgstr ""
1674
 
1675
- #: lite/wpforms-lite.php:446
1676
  msgid "is a PRO Feature"
1677
  msgstr ""
1678
 
1679
- #: lite/wpforms-lite.php:447
1680
  msgid ""
1681
  "We're sorry, %name% is not available on your plan.<br><br>Please upgrade to "
1682
  "the PRO plan to unlock all these awesome features."
1683
  msgstr ""
1684
 
1685
- #: lite/wpforms-lite.php:448
1686
  msgid "Upgrade to PRO"
1687
  msgstr ""
1688
 
@@ -1716,17 +2340,10 @@ msgid "Addon installed."
1716
  msgstr ""
1717
 
1718
  #: pro/includes/admin/builder/panels/class-payments.php:21
1719
- #: pro/includes/admin/class-settings.php:157
1720
  msgid "Payments"
1721
  msgstr ""
1722
 
1723
- #: pro/includes/admin/builder/panels/class-payments.php:60
1724
- #: pro/includes/admin/builder/panels/class-providers.php:97
1725
- msgid ""
1726
- "You need to <a href=\"#\" class=\"wpforms-panel-switch\" data-panel=\"setup"
1727
- "\">setup your form</a> before you can manage these settings."
1728
- msgstr ""
1729
-
1730
  #: pro/includes/admin/builder/panels/class-payments.php:69
1731
  msgid "Install Your Payment Integration"
1732
  msgstr ""
@@ -1749,57 +2366,6 @@ msgid ""
1749
  "best to get it added as fast as possible"
1750
  msgstr ""
1751
 
1752
- #: pro/includes/admin/builder/panels/class-providers.php:21
1753
- msgid "Marketing"
1754
- msgstr ""
1755
-
1756
- #: pro/includes/admin/builder/panels/class-providers.php:55
1757
- msgid ""
1758
- "We need to save your progress to continue to the Marketing panel. Is that OK?"
1759
- msgstr ""
1760
-
1761
- #: pro/includes/admin/builder/panels/class-providers.php:56
1762
- msgid "Are you sure you want to delete this connecton?"
1763
- msgstr ""
1764
-
1765
- #: pro/includes/admin/builder/panels/class-providers.php:57
1766
- msgid "Enter a %type% nickname"
1767
- msgstr ""
1768
-
1769
- #: pro/includes/admin/builder/panels/class-providers.php:58
1770
- msgid "Eg: Newsletter Optin"
1771
- msgstr ""
1772
-
1773
- #: pro/includes/admin/builder/panels/class-providers.php:59
1774
- msgid "You must provide a connection nickname"
1775
- msgstr ""
1776
-
1777
- #: pro/includes/admin/builder/panels/class-providers.php:60
1778
- msgid "Field required"
1779
- msgstr ""
1780
-
1781
- #: pro/includes/admin/builder/panels/class-providers.php:106
1782
- msgid "Install Your Marketing Integration"
1783
- msgstr ""
1784
-
1785
- #: pro/includes/admin/builder/panels/class-providers.php:107
1786
- msgid ""
1787
- "It seems you do not have any marketing add-ons activated. You can head over "
1788
- "to the <a href=\"%s\">Add-Ons page</a> to install and activate the add-on "
1789
- "for your provider."
1790
- msgstr ""
1791
-
1792
- #: pro/includes/admin/builder/panels/class-providers.php:113
1793
- msgid "Select Your Marketing Integration"
1794
- msgstr ""
1795
-
1796
- #: pro/includes/admin/builder/panels/class-providers.php:114
1797
- msgid ""
1798
- "Select your email marketing service provider or CRM from the options on the "
1799
- "left. If you don't see your email marketing service listed, then let us know "
1800
- "and we'll do our best to get it added as fast as possible"
1801
- msgstr ""
1802
-
1803
  #: pro/includes/admin/class-addons.php:85
1804
  #: pro/includes/admin/class-addons.php:239
1805
  msgid "Install Addon"
@@ -1913,113 +2479,147 @@ msgid ""
1913
  "to help us spread the word and boost our motivation?"
1914
  msgstr ""
1915
 
1916
- #: pro/includes/admin/class-settings.php:158
1917
- msgid "Integrations"
1918
- msgstr ""
1919
-
1920
- #: pro/includes/admin/class-settings.php:159
1921
  msgid "Import/Export"
1922
  msgstr ""
1923
 
1924
- #: pro/includes/admin/class-settings.php:160
1925
- msgid "System Info"
1926
- msgstr ""
1927
-
1928
- #: pro/includes/admin/class-settings.php:211
1929
  msgid "Please enter a license key to verify."
1930
  msgstr ""
1931
 
1932
- #: pro/includes/admin/class-settings.php:241
1933
  msgid "License"
1934
  msgstr ""
1935
 
1936
- #: pro/includes/admin/class-settings.php:242
1937
  msgid "Your license key provides access to updates and Add-ons. "
1938
  msgstr ""
1939
 
1940
- #: pro/includes/admin/class-settings.php:247
1941
  msgid "License Key"
1942
  msgstr ""
1943
 
1944
- #: pro/includes/admin/class-settings.php:251
1945
  msgid "Verify Key"
1946
  msgstr ""
1947
 
1948
- #: pro/includes/admin/class-settings.php:253
1949
  msgid "Deactivate Key"
1950
  msgstr ""
1951
 
1952
- #: pro/includes/admin/class-settings.php:261
1953
  msgid "License Key Type"
1954
  msgstr ""
1955
 
1956
- #: pro/includes/admin/class-settings.php:264
1957
  msgid "Your license key type for this site is <strong>%s.</strong>"
1958
  msgstr ""
1959
 
1960
- #: pro/includes/admin/class-settings.php:265
1961
  msgid "Refresh Key"
1962
  msgstr ""
1963
 
1964
- #: pro/includes/admin/class-settings.php:266
1965
  msgid ""
1966
  "If your license has been upgraded or is incorrect, you may force a refresh."
1967
  msgstr ""
1968
 
1969
- #: pro/includes/admin/class-settings.php:414
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1970
  msgid "Settings updated."
1971
  msgstr ""
1972
 
1973
- #: pro/includes/admin/class-settings.php:428
1974
  msgid "Currency"
1975
  msgstr ""
1976
 
1977
- #: pro/includes/admin/class-settings.php:440
1978
  msgid "Determines which currency to use for payments."
1979
  msgstr ""
1980
 
1981
- #: pro/includes/admin/class-settings.php:471
1982
- msgid ""
1983
- "You do not have any marketing add-ons activated. You can head over to the <a "
1984
- "href=\"%s\">Add-Ons page</a> to install and activate the add-on for your "
1985
- "provider."
1986
- msgstr ""
1987
-
1988
- #: pro/includes/admin/class-settings.php:492
1989
  msgid "Form(s) imported"
1990
  msgstr ""
1991
 
1992
- #: pro/includes/admin/class-settings.php:501
1993
  msgid "Form Import"
1994
  msgstr ""
1995
 
1996
- #: pro/includes/admin/class-settings.php:506
1997
  msgid "Select an export file."
1998
  msgstr ""
1999
 
2000
- #: pro/includes/admin/class-settings.php:512
2001
  msgid "Import"
2002
  msgstr ""
2003
 
2004
- #: pro/includes/admin/class-settings.php:519
2005
  msgid "Form Export"
2006
  msgstr ""
2007
 
2008
- #: pro/includes/admin/class-settings.php:524
2009
  msgid ""
2010
  "Select form(s) to download an export file. This can be imported into another "
2011
  "site."
2012
  msgstr ""
2013
 
2014
- #: pro/includes/admin/class-settings.php:540
2015
  msgid "Export"
2016
  msgstr ""
2017
 
2018
- #: pro/includes/admin/class-settings.php:603
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2019
  msgid "Please upload a valid .json form export file."
2020
  msgstr ""
2021
 
2022
- #: pro/includes/admin/class-settings.php:603
2023
  #: pro/includes/admin/entries/class-entries-export.php:300
2024
  msgid "Error"
2025
  msgstr ""
@@ -2381,114 +2981,6 @@ msgstr ""
2381
  msgid "(Abandoned)"
2382
  msgstr ""
2383
 
2384
- #: pro/includes/class-provider.php:84
2385
- msgid "Connection"
2386
- msgstr ""
2387
-
2388
- #: pro/includes/class-provider.php:149 pro/includes/class-provider.php:1129
2389
- #: pro/includes/class-provider.php:1164
2390
- msgid "You do not have permission"
2391
- msgstr ""
2392
-
2393
- #: pro/includes/class-provider.php:436
2394
- msgid "Full"
2395
- msgstr ""
2396
-
2397
- #: pro/includes/class-provider.php:658
2398
- msgid "Select Account"
2399
- msgstr ""
2400
-
2401
- #: pro/includes/class-provider.php:670 pro/includes/class-provider.php:1243
2402
- msgid "Add New Account"
2403
- msgstr ""
2404
-
2405
- #: pro/includes/class-provider.php:700
2406
- msgid "Select List"
2407
- msgstr ""
2408
-
2409
- #: pro/includes/class-provider.php:740
2410
- msgid "Select Groups"
2411
- msgstr ""
2412
-
2413
- #: pro/includes/class-provider.php:742
2414
- msgid ""
2415
- "We also noticed that you have some segments in your list. You can select "
2416
- "specific list segments below if needed. This is optional."
2417
- msgstr ""
2418
-
2419
- #: pro/includes/class-provider.php:798 pro/includes/class-provider.php:803
2420
- msgid "List Fields"
2421
- msgstr ""
2422
-
2423
- #: pro/includes/class-provider.php:803
2424
- msgid "Available Form Fields"
2425
- msgstr ""
2426
-
2427
- #: pro/includes/class-provider.php:864
2428
- msgid "Conditional Logic"
2429
- msgstr ""
2430
-
2431
- #: pro/includes/class-provider.php:873
2432
- msgid "Enable conditional logic"
2433
- msgstr ""
2434
-
2435
- #: pro/includes/class-provider.php:880
2436
- msgid "Process this form if"
2437
- msgstr ""
2438
-
2439
- #: pro/includes/class-provider.php:911
2440
- msgid "-- Select field --"
2441
- msgstr ""
2442
-
2443
- #: pro/includes/class-provider.php:928
2444
- msgid "is"
2445
- msgstr ""
2446
-
2447
- #: pro/includes/class-provider.php:929
2448
- msgid "is not"
2449
- msgstr ""
2450
-
2451
- #: pro/includes/class-provider.php:963
2452
- msgid "AND"
2453
- msgstr ""
2454
-
2455
- #: pro/includes/class-provider.php:980
2456
- msgid "Add rule group"
2457
- msgstr ""
2458
-
2459
- #: pro/includes/class-provider.php:1133 pro/includes/class-provider.php:1168
2460
- msgid "Missing data"
2461
- msgstr ""
2462
-
2463
- #: pro/includes/class-provider.php:1145
2464
- msgid "Connection missing"
2465
- msgstr ""
2466
-
2467
- #: pro/includes/class-provider.php:1182 pro/includes/class-provider.php:1233
2468
- msgid "Connected on: "
2469
- msgstr ""
2470
-
2471
- #: pro/includes/class-provider.php:1183 pro/includes/class-provider.php:1234
2472
- msgid "Disconnect "
2473
- msgstr ""
2474
-
2475
- #: pro/includes/class-provider.php:1218
2476
- msgid "Integrate %s with WPForms"
2477
- msgstr ""
2478
-
2479
- #: pro/includes/class-provider.php:1219
2480
- msgid "Connected"
2481
- msgstr ""
2482
-
2483
- #: pro/includes/class-provider.php:1249
2484
- msgid ""
2485
- "Please fill out all of the fields below to add your new provider account."
2486
- msgstr ""
2487
-
2488
- #: pro/includes/class-provider.php:1255
2489
- msgid "Connect to"
2490
- msgstr ""
2491
-
2492
  #: pro/includes/fields/class-address.php:21
2493
  #: pro/includes/templates/class-order.php:57
2494
  msgid "Address"
@@ -2623,82 +3115,76 @@ msgstr ""
2623
  msgid "File Upload"
2624
  msgstr ""
2625
 
2626
- #: pro/includes/fields/class-file-upload.php:141
2627
  msgid "Allowed File Extensions"
2628
  msgstr ""
2629
 
2630
- #: pro/includes/fields/class-file-upload.php:142
2631
  msgid "Enter the extensions you would like to allow, comma separated."
2632
  msgstr ""
2633
 
2634
- #: pro/includes/fields/class-file-upload.php:163
2635
  msgid "Max File Size"
2636
  msgstr ""
2637
 
2638
- #: pro/includes/fields/class-file-upload.php:164
2639
  msgid ""
2640
  "Enter the max file size, in megabytyes, to allow. If left blank, the value "
2641
  "defaults to the maximum size the server allows which is "
2642
  msgstr ""
2643
 
2644
- #: pro/includes/fields/class-file-upload.php:205
2645
  msgid "Store file in WordPress Media Library"
2646
  msgstr ""
2647
 
2648
- #: pro/includes/fields/class-file-upload.php:206
2649
  msgid ""
2650
  "Check this option to store the final uploaded file in the WordPress Media "
2651
  "Library"
2652
  msgstr ""
2653
 
2654
- #: pro/includes/fields/class-file-upload.php:338
2655
  msgid "The uploaded file exceeds the upload_max_filesize directive in php.ini."
2656
  msgstr ""
2657
 
2658
- #: pro/includes/fields/class-file-upload.php:339
2659
  msgid ""
2660
  "The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in "
2661
  "the HTML form."
2662
  msgstr ""
2663
 
2664
- #: pro/includes/fields/class-file-upload.php:340
2665
  msgid "The uploaded file was only partially uploaded."
2666
  msgstr ""
2667
 
2668
- #: pro/includes/fields/class-file-upload.php:341
2669
  msgid "No file was uploaded."
2670
  msgstr ""
2671
 
2672
- #: pro/includes/fields/class-file-upload.php:343
2673
  msgid "Missing a temporary folder."
2674
  msgstr ""
2675
 
2676
- #: pro/includes/fields/class-file-upload.php:344
2677
  msgid "Failed to write file to disk."
2678
  msgstr ""
2679
 
2680
- #: pro/includes/fields/class-file-upload.php:345
2681
  msgid "File upload stopped by extension."
2682
  msgstr ""
2683
 
2684
- #: pro/includes/fields/class-file-upload.php:347
2685
  msgid "File upload error. "
2686
  msgstr ""
2687
 
2688
- #: pro/includes/fields/class-file-upload.php:366
2689
  msgid "File exceeds max size allowed"
2690
  msgstr ""
2691
 
2692
- #: pro/includes/fields/class-file-upload.php:384
2693
  msgid "File must have an extension."
2694
  msgstr ""
2695
 
2696
- #: pro/includes/fields/class-file-upload.php:394
2697
- #: pro/includes/fields/class-file-upload.php:413
2698
- #: pro/includes/fields/class-file-upload.php:431
2699
- msgid "File type is not allowed."
2700
- msgstr ""
2701
-
2702
  #: pro/includes/fields/class-hidden.php:21
2703
  msgid "Hidden Field"
2704
  msgstr ""
@@ -2707,108 +3193,119 @@ msgstr ""
2707
  msgid "HTML"
2708
  msgstr ""
2709
 
2710
- #: pro/includes/fields/class-html.php:66
2711
  msgid "HTML / Code Block"
2712
  msgstr ""
2713
 
2714
- #: pro/includes/fields/class-html.php:69
2715
  msgid "Contents of this field are not displayed in the admin area."
2716
  msgstr ""
2717
 
2718
  #: pro/includes/fields/class-page-break.php:21
2719
- #: pro/includes/fields/class-page-break.php:171
2720
  msgid "Page Break"
2721
  msgstr ""
2722
 
2723
- #: pro/includes/fields/class-page-break.php:53
2724
- msgid ""
2725
- "Select theme for Page Indicator which is displayed at the top of the form."
2726
- msgstr ""
2727
-
2728
- #: pro/includes/fields/class-page-break.php:55
2729
  msgid "Progress Bar"
2730
  msgstr ""
2731
 
2732
- #: pro/includes/fields/class-page-break.php:56
2733
  msgid "Circles"
2734
  msgstr ""
2735
 
2736
- #: pro/includes/fields/class-page-break.php:57
2737
  msgid "Connector"
2738
  msgstr ""
2739
 
2740
- #: pro/includes/fields/class-page-break.php:60
2741
  msgid "Progress Indicator"
2742
  msgstr ""
2743
 
2744
- #: pro/includes/fields/class-page-break.php:66
2745
- msgid "Select the primary color for the Page Indicator theme."
 
2746
  msgstr ""
2747
 
2748
- #: pro/includes/fields/class-page-break.php:67
2749
  msgid "Page Indicator Color"
2750
  msgstr ""
2751
 
2752
- #: pro/includes/fields/class-page-break.php:74
2753
- msgid "Enter text for the page title."
2754
  msgstr ""
2755
 
2756
- #: pro/includes/fields/class-page-break.php:76
2757
  msgid "Page Title"
2758
  msgstr ""
2759
 
2760
- #: pro/includes/fields/class-page-break.php:83
2761
- msgid "Enter text for Next page navigation button."
2762
  msgstr ""
2763
 
2764
- #: pro/includes/fields/class-page-break.php:84
2765
- #: pro/includes/fields/class-page-break.php:146
2766
- msgid "Next"
2767
  msgstr ""
2768
 
2769
- #: pro/includes/fields/class-page-break.php:85
2770
- msgid "Next Label"
2771
  msgstr ""
2772
 
2773
- #: pro/includes/fields/class-page-break.php:93
2774
- #: pro/includes/fields/class-page-break.php:99
2775
- msgid "Enter text for Previous page navigation button."
2776
  msgstr ""
2777
 
2778
- #: pro/includes/fields/class-page-break.php:95
2779
  msgid "Display Previous"
2780
  msgstr ""
2781
 
2782
- #: pro/includes/fields/class-page-break.php:101
 
 
 
 
2783
  msgid "Previous Label"
2784
  msgstr ""
2785
 
2786
- #: pro/includes/fields/class-page-break.php:118
 
 
 
 
 
 
 
 
2787
  msgid "Select the alignment for the Next/Previous page navigation buttons"
2788
  msgstr ""
2789
 
2790
- #: pro/includes/fields/class-page-break.php:120
2791
  msgid "Left"
2792
  msgstr ""
2793
 
2794
- #: pro/includes/fields/class-page-break.php:121
2795
  msgid "Right"
2796
  msgstr ""
2797
 
2798
- #: pro/includes/fields/class-page-break.php:122
2799
  msgid "Center"
2800
  msgstr ""
2801
 
2802
- #: pro/includes/fields/class-page-break.php:123
2803
  msgid "Split"
2804
  msgstr ""
2805
 
2806
- #: pro/includes/fields/class-page-break.php:125
2807
- msgid "Page Navigation Alignment"
2808
  msgstr ""
2809
 
2810
- #: pro/includes/fields/class-page-break.php:169
2811
- msgid "First Page"
 
 
 
 
2812
  msgstr ""
2813
 
2814
  #: pro/includes/fields/class-password.php:21
@@ -2838,10 +3335,6 @@ msgstr ""
2838
  msgid "Email does not match"
2839
  msgstr ""
2840
 
2841
- #: pro/includes/fields/class-payment-credit-card.php:21
2842
- msgid "Credit Card"
2843
- msgstr ""
2844
-
2845
  #: pro/includes/fields/class-payment-credit-card.php:59
2846
  msgid "Card Number Placeholder Text"
2847
  msgstr ""
@@ -2959,6 +3452,10 @@ msgstr ""
2959
  msgid "Amount mismatch"
2960
  msgstr ""
2961
 
 
 
 
 
2962
  #: pro/includes/fields/class-phone.php:21
2963
  #: pro/includes/templates/class-order.php:49
2964
  #: pro/includes/templates/class-request-quote.php:53
@@ -2973,7 +3470,7 @@ msgstr ""
2973
  msgid "Website / URL"
2974
  msgstr ""
2975
 
2976
- #: pro/includes/fields/class-url.php:130
2977
  msgid "Please enter a valid URL"
2978
  msgstr ""
2979
 
@@ -3083,12 +3580,6 @@ msgid ""
3083
  "Donation form. You can add and remove fields as needed."
3084
  msgstr ""
3085
 
3086
- #: pro/includes/templates/class-donation.php:26
3087
- #: pro/includes/templates/class-order.php:26
3088
- #: pro/includes/templates/class-subscribe.php:26
3089
- msgid "Don&#39;t Forget"
3090
- msgstr ""
3091
-
3092
  #: pro/includes/templates/class-donation.php:27
3093
  msgid "Click the Payments tab to configure your payment provider"
3094
  msgstr ""
@@ -3137,45 +3628,31 @@ msgstr ""
3137
  msgid "Request"
3138
  msgstr ""
3139
 
3140
- #: pro/includes/templates/class-subscribe.php:20
3141
- msgid "Newsletter Signup Form"
3142
- msgstr ""
3143
-
3144
- #: pro/includes/templates/class-subscribe.php:22
3145
- msgid ""
3146
- "Add subscribers and grow your email list with this newsletter signup form. "
3147
- "You can add and remove fields as needed."
3148
- msgstr ""
3149
-
3150
- #: pro/includes/templates/class-subscribe.php:27
3151
- msgid "Click the marketing tab to configure your newsletter service provider"
3152
- msgstr ""
3153
-
3154
- #: pro/wpforms-pro.php:189
3155
  msgid "Disable storing entry information in WordPress"
3156
  msgstr ""
3157
 
3158
- #: pro/wpforms-pro.php:250
3159
  msgid "Add New Notification"
3160
  msgstr ""
3161
 
3162
- #: pro/wpforms-pro.php:405
3163
  msgid "Send"
3164
  msgstr ""
3165
 
3166
- #: pro/wpforms-pro.php:406
3167
  msgid "Don't send"
3168
  msgstr ""
3169
 
3170
- #: pro/wpforms-pro.php:408
3171
  msgid "this notification if"
3172
  msgstr ""
3173
 
3174
- #: pro/wpforms-pro.php:409
3175
  msgid "Email notifications"
3176
  msgstr ""
3177
 
3178
- #: pro/wpforms-pro.php:412
3179
  msgid ""
3180
  "Install the <a href=\"%s\">Conditional Logic add-on</a> to enable "
3181
  "conditional logic for Email Notifications."
@@ -3185,9 +3662,9 @@ msgstr ""
3185
  msgid "Please deactivate WPForms Lite before activating WPForms"
3186
  msgstr ""
3187
 
3188
- #. #-#-#-#-# wpforms.pot (WPForms 1.3.5) #-#-#-#-#
3189
  #. Plugin URI of the plugin/theme
3190
- #. #-#-#-#-# wpforms.pot (WPForms 1.3.5) #-#-#-#-#
3191
  #. Author URI of the plugin/theme
3192
  msgid "https://wpforms.com"
3193
  msgstr ""
2
  # This file is distributed under the same license as the WPForms package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: WPForms 1.3.7.2\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wpforms\n"
7
+ "POT-Creation-Date: 2017-04-26 18:21:57+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
14
 
15
+ #: includes/admin/ajax-actions.php:24 includes/fields/class-base.php:727
16
  msgid "You do no have permission."
17
  msgstr ""
18
 
40
  msgid "Error updating form template"
41
  msgstr ""
42
 
43
+ #: includes/admin/ajax-actions.php:243 includes/fields/class-base.php:400
44
  msgid "post type"
45
  msgstr ""
46
 
47
+ #: includes/admin/ajax-actions.php:262 includes/fields/class-base.php:407
48
  msgid "taxonomy"
49
  msgstr ""
50
 
51
+ #: includes/admin/builder/class-builder.php:273
52
+ msgid "Add New Choices"
53
+ msgstr ""
54
+
55
+ #: includes/admin/builder/class-builder.php:274
56
+ #: includes/fields/class-base.php:359
57
+ msgid "Bulk Add"
58
+ msgstr ""
59
+
60
+ #: includes/admin/builder/class-builder.php:275
61
+ msgid "Hide Bulk Add"
62
+ msgstr ""
63
+
64
+ #: includes/admin/builder/class-builder.php:276
65
+ msgid "Add Choices (one per line)"
66
+ msgstr ""
67
+
68
+ #: includes/admin/builder/class-builder.php:277
69
+ msgid ""
70
+ "Blue\n"
71
+ "Red\n"
72
+ "Green"
73
+ msgstr ""
74
+
75
+ #: includes/admin/builder/class-builder.php:278
76
+ msgid "Show presets"
77
+ msgstr ""
78
+
79
+ #: includes/admin/builder/class-builder.php:279
80
+ msgid "Hide presets"
81
+ msgstr ""
82
+
83
+ #: includes/admin/builder/class-builder.php:280
84
  #: pro/includes/fields/class-date-time.php:229
85
  #: pro/includes/fields/class-date-time.php:231
86
  #: pro/includes/fields/class-date-time.php:452
88
  msgid "DD"
89
  msgstr ""
90
 
91
+ #: includes/admin/builder/class-builder.php:281
92
  #: pro/includes/fields/class-date-time.php:228
93
  #: pro/includes/fields/class-date-time.php:232
94
  #: pro/includes/fields/class-date-time.php:433
97
  msgid "MM"
98
  msgstr ""
99
 
100
+ #: includes/admin/builder/class-builder.php:282
101
  msgid ""
102
  "The {source} {type} contains over {limit} items ({total}). This may make the "
103
  "field difficult for your vistors to use and/or cause the form to be slow."
104
  msgstr ""
105
 
106
+ #: includes/admin/builder/class-builder.php:283
107
  #: includes/admin/class-editor.php:96
108
  #: pro/includes/admin/entries/class-entries.php:994
109
  msgid "Cancel"
110
  msgstr ""
111
 
112
+ #: includes/admin/builder/class-builder.php:284
113
  msgid "OK"
114
  msgstr ""
115
 
116
+ #: includes/admin/builder/class-builder.php:285
117
  #: includes/admin/class-editor.php:70
118
  msgid "Close"
119
  msgstr ""
120
 
121
+ #: includes/admin/builder/class-builder.php:286
122
  msgid ""
123
  "Due to form changes, conditional logic rules have been removed or updated:"
124
  msgstr ""
125
 
126
+ #: includes/admin/builder/class-builder.php:287
127
  #: pro/includes/admin/entries/class-entries-table.php:176
128
  msgid "Field"
129
  msgstr ""
130
 
131
+ #: includes/admin/builder/class-builder.php:288
132
  msgid "Field Locked"
133
  msgstr ""
134
 
135
+ #: includes/admin/builder/class-builder.php:289
136
  msgid "This field cannot be deleted or duplicated."
137
  msgstr ""
138
 
139
+ #: includes/admin/builder/class-builder.php:290
140
  msgid "Available Fields"
141
  msgstr ""
142
 
143
+ #: includes/admin/builder/class-builder.php:291
144
  msgid "No fields available"
145
  msgstr ""
146
 
147
+ #: includes/admin/builder/class-builder.php:292
148
  msgid "Heads up!"
149
  msgstr ""
150
 
151
+ #: includes/admin/builder/class-builder.php:294
152
  msgid "No email fields"
153
  msgstr ""
154
 
155
+ #: includes/admin/builder/class-builder.php:295
156
  msgid "Are you sure you want to delete this notification?"
157
  msgstr ""
158
 
159
+ #: includes/admin/builder/class-builder.php:296
160
  msgid "Enter a notification name"
161
  msgstr ""
162
 
163
+ #: includes/admin/builder/class-builder.php:297
164
  msgid "Eg: User Confirmation"
165
  msgstr ""
166
 
167
+ #: includes/admin/builder/class-builder.php:298
168
  msgid "You must provide a notification name"
169
  msgstr ""
170
 
171
+ #: includes/admin/builder/class-builder.php:299
172
  msgid ""
173
  "Form must contain one notification. To disable all notifications use the "
174
  "setting Notifications dropdown setting."
175
  msgstr ""
176
 
177
+ #: includes/admin/builder/class-builder.php:300
178
+ #: lite/includes/admin/class-settings.php:149
179
+ #: pro/includes/admin/class-settings.php:160
180
  msgid "Saving ..."
181
  msgstr ""
182
 
183
+ #: includes/admin/builder/class-builder.php:301
184
  msgid "Saved!"
185
  msgstr ""
186
 
187
+ #: includes/admin/builder/class-builder.php:302
188
  msgid "Save and Exit"
189
  msgstr ""
190
 
191
+ #: includes/admin/builder/class-builder.php:303
192
+ #: includes/fields/class-base.php:535
193
+ msgid "Show Layouts"
194
+ msgstr ""
195
+
196
+ #: includes/admin/builder/class-builder.php:304
197
+ msgid "Hide Layouts"
198
+ msgstr ""
199
+
200
+ #: includes/admin/builder/class-builder.php:305
201
+ msgid "Select your layout"
202
+ msgstr ""
203
+
204
+ #: includes/admin/builder/class-builder.php:306
205
+ msgid "Select your column"
206
+ msgstr ""
207
+
208
+ #: includes/admin/builder/class-builder.php:307
209
+ #: includes/admin/builder/class-builder.php:408
210
  msgid "Loading"
211
  msgstr ""
212
 
213
+ #: includes/admin/builder/class-builder.php:313
214
  msgid "Use Template"
215
  msgstr ""
216
 
217
+ #: includes/admin/builder/class-builder.php:314
218
  msgid ""
219
  "Changing templates on an existing form will DELETE existing form fields. Are "
220
  "you sure you want apply the new template?"
221
  msgstr ""
222
 
223
+ #: includes/admin/builder/class-builder.php:315
224
  msgid ""
225
  "You are almost done. To embed this form on your site, please paste the "
226
  "following shortcode inside a post or page."
227
  msgstr ""
228
 
229
+ #: includes/admin/builder/class-builder.php:316
230
  msgid "Or you can follow the instructions in this video."
231
  msgstr ""
232
 
233
+ #: includes/admin/builder/class-builder.php:317
234
+ #: includes/admin/builder/class-builder.php:458
235
  msgid "Exit"
236
  msgstr ""
237
 
238
+ #: includes/admin/builder/class-builder.php:319
239
  msgid "If you exit without saving, your changes will be lost."
240
  msgstr ""
241
 
242
+ #: includes/admin/builder/class-builder.php:320
243
  msgid "Are you sure you want to delete this field?"
244
  msgstr ""
245
 
246
+ #: includes/admin/builder/class-builder.php:321
247
  msgid "Are you sure you want to duplicate this field?"
248
  msgstr ""
249
 
250
+ #: includes/admin/builder/class-builder.php:322
251
  msgid "(copy)"
252
  msgstr ""
253
 
254
+ #: includes/admin/builder/class-builder.php:323
255
  msgid "Please enter a form title."
256
  msgstr ""
257
 
258
+ #: includes/admin/builder/class-builder.php:324
259
  msgid "This item must contain at least one choice."
260
  msgstr ""
261
 
262
+ #: includes/admin/builder/class-builder.php:325
263
+ #: includes/fields/class-base.php:250 includes/fields/class-base.php:583
264
+ #: lite/wpforms-lite.php:78 pro/wpforms-pro.php:262
265
  msgid "Off"
266
  msgstr ""
267
 
268
+ #: includes/admin/builder/class-builder.php:326
269
+ #: includes/fields/class-base.php:250 lite/wpforms-lite.php:77
270
+ #: pro/wpforms-pro.php:261
271
  msgid "On"
272
  msgstr ""
273
 
274
+ #: includes/admin/builder/class-builder.php:327
275
  #: includes/templates/class-suggestion.php:59
276
  msgid "Other"
277
  msgstr ""
278
 
279
+ #: includes/admin/builder/class-builder.php:328
280
+ #: pro/includes/fields/class-page-break.php:317
281
+ #: pro/includes/fields/class-page-break.php:584
282
  msgid "Previous"
283
  msgstr ""
284
 
285
+ #: includes/admin/builder/class-builder.php:331
286
+ #: includes/admin/builder/functions.php:246 includes/fields/class-base.php:484
287
  msgid "Show Smart Tags"
288
  msgstr ""
289
 
290
+ #: includes/admin/builder/class-builder.php:332
291
  msgid "Hide Smart Tags"
292
  msgstr ""
293
 
294
+ #: includes/admin/builder/class-builder.php:333
295
  msgid "-- Select Field --"
296
  msgstr ""
297
 
298
+ #: includes/admin/builder/class-builder.php:334
299
+ #: includes/providers/class-base.php:952
300
  msgid "-- Select Choice --"
301
  msgstr ""
302
 
303
+ #: includes/admin/builder/class-builder.php:361
304
+ msgid "Countries"
305
+ msgstr ""
306
+
307
+ #: includes/admin/builder/class-builder.php:365
308
+ msgid "Countries Postal Code"
309
+ msgstr ""
310
+
311
+ #: includes/admin/builder/class-builder.php:369
312
+ msgid "States"
313
+ msgstr ""
314
+
315
+ #: includes/admin/builder/class-builder.php:373
316
+ msgid "States Postal Code"
317
+ msgstr ""
318
+
319
+ #: includes/admin/builder/class-builder.php:377
320
+ msgid "Months"
321
+ msgstr ""
322
+
323
+ #: includes/admin/builder/class-builder.php:381
324
+ msgid "Days"
325
+ msgstr ""
326
+
327
+ #: includes/admin/builder/class-builder.php:431
328
  msgid "Now editing"
329
  msgstr ""
330
 
331
+ #: includes/admin/builder/class-builder.php:441
332
  #: pro/includes/admin/entries/class-entries.php:512
333
  msgid "Preview Form"
334
  msgstr ""
335
 
336
+ #: includes/admin/builder/class-builder.php:443
337
  #: includes/admin/overview/class-overview-table.php:159
338
  msgid "Preview"
339
  msgstr ""
340
 
341
+ #: includes/admin/builder/class-builder.php:446
342
  msgid "Embed Form"
343
  msgstr ""
344
 
345
+ #: includes/admin/builder/class-builder.php:448
346
  msgid "Embed"
347
  msgstr ""
348
 
349
+ #: includes/admin/builder/class-builder.php:451
350
  msgid "Save Form"
351
  msgstr ""
352
 
353
+ #: includes/admin/builder/class-builder.php:453
354
+ #: pro/includes/admin/class-settings.php:603
355
  msgid "Save"
356
  msgstr ""
357
 
403
  msgstr ""
404
 
405
  #: includes/admin/builder/panels/class-fields.php:252
406
+ #: includes/fields/class-base.php:766
407
  msgid "Duplicate Field"
408
  msgstr ""
409
 
410
  #: includes/admin/builder/panels/class-fields.php:254
411
+ #: includes/fields/class-base.php:767
412
  msgid "Delete Field"
413
  msgstr ""
414
 
415
  #: includes/admin/builder/panels/class-fields.php:256
416
+ #: includes/fields/class-base.php:768
417
  msgid "Click to edit. Drag to reorder."
418
  msgstr ""
419
 
420
+ #: includes/admin/builder/panels/class-providers.php:21
421
+ msgid "Marketing"
422
+ msgstr ""
423
+
424
+ #: includes/admin/builder/panels/class-providers.php:55
425
+ msgid ""
426
+ "We need to save your progress to continue to the Marketing panel. Is that OK?"
427
+ msgstr ""
428
+
429
+ #: includes/admin/builder/panels/class-providers.php:56
430
+ msgid "Are you sure you want to delete this connecton?"
431
+ msgstr ""
432
+
433
+ #: includes/admin/builder/panels/class-providers.php:57
434
+ msgid "Enter a %type% nickname"
435
+ msgstr ""
436
+
437
+ #: includes/admin/builder/panels/class-providers.php:58
438
+ msgid "Eg: Newsletter Optin"
439
+ msgstr ""
440
+
441
+ #: includes/admin/builder/panels/class-providers.php:59
442
+ msgid "You must provide a connection nickname"
443
+ msgstr ""
444
+
445
+ #: includes/admin/builder/panels/class-providers.php:60
446
+ msgid "Field required"
447
+ msgstr ""
448
+
449
+ #: includes/admin/builder/panels/class-providers.php:97
450
+ #: pro/includes/admin/builder/panels/class-payments.php:60
451
+ msgid ""
452
+ "You need to <a href=\"#\" class=\"wpforms-panel-switch\" data-panel=\"setup"
453
+ "\">setup your form</a> before you can manage these settings."
454
+ msgstr ""
455
+
456
+ #: includes/admin/builder/panels/class-providers.php:106
457
+ msgid "Install Your Marketing Integration"
458
+ msgstr ""
459
+
460
+ #: includes/admin/builder/panels/class-providers.php:107
461
+ msgid ""
462
+ "It seems you do not have any marketing add-ons activated. You can head over "
463
+ "to the <a href=\"%s\">Add-Ons page</a> to install and activate the add-on "
464
+ "for your provider."
465
+ msgstr ""
466
+
467
+ #: includes/admin/builder/panels/class-providers.php:113
468
+ msgid "Select Your Marketing Integration"
469
+ msgstr ""
470
+
471
+ #: includes/admin/builder/panels/class-providers.php:114
472
+ msgid ""
473
+ "Select your email marketing service provider or CRM from the options on the "
474
+ "left. If you don't see your email marketing service listed, then let us know "
475
+ "and we'll do our best to get it added as fast as possible"
476
+ msgstr ""
477
+
478
  #: includes/admin/builder/panels/class-settings.php:21
479
+ #: includes/admin/class-menu.php:81 lite/includes/admin/class-settings.php:523
480
+ #: pro/includes/admin/class-settings.php:962
481
  msgid "Settings"
482
  msgstr ""
483
 
484
  #: includes/admin/builder/panels/class-settings.php:57
485
  #: includes/admin/builder/panels/class-settings.php:87
486
+ #: lite/includes/admin/class-settings.php:170
487
+ #: pro/includes/admin/class-settings.php:181
488
  msgid "General"
489
  msgstr ""
490
 
491
  #: includes/admin/builder/panels/class-settings.php:58 lite/wpforms-lite.php:63
492
+ #: lite/wpforms-lite.php:73 pro/wpforms-pro.php:248 pro/wpforms-pro.php:257
493
  msgid "Notifications"
494
  msgstr ""
495
 
496
  #: includes/admin/builder/panels/class-settings.php:59
497
+ #: includes/admin/builder/panels/class-settings.php:177
498
  msgid "Confirmation"
499
  msgstr ""
500
 
554
  msgid "Enable anti-spam honeypot"
555
  msgstr ""
556
 
557
+ #: includes/admin/builder/panels/class-settings.php:159
558
+ msgid "Enable Google invisible reCAPTCHA"
559
+ msgstr ""
560
+
561
+ #: includes/admin/builder/panels/class-settings.php:159
562
+ msgid "Enable Google reCAPTCHA (v2)"
563
  msgstr ""
564
 
565
+ #: includes/admin/builder/panels/class-settings.php:184
566
  msgid "Confirmation Type"
567
  msgstr ""
568
 
569
+ #: includes/admin/builder/panels/class-settings.php:188
570
  #: includes/templates/class-suggestion.php:74 lite/wpforms-lite.php:191
571
+ #: pro/wpforms-pro.php:381
572
  msgid "Message"
573
  msgstr ""
574
 
575
+ #: includes/admin/builder/panels/class-settings.php:189
576
  msgid "Show Page"
577
  msgstr ""
578
 
579
+ #: includes/admin/builder/panels/class-settings.php:190
580
  msgid "Go to URL (Redirect)"
581
  msgstr ""
582
 
583
+ #: includes/admin/builder/panels/class-settings.php:199
584
  msgid "Confirmation Message"
585
  msgstr ""
586
 
587
+ #: includes/admin/builder/panels/class-settings.php:201
588
  msgid "Thanks for contacting us! We will be in touch with you shortly."
589
  msgstr ""
590
 
591
+ #: includes/admin/builder/panels/class-settings.php:212
592
  msgid "Automatically scroll to the confirmation message"
593
  msgstr ""
594
 
595
+ #: includes/admin/builder/panels/class-settings.php:225
596
  msgid "Confirmation Page"
597
  msgstr ""
598
 
599
+ #: includes/admin/builder/panels/class-settings.php:233
600
  msgid "Confirmation Redirect URL"
601
  msgstr ""
602
 
665
  "a>?"
666
  msgstr ""
667
 
668
+ #. #-#-#-#-# wpforms.pot (WPForms 1.3.7.2) #-#-#-#-#
669
  #. Plugin Name of the plugin/theme
670
+ #. #-#-#-#-# wpforms.pot (WPForms 1.3.7.2) #-#-#-#-#
671
  #. Author of the plugin/theme
672
  #: includes/admin/class-menu.php:36 includes/admin/class-menu.php:37
673
+ #: includes/admin/class-menu.php:48 includes/admin/class-menu.php:90
674
+ #: includes/integrations.php:34
675
  msgid "WPForms"
676
  msgstr ""
677
 
685
 
686
  #: includes/admin/class-menu.php:59
687
  #: includes/admin/overview/class-overview.php:148
688
+ #: includes/providers/class-base.php:1093
689
  msgid "Add New"
690
  msgstr ""
691
 
695
 
696
  #: includes/admin/class-menu.php:69
697
  #: includes/admin/overview/class-overview-table.php:152
698
+ #: pro/includes/admin/entries/class-entries.php:411 pro/wpforms-pro.php:201
699
  msgid "Entries"
700
  msgstr ""
701
 
703
  msgid "WPForms Settings"
704
  msgstr ""
705
 
706
+ #: includes/admin/class-menu.php:91
707
+ msgid "Info"
708
+ msgstr ""
709
+
710
+ #: includes/admin/class-menu.php:100
711
  msgid "WPForms Addons"
712
  msgstr ""
713
 
714
+ #: includes/admin/class-menu.php:101
715
  msgid "Addons"
716
  msgstr ""
717
 
749
 
750
  #: includes/admin/class-welcome.php:121
751
  msgid ""
752
+ "WPForms makes it easy to create forms in WordPress. You can follow the video "
753
  "tutorial on the right or read our how to <a href=\"%s\" target=\"_blank\" "
754
  "rel=\"noopener\">create your first form guide</a>."
755
  msgstr ""
775
  msgstr ""
776
 
777
  #: includes/admin/overview/class-overview-table.php:53
778
+ #: includes/fields/class-name.php:21 includes/fields/class-name.php:278
779
  #: includes/templates/class-contact.php:32
780
+ #: includes/templates/class-subscribe.php:35
781
  #: includes/templates/class-suggestion.php:32
782
  #: pro/includes/templates/class-donation.php:35
783
  #: pro/includes/templates/class-order.php:35
784
  #: pro/includes/templates/class-request-quote.php:32
 
785
  msgid "Name"
786
  msgstr ""
787
 
863
  msgid "Forms Overview"
864
  msgstr ""
865
 
866
+ #: includes/class-frontend.php:904 lite/includes/admin/class-settings.php:372
867
+ #: pro/includes/admin/class-settings.php:447
868
+ msgid "This field is required."
869
  msgstr ""
870
 
871
+ #: includes/class-frontend.php:905 lite/includes/admin/class-settings.php:380
872
+ #: pro/includes/admin/class-settings.php:455
873
+ msgid "Please enter a valid URL."
874
+ msgstr ""
875
+
876
+ #: includes/class-frontend.php:906 lite/includes/admin/class-settings.php:388
877
+ #: pro/includes/admin/class-settings.php:463
878
+ msgid "Please enter a valid email address."
879
+ msgstr ""
880
+
881
+ #: includes/class-frontend.php:907 includes/fields/class-number.php:157
882
+ #: lite/includes/admin/class-settings.php:396
883
+ #: pro/includes/admin/class-settings.php:471
884
+ msgid "Please enter a valid number."
885
+ msgstr ""
886
+
887
+ #: includes/class-frontend.php:908 lite/includes/admin/class-settings.php:404
888
+ #: pro/includes/admin/class-settings.php:479
889
+ msgid "Field values do not match."
890
+ msgstr ""
891
+
892
+ #: includes/class-frontend.php:909 pro/includes/admin/class-settings.php:487
893
+ #: pro/includes/fields/class-file-upload.php:365
894
+ #: pro/includes/fields/class-file-upload.php:381
895
+ #: pro/includes/fields/class-file-upload.php:398
896
+ msgid "File type is not allowed."
897
+ msgstr ""
898
+
899
+ #: includes/class-frontend.php:910 pro/includes/admin/class-settings.php:495
900
+ msgid "File exceeds max size allowed."
901
+ msgstr ""
902
+
903
+ #: includes/class-frontend.php:911 pro/includes/admin/class-settings.php:503
904
+ msgid "Please enter time in 12-hour AM/PM format (eg 8:45 AM)."
905
+ msgstr ""
906
+
907
+ #: includes/class-frontend.php:912 pro/includes/admin/class-settings.php:511
908
+ msgid "Please enter time in 24-hour format (eg 22:45)."
909
+ msgstr ""
910
+
911
+ #: includes/class-frontend.php:913 pro/includes/admin/class-settings.php:519
912
+ msgid "Payment is required."
913
+ msgstr ""
914
+
915
+ #: includes/class-frontend.php:914 pro/includes/admin/class-settings.php:527
916
+ msgid "Please enter a valid credit card number."
917
  msgstr ""
918
 
919
  #: includes/class-logging.php:38
951
 
952
  #: includes/class-preview.php:174
953
  msgid ""
954
+ "The page is set to private, so it is not publicly accessible. Please do not "
955
+ "delete this page :) ."
956
  msgstr ""
957
 
958
  #: includes/class-preview.php:179
960
  msgstr ""
961
 
962
  #: includes/class-preview.php:261
963
+ msgid "This is a preview of your form. This page is not publicly accessible."
964
  msgstr ""
965
 
966
  #: includes/class-preview.php:263
992
  msgstr ""
993
 
994
  #: includes/class-process.php:340 lite/wpforms-lite.php:55
995
+ #: pro/wpforms-pro.php:241
996
  msgid "New %s Entry"
997
  msgstr ""
998
 
1083
  msgid "Lost Password URL"
1084
  msgstr ""
1085
 
1086
+ #: includes/class-widget.php:127 pro/includes/admin/class-settings.php:683
1087
  msgid "No forms"
1088
  msgstr ""
1089
 
1101
  "reached"
1102
  msgstr ""
1103
 
1104
+ #: includes/emails/class-emails.php:423 includes/emails/class-emails.php:447
1105
+ #: includes/fields/class-checkbox.php:164 includes/fields/class-radio.php:164
1106
+ #: includes/fields/class-select.php:170
1107
+ msgid "(empty)"
1108
+ msgstr ""
1109
+
1110
+ #: includes/emails/class-emails.php:424 includes/emails/class-emails.php:448
1111
  msgid "Field ID #"
1112
  msgstr ""
1113
 
1115
  msgid "Sent from <a href=\"%s\" style=\"color:#bbbbbb;\">%s</a>"
1116
  msgstr ""
1117
 
1118
+ #: includes/fields/class-base.php:310
1119
  msgid ""
1120
  "Enter text for the form field label. Field labels are recommended and can be "
1121
  "hidden in the Advanced Settings."
1122
  msgstr ""
1123
 
1124
+ #: includes/fields/class-base.php:311
1125
  msgid "Label"
1126
  msgstr ""
1127
 
1128
+ #: includes/fields/class-base.php:320
1129
  msgid "Enter text for the form field description."
1130
  msgstr ""
1131
 
1132
+ #: includes/fields/class-base.php:321
1133
  msgid "Description"
1134
  msgstr ""
1135
 
1136
+ #: includes/fields/class-base.php:331
1137
  msgid ""
1138
  "Check this option to mark the field required. A form will not submit unless "
1139
  "all required fields are provided."
1140
  msgstr ""
1141
 
1142
+ #: includes/fields/class-base.php:332
1143
+ #: lite/includes/admin/class-settings.php:369
1144
+ #: pro/includes/admin/class-settings.php:444
1145
  msgid "Required"
1146
  msgstr ""
1147
 
1148
+ #: includes/fields/class-base.php:348
1149
  msgid "Enter code for the form field."
1150
  msgstr ""
1151
 
1152
+ #: includes/fields/class-base.php:349
1153
  msgid "Code"
1154
  msgstr ""
1155
 
1156
+ #: includes/fields/class-base.php:358 includes/fields/class-base.php:432
1157
  msgid "Add choices for the form field."
1158
  msgstr ""
1159
 
1160
+ #: includes/fields/class-base.php:371
1161
  msgid "Choices"
1162
  msgstr ""
1163
 
1164
+ #: includes/fields/class-base.php:414
1165
  msgid ""
1166
  "Choices are dynamically populated from the <span class=\"dynamic-name\">%s</"
1167
  "span> <span class=\"dynamic-type\">%s</span>"
1168
  msgstr ""
1169
 
1170
+ #: includes/fields/class-base.php:441
1171
  msgid "Items"
1172
  msgstr ""
1173
 
1174
+ #: includes/fields/class-base.php:483
1175
  msgid "Enter text for the default form field value."
1176
  msgstr ""
1177
 
1178
+ #: includes/fields/class-base.php:485 includes/fields/class-name.php:285
1179
+ #: includes/fields/class-name.php:300 includes/fields/class-name.php:315
1180
+ #: includes/fields/class-name.php:330 pro/includes/fields/class-address.php:117
1181
  #: pro/includes/fields/class-address.php:133
1182
  #: pro/includes/fields/class-address.php:151
1183
  #: pro/includes/fields/class-address.php:166
1186
  msgid "Default Value"
1187
  msgstr ""
1188
 
1189
+ #: includes/fields/class-base.php:494
1190
  msgid "Select the default form field size."
1191
  msgstr ""
1192
 
1193
+ #: includes/fields/class-base.php:496
1194
  msgid "Small"
1195
  msgstr ""
1196
 
1197
+ #: includes/fields/class-base.php:497
1198
  msgid "Medium"
1199
  msgstr ""
1200
 
1201
+ #: includes/fields/class-base.php:498
1202
  msgid "Large"
1203
  msgstr ""
1204
 
1205
+ #: includes/fields/class-base.php:500
1206
  msgid "Field Size"
1207
  msgstr ""
1208
 
1209
+ #: includes/fields/class-base.php:513
1210
  msgid "Advanced Options"
1211
  msgstr ""
1212
 
1213
+ #: includes/fields/class-base.php:524
1214
  msgid "Enter text for the form field placeholder."
1215
  msgstr ""
1216
 
1217
+ #: includes/fields/class-base.php:525
1218
  msgid "Placeholder Text"
1219
  msgstr ""
1220
 
1221
+ #: includes/fields/class-base.php:534
1222
  msgid ""
1223
  "Enter CSS class names for the form field container. Class names should be "
1224
  "separated with spaces."
1225
  msgstr ""
1226
 
1227
+ #: includes/fields/class-base.php:537
1228
  msgid "CSS Classes"
1229
  msgstr ""
1230
 
1231
+ #: includes/fields/class-base.php:546
1232
  msgid "Check this option to hide the form field label."
1233
  msgstr ""
1234
 
1235
+ #: includes/fields/class-base.php:548
1236
  msgid "Hide Label"
1237
  msgstr ""
1238
 
1239
+ #: includes/fields/class-base.php:556
1240
  msgid "Check this option to hide the form field sub-label."
1241
  msgstr ""
1242
 
1243
+ #: includes/fields/class-base.php:558
1244
  msgid "Hide Sub-Labels"
1245
  msgstr ""
1246
 
1247
+ #: includes/fields/class-base.php:566
1248
  msgid "Select the layout for displaying field choices."
1249
  msgstr ""
1250
 
1251
+ #: includes/fields/class-base.php:568
1252
  msgid "One Column"
1253
  msgstr ""
1254
 
1255
+ #: includes/fields/class-base.php:569
1256
  msgid "Two Columns"
1257
  msgstr ""
1258
 
1259
+ #: includes/fields/class-base.php:570
1260
  msgid "Three Columns"
1261
  msgstr ""
1262
 
1263
+ #: includes/fields/class-base.php:572
1264
  msgid "Choice Layout"
1265
  msgstr ""
1266
 
1267
+ #: includes/fields/class-base.php:581
1268
  msgid "Select auto-populate method to use."
1269
  msgstr ""
1270
 
1271
+ #: includes/fields/class-base.php:584 includes/fields/class-base.php:603
1272
  msgid "Post Type"
1273
  msgstr ""
1274
 
1275
+ #: includes/fields/class-base.php:585 includes/fields/class-base.php:609
1276
  msgid "Taxonomy"
1277
  msgstr ""
1278
 
1279
+ #: includes/fields/class-base.php:587
1280
  msgid "Dynamic Choices"
1281
  msgstr ""
1282
 
1283
+ #: includes/fields/class-base.php:614
1284
  msgid "Select %s to use for auto-populating field choices."
1285
  msgstr ""
1286
 
1287
+ #: includes/fields/class-base.php:615
1288
  msgid "Dynamic %s Source"
1289
  msgstr ""
1290
 
1291
+ #: includes/fields/class-base.php:732
1292
  msgid "No form ID found"
1293
  msgstr ""
1294
 
1295
+ #: includes/fields/class-base.php:737
1296
  msgid "No field type found"
1297
  msgstr ""
1298
 
1299
+ #: includes/fields/class-base.php:864 includes/fields/class-name.php:485
1300
+ #: includes/fields/class-number.php:152
1301
  #: pro/includes/fields/class-address.php:624
1302
  #: pro/includes/fields/class-date-time.php:532
1303
+ #: pro/includes/fields/class-file-upload.php:330
1304
  #: pro/includes/fields/class-password.php:296
1305
  #: pro/includes/fields/class-password.php:304
1306
  #: pro/includes/fields/class-password.php:309
1307
  #: pro/includes/fields/class-payment-dropdown.php:208
1308
  #: pro/includes/fields/class-payment-multiple.php:175
1309
  #: pro/includes/fields/class-payment-single.php:189
1310
+ #: pro/includes/fields/class-url.php:148
1311
  msgid "This field is required"
1312
  msgstr ""
1313
 
1339
  msgid "Show Values"
1340
  msgstr ""
1341
 
 
 
 
 
 
1342
  #: includes/fields/class-checkbox.php:181 includes/fields/class-radio.php:181
1343
  msgid ""
1344
  "Showing the first 20 choices.<br> All %d choices will be displayed when "
1345
  "viewing the form."
1346
  msgstr ""
1347
 
1348
+ #: includes/fields/class-email.php:21 includes/fields/class-email.php:68
1349
+ #: includes/fields/class-email.php:307
1350
+ #: includes/templates/class-subscribe.php:42
1351
+ #: lite/includes/admin/class-settings.php:262
1352
+ #: lite/includes/admin/class-settings.php:385
1353
+ #: pro/includes/admin/class-settings.php:337
1354
+ #: pro/includes/admin/class-settings.php:460
1355
  #: pro/includes/templates/class-donation.php:42
1356
  #: pro/includes/templates/class-order.php:42
1357
  #: pro/includes/templates/class-request-quote.php:46
 
1358
  msgid "Email"
1359
  msgstr ""
1360
 
1361
+ #: includes/fields/class-email.php:85
1362
+ msgid "Email does not match."
1363
+ msgstr ""
1364
+
1365
+ #: includes/fields/class-email.php:92 includes/fields/class-email.php:312
1366
+ msgid "Confirm Email"
1367
+ msgstr ""
1368
+
1369
+ #: includes/fields/class-email.php:208
1370
  msgid "Enable Email Confirmation"
1371
  msgstr ""
1372
 
1373
+ #: includes/fields/class-email.php:209
1374
  msgid "Check this option ask the user to provide their email address twice."
1375
  msgstr ""
1376
 
1377
+ #: includes/fields/class-email.php:247
1378
+ #: pro/includes/fields/class-password.php:91
1379
  msgid "Confirmation Placeholder Text"
1380
  msgstr ""
1381
 
1382
+ #: includes/fields/class-email.php:248
1383
+ #: pro/includes/fields/class-password.php:92
1384
  msgid "Enter text for the confirmation field placeholder."
1385
  msgstr ""
1386
 
1387
+ #: includes/fields/class-name.php:82 includes/fields/class-name.php:379
1388
+ #: includes/providers/class-base.php:452
1389
+ msgid "First"
1390
  msgstr ""
1391
 
1392
+ #: includes/fields/class-name.php:103 includes/fields/class-name.php:384
1393
+ #: includes/providers/class-base.php:464
1394
+ msgid "Middle"
1395
+ msgstr ""
1396
+
1397
+ #: includes/fields/class-name.php:125 includes/fields/class-name.php:389
1398
+ #: includes/providers/class-base.php:476
1399
+ msgid "Last"
1400
  msgstr ""
1401
 
1402
+ #: includes/fields/class-name.php:222
1403
+ #: pro/includes/fields/class-date-time.php:56
1404
+ #: pro/includes/fields/class-date-time.php:132
1405
+ #: pro/includes/fields/class-date-time.php:168
1406
+ #: pro/includes/fields/class-phone.php:50
1407
+ msgid "Format"
1408
+ msgstr ""
1409
+
1410
+ #: includes/fields/class-name.php:223
1411
  msgid "Select format to use for the name form field"
1412
  msgstr ""
1413
 
1414
+ #: includes/fields/class-name.php:234
1415
  msgid "Simple"
1416
  msgstr ""
1417
 
1418
+ #: includes/fields/class-name.php:235
1419
  msgid "First Last"
1420
  msgstr ""
1421
 
1422
+ #: includes/fields/class-name.php:236
1423
  msgid "First Middle Last"
1424
  msgstr ""
1425
 
1426
+ #: includes/fields/class-name.php:278
 
 
 
 
 
 
 
1427
  msgid "Name field advanced options."
1428
  msgstr ""
1429
 
1430
+ #: includes/fields/class-name.php:281 includes/fields/class-name.php:296
1431
+ #: includes/fields/class-name.php:311 includes/fields/class-name.php:326
1432
  #: pro/includes/fields/class-address.php:113
1433
  #: pro/includes/fields/class-address.php:129
1434
  #: pro/includes/fields/class-address.php:147
1440
  msgid "Placeholder"
1441
  msgstr ""
1442
 
1443
+ #: includes/fields/class-name.php:293
1444
  msgid "First Name"
1445
  msgstr ""
1446
 
1447
+ #: includes/fields/class-name.php:293
1448
  msgid "First name field advanced options."
1449
  msgstr ""
1450
 
1451
+ #: includes/fields/class-name.php:308
1452
  msgid "Middle Name"
1453
  msgstr ""
1454
 
1455
+ #: includes/fields/class-name.php:308
1456
  msgid "Middle name field advanced options."
1457
  msgstr ""
1458
 
1459
+ #: includes/fields/class-name.php:323
1460
  msgid "Last Name"
1461
  msgstr ""
1462
 
1463
+ #: includes/fields/class-name.php:323
1464
  msgid "Last name field advanced options."
1465
  msgstr ""
1466
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1467
  #: includes/fields/class-number.php:21
1468
  msgid "Numbers"
1469
  msgstr ""
1470
 
 
 
 
 
1471
  #: includes/fields/class-radio.php:21
1472
  msgid "Multiple Choice"
1473
  msgstr ""
1536
  msgid "Would you like to display the forms description?"
1537
  msgstr ""
1538
 
1539
+ #: includes/providers/class-base.php:84
1540
+ msgid "Connection"
1541
+ msgstr ""
1542
+
1543
+ #: includes/providers/class-base.php:149 includes/providers/class-base.php:1156
1544
+ #: includes/providers/class-base.php:1191
1545
+ msgid "You do not have permission"
1546
+ msgstr ""
1547
+
1548
+ #: includes/providers/class-base.php:441
1549
+ msgid "Full"
1550
+ msgstr ""
1551
+
1552
+ #: includes/providers/class-base.php:663
1553
+ msgid "Select Account"
1554
+ msgstr ""
1555
+
1556
+ #: includes/providers/class-base.php:675 includes/providers/class-base.php:1284
1557
+ #: includes/providers/class-constant-contact.php:476
1558
+ msgid "Add New Account"
1559
+ msgstr ""
1560
+
1561
+ #: includes/providers/class-base.php:705
1562
+ msgid "Select List"
1563
+ msgstr ""
1564
+
1565
+ #: includes/providers/class-base.php:747
1566
+ msgid "Select Groups"
1567
+ msgstr ""
1568
+
1569
+ #: includes/providers/class-base.php:749
1570
+ msgid ""
1571
+ "We also noticed that you have some segments in your list. You can select "
1572
+ "specific list segments below if needed. This is optional."
1573
+ msgstr ""
1574
+
1575
+ #: includes/providers/class-base.php:805 includes/providers/class-base.php:810
1576
+ msgid "List Fields"
1577
+ msgstr ""
1578
+
1579
+ #: includes/providers/class-base.php:810
1580
+ msgid "Available Form Fields"
1581
+ msgstr ""
1582
+
1583
+ #: includes/providers/class-base.php:871
1584
+ msgid "Conditional Logic"
1585
+ msgstr ""
1586
+
1587
+ #: includes/providers/class-base.php:880
1588
+ msgid "Enable conditional logic"
1589
+ msgstr ""
1590
+
1591
+ #: includes/providers/class-base.php:887
1592
+ msgid "Process this form if"
1593
+ msgstr ""
1594
+
1595
+ #: includes/providers/class-base.php:918
1596
+ msgid "-- Select field --"
1597
+ msgstr ""
1598
+
1599
+ #: includes/providers/class-base.php:935
1600
+ msgid "is"
1601
+ msgstr ""
1602
+
1603
+ #: includes/providers/class-base.php:936
1604
+ msgid "is not"
1605
+ msgstr ""
1606
+
1607
+ #: includes/providers/class-base.php:970
1608
+ msgid "AND"
1609
+ msgstr ""
1610
+
1611
+ #: includes/providers/class-base.php:987
1612
+ msgid "Add rule group"
1613
+ msgstr ""
1614
+
1615
+ #: includes/providers/class-base.php:1160
1616
+ #: includes/providers/class-base.php:1195
1617
+ msgid "Missing data"
1618
+ msgstr ""
1619
+
1620
+ #: includes/providers/class-base.php:1172
1621
+ msgid "Connection missing"
1622
+ msgstr ""
1623
+
1624
+ #: includes/providers/class-base.php:1212
1625
+ #: includes/providers/class-base.php:1274
1626
+ msgid "Connected on: "
1627
+ msgstr ""
1628
+
1629
+ #: includes/providers/class-base.php:1213
1630
+ #: includes/providers/class-base.php:1275
1631
+ msgid "Disconnect "
1632
+ msgstr ""
1633
+
1634
+ #: includes/providers/class-base.php:1259
1635
+ msgid "Integrate %s with WPForms"
1636
+ msgstr ""
1637
+
1638
+ #: includes/providers/class-base.php:1260
1639
+ msgid "Connected"
1640
+ msgstr ""
1641
+
1642
+ #: includes/providers/class-base.php:1290
1643
+ msgid ""
1644
+ "Please fill out all of the fields below to add your new provider account."
1645
+ msgstr ""
1646
+
1647
+ #: includes/providers/class-base.php:1296
1648
+ msgid "Connect to"
1649
+ msgstr ""
1650
+
1651
+ #: includes/providers/class-constant-contact.php:110
1652
+ msgid "Constant Contact Subscription stopped by conditional logic"
1653
+ msgstr ""
1654
+
1655
+ #: includes/providers/class-constant-contact.php:128
1656
+ #: includes/providers/class-constant-contact.php:301
1657
+ msgid "Constant Contact API Error"
1658
+ msgstr ""
1659
+
1660
+ #: includes/providers/class-constant-contact.php:382
1661
+ msgid "Constant Contact API error"
1662
+ msgstr ""
1663
+
1664
+ #: includes/providers/class-constant-contact.php:479
1665
+ msgid ""
1666
+ "Please fill out all of the fields below to register your new Constant "
1667
+ "Contact account."
1668
+ msgstr ""
1669
+
1670
+ #: includes/providers/class-constant-contact.php:481
1671
+ #: includes/providers/class-constant-contact.php:556
1672
+ msgid ""
1673
+ "Click here for documentation on connecting WPForms with Constant Contact."
1674
+ msgstr ""
1675
+
1676
+ #: includes/providers/class-constant-contact.php:486
1677
+ #: includes/providers/class-constant-contact.php:561
1678
+ msgid ""
1679
+ "Because Constant Contact requires external authentication, you will need to "
1680
+ "register WPForms with Constant Contact before you can proceed."
1681
+ msgstr ""
1682
+
1683
+ #: includes/providers/class-constant-contact.php:490
1684
+ #: includes/providers/class-constant-contact.php:565
1685
+ msgid "Click here to register with Constant Contact"
1686
+ msgstr ""
1687
+
1688
+ #: includes/providers/class-constant-contact.php:493
1689
+ #: includes/providers/class-constant-contact.php:568
1690
+ msgid "Authorization Code"
1691
+ msgstr ""
1692
+
1693
+ #: includes/providers/class-constant-contact.php:495
1694
+ #: includes/providers/class-constant-contact.php:570
1695
+ msgid "Account Nickname"
1696
+ msgstr ""
1697
+
1698
+ #: includes/providers/class-constant-contact.php:497
1699
+ msgid "Connect"
1700
+ msgstr ""
1701
+
1702
+ #: includes/providers/class-constant-contact.php:532
1703
+ msgid ""
1704
+ "Get the most out of <strong>WPForms</strong> &mdash; use it with an active "
1705
+ "Constant Contact account."
1706
+ msgstr ""
1707
+
1708
+ #: includes/providers/class-constant-contact.php:534
1709
+ #: includes/providers/class-constant-contact.php:619
1710
+ msgid "Try Constant Contact for Free"
1711
+ msgstr ""
1712
+
1713
+ #: includes/providers/class-constant-contact.php:535
1714
+ msgid ""
1715
+ "Learn More about the <a href=\"%s\" target=\"_blank\" rel=\"noopener "
1716
+ "noreferrer\">power of email marketing</a>"
1717
+ msgstr ""
1718
+
1719
+ #: includes/providers/class-constant-contact.php:617
1720
+ msgid ""
1721
+ "Get the most out of the <strong>WPForms</strong> plugin &mdash; use it with "
1722
+ "an active Constant Contact account."
1723
+ msgstr ""
1724
+
1725
+ #: includes/providers/class-constant-contact.php:620
1726
+ msgid "Connect your existing account"
1727
+ msgstr ""
1728
+
1729
+ #: includes/providers/class-constant-contact.php:621
1730
+ msgid "Learn More about the <a href=\"%s\">power of email marketing</a>"
1731
+ msgstr ""
1732
+
1733
+ #: includes/providers/class-constant-contact.php:676
1734
+ msgid "Grow Your Website with WPForms + Email Marketing"
1735
+ msgstr ""
1736
+
1737
+ #: includes/providers/class-constant-contact.php:677
1738
+ msgid "Wondering if email marketing is really worth your time?"
1739
+ msgstr ""
1740
+
1741
+ #: includes/providers/class-constant-contact.php:678
1742
+ msgid ""
1743
+ "Email is hands-down the most effective way to nurture leads and turn them "
1744
+ "into customers, with a return on investment (ROI) of <strong>$44 back for "
1745
+ "every $1 spent</strong> according to Direct Marketing Association."
1746
+ msgstr ""
1747
+
1748
+ #: includes/providers/class-constant-contact.php:679
1749
+ msgid ""
1750
+ "Here are 3 big reasons why every smart business in the world has an email "
1751
+ "list:"
1752
+ msgstr ""
1753
+
1754
+ #: includes/providers/class-constant-contact.php:682
1755
+ msgid ""
1756
+ "<strong>Email is still #1</strong> - At least 91% of consumers check their "
1757
+ "email on a daily basis. You get direct access to your subscribers, without "
1758
+ "having to play by social media&#39;s rules and algorithms."
1759
+ msgstr ""
1760
+
1761
+ #: includes/providers/class-constant-contact.php:683
1762
+ msgid ""
1763
+ "<strong>You own your email list</strong> - Unlike with social media, your "
1764
+ "list is your property and no one can revoke your access to it."
1765
+ msgstr ""
1766
+
1767
+ #: includes/providers/class-constant-contact.php:684
1768
+ msgid ""
1769
+ "<strong>Email converts</strong> - People who buy products marketed through "
1770
+ "email spend 138% more than those who don&#39;t receive email offers."
1771
+ msgstr ""
1772
+
1773
+ #: includes/providers/class-constant-contact.php:686
1774
+ msgid ""
1775
+ "That&#39;s why it&#39;s crucial to start collecting email addresses and "
1776
+ "building your list as soon as possible."
1777
+ msgstr ""
1778
+
1779
+ #: includes/providers/class-constant-contact.php:687
1780
+ msgid ""
1781
+ "For more details, see this guide on <a href=\"%s\" target=\"_blank\" rel="
1782
+ "\"noopener noreferrer\">why building your email list is so important."
1783
+ msgstr ""
1784
+
1785
+ #: includes/providers/class-constant-contact.php:689
1786
+ msgid "You&#39;ve Already Started - Here&#39;s the Next Step (It&#39;s Easy)"
1787
+ msgstr ""
1788
+
1789
+ #: includes/providers/class-constant-contact.php:690
1790
+ msgid "Here are the 3 things you need to build an email list:"
1791
+ msgstr ""
1792
+
1793
+ #: includes/providers/class-constant-contact.php:692
1794
+ msgid "A Website or Blog"
1795
+ msgstr ""
1796
+
1797
+ #: includes/providers/class-constant-contact.php:693
1798
+ msgid "High-Converting Form Builder"
1799
+ msgstr ""
1800
+
1801
+ #: includes/providers/class-constant-contact.php:694
1802
+ msgid "The Best Email Marketing Service"
1803
+ msgstr ""
1804
+
1805
+ #: includes/providers/class-constant-contact.php:696
1806
+ msgid ""
1807
+ "With a powerful email marketing service like Constant Contact, you can "
1808
+ "instantly send out mass notifications and beautifully designed newsletters "
1809
+ "to engage your subscribers."
1810
+ msgstr ""
1811
+
1812
+ #: includes/providers/class-constant-contact.php:697
1813
+ msgid "Get Started with Constant Contact for Free"
1814
+ msgstr ""
1815
+
1816
+ #: includes/providers/class-constant-contact.php:698
1817
+ msgid ""
1818
+ "WPForms plugin makes it fast and easy to capture all kinds of visitor "
1819
+ "information right from your WordPress site - even if you don&#39;t have a "
1820
+ "Constant Contact account."
1821
+ msgstr ""
1822
+
1823
+ #: includes/providers/class-constant-contact.php:699
1824
+ msgid ""
1825
+ "But when you combine WPForms with Constant Contact, you can nurture your "
1826
+ "contacts and engage with them even after they leave your website. When you "
1827
+ "use Constant Contact + WPForms together, you can:"
1828
+ msgstr ""
1829
+
1830
+ #: includes/providers/class-constant-contact.php:701
1831
+ msgid "Seamlessly add new contacts to your email list"
1832
+ msgstr ""
1833
+
1834
+ #: includes/providers/class-constant-contact.php:702
1835
+ msgid "Create and send professional email newsletters"
1836
+ msgstr ""
1837
+
1838
+ #: includes/providers/class-constant-contact.php:703
1839
+ msgid "Get expert marketing and support"
1840
+ msgstr ""
1841
+
1842
+ #: includes/providers/class-constant-contact.php:705
1843
+ msgid "Try Constant Contact Today"
1844
+ msgstr ""
1845
+
1846
+ #: includes/providers/class-constant-contact.php:707
1847
+ msgid "WPForms Makes List Building Easy"
1848
+ msgstr ""
1849
+
1850
+ #: includes/providers/class-constant-contact.php:708
1851
+ msgid ""
1852
+ "When creating WPForms, our goal was to make a WordPress forms plugin "
1853
+ "that&#39;s both EASY and POWERFUL."
1854
+ msgstr ""
1855
+
1856
+ #: includes/providers/class-constant-contact.php:709
1857
+ msgid ""
1858
+ "We made the form creation process extremely intuitive, so you can create a "
1859
+ "form to start capturing emails within 5 minutes or less."
1860
+ msgstr ""
1861
+
1862
+ #: includes/providers/class-constant-contact.php:710
1863
+ msgid "Here&#39;s how it works."
1864
+ msgstr ""
1865
+
1866
+ #: includes/providers/class-constant-contact.php:714
1867
+ msgid "1. Select from our pre-built templates, or create a form from scratch."
1868
+ msgstr ""
1869
+
1870
+ #: includes/providers/class-constant-contact.php:718
1871
+ msgid "2. Drag and drop any field you want onto your signup form."
1872
+ msgstr ""
1873
+
1874
+ #: includes/providers/class-constant-contact.php:722
1875
+ msgid "3. Connect your Constant Contact email list."
1876
+ msgstr ""
1877
+
1878
+ #: includes/providers/class-constant-contact.php:726
1879
+ msgid "4. Add your new form to any post, page, or sidebar."
1880
+ msgstr ""
1881
+
1882
+ #: includes/providers/class-constant-contact.php:729
1883
+ msgid ""
1884
+ "It doesn&#39;t matter what kind of business you run, what kind of website "
1885
+ "you have, or what industry you are in - you need to start building your "
1886
+ "email list today."
1887
+ msgstr ""
1888
+
1889
+ #: includes/providers/class-constant-contact.php:730
1890
+ msgid "With Constant Contact + WPForms, growing your list is easy."
1891
+ msgstr ""
1892
+
1893
  #: includes/templates/class-blank.php:20
1894
  msgid "Blank Form"
1895
  msgstr ""
1902
 
1903
  #: includes/templates/class-blank.php:32
1904
  #: includes/templates/class-contact.php:63
1905
+ #: includes/templates/class-subscribe.php:50
1906
  #: includes/templates/class-suggestion.php:88
1907
  #: pro/includes/templates/class-donation.php:65
1908
  #: pro/includes/templates/class-order.php:99
1909
  #: pro/includes/templates/class-request-quote.php:69
 
1910
  msgid "Sending..."
1911
  msgstr ""
1912
 
1931
  msgid "Comment or Message"
1932
  msgstr ""
1933
 
1934
+ #: includes/templates/class-subscribe.php:20
1935
+ msgid "Newsletter Signup Form"
1936
+ msgstr ""
1937
+
1938
+ #: includes/templates/class-subscribe.php:22
1939
+ msgid ""
1940
+ "Add subscribers and grow your email list with this newsletter signup form. "
1941
+ "You can add and remove fields as needed."
1942
+ msgstr ""
1943
+
1944
+ #: includes/templates/class-subscribe.php:26
1945
+ #: pro/includes/templates/class-donation.php:26
1946
+ #: pro/includes/templates/class-order.php:26
1947
+ msgid "Don&#39;t Forget"
1948
+ msgstr ""
1949
+
1950
+ #: includes/templates/class-subscribe.php:27
1951
+ msgid "Click the marketing tab to configure your newsletter service provider"
1952
+ msgstr ""
1953
+
1954
  #: includes/templates/class-suggestion.php:20
1955
  msgid "Suggestion Form"
1956
  msgstr ""
2021
  "from the WPForms team!"
2022
  msgstr ""
2023
 
2024
+ #: lite/includes/admin/class-settings.php:150
2025
+ #: pro/includes/admin/class-settings.php:161
2026
  msgid "Are you sure you want to disconnect this account?"
2027
  msgstr ""
2028
 
2029
+ #: lite/includes/admin/class-settings.php:151
2030
+ #: pro/includes/admin/class-settings.php:162
2031
  msgid "Upload or Choose Your Image"
2032
  msgstr ""
2033
 
2034
+ #: lite/includes/admin/class-settings.php:152
2035
+ #: pro/includes/admin/class-settings.php:163
2036
  msgid "Use Image"
2037
  msgstr ""
2038
 
2039
+ #: lite/includes/admin/class-settings.php:171
2040
+ #: pro/includes/admin/class-settings.php:183
2041
+ msgid "Integrations"
2042
  msgstr ""
2043
 
2044
+ #: lite/includes/admin/class-settings.php:172
2045
+ #: pro/includes/admin/class-settings.php:185
2046
+ msgid "System Info"
2047
+ msgstr ""
2048
+
2049
+ #: lite/includes/admin/class-settings.php:195
2050
+ #: pro/includes/admin/class-settings.php:208
2051
+ #: pro/includes/admin/class-settings.php:555
2052
  msgid "Settings check failed."
2053
  msgstr ""
2054
 
2055
+ #: lite/includes/admin/class-settings.php:222
2056
+ #: pro/includes/admin/class-settings.php:241
2057
  msgid "General settings updated."
2058
  msgstr ""
2059
 
2060
+ #: lite/includes/admin/class-settings.php:239
2061
+ #: pro/includes/admin/class-settings.php:314
2062
  msgid "Include Form Styling"
2063
  msgstr ""
2064
 
2065
+ #: lite/includes/admin/class-settings.php:243
2066
+ #: pro/includes/admin/class-settings.php:318
2067
  msgid "Base and form theme styling"
2068
  msgstr ""
2069
 
2070
+ #: lite/includes/admin/class-settings.php:244
2071
+ #: pro/includes/admin/class-settings.php:319
2072
  msgid "Base styling only"
2073
  msgstr ""
2074
 
2075
+ #: lite/includes/admin/class-settings.php:245
2076
+ #: pro/includes/admin/class-settings.php:320
2077
+ #: pro/includes/fields/class-page-break.php:74
2078
  msgid "None"
2079
  msgstr ""
2080
 
2081
+ #: lite/includes/admin/class-settings.php:247
2082
+ #: pro/includes/admin/class-settings.php:322
2083
  msgid "Determines which CSS files to load for the site."
2084
  msgstr ""
2085
 
2086
+ #: lite/includes/admin/class-settings.php:252
2087
+ #: pro/includes/admin/class-settings.php:327
2088
  msgid "Load Assets Globally"
2089
  msgstr ""
2090
 
2091
+ #: lite/includes/admin/class-settings.php:256
2092
+ #: pro/includes/admin/class-settings.php:331
2093
  msgid ""
2094
  "Check this if you would like to load WPForms assets site-wide. Only check if "
2095
  "your site is having compatibility issues or instructed to by support."
2096
  msgstr ""
2097
 
2098
+ #: lite/includes/admin/class-settings.php:267
2099
+ #: pro/includes/admin/class-settings.php:342
2100
  msgid "Email Template"
2101
  msgstr ""
2102
 
2103
+ #: lite/includes/admin/class-settings.php:271
2104
+ #: pro/includes/admin/class-settings.php:346
2105
  msgid "Default HTML template"
2106
  msgstr ""
2107
 
2108
+ #: lite/includes/admin/class-settings.php:272
2109
+ #: pro/includes/admin/class-settings.php:347
2110
  msgid "Plain Text"
2111
  msgstr ""
2112
 
2113
+ #: lite/includes/admin/class-settings.php:274
2114
+ #: pro/includes/admin/class-settings.php:349
2115
  msgid "Determines how email notifications will be formatted."
2116
  msgstr ""
2117
 
2118
+ #: lite/includes/admin/class-settings.php:279
2119
+ #: pro/includes/admin/class-settings.php:354
2120
  msgid "Email Header Image "
2121
  msgstr ""
2122
 
2123
+ #: lite/includes/admin/class-settings.php:291
2124
+ #: pro/includes/admin/class-settings.php:366
2125
  msgid "Upload Image"
2126
  msgstr ""
2127
 
2128
+ #: lite/includes/admin/class-settings.php:293
2129
+ #: pro/includes/admin/class-settings.php:368
2130
  msgid ""
2131
  "Upload or choose a logo to be displayed at the top of email notifications."
2132
  msgstr ""
2133
 
2134
+ #: lite/includes/admin/class-settings.php:294
2135
+ #: pro/includes/admin/class-settings.php:369
2136
  msgid "Recommended size is 300x100 or smaller for best support on all devices."
2137
  msgstr ""
2138
 
2139
+ #: lite/includes/admin/class-settings.php:300
2140
+ #: pro/includes/admin/class-settings.php:375
2141
  msgid "Email Background Color"
2142
  msgstr ""
2143
 
2144
+ #: lite/includes/admin/class-settings.php:304
2145
+ #: pro/includes/admin/class-settings.php:379
2146
  msgid "Customize the background color of the HTML email template."
2147
  msgstr ""
2148
 
2149
+ #: lite/includes/admin/class-settings.php:309
2150
+ #: pro/includes/admin/class-settings.php:384
2151
  msgid "Email Carbon Copy"
2152
  msgstr ""
2153
 
2154
+ #: lite/includes/admin/class-settings.php:313
2155
+ #: pro/includes/admin/class-settings.php:388
2156
+ msgid ""
2157
+ "Check this if you would like to enable the ability to CC: email addresses in "
2158
+ "the form notification settings."
2159
+ msgstr ""
2160
+
2161
+ #: lite/includes/admin/class-settings.php:319
2162
+ #: pro/includes/admin/class-settings.php:394
2163
+ msgid "reCAPTCHA"
2164
+ msgstr ""
2165
+
2166
+ #: lite/includes/admin/class-settings.php:320
2167
+ #: pro/includes/admin/class-settings.php:395
2168
+ msgid ""
2169
+ "reCAPTCHA is a free anti-spam service from Google which helps to protect "
2170
+ "your website from spam and abuse while letting real people pass through with "
2171
+ "ease."
2172
+ msgstr ""
2173
+
2174
+ #: lite/includes/admin/class-settings.php:321
2175
+ #: pro/includes/admin/class-settings.php:396
2176
+ msgid ""
2177
+ "Google's original <a href=\"https://www.google.com/recaptcha/intro/\" rel="
2178
+ "\"noopener noreferrer\">v2 reCAPTCHA</a> prompts users to check a box to "
2179
+ "prove they're human, whereas <a href=\"https://www.google.com/recaptcha/"
2180
+ "intro/invisible.html\" rel=\"noopener noreferrer\">Invisible reCAPTCHA</a> "
2181
+ "uses advanced technology to detect real users without requiring any input."
2182
+ msgstr ""
2183
+
2184
+ #: lite/includes/admin/class-settings.php:322
2185
+ #: pro/includes/admin/class-settings.php:397
2186
+ msgid ""
2187
+ "Sites already using v2 reCAPTCHA will need to create new site keys before "
2188
+ "switching to the Invisible reCAPTCHA."
2189
+ msgstr ""
2190
+
2191
+ #: lite/includes/admin/class-settings.php:323
2192
+ #: pro/includes/admin/class-settings.php:398
2193
+ msgid ""
2194
+ "<a href=\"https://wpforms.com/docs/setup-captcha-wpforms/\" rel=\"noopener "
2195
+ "noreferrer\">Read our walk through</a> to learn more and for step-by-step "
2196
+ "directions."
2197
+ msgstr ""
2198
+
2199
+ #: lite/includes/admin/class-settings.php:328
2200
+ #: pro/includes/admin/class-settings.php:403
2201
+ msgid "reCAPTCHA Type"
2202
+ msgstr ""
2203
+
2204
+ #: lite/includes/admin/class-settings.php:347
2205
+ #: pro/includes/admin/class-settings.php:422
2206
+ msgid "reCAPTCHA Site key"
2207
+ msgstr ""
2208
+
2209
+ #: lite/includes/admin/class-settings.php:355
2210
+ #: pro/includes/admin/class-settings.php:430
2211
+ msgid "reCAPTCHA Secret key"
2212
+ msgstr ""
2213
+
2214
+ #: lite/includes/admin/class-settings.php:364
2215
+ #: pro/includes/admin/class-settings.php:439
2216
+ msgid "Validation Messages"
2217
  msgstr ""
2218
 
2219
+ #: lite/includes/admin/class-settings.php:377
2220
+ #: pro/includes/admin/class-settings.php:452
2221
+ msgid "Website URL"
2222
  msgstr ""
2223
 
2224
+ #: lite/includes/admin/class-settings.php:393
2225
+ #: pro/includes/admin/class-settings.php:468
2226
+ msgid "Number"
 
 
 
 
 
 
 
2227
  msgstr ""
2228
 
2229
+ #: lite/includes/admin/class-settings.php:401
2230
+ #: pro/includes/admin/class-settings.php:476
2231
+ msgid "Confirm Value"
2232
  msgstr ""
2233
 
2234
+ #: lite/includes/admin/class-settings.php:410
2235
+ #: pro/includes/admin/class-settings.php:533
2236
+ msgid "Save General Settings"
2237
  msgstr ""
2238
 
2239
+ #: lite/includes/admin/class-settings.php:430
2240
+ #: pro/includes/admin/class-settings.php:623
2241
+ msgid ""
2242
+ "You do not have any marketing add-ons activated. You can head over to the <a "
2243
+ "href=\"%s\">Add-Ons page</a> to install and activate the add-on for your "
2244
+ "provider."
2245
  msgstr ""
2246
 
2247
+ #: lite/includes/admin/class-settings.php:555
2248
+ #: lite/includes/admin/class-settings.php:559
2249
+ #: pro/includes/admin/class-settings.php:994
2250
+ #: pro/includes/admin/class-settings.php:998
2251
  #: pro/includes/admin/entries/class-entries.php:1105
2252
  #: pro/includes/admin/entries/class-entries.php:1427
2253
  msgid "M j, Y @ g:ia"
2254
  msgstr ""
2255
 
2256
+ #: lite/wpforms-lite.php:86 pro/wpforms-pro.php:269
2257
  msgid "Default Notification"
2258
  msgstr ""
2259
 
2260
+ #: lite/wpforms-lite.php:94 pro/wpforms-pro.php:284
2261
  msgid "Send To Email Address"
2262
  msgstr ""
2263
 
2264
+ #: lite/wpforms-lite.php:97 pro/wpforms-pro.php:287
2265
  msgid ""
2266
  "Enter the email address to receive form entry notifications. For multiple "
2267
  "notifications, separate email addresses with a comma."
2268
  msgstr ""
2269
 
2270
+ #: lite/wpforms-lite.php:113 pro/wpforms-pro.php:303
2271
  msgid "CC"
2272
  msgstr ""
2273
 
2274
+ #: lite/wpforms-lite.php:129 pro/wpforms-pro.php:319
2275
  msgid "Email Subject"
2276
  msgstr ""
2277
 
2278
+ #: lite/wpforms-lite.php:131 pro/wpforms-pro.php:321
2279
  msgid "New Entry: "
2280
  msgstr ""
2281
 
2282
+ #: lite/wpforms-lite.php:144 pro/wpforms-pro.php:334
2283
  msgid "From Name"
2284
  msgstr ""
2285
 
2286
+ #: lite/wpforms-lite.php:160 pro/wpforms-pro.php:350
2287
  msgid "From Email"
2288
  msgstr ""
2289
 
2290
+ #: lite/wpforms-lite.php:176 pro/wpforms-pro.php:366
2291
  msgid "Reply-To"
2292
  msgstr ""
2293
 
2294
+ #: lite/wpforms-lite.php:201 pro/wpforms-pro.php:391
2295
  msgid ""
2296
  "To display all form fields, use the <code>{all_fields}</code> Smart Tag."
2297
  msgstr ""
2298
 
2299
+ #: lite/wpforms-lite.php:438
2300
  msgid "is a PRO Feature"
2301
  msgstr ""
2302
 
2303
+ #: lite/wpforms-lite.php:439
2304
  msgid ""
2305
  "We're sorry, %name% is not available on your plan.<br><br>Please upgrade to "
2306
  "the PRO plan to unlock all these awesome features."
2307
  msgstr ""
2308
 
2309
+ #: lite/wpforms-lite.php:440
2310
  msgid "Upgrade to PRO"
2311
  msgstr ""
2312
 
2340
  msgstr ""
2341
 
2342
  #: pro/includes/admin/builder/panels/class-payments.php:21
2343
+ #: pro/includes/admin/class-settings.php:182
2344
  msgid "Payments"
2345
  msgstr ""
2346
 
 
 
 
 
 
 
 
2347
  #: pro/includes/admin/builder/panels/class-payments.php:69
2348
  msgid "Install Your Payment Integration"
2349
  msgstr ""
2366
  "best to get it added as fast as possible"
2367
  msgstr ""
2368
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2369
  #: pro/includes/admin/class-addons.php:85
2370
  #: pro/includes/admin/class-addons.php:239
2371
  msgid "Install Addon"
2479
  "to help us spread the word and boost our motivation?"
2480
  msgstr ""
2481
 
2482
+ #: pro/includes/admin/class-settings.php:184
 
 
 
 
2483
  msgid "Import/Export"
2484
  msgstr ""
2485
 
2486
+ #: pro/includes/admin/class-settings.php:248
 
 
 
 
2487
  msgid "Please enter a license key to verify."
2488
  msgstr ""
2489
 
2490
+ #: pro/includes/admin/class-settings.php:277
2491
  msgid "License"
2492
  msgstr ""
2493
 
2494
+ #: pro/includes/admin/class-settings.php:278
2495
  msgid "Your license key provides access to updates and Add-ons. "
2496
  msgstr ""
2497
 
2498
+ #: pro/includes/admin/class-settings.php:283
2499
  msgid "License Key"
2500
  msgstr ""
2501
 
2502
+ #: pro/includes/admin/class-settings.php:287
2503
  msgid "Verify Key"
2504
  msgstr ""
2505
 
2506
+ #: pro/includes/admin/class-settings.php:289
2507
  msgid "Deactivate Key"
2508
  msgstr ""
2509
 
2510
+ #: pro/includes/admin/class-settings.php:297
2511
  msgid "License Key Type"
2512
  msgstr ""
2513
 
2514
+ #: pro/includes/admin/class-settings.php:300
2515
  msgid "Your license key type for this site is <strong>%s.</strong>"
2516
  msgstr ""
2517
 
2518
+ #: pro/includes/admin/class-settings.php:301
2519
  msgid "Refresh Key"
2520
  msgstr ""
2521
 
2522
+ #: pro/includes/admin/class-settings.php:302
2523
  msgid ""
2524
  "If your license has been upgraded or is incorrect, you may force a refresh."
2525
  msgstr ""
2526
 
2527
+ #: pro/includes/admin/class-settings.php:484
2528
+ msgid "File Extension"
2529
+ msgstr ""
2530
+
2531
+ #: pro/includes/admin/class-settings.php:492
2532
+ msgid "File Size"
2533
+ msgstr ""
2534
+
2535
+ #: pro/includes/admin/class-settings.php:500
2536
+ #: pro/includes/admin/class-settings.php:508
2537
+ msgid "Time (12 hour)"
2538
+ msgstr ""
2539
+
2540
+ #: pro/includes/admin/class-settings.php:516
2541
+ msgid "Payment Required"
2542
+ msgstr ""
2543
+
2544
+ #: pro/includes/admin/class-settings.php:524
2545
+ #: pro/includes/fields/class-payment-credit-card.php:21
2546
+ msgid "Credit Card"
2547
+ msgstr ""
2548
+
2549
+ #: pro/includes/admin/class-settings.php:566
2550
  msgid "Settings updated."
2551
  msgstr ""
2552
 
2553
+ #: pro/includes/admin/class-settings.php:580
2554
  msgid "Currency"
2555
  msgstr ""
2556
 
2557
+ #: pro/includes/admin/class-settings.php:592
2558
  msgid "Determines which currency to use for payments."
2559
  msgstr ""
2560
 
2561
+ #: pro/includes/admin/class-settings.php:642
 
 
 
 
 
 
 
2562
  msgid "Form(s) imported"
2563
  msgstr ""
2564
 
2565
+ #: pro/includes/admin/class-settings.php:651
2566
  msgid "Form Import"
2567
  msgstr ""
2568
 
2569
+ #: pro/includes/admin/class-settings.php:656
2570
  msgid "Select an export file."
2571
  msgstr ""
2572
 
2573
+ #: pro/includes/admin/class-settings.php:662
2574
  msgid "Import"
2575
  msgstr ""
2576
 
2577
+ #: pro/includes/admin/class-settings.php:669
2578
  msgid "Form Export"
2579
  msgstr ""
2580
 
2581
+ #: pro/includes/admin/class-settings.php:674
2582
  msgid ""
2583
  "Select form(s) to download an export file. This can be imported into another "
2584
  "site."
2585
  msgstr ""
2586
 
2587
+ #: pro/includes/admin/class-settings.php:689
2588
  msgid "Export"
2589
  msgstr ""
2590
 
2591
+ #: pro/includes/admin/class-settings.php:696
2592
+ msgid "Form Template Export"
2593
+ msgstr ""
2594
+
2595
+ #: pro/includes/admin/class-settings.php:703
2596
+ msgid ""
2597
+ "The following code can be used to register your custom form template. Copy "
2598
+ "and paste the following code to your theme's functions.php file or include "
2599
+ "it within an external file."
2600
+ msgstr ""
2601
+
2602
+ #: pro/includes/admin/class-settings.php:704
2603
+ msgid ""
2604
+ "For more information <a href=\"%s\" target=\"blank\" rel=\"noopener "
2605
+ "noreferrer\">see our documentation</a> for additional details."
2606
+ msgstr ""
2607
+
2608
+ #: pro/includes/admin/class-settings.php:708
2609
+ msgid ""
2610
+ "Select a form to generate PHP code that can be used to register a custom "
2611
+ "form template."
2612
+ msgstr ""
2613
+
2614
+ #: pro/includes/admin/class-settings.php:723
2615
+ msgid "Generate template code"
2616
+ msgstr ""
2617
+
2618
+ #: pro/includes/admin/class-settings.php:788
2619
  msgid "Please upload a valid .json form export file."
2620
  msgstr ""
2621
 
2622
+ #: pro/includes/admin/class-settings.php:788
2623
  #: pro/includes/admin/entries/class-entries-export.php:300
2624
  msgid "Error"
2625
  msgstr ""
2981
  msgid "(Abandoned)"
2982
  msgstr ""
2983
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2984
  #: pro/includes/fields/class-address.php:21
2985
  #: pro/includes/templates/class-order.php:57
2986
  msgid "Address"
3115
  msgid "File Upload"
3116
  msgstr ""
3117
 
3118
+ #: pro/includes/fields/class-file-upload.php:149
3119
  msgid "Allowed File Extensions"
3120
  msgstr ""
3121
 
3122
+ #: pro/includes/fields/class-file-upload.php:150
3123
  msgid "Enter the extensions you would like to allow, comma separated."
3124
  msgstr ""
3125
 
3126
+ #: pro/includes/fields/class-file-upload.php:175
3127
  msgid "Max File Size"
3128
  msgstr ""
3129
 
3130
+ #: pro/includes/fields/class-file-upload.php:176
3131
  msgid ""
3132
  "Enter the max file size, in megabytyes, to allow. If left blank, the value "
3133
  "defaults to the maximum size the server allows which is "
3134
  msgstr ""
3135
 
3136
+ #: pro/includes/fields/class-file-upload.php:224
3137
  msgid "Store file in WordPress Media Library"
3138
  msgstr ""
3139
 
3140
+ #: pro/includes/fields/class-file-upload.php:225
3141
  msgid ""
3142
  "Check this option to store the final uploaded file in the WordPress Media "
3143
  "Library"
3144
  msgstr ""
3145
 
3146
+ #: pro/includes/fields/class-file-upload.php:312
3147
  msgid "The uploaded file exceeds the upload_max_filesize directive in php.ini."
3148
  msgstr ""
3149
 
3150
+ #: pro/includes/fields/class-file-upload.php:313
3151
  msgid ""
3152
  "The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in "
3153
  "the HTML form."
3154
  msgstr ""
3155
 
3156
+ #: pro/includes/fields/class-file-upload.php:314
3157
  msgid "The uploaded file was only partially uploaded."
3158
  msgstr ""
3159
 
3160
+ #: pro/includes/fields/class-file-upload.php:315
3161
  msgid "No file was uploaded."
3162
  msgstr ""
3163
 
3164
+ #: pro/includes/fields/class-file-upload.php:317
3165
  msgid "Missing a temporary folder."
3166
  msgstr ""
3167
 
3168
+ #: pro/includes/fields/class-file-upload.php:318
3169
  msgid "Failed to write file to disk."
3170
  msgstr ""
3171
 
3172
+ #: pro/includes/fields/class-file-upload.php:319
3173
  msgid "File upload stopped by extension."
3174
  msgstr ""
3175
 
3176
+ #: pro/includes/fields/class-file-upload.php:321
3177
  msgid "File upload error. "
3178
  msgstr ""
3179
 
3180
+ #: pro/includes/fields/class-file-upload.php:340
3181
  msgid "File exceeds max size allowed"
3182
  msgstr ""
3183
 
3184
+ #: pro/includes/fields/class-file-upload.php:356
3185
  msgid "File must have an extension."
3186
  msgstr ""
3187
 
 
 
 
 
 
 
3188
  #: pro/includes/fields/class-hidden.php:21
3189
  msgid "Hidden Field"
3190
  msgstr ""
3193
  msgid "HTML"
3194
  msgstr ""
3195
 
3196
+ #: pro/includes/fields/class-html.php:116
3197
  msgid "HTML / Code Block"
3198
  msgstr ""
3199
 
3200
+ #: pro/includes/fields/class-html.php:117
3201
  msgid "Contents of this field are not displayed in the admin area."
3202
  msgstr ""
3203
 
3204
  #: pro/includes/fields/class-page-break.php:21
3205
+ #: pro/includes/fields/class-page-break.php:324
3206
  msgid "Page Break"
3207
  msgstr ""
3208
 
3209
+ #: pro/includes/fields/class-page-break.php:71
 
 
 
 
 
3210
  msgid "Progress Bar"
3211
  msgstr ""
3212
 
3213
+ #: pro/includes/fields/class-page-break.php:72
3214
  msgid "Circles"
3215
  msgstr ""
3216
 
3217
+ #: pro/includes/fields/class-page-break.php:73
3218
  msgid "Connector"
3219
  msgstr ""
3220
 
3221
+ #: pro/includes/fields/class-page-break.php:81
3222
  msgid "Progress Indicator"
3223
  msgstr ""
3224
 
3225
+ #: pro/includes/fields/class-page-break.php:82
3226
+ msgid ""
3227
+ "Select theme for Page Indicator which is displayed at the top of the form."
3228
  msgstr ""
3229
 
3230
+ #: pro/includes/fields/class-page-break.php:108
3231
  msgid "Page Indicator Color"
3232
  msgstr ""
3233
 
3234
+ #: pro/includes/fields/class-page-break.php:109
3235
+ msgid "Select the primary color for the Page Indicator theme."
3236
  msgstr ""
3237
 
3238
+ #: pro/includes/fields/class-page-break.php:138
3239
  msgid "Page Title"
3240
  msgstr ""
3241
 
3242
+ #: pro/includes/fields/class-page-break.php:139
3243
+ msgid "Enter text for the page title."
3244
  msgstr ""
3245
 
3246
+ #: pro/includes/fields/class-page-break.php:166
3247
+ msgid "Next Label"
 
3248
  msgstr ""
3249
 
3250
+ #: pro/includes/fields/class-page-break.php:167
3251
+ msgid "Enter text for Next page navigation button."
3252
  msgstr ""
3253
 
3254
+ #: pro/includes/fields/class-page-break.php:176
3255
+ #: pro/includes/fields/class-page-break.php:319
3256
+ msgid "Next"
3257
  msgstr ""
3258
 
3259
+ #: pro/includes/fields/class-page-break.php:196
3260
  msgid "Display Previous"
3261
  msgstr ""
3262
 
3263
+ #: pro/includes/fields/class-page-break.php:197
3264
+ msgid "Toggle displaying the Previous page navigation button."
3265
+ msgstr ""
3266
+
3267
+ #: pro/includes/fields/class-page-break.php:222
3268
  msgid "Previous Label"
3269
  msgstr ""
3270
 
3271
+ #: pro/includes/fields/class-page-break.php:223
3272
+ msgid "Enter text for Previous page navigation button."
3273
+ msgstr ""
3274
+
3275
+ #: pro/includes/fields/class-page-break.php:271
3276
+ msgid "Page Navigation Alignment"
3277
+ msgstr ""
3278
+
3279
+ #: pro/includes/fields/class-page-break.php:272
3280
  msgid "Select the alignment for the Next/Previous page navigation buttons"
3281
  msgstr ""
3282
 
3283
+ #: pro/includes/fields/class-page-break.php:282
3284
  msgid "Left"
3285
  msgstr ""
3286
 
3287
+ #: pro/includes/fields/class-page-break.php:283
3288
  msgid "Right"
3289
  msgstr ""
3290
 
3291
+ #: pro/includes/fields/class-page-break.php:284
3292
  msgid "Center"
3293
  msgstr ""
3294
 
3295
+ #: pro/includes/fields/class-page-break.php:285
3296
  msgid "Split"
3297
  msgstr ""
3298
 
3299
+ #: pro/includes/fields/class-page-break.php:323
3300
+ msgid "First Page"
3301
  msgstr ""
3302
 
3303
+ #: pro/includes/fields/class-page-break.php:525
3304
+ msgid "Step"
3305
+ msgstr ""
3306
+
3307
+ #: pro/includes/fields/class-page-break.php:526
3308
+ msgid "of"
3309
  msgstr ""
3310
 
3311
  #: pro/includes/fields/class-password.php:21
3335
  msgid "Email does not match"
3336
  msgstr ""
3337
 
 
 
 
 
3338
  #: pro/includes/fields/class-payment-credit-card.php:59
3339
  msgid "Card Number Placeholder Text"
3340
  msgstr ""
3452
  msgid "Amount mismatch"
3453
  msgstr ""
3454
 
3455
+ #: pro/includes/fields/class-payment-total.php:199
3456
+ msgid "Payment is required"
3457
+ msgstr ""
3458
+
3459
  #: pro/includes/fields/class-phone.php:21
3460
  #: pro/includes/templates/class-order.php:49
3461
  #: pro/includes/templates/class-request-quote.php:53
3470
  msgid "Website / URL"
3471
  msgstr ""
3472
 
3473
+ #: pro/includes/fields/class-url.php:153
3474
  msgid "Please enter a valid URL"
3475
  msgstr ""
3476
 
3580
  "Donation form. You can add and remove fields as needed."
3581
  msgstr ""
3582
 
 
 
 
 
 
 
3583
  #: pro/includes/templates/class-donation.php:27
3584
  msgid "Click the Payments tab to configure your payment provider"
3585
  msgstr ""
3628
  msgid "Request"
3629
  msgstr ""
3630
 
3631
+ #: pro/wpforms-pro.php:188
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3632
  msgid "Disable storing entry information in WordPress"
3633
  msgstr ""
3634
 
3635
+ #: pro/wpforms-pro.php:249
3636
  msgid "Add New Notification"
3637
  msgstr ""
3638
 
3639
+ #: pro/wpforms-pro.php:404
3640
  msgid "Send"
3641
  msgstr ""
3642
 
3643
+ #: pro/wpforms-pro.php:405
3644
  msgid "Don't send"
3645
  msgstr ""
3646
 
3647
+ #: pro/wpforms-pro.php:407
3648
  msgid "this notification if"
3649
  msgstr ""
3650
 
3651
+ #: pro/wpforms-pro.php:408
3652
  msgid "Email notifications"
3653
  msgstr ""
3654
 
3655
+ #: pro/wpforms-pro.php:411
3656
  msgid ""
3657
  "Install the <a href=\"%s\">Conditional Logic add-on</a> to enable "
3658
  "conditional logic for Email Notifications."
3662
  msgid "Please deactivate WPForms Lite before activating WPForms"
3663
  msgstr ""
3664
 
3665
+ #. #-#-#-#-# wpforms.pot (WPForms 1.3.7.2) #-#-#-#-#
3666
  #. Plugin URI of the plugin/theme
3667
+ #. #-#-#-#-# wpforms.pot (WPForms 1.3.7.2) #-#-#-#-#
3668
  #. Author URI of the plugin/theme
3669
  msgid "https://wpforms.com"
3670
  msgstr ""
lite/includes/admin/class-settings.php CHANGED
@@ -7,16 +7,25 @@
7
  * @since 1.0.0
8
  * @license GPL-2.0+
9
  * @copyright Copyright (c) 2016, WPForms LLC
10
- */
11
  class WPForms_Settings {
12
 
13
  /**
14
- * Holds the plugin settings
15
  *
16
  * @since 1.0.0
 
17
  */
18
  protected $options;
19
 
 
 
 
 
 
 
 
 
20
  /**
21
  * Primary class constructor.
22
  *
@@ -35,18 +44,20 @@ class WPForms_Settings {
35
  * Get the value of a specific setting.
36
  *
37
  * @since 1.0.0
 
 
 
38
  * @return mixed
39
- */
40
  public function get( $key, $default = false, $option = 'wpforms_settings' ) {
41
 
42
- if ( 'wpforms_settings' == $option && !empty( $this->options ) ) {
43
  $options = $this->options;
44
  } else {
45
  $options = get_option( $option, false );
46
  }
47
 
48
- $value = ! empty( $options[ $key ] ) ? $options[ $key ] : $default;
49
- return $value;
50
  }
51
 
52
  /**
@@ -56,20 +67,26 @@ class WPForms_Settings {
56
  */
57
  public function init() {
58
 
59
- // Check what page we are on
60
  $page = isset( $_GET['page'] ) ? $_GET['page'] : '';
61
 
62
- // Only load if we are actually on the settings page
63
- if ( $page == 'wpforms-settings' ) {
64
 
65
- // Retrieve settings
66
  $this->options = get_option( 'wpforms_settings', array() );
67
 
68
- add_action( 'wpforms_tab_settings_general', array( $this, 'settings_page_tab_general' ) );
69
- add_action( 'wpforms_tab_settings_providers', array( $this, 'settings_page_tab_providers' ) );
70
- add_action( 'wpforms_tab_settings_system', array( $this, 'settings_page_tab_system' ) );
71
- add_action( 'admin_enqueue_scripts', array( $this, 'enqueues' ) );
72
- add_action( 'wpforms_admin_page', array( $this, 'output' ) );
 
 
 
 
 
 
73
 
74
  // Hook for add-ons
75
  do_action( 'wpforms_settings_init' );
@@ -119,7 +136,7 @@ class WPForms_Settings {
119
  wp_enqueue_script(
120
  'wpforms-settings',
121
  WPFORMS_PLUGIN_URL . 'assets/js/admin-settings.js',
122
- array( 'jquery', 'jquery-ui-tabs' ),
123
  WPFORMS_VERSION,
124
  false
125
  );
@@ -136,7 +153,7 @@ class WPForms_Settings {
136
  )
137
  );
138
 
139
- // Hook for add-ons
140
  do_action( 'wpforms_settings_enqueue' );
141
  }
142
 
@@ -148,14 +165,14 @@ class WPForms_Settings {
148
  */
149
  public function setting_page_tabs() {
150
 
151
- // Define our base tabs
152
  $tabs = array(
153
- 'general' => __( 'General', 'wpforms' ),
154
- 'providers' => __( 'Integrations', 'wpforms' ),
155
- 'system' => __( 'System Information', 'wpforms' ),
156
  );
157
 
158
- // Allow for addons and extensions to add additional tabs
159
  $tabs = apply_filters( 'wpform_settings_tabs', $tabs );
160
 
161
  return $tabs;
@@ -168,38 +185,45 @@ class WPForms_Settings {
168
  */
169
  public function settings_page_tab_general() {
170
 
171
- // Check for save, if found let's dance
172
- if ( !empty( $_POST['wpforms-settings-general-nonce'] ) ) {
173
 
174
- // Do we have a valid nonce and permission?
175
- if ( ! wp_verify_nonce( $_POST['wpforms-settings-general-nonce'], 'wpforms-settings-general-nonce' ) || !current_user_can( apply_filters( 'wpforms_manage_cap', 'manage_options' ) ) ) {
176
 
177
- // No funny business
178
  printf( '<div class="error below-h2"><p>%s</p></div>', __( 'Settings check failed.', 'wpforms' ) );
179
 
180
  } else {
181
 
182
- // Save General Settings
183
  if ( isset( $_POST['submit-general'] ) ) {
184
 
185
- // Prep and sanatize settings for save
186
- $this->options['email-template'] = !empty( $_POST['email-template'] ) ? esc_attr( $_POST['email-template'] ) : 'default';
187
- $this->options['email-header-image'] = !empty( $_POST['email-header-image'] ) ? esc_url_raw( $_POST['email-header-image'] ) : '';
188
- $this->options['email-background-color'] = !empty( $_POST['email-background-color'] ) ? wpforms_sanitize_hex_color( $_POST['email-background-color'] ) : '#e9eaec';
189
- $this->options['email-carbon-copy'] = !empty( $_POST['email-carbon-copy'] ) ? '1' : false;
190
- $this->options['disable-css'] = !empty( $_POST['disable-css'] ) ? intval( $_POST['disable-css'] ) : '1';
191
- $this->options['global-assets'] = !empty( $_POST['global-assets'] ) ? '1' : false;
192
- $this->options['recaptcha-site-key'] = !empty( $_POST['recaptcha-site-key'] ) ? esc_html( $_POST['recaptcha-site-key'] ) : '';
193
- $this->options['recaptcha-secret-key'] = !empty( $_POST['recaptcha-secret-key'] ) ? esc_html( $_POST['recaptcha-secret-key'] ) : '';
 
 
 
 
 
 
194
  $this->options = apply_filters( 'wpforms_settings_save', $this->options, $_POST, 'general' );
195
 
196
- // Update settings in DB
197
  update_option( 'wpforms_settings' , $this->options );
198
 
199
  printf( '<div class="updated below-h2"><p>%s</p></div>', __( 'General settings updated.', 'wpforms' ) );
 
200
  }
201
- }
202
- }
203
  ?>
204
 
205
  <div id="wpforms-settings-general">
@@ -263,7 +287,7 @@ class WPForms_Settings {
263
  }
264
  ?>
265
  </label>
266
- <input type="text" name="email-header-image" id="wpforms-settings-email-header-image" class="wpforms-settings-upload-image-value" value="<?php echo esc_url_raw( $this->get( 'email-header-image' ) ); ?>" />
267
  <a href="#" class="button button-secondary wpforms-settings-upload-image"><?php _e( 'Upload Image', 'wpforms' ); ?></a>
268
  <p class="description">
269
  <?php _e( 'Upload or choose a logo to be displayed at the top of email notifications.', 'wpforms' ); ?><br>
@@ -293,7 +317,29 @@ class WPForms_Settings {
293
  <td class="section" colspan="2">
294
  <hr>
295
  <h4><?php _e( 'reCAPTCHA', 'wpforms' ); ?></h4>
296
- <p><?php _e( 'reCAPTCHA is a free anti-spam service from Google. Its helps protect your website from spam and abuse while letting real people pass through with ease. <a href="http://www.google.com/recaptcha/intro/index.html" target="_blank" rel="noopener">Visit reCAPTCHA</a> to learn more and sign up for a free account or <a href="https://wpforms.com/docs/setup-captcha-wpforms/" target="_blank" rel="noopener">read our walk through</a> for step-by-step directions.', 'wpforms' ); ?></p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
297
  </td>
298
  </tr>
299
  <tr>
@@ -312,6 +358,52 @@ class WPForms_Settings {
312
  <input type="text" name="recaptcha-secret-key" value="<?php echo esc_attr( $this->get( 'recaptcha-secret-key' ) ); ?>" id="wpforms-settings-general-recaptcha-secret-key">
313
  </td>
314
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
315
  </tbody>
316
  </table>
317
 
@@ -333,7 +425,7 @@ class WPForms_Settings {
333
  $providers = get_option( 'wpforms_providers', false );
334
  $active = apply_filters( 'wpforms_providers_available', array() );
335
 
336
- // If no provider addons are activated display a message and bail
337
  if ( empty( $active ) ) {
338
  echo '<div class="notice notice-info below-h2"><p>' . sprintf( __( 'You do not have any marketing add-ons activated. You can head over to the <a href="%s">Add-Ons page</a> to install and activate the add-on for your provider.', 'wpforms' ), admin_url( 'admin.php?page=wpforms-addons' ) ) . '</p></div>';
339
  return;
@@ -341,9 +433,7 @@ class WPForms_Settings {
341
  ?>
342
 
343
  <div id="wpforms-settings-providers">
344
-
345
  <?php do_action( 'wpforms_settings_providers', $active, $providers ); ?>
346
-
347
  </div>
348
  <?php
349
  }
@@ -357,9 +447,7 @@ class WPForms_Settings {
357
 
358
  ?>
359
  <div id="wpforms-settings-system">
360
-
361
  <textarea readonly="readonly" class="system-info-textarea"><?php echo $this->get_system_info(); ?></textarea>
362
-
363
  </div>
364
  <?php
365
  }
@@ -422,7 +510,19 @@ class WPForms_Settings {
422
  */
423
  public function settings_link( $links ) {
424
 
425
- $setting_link = sprintf( '<a href="%s">%s</a>', add_query_arg( array( 'page' => 'wpforms-settings' ), admin_url( 'admin.php' ) ), __( 'Settings', 'wpforms' ) );
 
 
 
 
 
 
 
 
 
 
 
 
426
  array_unshift( $links, $setting_link );
427
 
428
  return $links;
@@ -431,7 +531,7 @@ class WPForms_Settings {
431
  /**
432
  * Get system information.
433
  *
434
- * Based on a function from Easy Digital Downloads by Pippin Williamson
435
  *
436
  * @link https://github.com/easydigitaldownloads/easy-digital-downloads/blob/master/includes/admin/tools.php#L470
437
  * @since 1.2.3
@@ -441,20 +541,20 @@ class WPForms_Settings {
441
 
442
  global $wpdb;
443
 
444
- // Get theme info
445
  $theme_data = wp_get_theme();
446
  $theme = $theme_data->Name . ' ' . $theme_data->Version;
447
 
448
  $return = '### Begin System Info ###' . "\n\n";
449
 
450
- // WPForms info
451
  $activated = get_option( 'wpforms_activated', array() );
452
  $return .= '-- WPForms Info' . "\n\n";
453
- if ( !empty( $activated['pro'] ) ) {
454
  $date = $activated['pro'] + ( get_option( 'gmt_offset' ) * 3600 );
455
  $return .= 'Pro: ' . date_i18n( __( 'M j, Y @ g:ia' ), $date ) . "\n";
456
  }
457
- if ( !empty( $activated['lite'] ) ) {
458
  $date = $activated['lite'] + ( get_option( 'gmt_offset' ) * 3600 );
459
  $return .= 'Lite: ' . date_i18n( __( 'M j, Y @ g:ia' ), $date ) . "\n";
460
  }
@@ -465,129 +565,103 @@ class WPForms_Settings {
465
  $return .= 'Home URL: ' . home_url() . "\n";
466
  $return .= 'Multisite: ' . ( is_multisite() ? 'Yes' : 'No' ) . "\n";
467
 
468
- // WordPress configuration
469
  $return .= "\n" . '-- WordPress Configuration' . "\n\n";
470
  $return .= 'Version: ' . get_bloginfo( 'version' ) . "\n";
471
  $return .= 'Language: ' . ( defined( 'WPLANG' ) && WPLANG ? WPLANG : 'en_US' ) . "\n";
472
  $return .= 'Permalink Structure: ' . ( get_option( 'permalink_structure' ) ? get_option( 'permalink_structure' ) : 'Default' ) . "\n";
473
  $return .= 'Active Theme: ' . $theme . "\n";
474
  $return .= 'Show On Front: ' . get_option( 'show_on_front' ) . "\n";
475
-
476
- // Only show page specs if frontpage is set to 'page'
477
- if( get_option( 'show_on_front' ) == 'page' ) {
478
  $front_page_id = get_option( 'page_on_front' );
479
  $blog_page_id = get_option( 'page_for_posts' );
480
- $return .= 'Page On Front: ' . ( $front_page_id != 0 ? get_the_title( $front_page_id ) . ' (#' . $front_page_id . ')' : 'Unset' ) . "\n";
481
- $return .= 'Page For Posts: ' . ( $blog_page_id != 0 ? get_the_title( $blog_page_id ) . ' (#' . $blog_page_id . ')' : 'Unset' ) . "\n";
482
  }
483
-
484
  $return .= 'ABSPATH: ' . ABSPATH . "\n";
485
-
486
- // Make sure wp_remote_post() is working
487
- /*
488
- $request['cmd'] = '_notify-validate';
489
- $params = array(
490
- 'sslverify' => false,
491
- 'timeout' => 60,
492
- 'user-agent' => 'WPForms/' . WPFORMS_VERSION,
493
- 'body' => $request
494
- );
495
-
496
- $response = wp_remote_post( 'https://www.paypal.com/cgi-bin/webscr', $params );
497
-
498
- if( !is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) {
499
- $WP_REMOTE_POST = 'wp_remote_post() works';
500
- } else {
501
- $WP_REMOTE_POST = 'wp_remote_post() does not work';
502
- }
503
- $return .= 'Remote Post: ' . $WP_REMOTE_POST . "\n";
504
- */
505
-
506
  $return .= 'Table Prefix: ' . 'Length: ' . strlen( $wpdb->prefix ) . ' Status: ' . ( strlen( $wpdb->prefix ) > 16 ? 'ERROR: Too long' : 'Acceptable' ) . "\n";
507
  $return .= 'WP_DEBUG: ' . ( defined( 'WP_DEBUG' ) ? WP_DEBUG ? 'Enabled' : 'Disabled' : 'Not set' ) . "\n";
508
  $return .= 'WPFORMS_DEBUG: ' . ( defined( 'WPFORMS_DEBUG' ) ? WPFORMS_DEBUG ? 'Enabled' : 'Disabled' : 'Not set' ) . "\n";
509
  $return .= 'Memory Limit: ' . WP_MEMORY_LIMIT . "\n";
510
  $return .= 'Registered Post Stati: ' . implode( ', ', get_post_stati() ) . "\n";
511
 
512
- // @todo WPForms configuration/specific details
513
  $return .= "\n" . '-- WordPress Uploads/Constants' . "\n\n";
514
  $return .= 'WP_CONTENT_DIR: ' . ( defined( 'WP_CONTENT_DIR' ) ? WP_CONTENT_DIR ? WP_CONTENT_DIR : 'Disabled' : 'Not set' ) . "\n";
515
  $return .= 'WP_CONTENT_URL: ' . ( defined( 'WP_CONTENT_URL' ) ? WP_CONTENT_URL ? WP_CONTENT_URL : 'Disabled' : 'Not set' ) . "\n";
516
  $return .= 'UPLOADS: ' . ( defined( 'UPLOADS' ) ? UPLOADS ? UPLOADS : 'Disabled' : 'Not set' ) . "\n";
517
  $uploads_dir = wp_upload_dir();
518
- $return .= 'wp_uploads_dir() path: ' . $uploads_dir['path']. "\n";
519
- $return .= 'wp_uploads_dir() url: ' . $uploads_dir['url']. "\n";
520
- $return .= 'wp_uploads_dir() basedir: ' . $uploads_dir['basedir']. "\n";
521
- $return .= 'wp_uploads_dir() baseurl: ' . $uploads_dir['baseurl']. "\n";
522
-
523
 
524
- // Get plugins that have an update
525
  $updates = get_plugin_updates();
526
 
527
- // Must-use plugins
528
  // NOTE: MU plugins can't show updates!
529
  $muplugins = get_mu_plugins();
530
- if( count( $muplugins ) > 0 && !empty( $muplugins ) ) {
531
  $return .= "\n" . '-- Must-Use Plugins' . "\n\n";
532
 
533
- foreach( $muplugins as $plugin => $plugin_data ) {
534
  $return .= $plugin_data['Name'] . ': ' . $plugin_data['Version'] . "\n";
535
  }
536
  }
537
 
538
- // WordPress active plugins
539
  $return .= "\n" . '-- WordPress Active Plugins' . "\n\n";
540
 
541
  $plugins = get_plugins();
542
  $active_plugins = get_option( 'active_plugins', array() );
543
 
544
- foreach( $plugins as $plugin_path => $plugin ) {
545
- if( !in_array( $plugin_path, $active_plugins ) )
546
  continue;
547
-
548
- $update = ( array_key_exists( $plugin_path, $updates ) ) ? ' (needs update - ' . $updates[$plugin_path]->update->new_version . ')' : '';
549
  $return .= $plugin['Name'] . ': ' . $plugin['Version'] . $update . "\n";
550
  }
551
 
552
- // WordPress inactive plugins
553
  $return .= "\n" . '-- WordPress Inactive Plugins' . "\n\n";
554
 
555
- foreach( $plugins as $plugin_path => $plugin ) {
556
- if( in_array( $plugin_path, $active_plugins ) )
557
  continue;
558
-
559
- $update = ( array_key_exists( $plugin_path, $updates ) ) ? ' (needs update - ' . $updates[$plugin_path]->update->new_version . ')' : '';
560
  $return .= $plugin['Name'] . ': ' . $plugin['Version'] . $update . "\n";
561
  }
562
 
563
- if( is_multisite() ) {
564
- // WordPress Multisite active plugins
565
  $return .= "\n" . '-- Network Active Plugins' . "\n\n";
566
 
567
  $plugins = wp_get_active_network_plugins();
568
  $active_plugins = get_site_option( 'active_sitewide_plugins', array() );
569
 
570
- foreach( $plugins as $plugin_path ) {
571
  $plugin_base = plugin_basename( $plugin_path );
572
-
573
- if( !array_key_exists( $plugin_base, $active_plugins ) )
574
  continue;
575
-
576
- $update = ( array_key_exists( $plugin_path, $updates ) ) ? ' (needs update - ' . $updates[$plugin_path]->update->new_version . ')' : '';
577
  $plugin = get_plugin_data( $plugin_path );
578
  $return .= $plugin['Name'] . ': ' . $plugin['Version'] . $update . "\n";
579
  }
580
  }
581
 
582
- // Server configuration (really just versioning)
583
  $return .= "\n" . '-- Webserver Configuration' . "\n\n";
584
  $return .= 'PHP Version: ' . PHP_VERSION . "\n";
585
  $return .= 'MySQL Version: ' . $wpdb->db_version() . "\n";
586
  $return .= 'Webserver Info: ' . $_SERVER['SERVER_SOFTWARE'] . "\n";
587
 
588
- // PHP configs... now we're getting to the important stuff
589
  $return .= "\n" . '-- PHP Configuration' . "\n\n";
590
- //$return .= 'Safe Mode: ' . ( ini_get( 'safe_mode' ) ? 'Enabled' : 'Disabled' . "\n" );
591
  $return .= 'Memory Limit: ' . ini_get( 'memory_limit' ) . "\n";
592
  $return .= 'Upload Max Size: ' . ini_get( 'upload_max_filesize' ) . "\n";
593
  $return .= 'Post Max Size: ' . ini_get( 'post_max_size' ) . "\n";
@@ -596,7 +670,7 @@ class WPForms_Settings {
596
  $return .= 'Max Input Vars: ' . ini_get( 'max_input_vars' ) . "\n";
597
  $return .= 'Display Errors: ' . ( ini_get( 'display_errors' ) ? 'On (' . ini_get( 'display_errors' ) . ')' : 'N/A' ) . "\n";
598
 
599
- // PHP extensions and such
600
  $return .= "\n" . '-- PHP Extensions' . "\n\n";
601
  $return .= 'cURL: ' . ( function_exists( 'curl_init' ) ? 'Supported' : 'Not Supported' ) . "\n";
602
  $return .= 'fsockopen: ' . ( function_exists( 'fsockopen' ) ? 'Supported' : 'Not Supported' ) . "\n";
@@ -607,8 +681,8 @@ class WPForms_Settings {
607
  $return .= "\n" . '-- Session Configuration' . "\n\n";
608
  $return .= 'Session: ' . ( isset( $_SESSION ) ? 'Enabled' : 'Disabled' ) . "\n";
609
 
610
- // The rest of this is only relevant is session is enabled
611
- if( isset( $_SESSION ) ) {
612
  $return .= 'Session Name: ' . esc_html( ini_get( 'session.name' ) ) . "\n";
613
  $return .= 'Cookie Path: ' . esc_html( ini_get( 'session.cookie_path' ) ) . "\n";
614
  $return .= 'Save Path: ' . esc_html( ini_get( 'session.save_path' ) ) . "\n";
@@ -621,4 +695,4 @@ class WPForms_Settings {
621
  return $return;
622
  }
623
  }
624
- new WPForms_Settings;
7
  * @since 1.0.0
8
  * @license GPL-2.0+
9
  * @copyright Copyright (c) 2016, WPForms LLC
10
+ */
11
  class WPForms_Settings {
12
 
13
  /**
14
+ * Holds the plugin settings.
15
  *
16
  * @since 1.0.0
17
+ * @var array
18
  */
19
  protected $options;
20
 
21
+ /**
22
+ * The available forms.
23
+ *
24
+ * @since 1.3.7
25
+ * @var array
26
+ */
27
+ public $forms = false;
28
+
29
  /**
30
  * Primary class constructor.
31
  *
44
  * Get the value of a specific setting.
45
  *
46
  * @since 1.0.0
47
+ * @param string $key
48
+ * @param bool $default
49
+ * @param string $option
50
  * @return mixed
51
+ */
52
  public function get( $key, $default = false, $option = 'wpforms_settings' ) {
53
 
54
+ if ( 'wpforms_settings' === $option && ! empty( $this->options ) ) {
55
  $options = $this->options;
56
  } else {
57
  $options = get_option( $option, false );
58
  }
59
 
60
+ return ! empty( $options[ $key ] ) ? $options[ $key ] : $default;
 
61
  }
62
 
63
  /**
67
  */
68
  public function init() {
69
 
70
+ // Check what page we are on.
71
  $page = isset( $_GET['page'] ) ? $_GET['page'] : '';
72
 
73
+ // Only load if we are actually on the settings page.
74
+ if ( 'wpforms-settings' === $page ) {
75
 
76
+ // Retrieve settings.
77
  $this->options = get_option( 'wpforms_settings', array() );
78
 
79
+ // Retrieve available forms.
80
+ $args = array(
81
+ 'orderby' => 'title',
82
+ );
83
+ $this->forms = wpforms()->form->get( '', $args );
84
+
85
+ add_action( 'wpforms_tab_settings_general', array( $this, 'settings_page_tab_general' ) );
86
+ add_action( 'wpforms_tab_settings_providers', array( $this, 'settings_page_tab_providers' ) );
87
+ add_action( 'wpforms_tab_settings_system', array( $this, 'settings_page_tab_system' ) );
88
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueues' ) );
89
+ add_action( 'wpforms_admin_page', array( $this, 'output' ) );
90
 
91
  // Hook for add-ons
92
  do_action( 'wpforms_settings_init' );
136
  wp_enqueue_script(
137
  'wpforms-settings',
138
  WPFORMS_PLUGIN_URL . 'assets/js/admin-settings.js',
139
+ array( 'jquery' ),
140
  WPFORMS_VERSION,
141
  false
142
  );
153
  )
154
  );
155
 
156
+ // Hook for add-ons.
157
  do_action( 'wpforms_settings_enqueue' );
158
  }
159
 
165
  */
166
  public function setting_page_tabs() {
167
 
168
+ // Define our base tabs.
169
  $tabs = array(
170
+ 'general' => __( 'General', 'wpforms' ),
171
+ 'providers' => __( 'Integrations', 'wpforms' ),
172
+ 'system' => __( 'System Info', 'wpforms' ),
173
  );
174
 
175
+ // Allow for addons and extensions to add additional tabs.
176
  $tabs = apply_filters( 'wpform_settings_tabs', $tabs );
177
 
178
  return $tabs;
185
  */
186
  public function settings_page_tab_general() {
187
 
188
+ // Check for save, if found let's dance.
189
+ if ( ! empty( $_POST['wpforms-settings-general-nonce'] ) ) {
190
 
191
+ // Do we have a valid nonce and permission?.
192
+ if ( ! wp_verify_nonce( $_POST['wpforms-settings-general-nonce'], 'wpforms-settings-general-nonce' ) || ! current_user_can( apply_filters( 'wpforms_manage_cap', 'manage_options' ) ) ) {
193
 
194
+ // No funny business.
195
  printf( '<div class="error below-h2"><p>%s</p></div>', __( 'Settings check failed.', 'wpforms' ) );
196
 
197
  } else {
198
 
199
+ // Save General Settings.
200
  if ( isset( $_POST['submit-general'] ) ) {
201
 
202
+ // Prep and sanatize settings for save.
203
+ $this->options['email-template'] = ! empty( $_POST['email-template'] ) ? esc_attr( $_POST['email-template'] ) : 'default';
204
+ $this->options['email-header-image'] = ! empty( $_POST['email-header-image'] ) ? esc_url_raw( $_POST['email-header-image'] ) : '';
205
+ $this->options['email-background-color'] = ! empty( $_POST['email-background-color'] ) ? wpforms_sanitize_hex_color( $_POST['email-background-color'] ) : '#e9eaec';
206
+ $this->options['email-carbon-copy'] = ! empty( $_POST['email-carbon-copy'] ) ? '1' : false;
207
+ $this->options['disable-css'] = ! empty( $_POST['disable-css'] ) ? intval( $_POST['disable-css'] ) : '1';
208
+ $this->options['global-assets'] = ! empty( $_POST['global-assets'] ) ? '1' : false;
209
+ $this->options['recaptcha-type'] = ! empty( $_POST['recaptcha-type'] ) ? esc_html( $_POST['recaptcha-type'] ) : 'v2';
210
+ $this->options['recaptcha-site-key'] = ! empty( $_POST['recaptcha-site-key'] ) ? esc_html( $_POST['recaptcha-site-key'] ) : '';
211
+ $this->options['recaptcha-secret-key'] = ! empty( $_POST['recaptcha-secret-key'] ) ? esc_html( $_POST['recaptcha-secret-key'] ) : '';
212
+ $this->options['validation-required'] = ! empty( $_POST['validation-required'] ) ? sanitize_text_field( $_POST['validation-required'] ) : '';
213
+ $this->options['validation-url'] = ! empty( $_POST['validation-url'] ) ? sanitize_text_field( $_POST['validation-url'] ) : '';
214
+ $this->options['validation-email'] = ! empty( $_POST['validation-email'] ) ? sanitize_text_field( $_POST['validation-email'] ) : '';
215
+ $this->options['validation-confirm'] = ! empty( $_POST['validation-confirm'] ) ? sanitize_text_field( $_POST['validation-confirm'] ) : '';
216
+
217
  $this->options = apply_filters( 'wpforms_settings_save', $this->options, $_POST, 'general' );
218
 
219
+ // Update settings in DB.
220
  update_option( 'wpforms_settings' , $this->options );
221
 
222
  printf( '<div class="updated below-h2"><p>%s</p></div>', __( 'General settings updated.', 'wpforms' ) );
223
+
224
  }
225
+ } // End if().
226
+ } // End if().
227
  ?>
228
 
229
  <div id="wpforms-settings-general">
287
  }
288
  ?>
289
  </label>
290
+ <input type="text" name="email-header-image" id="wpforms-settings-general-email-header-image" class="wpforms-settings-upload-image-value" value="<?php echo esc_url_raw( $this->get( 'email-header-image' ) ); ?>" />
291
  <a href="#" class="button button-secondary wpforms-settings-upload-image"><?php _e( 'Upload Image', 'wpforms' ); ?></a>
292
  <p class="description">
293
  <?php _e( 'Upload or choose a logo to be displayed at the top of email notifications.', 'wpforms' ); ?><br>
317
  <td class="section" colspan="2">
318
  <hr>
319
  <h4><?php _e( 'reCAPTCHA', 'wpforms' ); ?></h4>
320
+ <p><?php _e( 'reCAPTCHA is a free anti-spam service from Google which helps to protect your website from spam and abuse while letting real people pass through with ease.', 'wpforms' ); ?></p>
321
+ <p><?php _e( 'Google\'s original <a href="https://www.google.com/recaptcha/intro/" rel="noopener noreferrer">v2 reCAPTCHA</a> prompts users to check a box to prove they\'re human, whereas <a href="https://www.google.com/recaptcha/intro/invisible.html" rel="noopener noreferrer">Invisible reCAPTCHA</a> uses advanced technology to detect real users without requiring any input.', 'wpforms' ); ?></p>
322
+ <p><?php _e( 'Sites already using v2 reCAPTCHA will need to create new site keys before switching to the Invisible reCAPTCHA.', 'wpforms' ); ?></p>
323
+ <p><?php _e( '<a href="https://wpforms.com/docs/setup-captcha-wpforms/" rel="noopener noreferrer">Read our walk through</a> to learn more and for step-by-step directions.', 'wpforms' ); ?></p>
324
+ </td>
325
+ </tr>
326
+ <tr>
327
+ <th scope="row">
328
+ <label for="wpforms-settings-general-recaptcha-type"><?php _e( 'reCAPTCHA Type', 'wpforms' ); ?></label>
329
+ </th>
330
+ <td>
331
+ <select name="recaptcha-type" id="wpforms-settings-general-recaptcha-type">
332
+ <?php
333
+ $options = array(
334
+ 'v2' => 'v2 reCAPTCHA',
335
+ 'invisible' => 'Invisible reCAPTCHA',
336
+ );
337
+ $selected = $this->get( 'recaptcha-type' );
338
+ foreach ( $options as $key => $option ) {
339
+ printf( '<option value="%s" %s>%s</option>', esc_attr( $key ), selected( $selected, $key, false ), esc_html( $option ) );
340
+ }
341
+ ?>
342
+ </select>
343
  </td>
344
  </tr>
345
  <tr>
358
  <input type="text" name="recaptcha-secret-key" value="<?php echo esc_attr( $this->get( 'recaptcha-secret-key' ) ); ?>" id="wpforms-settings-general-recaptcha-secret-key">
359
  </td>
360
  </tr>
361
+ <tr>
362
+ <td class="section" colspan="2">
363
+ <hr>
364
+ <h4><?php _e( 'Validation Messages', 'wpforms' ); ?></h4>
365
+ </td>
366
+ </tr>
367
+ <tr>
368
+ <th scope="row">
369
+ <label for="wpforms-settings-general-validation-required"><?php _e( 'Required', 'wpforms' ); ?></label>
370
+ </th>
371
+ <td>
372
+ <input type="text" name="validation-required" value="<?php echo esc_attr( $this->get( 'validation-required', __( 'This field is required.', 'wpforms' ) ) ); ?>" id="wpforms-settings-general-validation-required">
373
+ </td>
374
+ </tr>
375
+ <tr>
376
+ <th scope="row">
377
+ <label for="wpforms-settings-general-validation-url"><?php _e( 'Website URL', 'wpforms' ); ?></label>
378
+ </th>
379
+ <td>
380
+ <input type="text" name="validation-url" value="<?php echo esc_attr( $this->get( 'validation-url', __( 'Please enter a valid URL.', 'wpforms' ) ) ); ?>" id="wpforms-settings-general-validation-url">
381
+ </td>
382
+ </tr>
383
+ <tr>
384
+ <th scope="row">
385
+ <label for="wpforms-settings-general-validation-email"><?php _e( 'Email', 'wpforms' ); ?></label>
386
+ </th>
387
+ <td>
388
+ <input type="text" name="validation-email" value="<?php echo esc_attr( $this->get( 'validation-email', __( 'Please enter a valid email address.', 'wpforms' ) ) ); ?>" id="wpforms-settings-general-validation-email">
389
+ </td>
390
+ </tr>
391
+ <tr>
392
+ <th scope="row">
393
+ <label for="wpforms-settings-general-validation-number"><?php _e( 'Number', 'wpforms' ); ?></label>
394
+ </th>
395
+ <td>
396
+ <input type="text" name="validation-number" value="<?php echo esc_attr( $this->get( 'validation-number', __( 'Please enter a valid number.', 'wpforms' ) ) ); ?>" id="wpforms-settings-general-validation-number">
397
+ </td>
398
+ </tr>
399
+ <tr>
400
+ <th scope="row">
401
+ <label for="wpforms-settings-general-validation-confirm"><?php _e( 'Confirm Value', 'wpforms' ); ?></label>
402
+ </th>
403
+ <td>
404
+ <input type="text" name="validation-confirm" value="<?php echo esc_attr( $this->get( 'validation-confirm', __( 'Field values do not match.', 'wpforms' ) ) ); ?>" id="wpforms-settings-general-validation-confirm">
405
+ </td>
406
+ </tr>
407
  </tbody>
408
  </table>
409
 
425
  $providers = get_option( 'wpforms_providers', false );
426
  $active = apply_filters( 'wpforms_providers_available', array() );
427
 
428
+ // If no provider addons are activated display a message and bail.
429
  if ( empty( $active ) ) {
430
  echo '<div class="notice notice-info below-h2"><p>' . sprintf( __( 'You do not have any marketing add-ons activated. You can head over to the <a href="%s">Add-Ons page</a> to install and activate the add-on for your provider.', 'wpforms' ), admin_url( 'admin.php?page=wpforms-addons' ) ) . '</p></div>';
431
  return;
433
  ?>
434
 
435
  <div id="wpforms-settings-providers">
 
436
  <?php do_action( 'wpforms_settings_providers', $active, $providers ); ?>
 
437
  </div>
438
  <?php
439
  }
447
 
448
  ?>
449
  <div id="wpforms-settings-system">
 
450
  <textarea readonly="readonly" class="system-info-textarea"><?php echo $this->get_system_info(); ?></textarea>
 
451
  </div>
452
  <?php
453
  }
510
  */
511
  public function settings_link( $links ) {
512
 
513
+ $admin_link = add_query_arg(
514
+ array(
515
+ 'page' => 'wpforms-settings',
516
+ ),
517
+ admin_url( 'admin.php' )
518
+ );
519
+
520
+ $setting_link = sprintf(
521
+ '<a href="%s">%s</a>',
522
+ $admin_link ,
523
+ __( 'Settings', 'wpforms' )
524
+ );
525
+
526
  array_unshift( $links, $setting_link );
527
 
528
  return $links;
531
  /**
532
  * Get system information.
533
  *
534
+ * Based on a function from Easy Digital Downloads by Pippin Williamson.
535
  *
536
  * @link https://github.com/easydigitaldownloads/easy-digital-downloads/blob/master/includes/admin/tools.php#L470
537
  * @since 1.2.3
541
 
542
  global $wpdb;
543
 
544
+ // Get theme info.
545
  $theme_data = wp_get_theme();
546
  $theme = $theme_data->Name . ' ' . $theme_data->Version;
547
 
548
  $return = '### Begin System Info ###' . "\n\n";
549
 
550
+ // WPForms info.
551
  $activated = get_option( 'wpforms_activated', array() );
552
  $return .= '-- WPForms Info' . "\n\n";
553
+ if ( ! empty( $activated['pro'] ) ) {
554
  $date = $activated['pro'] + ( get_option( 'gmt_offset' ) * 3600 );
555
  $return .= 'Pro: ' . date_i18n( __( 'M j, Y @ g:ia' ), $date ) . "\n";
556
  }
557
+ if ( ! empty( $activated['lite'] ) ) {
558
  $date = $activated['lite'] + ( get_option( 'gmt_offset' ) * 3600 );
559
  $return .= 'Lite: ' . date_i18n( __( 'M j, Y @ g:ia' ), $date ) . "\n";
560
  }
565
  $return .= 'Home URL: ' . home_url() . "\n";
566
  $return .= 'Multisite: ' . ( is_multisite() ? 'Yes' : 'No' ) . "\n";
567
 
568
+ // WordPress configuration.
569
  $return .= "\n" . '-- WordPress Configuration' . "\n\n";
570
  $return .= 'Version: ' . get_bloginfo( 'version' ) . "\n";
571
  $return .= 'Language: ' . ( defined( 'WPLANG' ) && WPLANG ? WPLANG : 'en_US' ) . "\n";
572
  $return .= 'Permalink Structure: ' . ( get_option( 'permalink_structure' ) ? get_option( 'permalink_structure' ) : 'Default' ) . "\n";
573
  $return .= 'Active Theme: ' . $theme . "\n";
574
  $return .= 'Show On Front: ' . get_option( 'show_on_front' ) . "\n";
575
+ // Only show page specs if frontpage is set to 'page'.
576
+ if ( get_option( 'show_on_front' ) === 'page' ) {
 
577
  $front_page_id = get_option( 'page_on_front' );
578
  $blog_page_id = get_option( 'page_for_posts' );
579
+ $return .= 'Page On Front: ' . ( 0 != $front_page_id ? get_the_title( $front_page_id ) . ' (#' . $front_page_id . ')' : 'Unset' ) . "\n";
580
+ $return .= 'Page For Posts: ' . ( 0 != $blog_page_id ? get_the_title( $blog_page_id ) . ' (#' . $blog_page_id . ')' : 'Unset' ) . "\n";
581
  }
 
582
  $return .= 'ABSPATH: ' . ABSPATH . "\n";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
583
  $return .= 'Table Prefix: ' . 'Length: ' . strlen( $wpdb->prefix ) . ' Status: ' . ( strlen( $wpdb->prefix ) > 16 ? 'ERROR: Too long' : 'Acceptable' ) . "\n";
584
  $return .= 'WP_DEBUG: ' . ( defined( 'WP_DEBUG' ) ? WP_DEBUG ? 'Enabled' : 'Disabled' : 'Not set' ) . "\n";
585
  $return .= 'WPFORMS_DEBUG: ' . ( defined( 'WPFORMS_DEBUG' ) ? WPFORMS_DEBUG ? 'Enabled' : 'Disabled' : 'Not set' ) . "\n";
586
  $return .= 'Memory Limit: ' . WP_MEMORY_LIMIT . "\n";
587
  $return .= 'Registered Post Stati: ' . implode( ', ', get_post_stati() ) . "\n";
588
 
589
+ // @todo WPForms configuration/specific details.
590
  $return .= "\n" . '-- WordPress Uploads/Constants' . "\n\n";
591
  $return .= 'WP_CONTENT_DIR: ' . ( defined( 'WP_CONTENT_DIR' ) ? WP_CONTENT_DIR ? WP_CONTENT_DIR : 'Disabled' : 'Not set' ) . "\n";
592
  $return .= 'WP_CONTENT_URL: ' . ( defined( 'WP_CONTENT_URL' ) ? WP_CONTENT_URL ? WP_CONTENT_URL : 'Disabled' : 'Not set' ) . "\n";
593
  $return .= 'UPLOADS: ' . ( defined( 'UPLOADS' ) ? UPLOADS ? UPLOADS : 'Disabled' : 'Not set' ) . "\n";
594
  $uploads_dir = wp_upload_dir();
595
+ $return .= 'wp_uploads_dir() path: ' . $uploads_dir['path'] . "\n";
596
+ $return .= 'wp_uploads_dir() url: ' . $uploads_dir['url'] . "\n";
597
+ $return .= 'wp_uploads_dir() basedir: ' . $uploads_dir['basedir'] . "\n";
598
+ $return .= 'wp_uploads_dir() baseurl: ' . $uploads_dir['baseurl'] . "\n";
 
599
 
600
+ // Get plugins that have an update.
601
  $updates = get_plugin_updates();
602
 
603
+ // Must-use plugins.
604
  // NOTE: MU plugins can't show updates!
605
  $muplugins = get_mu_plugins();
606
+ if ( count( $muplugins ) > 0 && ! empty( $muplugins ) ) {
607
  $return .= "\n" . '-- Must-Use Plugins' . "\n\n";
608
 
609
+ foreach ( $muplugins as $plugin => $plugin_data ) {
610
  $return .= $plugin_data['Name'] . ': ' . $plugin_data['Version'] . "\n";
611
  }
612
  }
613
 
614
+ // WordPress active plugins.
615
  $return .= "\n" . '-- WordPress Active Plugins' . "\n\n";
616
 
617
  $plugins = get_plugins();
618
  $active_plugins = get_option( 'active_plugins', array() );
619
 
620
+ foreach ( $plugins as $plugin_path => $plugin ) {
621
+ if ( ! in_array( $plugin_path, $active_plugins, true ) ) {
622
  continue;
623
+ }
624
+ $update = ( array_key_exists( $plugin_path, $updates ) ) ? ' (needs update - ' . $updates[ $plugin_path ]->update->new_version . ')' : '';
625
  $return .= $plugin['Name'] . ': ' . $plugin['Version'] . $update . "\n";
626
  }
627
 
628
+ // WordPress inactive plugins.
629
  $return .= "\n" . '-- WordPress Inactive Plugins' . "\n\n";
630
 
631
+ foreach ( $plugins as $plugin_path => $plugin ) {
632
+ if ( in_array( $plugin_path, $active_plugins ) ) {
633
  continue;
634
+ }
635
+ $update = ( array_key_exists( $plugin_path, $updates ) ) ? ' (needs update - ' . $updates[ $plugin_path ]->update->new_version . ')' : '';
636
  $return .= $plugin['Name'] . ': ' . $plugin['Version'] . $update . "\n";
637
  }
638
 
639
+ if ( is_multisite() ) {
640
+ // WordPress Multisite active plugins.
641
  $return .= "\n" . '-- Network Active Plugins' . "\n\n";
642
 
643
  $plugins = wp_get_active_network_plugins();
644
  $active_plugins = get_site_option( 'active_sitewide_plugins', array() );
645
 
646
+ foreach ( $plugins as $plugin_path ) {
647
  $plugin_base = plugin_basename( $plugin_path );
648
+ if ( ! array_key_exists( $plugin_base, $active_plugins ) ) {
 
649
  continue;
650
+ }
651
+ $update = ( array_key_exists( $plugin_path, $updates ) ) ? ' (needs update - ' . $updates[ $plugin_path ]->update->new_version . ')' : '';
652
  $plugin = get_plugin_data( $plugin_path );
653
  $return .= $plugin['Name'] . ': ' . $plugin['Version'] . $update . "\n";
654
  }
655
  }
656
 
657
+ // Server configuration (really just versioning).
658
  $return .= "\n" . '-- Webserver Configuration' . "\n\n";
659
  $return .= 'PHP Version: ' . PHP_VERSION . "\n";
660
  $return .= 'MySQL Version: ' . $wpdb->db_version() . "\n";
661
  $return .= 'Webserver Info: ' . $_SERVER['SERVER_SOFTWARE'] . "\n";
662
 
663
+ // PHP configs... now we're getting to the important stuff.
664
  $return .= "\n" . '-- PHP Configuration' . "\n\n";
 
665
  $return .= 'Memory Limit: ' . ini_get( 'memory_limit' ) . "\n";
666
  $return .= 'Upload Max Size: ' . ini_get( 'upload_max_filesize' ) . "\n";
667
  $return .= 'Post Max Size: ' . ini_get( 'post_max_size' ) . "\n";
670
  $return .= 'Max Input Vars: ' . ini_get( 'max_input_vars' ) . "\n";
671
  $return .= 'Display Errors: ' . ( ini_get( 'display_errors' ) ? 'On (' . ini_get( 'display_errors' ) . ')' : 'N/A' ) . "\n";
672
 
673
+ // PHP extensions and such.
674
  $return .= "\n" . '-- PHP Extensions' . "\n\n";
675
  $return .= 'cURL: ' . ( function_exists( 'curl_init' ) ? 'Supported' : 'Not Supported' ) . "\n";
676
  $return .= 'fsockopen: ' . ( function_exists( 'fsockopen' ) ? 'Supported' : 'Not Supported' ) . "\n";
681
  $return .= "\n" . '-- Session Configuration' . "\n\n";
682
  $return .= 'Session: ' . ( isset( $_SESSION ) ? 'Enabled' : 'Disabled' ) . "\n";
683
 
684
+ // The rest of this is only relevant is session is enabled.
685
+ if ( isset( $_SESSION ) ) {
686
  $return .= 'Session Name: ' . esc_html( ini_get( 'session.name' ) ) . "\n";
687
  $return .= 'Cookie Path: ' . esc_html( ini_get( 'session.cookie_path' ) ) . "\n";
688
  $return .= 'Save Path: ' . esc_html( ini_get( 'session.save_path' ) ) . "\n";
695
  return $return;
696
  }
697
  }
698
+ new WPForms_Settings;
readme.txt CHANGED
@@ -2,7 +2,7 @@
2
  Contributors: wpforms, jaredatch, smub
3
  Tags: contact form, contact form plugin, contact button, contact me, custom form, custom contact form, form builder, form manager, form, forms builder, forms creator, captcha, recaptcha, Akismet, email form, web form, feedback form, payment form, survey form, donation form, email submit form, message form, mailchimp, mailchimp form, aweber, aweber form, paypal, paypal form, stripe, stripe form, getresponse, getresponse form, email subscription, contact form widget, user registration form, wordpress registration, wordpress login form
4
  Requires at least: 4.5
5
- Tested up to: 4.7.3
6
  Stable tag: trunk
7
  License: GNU General Public License v2.0 or later
8
 
@@ -164,6 +164,25 @@ Syed Balkhi
164
 
165
  == Changelog ==
166
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
167
  = 1.3.6.2 =
168
  - Changed: Improved messaging on Entries page (Lite)
169
 
2
  Contributors: wpforms, jaredatch, smub
3
  Tags: contact form, contact form plugin, contact button, contact me, custom form, custom contact form, form builder, form manager, form, forms builder, forms creator, captcha, recaptcha, Akismet, email form, web form, feedback form, payment form, survey form, donation form, email submit form, message form, mailchimp, mailchimp form, aweber, aweber form, paypal, paypal form, stripe, stripe form, getresponse, getresponse form, email subscription, contact form widget, user registration form, wordpress registration, wordpress login form
4
  Requires at least: 4.5
5
+ Tested up to: 4.7.4
6
  Stable tag: trunk
7
  License: GNU General Public License v2.0 or later
8
 
164
 
165
  == Changelog ==
166
 
167
+ = 1.3.7.2 =
168
+ - Fixed: Error for some users with PHP 5.4 and below
169
+
170
+ = 1.3.7.1 =
171
+ - Fixed: Issue sending form notifications using email fields that had confirmation enabled
172
+
173
+ = 1.3.7 =
174
+ - Added: Google Invisible reCAPTCHA support
175
+ - Added: Custom field validation messages (see WPForms Settings page)
176
+ - Added: Bulk add choices for Checkbox, Multiple Choice, and Dropdown fields
177
+ - Addded: Filter to allow email notifications to include empty fields, `wpforms_email_display_empty_fields`
178
+ - Added: Field CSS layout selector
179
+ - Changed: Leverage `wp_json_encode` instead of native PHP function
180
+ - Changed: Various WordPress coding standard improvements (work in progress)
181
+ - Changed: Refactored form front-end code to allow for more customizations
182
+ - Changed: Refactored text, textarea, email, number, nand ame fields to allow for more customizations (more coming next release)
183
+ - Fixed: Welcome page typo
184
+ - Fixed: SmartTag selectors getting off sync inside form builder
185
+
186
  = 1.3.6.2 =
187
  - Changed: Improved messaging on Entries page (Lite)
188
 
wpforms.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: Beginner friendly WordPress contact form plugin. Use our Drag & Drop form builder to create your WordPress forms.
6
  * Author: WPForms
7
  * Author URI: https://wpforms.com
8
- * Version: 1.3.6.2
9
  * Text Domain: wpforms
10
  * Domain Path: languages
11
  *
@@ -81,7 +81,7 @@ final class WPForms {
81
  * @since 1.0.0
82
  * @var sting
83
  */
84
- public $version = '1.3.6.2';
85
 
86
  /**
87
  * The form data handler instance.
5
  * Description: Beginner friendly WordPress contact form plugin. Use our Drag & Drop form builder to create your WordPress forms.
6
  * Author: WPForms
7
  * Author URI: https://wpforms.com
8
+ * Version: 1.3.7.2
9
  * Text Domain: wpforms
10
  * Domain Path: languages
11
  *
81
  * @since 1.0.0
82
  * @var sting
83
  */
84
+ public $version = '1.3.7.2';
85
 
86
  /**
87
  * The form data handler instance.