Strong Testimonials - Version 2.41.0

Version Description

Download this release

Release Info

Developer giucu91
Plugin Icon 128x128 Strong Testimonials
Version 2.41.0
Comparing to
See all releases

Code changes from version 2.40.7 to 2.41.0

Files changed (129) hide show
  1. admin/admin-notices.php +3 -3
  2. admin/admin.php +18 -4
  3. admin/class-strong-testimonials-defaults.php +32 -6
  4. admin/class-strong-testimonials-page-shortcodes.php +53 -0
  5. admin/class-strong-testimonials-post-editor.php +25 -8
  6. admin/class-strong-testimonials-updater.php +103 -3
  7. admin/class-strong-testimonials-upsell.php +10 -8
  8. admin/class-strong-views-list-table.php +1 -0
  9. admin/compat.php +2 -2
  10. admin/css/post-editor.css +7 -4
  11. admin/custom-fields.php +18 -4
  12. admin/js/admin-compat.js +0 -13
  13. admin/js/admin-order.js +2 -3
  14. admin/js/views.js +81 -12
  15. admin/menu/class-strong-testimonials-menu-fields.php +4 -4
  16. admin/partials/views/option-client-section.php +1 -0
  17. admin/partials/views/option-content.php +7 -1
  18. admin/partials/views/option-pagination.php +1 -0
  19. admin/partials/views/option-thumbnail.php +3 -1
  20. admin/partials/views/option-title.php +2 -0
  21. admin/settings/class-strong-testimonials-settings-compat.php +23 -125
  22. admin/settings/class-strong-testimonials-settings-form.php +1 -2
  23. admin/settings/class-strong-testimonials-settings-general.php +8 -4
  24. admin/settings/class-strong-testimonials-settings.php +2 -2
  25. admin/settings/partials/form.php +9 -7
  26. admin/settings/partials/general.php +66 -6
  27. admin/views-ajax.php +39 -4
  28. admin/views-validate.php +10 -1
  29. admin/views.php +102 -25
  30. changelog.txt +18 -0
  31. includes/class-strong-form.php +3 -2
  32. includes/class-strong-testimonials-order.php +1 -1
  33. includes/class-strong-testimonials-privacy.php +47 -19
  34. includes/class-strong-testimonials-shortcode-average.php +84 -26
  35. includes/class-strong-view-display.php +63 -7
  36. includes/class-strong-view-slideshow.php +15 -0
  37. includes/class-strong-view.php +1 -1
  38. includes/functions-activation.php +1 -1
  39. includes/functions-content.php +12 -9
  40. includes/functions-image.php +40 -11
  41. includes/functions-rating.php +2 -1
  42. includes/functions-template-form.php +43 -6
  43. includes/functions-template.php +57 -11
  44. includes/post-types.php +2 -1
  45. includes/scripts.php +32 -4
  46. public/css/lazyload.css +8 -0
  47. public/css/rating-display.css +9 -0
  48. public/css/rating-form.css +9 -0
  49. public/js/controller.js +10 -2
  50. public/js/controller.min.js +1 -1
  51. public/js/lib/actual/{jquery.actual.js → jquery-actual.js} +0 -0
  52. public/js/lib/actual/jquery-actual.min.js +1 -0
  53. public/js/lib/actual/jquery.min.js +1 -0
  54. public/js/lib/form-validation/form-validation.min.js +1 -1
  55. public/js/lib/imagesloaded/imagesloaded.min.js +1 -0
  56. public/js/lib/lozad/lozad-load.js +6 -0
  57. public/js/lib/lozad/lozad-load.min.js +1 -0
  58. public/js/lib/lozad/lozad.js +10 -0
  59. public/js/lib/lozad/lozad.min.js +1 -0
  60. public/js/lib/randomjs/random.js +13 -0
  61. public/js/lib/randomjs/random.min.js +1 -0
  62. public/js/lib/readmore/readmore.js +17 -3
  63. public/js/lib/readmore/readmore.min.js +1 -1
  64. public/js/lib/strongpager/{jquery.strongpager.js → jquery-strongpager.js} +0 -0
  65. public/js/lib/strongpager/jquery-strongpager.min.js +1 -0
  66. public/js/lib/strongpager/jquery.strongpager.min.js +0 -1
  67. public/js/lib/strongslider/{jquery.strongslider.js → jquery-strongslider.js} +0 -0
  68. public/js/lib/strongslider/jquery-strongslider.min.js +3 -0
  69. public/js/lib/strongslider/jquery.strongslider.min.js +0 -1
  70. public/js/lib/validate/additional-methods.min.js +3 -4
  71. public/js/lib/validate/{jquery.validate.js → jquery-validate.js} +0 -0
  72. public/js/lib/validate/jquery-validate.min.js +3 -0
  73. public/js/lib/validate/jquery.validate.min.js +0 -1
  74. public/js/lib/validate/localization/messages_ar.min.js +1 -4
  75. public/js/lib/validate/localization/messages_az.min.js +1 -4
  76. public/js/lib/validate/localization/messages_bg.min.js +1 -4
  77. public/js/lib/validate/localization/messages_bn_BD.min.js +1 -4
  78. public/js/lib/validate/localization/messages_ca.min.js +1 -4
  79. public/js/lib/validate/localization/messages_cs.min.js +1 -4
  80. public/js/lib/validate/localization/messages_da.min.js +1 -4
  81. public/js/lib/validate/localization/messages_de.min.js +1 -4
  82. public/js/lib/validate/localization/messages_el.min.js +1 -4
  83. public/js/lib/validate/localization/messages_es.min.js +1 -4
  84. public/js/lib/validate/localization/messages_es_AR.min.js +1 -4
  85. public/js/lib/validate/localization/messages_es_PE.min.js +1 -4
  86. public/js/lib/validate/localization/messages_et.min.js +1 -4
  87. public/js/lib/validate/localization/messages_eu.min.js +1 -4
  88. public/js/lib/validate/localization/messages_fa.min.js +1 -4
  89. public/js/lib/validate/localization/messages_fi.min.js +1 -4
  90. public/js/lib/validate/localization/messages_fr.min.js +1 -4
  91. public/js/lib/validate/localization/messages_ge.min.js +1 -4
  92. public/js/lib/validate/localization/messages_gl.min.js +1 -4
  93. public/js/lib/validate/localization/messages_he.min.js +1 -4
  94. public/js/lib/validate/localization/messages_hr.min.js +1 -4
  95. public/js/lib/validate/localization/messages_hu.min.js +1 -4
  96. public/js/lib/validate/localization/messages_hy_AM.min.js +1 -4
  97. public/js/lib/validate/localization/messages_id.min.js +1 -4
  98. public/js/lib/validate/localization/messages_is.min.js +1 -4
  99. public/js/lib/validate/localization/messages_it.min.js +1 -4
  100. public/js/lib/validate/localization/messages_ja.min.js +1 -4
  101. public/js/lib/validate/localization/messages_ka.min.js +1 -4
  102. public/js/lib/validate/localization/messages_kk.min.js +1 -4
  103. public/js/lib/validate/localization/messages_ko.min.js +1 -4
  104. public/js/lib/validate/localization/messages_lt.min.js +1 -4
  105. public/js/lib/validate/localization/messages_lv.min.js +1 -4
  106. public/js/lib/validate/localization/messages_mk.min.js +1 -4
  107. public/js/lib/validate/localization/messages_my.min.js +1 -4
  108. public/js/lib/validate/localization/messages_nl.min.js +1 -4
  109. public/js/lib/validate/localization/messages_no.min.js +1 -4
  110. public/js/lib/validate/localization/messages_pl.min.js +1 -4
  111. public/js/lib/validate/localization/messages_pt_BR.min.js +1 -4
  112. public/js/lib/validate/localization/messages_pt_PT.min.js +1 -4
  113. public/js/lib/validate/localization/messages_ro.min.js +1 -4
  114. public/js/lib/validate/localization/messages_ru.min.js +1 -4
  115. public/js/lib/validate/localization/messages_si.min.js +1 -4
  116. public/js/lib/validate/localization/messages_sk.min.js +1 -4
  117. public/js/lib/validate/localization/messages_sl.min.js +1 -4
  118. public/js/lib/validate/localization/messages_sr.min.js +1 -4
  119. public/js/lib/validate/localization/messages_sr_lat.min.js +1 -4
  120. public/js/lib/validate/localization/messages_sv.min.js +1 -4
  121. public/js/lib/validate/localization/messages_th.min.js +1 -4
  122. public/js/lib/validate/localization/messages_tj.min.js +1 -4
  123. public/js/lib/validate/localization/messages_tr.min.js +1 -4
  124. public/js/lib/validate/localization/messages_uk.min.js +1 -4
  125. public/js/lib/validate/localization/messages_ur.min.js +1 -4
  126. public/js/lib/validate/localization/messages_vi.min.js +1 -4
  127. public/js/lib/validate/localization/messages_zh.min.js +1 -4
  128. public/js/lib/validate/localization/messages_zh_TW.min.js +1 -4
  129. public/js/lib/validate/localization/methods_de.min.js +1 -4
admin/admin-notices.php CHANGED
@@ -132,7 +132,7 @@ add_filter( 'wpmtst_admin_notice', 'wpmtst_admin_notice_text', 10, 2 );
132
  function wpmtst_add_admin_notice( $key, $persist = false ) {
133
  $notices = get_option( 'wpmtst_admin_notices', array() );
134
  $notices[ $key ] = array( 'persist' => $persist );
135
- update_option( 'wpmtst_admin_notices', $notices );
136
  }
137
 
138
 
@@ -146,7 +146,7 @@ function wpmtst_add_admin_notice( $key, $persist = false ) {
146
  function wpmtst_delete_admin_notice( $key ) {
147
  $notices = get_option( 'wpmtst_admin_notices', array() );
148
  unset( $notices[ $key ] );
149
- update_option( 'wpmtst_admin_notices', $notices );
150
  }
151
 
152
 
@@ -169,7 +169,7 @@ function wpmtst_auto_dismiss_notices( $option, $old_value, $value ) {
169
  $notices = get_option( 'wpmtst_admin_notices', array() );
170
  if ( isset( $notices['captcha-options-changed'] ) ) {
171
  unset( $notices['captcha-options-changed'] );
172
- update_option( 'wpmtst_admin_notices', $notices );
173
  }
174
  }
175
  }
132
  function wpmtst_add_admin_notice( $key, $persist = false ) {
133
  $notices = get_option( 'wpmtst_admin_notices', array() );
134
  $notices[ $key ] = array( 'persist' => $persist );
135
+ update_option( 'wpmtst_admin_notices', $notices, 'no' );
136
  }
137
 
138
 
146
  function wpmtst_delete_admin_notice( $key ) {
147
  $notices = get_option( 'wpmtst_admin_notices', array() );
148
  unset( $notices[ $key ] );
149
+ update_option( 'wpmtst_admin_notices', $notices, 'no' );
150
  }
151
 
152
 
169
  $notices = get_option( 'wpmtst_admin_notices', array() );
170
  if ( isset( $notices['captcha-options-changed'] ) ) {
171
  unset( $notices['captcha-options-changed'] );
172
+ update_option( 'wpmtst_admin_notices', $notices, 'no' );
173
  }
174
  }
175
  }
admin/admin.php CHANGED
@@ -193,7 +193,7 @@ add_action( 'updated_option', 'wpmtst_updated_option', 10, 3 );
193
  function wpmtst_add_config_error( $key ) {
194
  $errors = get_option( 'wpmtst_config_errors', array() );
195
  $errors[] = $key;
196
- update_option( 'wpmtst_config_errors', array_unique( $errors ) );
197
 
198
  wpmtst_add_admin_notice( $key, true );
199
  }
@@ -208,7 +208,7 @@ function wpmtst_add_config_error( $key ) {
208
  function wpmtst_delete_config_error( $key ) {
209
  $errors = get_option( 'wpmtst_config_errors', array() );
210
  $errors = array_diff( $errors, array ( $key ) );
211
- update_option( 'wpmtst_config_errors', $errors );
212
 
213
  wpmtst_delete_admin_notice( $key );
214
  }
@@ -271,6 +271,21 @@ function wpmtst_get_field_label( $field ) {
271
  return '';
272
  }
273
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
274
 
275
  /**
276
  * @param string $field_name
@@ -316,5 +331,4 @@ function wpmtst_extensions_installed() {
316
  }
317
 
318
  return false;
319
- }
320
-
193
  function wpmtst_add_config_error( $key ) {
194
  $errors = get_option( 'wpmtst_config_errors', array() );
195
  $errors[] = $key;
196
+ update_option( 'wpmtst_config_errors', array_unique( $errors ), 'no' );
197
 
198
  wpmtst_add_admin_notice( $key, true );
199
  }
208
  function wpmtst_delete_config_error( $key ) {
209
  $errors = get_option( 'wpmtst_config_errors', array() );
210
  $errors = array_diff( $errors, array ( $key ) );
211
+ update_option( 'wpmtst_config_errors', $errors, 'no' );
212
 
213
  wpmtst_delete_admin_notice( $key );
214
  }
271
  return '';
272
  }
273
 
274
+ function wpmtst_get_field_text( $field ) {
275
+ if ( isset( $field['field'] ) ) {
276
+ $custom_fields = wpmtst_get_custom_fields();
277
+ if ( isset( $custom_fields[ $field['field'] ]['text'] ) ) {
278
+ return $custom_fields[ $field['field'] ]['text'];
279
+ }
280
+ $builtin_fields = wpmtst_get_builtin_fields();
281
+ if ( isset( $builtin_fields[ $field['field'] ]['text'] ) ) {
282
+ return $builtin_fields[ $field['field'] ]['text'];
283
+ }
284
+ }
285
+
286
+ return '';
287
+ }
288
+
289
 
290
  /**
291
  * @param string $field_name
331
  }
332
 
333
  return false;
334
+ }
 
admin/class-strong-testimonials-defaults.php CHANGED
@@ -30,8 +30,10 @@ class Strong_Testimonials_Defaults {
30
  public static function get_options() {
31
  $default_options = array(
32
  'embed_width' => '',
33
- 'nofollow' => false,
34
- 'disable_rewrite' => false,
 
 
35
  'pending_indicator' => true,
36
  'remove_whitespace' => true,
37
  //@todo : delete commented line. For the moment let it be
@@ -41,8 +43,10 @@ class Strong_Testimonials_Defaults {
41
  'single_testimonial_slug' => 'testimonial',
42
  'scrolltop' => true,
43
  'scrolltop_offset' => 80,
44
- 'no_lazyload' => true,
 
45
  'touch_enabled' => true,
 
46
  );
47
 
48
  return $default_options;
@@ -82,6 +86,8 @@ class Strong_Testimonials_Defaults {
82
  'shortcode_on_form' => '',
83
  'shortcode_on_display' => '',
84
  'show_shortcode_options' => 0,
 
 
85
  ) );
86
  }
87
 
@@ -107,6 +113,7 @@ class Strong_Testimonials_Defaults {
107
  'admin_table_option' => 0,
108
  'show_admin_table_option' => 0,
109
  'name_mutable' => 0,
 
110
  ),
111
  'post_content' => array(
112
  'input_type' => 'textarea',
@@ -118,6 +125,7 @@ class Strong_Testimonials_Defaults {
118
  'admin_table' => 0,
119
  'show_admin_table_option' => 0,
120
  'name_mutable' => 0,
 
121
  ),
122
  'featured_image' => array(
123
  'input_type' => 'file',
@@ -127,7 +135,7 @@ class Strong_Testimonials_Defaults {
127
  'show_placeholder_option' => 0,
128
  'admin_table' => 0,
129
  'name_mutable' => 0,
130
- ),
131
  );
132
  foreach ( $field_types['post'] as $key => $array ) {
133
  $field_types['post'][ $key ] = array_merge( $field_base, $array );
@@ -283,6 +291,7 @@ class Strong_Testimonials_Defaults {
283
  'input_type' => 'text',
284
  'required' => 0,
285
  'after' => __( 'A headline for your testimonial.', 'strong-testimonials' ),
 
286
  ),
287
  6 => array(
288
  'record_type' => 'post',
@@ -291,6 +300,7 @@ class Strong_Testimonials_Defaults {
291
  'input_type' => 'textarea',
292
  'required' => 1,
293
  'after' => __( 'What do you think about us?', 'strong-testimonials' ),
 
294
  ),
295
  7 => array(
296
  'record_type' => 'post',
@@ -423,6 +433,14 @@ class Strong_Testimonials_Defaults {
423
  $default_form_options = array(
424
  'post_status' => 'pending',
425
  'admin_notify' => false,
 
 
 
 
 
 
 
 
426
  'mail_queue' => false,
427
  'sender_name' => get_bloginfo( 'name' ),
428
  'sender_site_email' => true,
@@ -440,9 +458,13 @@ class Strong_Testimonials_Defaults {
440
  'admin_email' => '',
441
  ),
442
  /* translators: Default subject line for new testimonial notification email. */
443
- 'email_subject' => __( 'New testimonial for %BLOGNAME%', 'strong-testimonials' ),
 
 
444
  /* translators: Default message for new testimonial notification email. */
445
- 'email_message' => __( 'New testimonial submission for %BLOGNAME%. This is awaiting action from the website administrator.', 'strong-testimonials' ),
 
 
446
  'messages' => $default_messages,
447
  'scrolltop_success' => true,
448
  'scrolltop_success_offset' => 80,
@@ -688,6 +710,9 @@ class Strong_Testimonials_Defaults {
688
  'form_ajax' => 0,
689
  'form_id' => 1,
690
  'gravatar' => 'no',
 
 
 
691
  'id' => '',
692
  'layout' => '',
693
  'lightbox' => '',
@@ -824,6 +849,7 @@ class Strong_Testimonials_Defaults {
824
  )
825
  ),
826
  ),
 
827
  );
828
 
829
  return $options;
30
  public static function get_options() {
31
  $default_options = array(
32
  'embed_width' => '',
33
+ 'nofollow' => true,
34
+ 'noopener' => false,
35
+ 'noreferrer' => false,
36
+ 'disable_rewrite' => false,
37
  'pending_indicator' => true,
38
  'remove_whitespace' => true,
39
  //@todo : delete commented line. For the moment let it be
43
  'single_testimonial_slug' => 'testimonial',
44
  'scrolltop' => true,
45
  'scrolltop_offset' => 80,
46
+ 'lazyload' => false,
47
+ 'no_lazyload_plugin' => true,
48
  'touch_enabled' => true,
49
+ 'upsells' => true
50
  );
51
 
52
  return $default_options;
86
  'shortcode_on_form' => '',
87
  'shortcode_on_display' => '',
88
  'show_shortcode_options' => 0,
89
+ 'show_length_option' => 0,
90
+ 'max_length' => ''
91
  ) );
92
  }
93
 
113
  'admin_table_option' => 0,
114
  'show_admin_table_option' => 0,
115
  'name_mutable' => 0,
116
+ 'show_length_option' => 1
117
  ),
118
  'post_content' => array(
119
  'input_type' => 'textarea',
125
  'admin_table' => 0,
126
  'show_admin_table_option' => 0,
127
  'name_mutable' => 0,
128
+ 'show_length_option' => 1
129
  ),
130
  'featured_image' => array(
131
  'input_type' => 'file',
135
  'show_placeholder_option' => 0,
136
  'admin_table' => 0,
137
  'name_mutable' => 0,
138
+ )
139
  );
140
  foreach ( $field_types['post'] as $key => $array ) {
141
  $field_types['post'][ $key ] = array_merge( $field_base, $array );
291
  'input_type' => 'text',
292
  'required' => 0,
293
  'after' => __( 'A headline for your testimonial.', 'strong-testimonials' ),
294
+ 'max_length' => ''
295
  ),
296
  6 => array(
297
  'record_type' => 'post',
300
  'input_type' => 'textarea',
301
  'required' => 1,
302
  'after' => __( 'What do you think about us?', 'strong-testimonials' ),
303
+ 'max_length' => ''
304
  ),
305
  7 => array(
306
  'record_type' => 'post',
433
  $default_form_options = array(
434
  'post_status' => 'pending',
435
  'admin_notify' => false,
436
+ 'customer-notify' => false,
437
+ 'approved-notify' => false,
438
+ 'sender_name_for_customer' => false,
439
+ 'sender_customer_email' => false,
440
+ 'sender_site_customer_email' => true,
441
+ 'sender_name_for_customer_approval' => false,
442
+ 'sender_site_customer_approval_email' => true,
443
+ 'sender_approval_email' => false,
444
  'mail_queue' => false,
445
  'sender_name' => get_bloginfo( 'name' ),
446
  'sender_site_email' => true,
458
  'admin_email' => '',
459
  ),
460
  /* translators: Default subject line for new testimonial notification email. */
461
+ 'email_subject' => __( 'New testimonial for %BLOGNAME%', 'strong-testimonials' ),
462
+ 'customer_approval_email_subject' => __( 'Testimonial for %BLOGNAME%', 'strong-testimonials' ),
463
+ 'customer_email_subject' => __( 'Testimonial for %BLOGNAME%', 'strong-testimonials' ),
464
  /* translators: Default message for new testimonial notification email. */
465
+ 'email_message' => __( 'New testimonial submission for %BLOGNAME%. This is awaiting action from the website administrator.', 'strong-testimonials' ),
466
+ 'customer_approval_email_message' => __( 'Your testimonial was published for %BLOGNAME%. Thank you!', 'strong-testimonials' ),
467
+ 'customer_email_message' => __( 'Your testimonial was received for %BLOGNAME% and awaiting approval from the website administrator. Thank you!', 'strong-testimonials' ),
468
  'messages' => $default_messages,
469
  'scrolltop_success' => true,
470
  'scrolltop_success_offset' => 80,
710
  'form_ajax' => 0,
711
  'form_id' => 1,
712
  'gravatar' => 'no',
713
+ 'initials_font_size' => '42',
714
+ 'initials_font_color' => '#000000',
715
+ 'initials_bg_color' => '#ffffff',
716
  'id' => '',
717
  'layout' => '',
718
  'lightbox' => '',
849
  )
850
  ),
851
  ),
852
+ 'random_js' => false
853
  );
854
 
855
  return $options;
admin/class-strong-testimonials-page-shortcodes.php CHANGED
@@ -218,6 +218,31 @@ class Strong_Testimonials_Page_Shortcodes {
218
  </tr>
219
  </table>
220
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
221
  <table class="form-table shortcodes average">
222
  <tr>
223
  <td>
@@ -237,6 +262,34 @@ class Strong_Testimonials_Page_Shortcodes {
237
  </td>
238
  </tr>
239
  </table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
240
 
241
  <table class="form-table shortcodes average">
242
  <tr>
218
  </tr>
219
  </table>
220
 
221
+ <table class="form-table shortcodes average">
222
+ <tr>
223
+ <td>
224
+ <p><code>decimals</code></p>
225
+ <p class="description">If you need to display multiple decimals for average rating you have to set a number to decimal.</p>
226
+
227
+ </td>
228
+ <td class="has-inner">
229
+ <table class="inner" cellpadding="0" cellspacing="0">
230
+ <tr>
231
+ <td class="shortcode">&#91;testimonial_average_rating decimals="number" /&#93;</td>
232
+ </tr>
233
+ <tr>
234
+ <td>
235
+ <div class="strong-rating-wrapper average block"><span class="strong-rating-title">Average Rating:</span>
236
+ <?php echo $stars; ?>
237
+ <span class="strong-rating-summary">4.333 stars (based on 9 ratings)</span>
238
+ </div>
239
+ </td>
240
+ </tr>
241
+ </table>
242
+ </td>
243
+ </tr>
244
+ </table>
245
+
246
  <table class="form-table shortcodes average">
247
  <tr>
248
  <td>
262
  </td>
263
  </tr>
264
  </table>
265
+
266
+ <table class="form-table shortcodes average">
267
+ <tr>
268
+ <td>
269
+ <p><code>field</code></p>
270
+ <p class="description">If using multiple rating fields, you can specify the specific field you need.</p>
271
+ <p class="description">If using multiple rating fields, you can use "all" to use all the rating fields.</p>
272
+ </td>
273
+ <td class="has-inner">
274
+ <table class="inner" cellpadding="0" cellspacing="0">
275
+ <tr>
276
+ <td class="shortcode">&#91;testimonial_average_rating field="rating" /&#93;</td>
277
+ </tr>
278
+ <tr>
279
+ <td class="shortcode">&#91;testimonial_average_rating field="all" /&#93;</td>
280
+ </tr>
281
+ <tr>
282
+ <td>
283
+ <div class="strong-rating-wrapper average block"><span class="strong-rating-title">Average Rating:</span>
284
+ <?php echo $stars; ?>
285
+ <span class="strong-rating-summary">4.3 stars (based on 9 ratings)</span>
286
+ </div>
287
+ </td>
288
+ </tr>
289
+ </table>
290
+ </td>
291
+ </tr>
292
+ </table>
293
 
294
  <table class="form-table shortcodes average">
295
  <tr>
admin/class-strong-testimonials-post-editor.php CHANGED
@@ -181,14 +181,31 @@ class Strong_Testimonials_Post_Editor {
181
  <?php printf( '<input id="%2$s" type="%1$s" class="custom-input" name="custom[%2$s]" value="%3$s" size="">',
182
  $field['input_type'], $field['name'], esc_attr( $post->{$field['name']} ) ); ?>
183
  </div>
184
- <div class="input-nofollow">
185
- <label for="custom_nofollow"><code>rel="nofollow"</code></label>
186
- <select id="custom_nofollow" name="custom[nofollow]">
187
- <option value="default" <?php selected( $post->nofollow, 'default' ); ?>><?php _e( 'default', 'strong-testimonials' ); ?></option>
188
- <option value="yes" <?php selected( $post->nofollow, 'yes' ); ?>><?php _e( 'yes', 'strong-testimonials' ); ?></option>
189
- <option value="no" <?php selected( $post->nofollow, 'no' ); ?>><?php _e( 'no', 'strong-testimonials' ); ?></option>
190
- </select>
191
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
192
  <?php
193
  }
194
 
181
  <?php printf( '<input id="%2$s" type="%1$s" class="custom-input" name="custom[%2$s]" value="%3$s" size="">',
182
  $field['input_type'], $field['name'], esc_attr( $post->{$field['name']} ) ); ?>
183
  </div>
184
+ <div class="input-links">
185
+ <div class="input-nofollow">
186
+ <label for="custom_nofollow"><code>rel="nofollow"</code></label>
187
+ <select id="custom_nofollow" name="custom[nofollow]">
188
+ <option value="default" <?php selected( $post->nofollow, 'default' ); ?>><?php _e( 'default', 'strong-testimonials' ); ?></option>
189
+ <option value="yes" <?php selected( $post->nofollow, 'yes' ); ?>><?php _e( 'yes', 'strong-testimonials' ); ?></option>
190
+ <option value="no" <?php selected( $post->nofollow, 'no' ); ?>><?php _e( 'no', 'strong-testimonials' ); ?></option>
191
+ </select>
192
+ </div>
193
+ <div class="input-noopener">
194
+ <label for="custom_noopener"><code>rel="noopener"</code></label>
195
+ <select id="custom_noopener" name="custom[noopener]">
196
+ <option value="default" <?php selected( $post->noopener, 'default' ); ?>><?php _e( 'default', 'strong-testimonials' ); ?></option>
197
+ <option value="yes" <?php selected( $post->noopener, 'yes' ); ?>><?php _e( 'yes', 'strong-testimonials' ); ?></option>
198
+ <option value="no" <?php selected( $post->noopener, 'no' ); ?>><?php _e( 'no', 'strong-testimonials' ); ?></option>
199
+ </select>
200
+ </div>
201
+ <div class="input-noreferrer">
202
+ <label for="custom_noreferrer"><code>rel="noreferrer"</code></label>
203
+ <select id="custom_noopener" name="custom[noreferrer]">
204
+ <option value="default" <?php selected( $post->noreferrer, 'default' ); ?>><?php _e( 'default', 'strong-testimonials' ); ?></option>
205
+ <option value="yes" <?php selected( $post->noreferrer, 'yes' ); ?>><?php _e( 'yes', 'strong-testimonials' ); ?></option>
206
+ <option value="no" <?php selected( $post->noreferrer, 'no' ); ?>><?php _e( 'no', 'strong-testimonials' ); ?></option>
207
+ </select>
208
+ </div>
209
  <?php
210
  }
211
 
admin/class-strong-testimonials-updater.php CHANGED
@@ -108,12 +108,12 @@ class Strong_Testimonials_Updater {
108
  /**
109
  * Custom fields.
110
  */
111
- update_option( 'wpmtst_fields', self::update_fields() );
112
 
113
  /**
114
  * Forms.
115
  */
116
- update_option( 'wpmtst_base_forms', self::update_base_forms() );
117
  update_option( 'wpmtst_custom_forms', self::update_custom_forms() );
118
  update_option( 'wpmtst_form_options', self::update_form_options() );
119
 
@@ -136,7 +136,7 @@ class Strong_Testimonials_Updater {
136
  *
137
  * @since 2.15.0
138
  */
139
- update_option( 'wpmtst_view_default', self::update_default_view() );
140
 
141
  /**
142
  * Update views.
@@ -149,6 +149,8 @@ class Strong_Testimonials_Updater {
149
  if ( ! isset( $history['2.23.0_convert_nofollow'] ) ) {
150
  self::convert_nofollow();
151
  self::update_history_log( '2.23.0_convert_nofollow' );
 
 
152
  }
153
 
154
 
@@ -1229,6 +1231,104 @@ class Strong_Testimonials_Updater {
1229
  update_post_meta( $post->ID, 'nofollow', $new_value );
1230
  }
1231
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1232
 
1233
  /**
1234
  * Convert pagination settings.
108
  /**
109
  * Custom fields.
110
  */
111
+ update_option( 'wpmtst_fields', self::update_fields(), 'no' );
112
 
113
  /**
114
  * Forms.
115
  */
116
+ update_option( 'wpmtst_base_forms', self::update_base_forms(), 'no' );
117
  update_option( 'wpmtst_custom_forms', self::update_custom_forms() );
118
  update_option( 'wpmtst_form_options', self::update_form_options() );
119
 
136
  *
137
  * @since 2.15.0
138
  */
139
+ update_option( 'wpmtst_view_default', self::update_default_view(), 'no' );
140
 
141
  /**
142
  * Update views.
149
  if ( ! isset( $history['2.23.0_convert_nofollow'] ) ) {
150
  self::convert_nofollow();
151
  self::update_history_log( '2.23.0_convert_nofollow' );
152
+ self::convert_noopener();
153
+ self::convert_noreferrer();
154
  }
155
 
156
 
1231
  update_post_meta( $post->ID, 'nofollow', $new_value );
1232
  }
1233
  }
1234
+
1235
+ /**
1236
+ * Convert noopener from (on|off) to (1|0).
1237
+ *
1238
+ * @since 2.41.0
1239
+ */
1240
+ public static function convert_noopener() {
1241
+ $args = array(
1242
+ 'posts_per_page' => - 1,
1243
+ 'post_type' => 'wpm-testimonial',
1244
+ 'post_status' => 'publish',
1245
+ 'suppress_filters' => true,
1246
+ );
1247
+ $posts = get_posts( $args );
1248
+ if ( ! $posts ) {
1249
+ return;
1250
+ }
1251
+
1252
+ /**
1253
+ * Remove the equivocation. There is no false.
1254
+ */
1255
+ foreach ( $posts as $post ) {
1256
+ $noopener = get_post_meta( $post->ID, 'noopener', true );
1257
+ $new_value = 'default';
1258
+
1259
+ if ( 'on' == $noopener ) {
1260
+ $new_value = 'yes';
1261
+ }
1262
+ elseif ( 1 === $noopener ) {
1263
+ $new_value = 'yes';
1264
+ }
1265
+ elseif ( 'off' == $noopener ) {
1266
+ $new_value = 'no';
1267
+ }
1268
+ elseif ( 0 === $noopener ) {
1269
+ $new_value = 'no';
1270
+ }
1271
+ elseif ( is_bool( $noopener ) ) {
1272
+ if ( $noopener ) {
1273
+ $new_value = 'yes';
1274
+ }
1275
+ else {
1276
+ $new_value = 'default';
1277
+ }
1278
+ }
1279
+
1280
+ update_post_meta( $post->ID, 'noopener', $new_value );
1281
+ }
1282
+ }
1283
+
1284
+ /**
1285
+ * Convert noreferrer from (on|off) to (1|0).
1286
+ *
1287
+ * @since 2.41.0
1288
+ */
1289
+ public static function convert_noreferrer() {
1290
+ $args = array(
1291
+ 'posts_per_page' => - 1,
1292
+ 'post_type' => 'wpm-testimonial',
1293
+ 'post_status' => 'publish',
1294
+ 'suppress_filters' => true,
1295
+ );
1296
+ $posts = get_posts( $args );
1297
+ if ( ! $posts ) {
1298
+ return;
1299
+ }
1300
+
1301
+ /**
1302
+ * Remove the equivocation. There is no false.
1303
+ */
1304
+ foreach ( $posts as $post ) {
1305
+ $noreferrer = get_post_meta( $post->ID, 'noreferrer', true );
1306
+ $new_value = 'default';
1307
+
1308
+ if ( 'on' == $noreferrer ) {
1309
+ $new_value = 'yes';
1310
+ }
1311
+ elseif ( 1 === $noreferrer ) {
1312
+ $new_value = 'yes';
1313
+ }
1314
+ elseif ( 'off' == $noreferrer ) {
1315
+ $new_value = 'no';
1316
+ }
1317
+ elseif ( 0 === $noreferrer ) {
1318
+ $new_value = 'no';
1319
+ }
1320
+ elseif ( is_bool( $noreferrer ) ) {
1321
+ if ( $noreferrer ) {
1322
+ $new_value = 'yes';
1323
+ }
1324
+ else {
1325
+ $new_value = 'default';
1326
+ }
1327
+ }
1328
+
1329
+ update_post_meta( $post->ID, 'noreferrer', $new_value );
1330
+ }
1331
+ }
1332
 
1333
  /**
1334
  * Convert pagination settings.
admin/class-strong-testimonials-upsell.php CHANGED
@@ -10,14 +10,16 @@ class Strong_Testimonials_Upsell {
10
 
11
  public function __construct() {
12
  $this->set_store_upgrade_url();
13
-
14
- add_action( 'wpmtst_after_form_type_selection', array( $this, 'add_upsells_1' ) );
15
- add_action( 'wpmtst_before_fields_settings', array( $this, 'add_upsells_2' ) );
16
- add_action( 'wpmtst_view_editor_after_groups', array( $this, 'add_upsells_3' ) );
17
- add_action( 'wpmtst_view_editor_after_group_select', array( $this, 'add_upsells_4' ) );
18
- add_action( 'wpmtst_fields_before_fields_editor_preview', array( $this, 'add_upsells_5' ) );
19
- add_action( 'wpmtst_after_form_settings', array( $this, 'add_upsells_6' ) );
20
- add_action( 'wpmtst_views_after_template_list', array( $this, 'add_upsells_7' ) );
 
 
21
 
22
  add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ) );
23
  }
10
 
11
  public function __construct() {
12
  $this->set_store_upgrade_url();
13
+ $options = get_option( 'wpmtst_options' );
14
+ if (isset($options['upsells']) && $options['upsells'] == false) {
15
+ add_action( 'wpmtst_after_form_type_selection', array( $this, 'add_upsells_1' ) );
16
+ add_action( 'wpmtst_before_fields_settings', array( $this, 'add_upsells_2' ) );
17
+ add_action( 'wpmtst_view_editor_after_groups', array( $this, 'add_upsells_3' ) );
18
+ add_action( 'wpmtst_view_editor_after_group_select', array( $this, 'add_upsells_4' ) );
19
+ add_action( 'wpmtst_fields_before_fields_editor_preview', array( $this, 'add_upsells_5' ) );
20
+ add_action( 'wpmtst_after_form_settings', array( $this, 'add_upsells_6' ) );
21
+ add_action( 'wpmtst_views_after_template_list', array( $this, 'add_upsells_7' ) );
22
+ }
23
 
24
  add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ) );
25
  }
admin/class-strong-views-list-table.php CHANGED
@@ -33,6 +33,7 @@ class Strong_Views_List_Table extends Strong_Testimonials_List_Table {
33
  usort( $data, array( &$this, 'usort_reorder' ) );
34
  }
35
  $data = $this->move_sticky( $data );
 
36
  $this->items = $data;
37
  }
38
 
33
  usort( $data, array( &$this, 'usort_reorder' ) );
34
  }
35
  $data = $this->move_sticky( $data );
36
+ $data = apply_filters('wpmtst_list_views', $data);
37
  $this->items = $data;
38
  }
39
 
admin/compat.php CHANGED
@@ -84,7 +84,7 @@ function wpmtst_deny_plugins_init() {
84
  }
85
 
86
  if ( $update )
87
- update_option( 'hicpo_options', $options );
88
  }
89
 
90
  /**
@@ -109,7 +109,7 @@ function wpmtst_deny_plugins_init() {
109
  }
110
 
111
  if ( $update )
112
- update_option( 'scporder_options', $options );
113
  }
114
 
115
  }
84
  }
85
 
86
  if ( $update )
87
+ update_option( 'hicpo_options', $options, 'no' );
88
  }
89
 
90
  /**
109
  }
110
 
111
  if ( $update )
112
+ update_option( 'scporder_options', $options, 'no' );
113
  }
114
 
115
  }
admin/css/post-editor.css CHANGED
@@ -38,8 +38,7 @@ div.checkbox input[type="checkbox"] {
38
  padding: 3px 5px;
39
  }
40
 
41
- .input-url,
42
- .input-nofollow {
43
  display: inline-block;
44
  }
45
 
@@ -47,10 +46,14 @@ div.checkbox input[type="checkbox"] {
47
  width: calc(100% - 210px);
48
  }
49
 
50
- .input-nofollow {
51
- float: right;
52
  }
53
 
 
 
 
 
54
  label.nowrap {
55
  word-break: keep-all;
56
  white-space: nowrap;
38
  padding: 3px 5px;
39
  }
40
 
41
+ .input-url {
 
42
  display: inline-block;
43
  }
44
 
46
  width: calc(100% - 210px);
47
  }
48
 
49
+ .input-links {
50
+ display: flex;
51
  }
52
 
53
+ /*.input-nofollow {
54
+ float: right;
55
+ }*/
56
+
57
  label.nowrap {
58
  word-break: keep-all;
59
  white-space: nowrap;
admin/custom-fields.php CHANGED
@@ -20,7 +20,6 @@ add_action( 'wpmtst_form_admin', 'wpmtst_form_admin2' );
20
  */
21
  function wpmtst_update_custom_fields() {
22
  $goback = wp_get_referer();
23
-
24
  if ( ! isset( $_POST['wpmtst_form_submitted'] ) ) {
25
  wp_redirect( $goback );
26
  exit;
@@ -67,6 +66,7 @@ function wpmtst_update_custom_fields() {
67
  $post_fields = stripslashes_deep( $_POST['fields'] );
68
 
69
  foreach ( $post_fields as $key => $field ) {
 
70
 
71
  /*
72
  * Before merging onto base field, catch fields that are "off"
@@ -109,7 +109,8 @@ function wpmtst_update_custom_fields() {
109
  $field['show_admin_table_option'] = $field['show_admin_table_option'] ? 1 : 0;
110
  $field['show_text_option'] = $field['show_text_option'] ? 1 : 0;
111
  $field['show_placeholder_option'] = $field['show_placeholder_option'] ? 1 : 0;
112
- $field['show_default_options'] = $field['show_default_options'] ? 1 : 0;
 
113
 
114
  $field = apply_filters( 'wpmtst_sanitize_form_field_options', $field );
115
 
@@ -159,7 +160,7 @@ function wpmtst_settings_custom_fields( $form_id = 1 ) {
159
  ?>
160
 
161
  <div class="wrap wpmtst">
162
- <h1 class="wp-heading-inline"><?php esc_html_e( 'Fields', 'strong-testimonials' ); ?></h1>
163
  <hr class="wp-header-end">
164
  <?php do_action( 'wpmtst_fields_editor_before_fields_intro' ); ?>
165
 
@@ -313,6 +314,18 @@ function wpmtst_show_field_secondary( $key, $field ) {
313
  $html .= '</tr>' . "\n";
314
  }
315
  }
 
 
 
 
 
 
 
 
 
 
 
 
316
 
317
  /**
318
  * Text (checkbox, radio)
@@ -322,7 +335,7 @@ function wpmtst_show_field_secondary( $key, $field ) {
322
  if ( $field['show_text_option'] ) {
323
  if ( isset( $field['text'] ) ) {
324
  $html .= '<tr class="field-secondary">' . "\n";
325
- $html .= '<th>' . esc_html__( 'Text', 'strong-testimonials' ) . '</th>' . "\n";
326
  $html .= '<td><input type="text" name="fields[' . esc_attr( $key ) . '][text]" value="' . esc_attr( $field['text'] ) . '" placeholder="' . esc_html__( 'next to the checkbox', 'strong-testimonials' ) . '"></td>' . "\n";
327
  $html .= '</tr>' . "\n";
328
  }
@@ -504,6 +517,7 @@ function wpmtst_show_field_hidden( $key, $field ) {
504
  $html .= sprintf( $pattern, $key, 'admin_table_option', $field['admin_table_option'] ) . "\n";
505
  $html .= sprintf( $pattern, $key, 'show_admin_table_option', $field['show_admin_table_option'] ) . "\n";
506
  $html .= sprintf( $pattern, $key, 'show_shortcode_options', $field['show_shortcode_options'] ) . "\n";
 
507
 
508
  if ( isset( $field['map'] ) ) {
509
  $html .= sprintf( $pattern, $key, 'map', $field['map'] ) . "\n";
20
  */
21
  function wpmtst_update_custom_fields() {
22
  $goback = wp_get_referer();
 
23
  if ( ! isset( $_POST['wpmtst_form_submitted'] ) ) {
24
  wp_redirect( $goback );
25
  exit;
66
  $post_fields = stripslashes_deep( $_POST['fields'] );
67
 
68
  foreach ( $post_fields as $key => $field ) {
69
+
70
 
71
  /*
72
  * Before merging onto base field, catch fields that are "off"
109
  $field['show_admin_table_option'] = $field['show_admin_table_option'] ? 1 : 0;
110
  $field['show_text_option'] = $field['show_text_option'] ? 1 : 0;
111
  $field['show_placeholder_option'] = $field['show_placeholder_option'] ? 1 : 0;
112
+ $field['show_default_options'] = $field['show_default_options'] ? 1 : 0;
113
+ $field['show_length_option'] = $field['show_length_option'] ? 1 : 0;
114
 
115
  $field = apply_filters( 'wpmtst_sanitize_form_field_options', $field );
116
 
160
  ?>
161
 
162
  <div class="wrap wpmtst">
163
+ <h1 class="wp-heading-inline"><?php esc_html_e( 'Forms', 'strong-testimonials' ); ?></h1>
164
  <hr class="wp-header-end">
165
  <?php do_action( 'wpmtst_fields_editor_before_fields_intro' ); ?>
166
 
314
  $html .= '</tr>' . "\n";
315
  }
316
  }
317
+
318
+ /*
319
+ * Length
320
+ */
321
+ if ( $field['show_length_option'] ) {
322
+ if ( isset( $field['max_length'] ) ) {
323
+ $html .= '<tr class="field-secondary">' . "\n";
324
+ $html .= '<th>' . esc_html__( 'Maximum Length', 'strong-testimonials' ) . '</th>' . "\n";
325
+ $html .= '<td><input type="number" name="fields[' . esc_attr( $key ) . '][max_length]" value="' . esc_attr($field['max_length']) . '"><span> ' . esc_html__( 'Limit the user imput to a certain number of characters', 'strong-testimonials' ) . '</span></td>' . "\n";
326
+ $html .= '</tr>' . "\n";
327
+ }
328
+ }
329
 
330
  /**
331
  * Text (checkbox, radio)
335
  if ( $field['show_text_option'] ) {
336
  if ( isset( $field['text'] ) ) {
337
  $html .= '<tr class="field-secondary">' . "\n";
338
+ $html .= '<th>' . esc_html__( 'Checked value', 'strong-testimonials' ) . '</th>' . "\n";
339
  $html .= '<td><input type="text" name="fields[' . esc_attr( $key ) . '][text]" value="' . esc_attr( $field['text'] ) . '" placeholder="' . esc_html__( 'next to the checkbox', 'strong-testimonials' ) . '"></td>' . "\n";
340
  $html .= '</tr>' . "\n";
341
  }
517
  $html .= sprintf( $pattern, $key, 'admin_table_option', $field['admin_table_option'] ) . "\n";
518
  $html .= sprintf( $pattern, $key, 'show_admin_table_option', $field['show_admin_table_option'] ) . "\n";
519
  $html .= sprintf( $pattern, $key, 'show_shortcode_options', $field['show_shortcode_options'] ) . "\n";
520
+ $html .= sprintf( $pattern, $key, 'show_length_option', $field['show_length_option'] ) . "\n";
521
 
522
  if ( isset( $field['map'] ) ) {
523
  $html .= sprintf( $pattern, $key, 'map', $field['map'] ) . "\n";
admin/js/admin-compat.js CHANGED
@@ -109,19 +109,6 @@
109
  e.preventDefault()
110
  })
111
 
112
- // Listen for [Add Row]
113
- $('#add-pair').on('click', function (e) {
114
- var $this = $(this);
115
- var key = $this.closest('.lazyload-pairs').find('.pair').length;
116
- var data = {
117
- 'action': 'wpmtst_add_lazyload_pair',
118
- 'key': key,
119
- };
120
- $.get(ajaxurl, data, function (response) {
121
- $this.parent().before(response.data).prev().find('input').first().focus();
122
- });
123
- });
124
-
125
  // Start
126
  saveCurrentSettings()
127
  updateDisplay()
109
  e.preventDefault()
110
  })
111
 
 
 
 
 
 
 
 
 
 
 
 
 
 
112
  // Start
113
  saveCurrentSettings()
114
  updateDisplay()
admin/js/admin-order.js CHANGED
@@ -80,9 +80,8 @@ jQuery(document).ready(function ($) {
80
  update: function (e, ui) {
81
  ui.item.find(".column-handle").addClass("refresh");
82
  $.post(ajaxurl, {
83
- action: 'update-menu-order',
84
- posts: $('#the-list').sortable('serialize'),
85
- order: wpmtstOrderHelper
86
  },
87
  function (data) {
88
  // update menu order shown
80
  update: function (e, ui) {
81
  ui.item.find(".column-handle").addClass("refresh");
82
  $.post(ajaxurl, {
83
+ action: 'st-update-menu-order',
84
+ order: $('#the-list').sortable('serialize'),
 
85
  },
86
  function (data) {
87
  // update menu order shown
admin/js/views.js CHANGED
@@ -647,9 +647,13 @@ jQuery(document).ready(function ($) {
647
  if ('unstyled' === template) {
648
  $('input[name=\'view[data][background][type]\']').prop('disabled', true);
649
  $('input[name=\'view[data][font-color][type]\']').prop('disabled', true);
 
 
650
  } else {
651
  $('input[name=\'view[data][background][type]\']').prop('disabled', false);
652
  $('input[name=\'view[data][font-color][type]\']').prop('disabled', false);
 
 
653
  }
654
 
655
  // Special handling for Lucid add-on until I can incorporate a template group config file
@@ -799,7 +803,7 @@ jQuery(document).ready(function ($) {
799
 
800
  }
801
 
802
- var backgroundRadios = $('input[type=radio][name=\'view[data][background][type]\']'),
803
  backgroundPreview = $('#background-preview'),
804
  backgroundPresetSelector = $('#view-background-preset');
805
 
@@ -807,7 +811,7 @@ jQuery(document).ready(function ($) {
807
  * Font-color change listener
808
  */
809
  // TODO Use ID instead.
810
- var fontColorRadios = $('input[type=radio][name=\'view[data][font-color][type]\']');
811
 
812
  function fontColorDescriptions () {
813
  var fontColorRadioOff, fontColorRadioOn, fontColorID;
@@ -939,6 +943,7 @@ jQuery(document).ready(function ($) {
939
  var data = {
940
  'action': 'wpmtst_view_add_field',
941
  'key': nextKey,
 
942
  };
943
  $.get(ajaxurl, data, function (response) {
944
  $.when(customFieldList.append(response)).then(function () {
@@ -950,7 +955,6 @@ jQuery(document).ready(function ($) {
950
  });
951
  });
952
  });
953
-
954
  /**
955
  * Field type change listener
956
  */
@@ -961,7 +965,7 @@ jQuery(document).ready(function ($) {
961
  var fieldName = $elParent.find('.field-name').find('select').val();
962
  // var key = $elParent.attr("id").split('-').slice(-1)[0];
963
  var key = $elParent.data('key');
964
- var data;
965
 
966
  switch (fieldType) {
967
 
@@ -973,6 +977,7 @@ jQuery(document).ready(function ($) {
973
  'fieldName': fieldName,
974
  'fieldType': fieldType,
975
  'key': key,
 
976
  };
977
  $.get(ajaxurl, data, function (response) {
978
  // insert into placeholder div
@@ -985,7 +990,6 @@ jQuery(document).ready(function ($) {
985
  $.fn.selectGroupOption($newFieldSelect);
986
  });
987
  textChangeListener();
988
-
989
  // Get field name --> Get field label --> Populate link_text label
990
  var fieldName = $elParent.find('.field-name').find('select').val();
991
  var data2 = {
@@ -1005,6 +1009,7 @@ jQuery(document).ready(function ($) {
1005
  data = {
1006
  'action': 'wpmtst_view_add_field_date',
1007
  'key': key,
 
1008
  };
1009
  $.get(ajaxurl, data, function (response) {
1010
  // insert into placeholder div
@@ -1013,8 +1018,20 @@ jQuery(document).ready(function ($) {
1013
  break;
1014
 
1015
  case 'text':
1016
- // if changing to [text], remove meta fields
1017
- $elParent.find('.field-property-box').empty();
 
 
 
 
 
 
 
 
 
 
 
 
1018
  break;
1019
 
1020
  default:
@@ -1033,6 +1050,7 @@ jQuery(document).ready(function ($) {
1033
  var key = $elParent.data('key');
1034
  var typeSelectParent = $elParent.find('.field-type');
1035
  var typeSelect = typeSelectParent.find('select');
 
1036
  var data;
1037
 
1038
  $elParent.not('.open').addClass('open').find('.field-properties').addClass('open').slideDown();
@@ -1063,14 +1081,13 @@ jQuery(document).ready(function ($) {
1063
  // Show dependent inputs
1064
  $elParent.find('.field-dep').show();
1065
  }
1066
-
1067
  switch (fieldValue) {
1068
  // First, the immutables
1069
  case 'post_date':
1070
  case 'submit_date':
1071
  // Disable type selector
1072
  typeSelect.val('date').prop('disabled', true);
1073
- typeSelectParent.append('<input type="hidden" class="save-type" name="view[data][client_section][' + key + '][save-type]" value="date">');
1074
 
1075
  // add format field
1076
  data = {
@@ -1101,7 +1118,7 @@ jQuery(document).ready(function ($) {
1101
 
1102
  case 'category':
1103
  $(typeSelect).val('category').prop('disabled', true);
1104
- typeSelectParent.append('<input type="hidden" class="save-type" name="view[data][client_section][' + key + '][save-type]" value="category">');
1105
  $elParent.find('.field-property-box').empty();
1106
  break;
1107
 
@@ -1110,14 +1127,33 @@ jQuery(document).ready(function ($) {
1110
  // Special handling
1111
  if ('rating' === fieldType) {
1112
  typeSelect.val('rating').prop('disabled', true);
1113
- typeSelectParent.append('<input type="hidden" class="save-type" name="view[data][client_section][' + key + '][save-type]" value="rating">');
1114
  $elParent.find('.field-property-box').empty();
1115
  break;
1116
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1117
 
1118
  if ('platform' === fieldType) {
1119
  typeSelect.val('platform').prop('disabled', true);
1120
- typeSelectParent.append('<input type="hidden" class="save-type" name="view[data][client_section][' + key + '][save-type]" value="platform">');
1121
  $elParent.find('.field-property-box').empty();
1122
  break;
1123
  }
@@ -1129,6 +1165,39 @@ jQuery(document).ready(function ($) {
1129
  $el.parent().find('input.save-type').remove();
1130
  }
1131
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1132
 
1133
  /**
1134
  * Delete a client field
647
  if ('unstyled' === template) {
648
  $('input[name=\'view[data][background][type]\']').prop('disabled', true);
649
  $('input[name=\'view[data][font-color][type]\']').prop('disabled', true);
650
+ $('input[name=\'wpmtst_style_options[background][type]\']').prop('disabled', true);
651
+ $('input[name=\'wpmtst_style_options[font-color][type]\']').prop('disabled', true);
652
  } else {
653
  $('input[name=\'view[data][background][type]\']').prop('disabled', false);
654
  $('input[name=\'view[data][font-color][type]\']').prop('disabled', false);
655
+ $('input[name=\'wpmtst_style_options[background][type]\']').prop('disabled', false);
656
+ $('input[name=\'wpmtst_style_options[font-color][type]\']').prop('disabled', false);
657
  }
658
 
659
  // Special handling for Lucid add-on until I can incorporate a template group config file
803
 
804
  }
805
 
806
+ var backgroundRadios = $('input[type=radio][name=\'view[data][background][type]\'], input[type=radio][name=\'wpmtst_style_options[background][type]\']'),
807
  backgroundPreview = $('#background-preview'),
808
  backgroundPresetSelector = $('#view-background-preset');
809
 
811
  * Font-color change listener
812
  */
813
  // TODO Use ID instead.
814
+ var fontColorRadios = $('input[type=radio][name=\'view[data][font-color][type]\'], input[type=radio][name=\'wpmtst_style_options[font-color][type]\']');
815
 
816
  function fontColorDescriptions () {
817
  var fontColorRadioOff, fontColorRadioOn, fontColorID;
943
  var data = {
944
  'action': 'wpmtst_view_add_field',
945
  'key': nextKey,
946
+ 'source': $(this).attr('source')
947
  };
948
  $.get(ajaxurl, data, function (response) {
949
  $.when(customFieldList.append(response)).then(function () {
955
  });
956
  });
957
  });
 
958
  /**
959
  * Field type change listener
960
  */
965
  var fieldName = $elParent.find('.field-name').find('select').val();
966
  // var key = $elParent.attr("id").split('-').slice(-1)[0];
967
  var key = $elParent.data('key');
968
+ var data;
969
 
970
  switch (fieldType) {
971
 
977
  'fieldName': fieldName,
978
  'fieldType': fieldType,
979
  'key': key,
980
+ 'source': $('#add-field').attr('source')
981
  };
982
  $.get(ajaxurl, data, function (response) {
983
  // insert into placeholder div
990
  $.fn.selectGroupOption($newFieldSelect);
991
  });
992
  textChangeListener();
 
993
  // Get field name --> Get field label --> Populate link_text label
994
  var fieldName = $elParent.find('.field-name').find('select').val();
995
  var data2 = {
1009
  data = {
1010
  'action': 'wpmtst_view_add_field_date',
1011
  'key': key,
1012
+ 'source': $('#add-field').attr('source')
1013
  };
1014
  $.get(ajaxurl, data, function (response) {
1015
  // insert into placeholder div
1018
  break;
1019
 
1020
  case 'text':
1021
+
1022
+ case 'checkbox':
1023
+ // if changing to [checkbox_value]
1024
+ data = {
1025
+ 'action': 'wpmtst_view_add_field_checkbox',
1026
+ 'fieldName': fieldName,
1027
+ 'fieldType': fieldType,
1028
+ 'key': key,
1029
+ 'source': $('#add-field').attr('source')
1030
+ };
1031
+ $.get(ajaxurl, data, function (response) {
1032
+ // insert into placeholder div
1033
+ $elParent.find('.field-property-box').html(response);
1034
+ });
1035
  break;
1036
 
1037
  default:
1050
  var key = $elParent.data('key');
1051
  var typeSelectParent = $elParent.find('.field-type');
1052
  var typeSelect = typeSelectParent.find('select');
1053
+ var source = $('#add-field').attr('source');
1054
  var data;
1055
 
1056
  $elParent.not('.open').addClass('open').find('.field-properties').addClass('open').slideDown();
1081
  // Show dependent inputs
1082
  $elParent.find('.field-dep').show();
1083
  }
 
1084
  switch (fieldValue) {
1085
  // First, the immutables
1086
  case 'post_date':
1087
  case 'submit_date':
1088
  // Disable type selector
1089
  typeSelect.val('date').prop('disabled', true);
1090
+ typeSelectParent.append('<input type="hidden" class="save-type" name="' + source + '[client_section][' + key + '][save-type]" value="date">');
1091
 
1092
  // add format field
1093
  data = {
1118
 
1119
  case 'category':
1120
  $(typeSelect).val('category').prop('disabled', true);
1121
+ typeSelectParent.append('<input type="hidden" class="save-type" name="' + source + '[client_section][' + key + '][save-type]" value="category">');
1122
  $elParent.find('.field-property-box').empty();
1123
  break;
1124
 
1127
  // Special handling
1128
  if ('rating' === fieldType) {
1129
  typeSelect.val('rating').prop('disabled', true);
1130
+ typeSelectParent.append('<input type="hidden" class="save-type" name="' + source + '[client_section][' + key + '][save-type]" value="rating">');
1131
  $elParent.find('.field-property-box').empty();
1132
  break;
1133
  }
1134
+
1135
+ if ('checkbox' === fieldType) {
1136
+ typeSelect.val('checkbox').prop('disabled', true);
1137
+ typeSelectParent.append('<input type="hidden" class="save-type" name="' + source + '[client_section][' + key + '][save-type]" value="checkbox">');
1138
+ typeSelect.parent().hide();
1139
+ var fieldName = $elParent.find('.field-name').find('select').val();
1140
+ data = {
1141
+ 'action': 'wpmtst_view_add_field_checkbox',
1142
+ 'fieldName': fieldName,
1143
+ 'fieldType': fieldType,
1144
+ 'key': key,
1145
+ 'source': source
1146
+ };
1147
+ $.get(ajaxurl, data, function (response) {
1148
+ // insert into placeholder div
1149
+ $elParent.find('.field-property-box').html(response);
1150
+ });
1151
+ break;
1152
+ }
1153
 
1154
  if ('platform' === fieldType) {
1155
  typeSelect.val('platform').prop('disabled', true);
1156
+ typeSelectParent.append('<input type="hidden" class="save-type" name="' + source + '[client_section][' + key + '][save-type]" value="platform">');
1157
  $elParent.find('.field-property-box').empty();
1158
  break;
1159
  }
1165
  $el.parent().find('input.save-type').remove();
1166
  }
1167
  });
1168
+
1169
+ /**
1170
+ * Custom field checkbox label
1171
+ */
1172
+ customFieldList.on('change', '.field-label-select', function () {
1173
+ var fieldValue = $(this).val();
1174
+ var elParent = $(this).closest('.field3');
1175
+ var fieldLabel = elParent.find('.client_section_field_label');
1176
+ var defaultValue = fieldLabel.attr('attr-defaultValue');
1177
+ if (fieldValue == 'custom') {
1178
+ fieldLabel.prop("readonly", false);
1179
+ } else {
1180
+ fieldLabel.prop("readonly", true);
1181
+ fieldLabel.val(defaultValue);
1182
+ }
1183
+ });
1184
+
1185
+ /**
1186
+ * Custom field checkbox value
1187
+ */
1188
+ customFieldList.on('change', '.field-checked-select', function () {
1189
+ var fieldValue = $(this).val();
1190
+ var elParent = $(this).closest('.field3');
1191
+ var fieldLabel = elParent.find('.client_section_field_checked_value');
1192
+ var defaultValue = fieldLabel.attr('attr-defaultValue');
1193
+ if (fieldValue == 'custom') {
1194
+ fieldLabel.prop("readonly", false);
1195
+ } else {
1196
+ fieldLabel.prop("readonly", true);
1197
+ fieldLabel.val(defaultValue);
1198
+ }
1199
+ });
1200
+
1201
 
1202
  /**
1203
  * Delete a client field
admin/menu/class-strong-testimonials-menu-fields.php CHANGED
@@ -42,11 +42,11 @@ class Strong_Testimonials_Menu_Fields {
42
  */
43
  public static function get_submenu() {
44
  return array(
45
- 'page_title' => apply_filters( 'wpmtst_fields_page_title', __( 'Fields', 'strong-testimonials' ) ),
46
- 'menu_title' => apply_filters( 'wpmtst_fields_menu_title', __( 'Fields', 'strong-testimonials' ) ),
47
  'capability' => 'strong_testimonials_fields',
48
- 'menu_slug' => 'testimonial-fields',
49
- 'function' => 'wpmtst_form_admin',
50
  );
51
  }
52
 
42
  */
43
  public static function get_submenu() {
44
  return array(
45
+ 'page_title' => apply_filters( 'wpmtst_fields_page_title', __( 'Forms', 'strong-testimonials' ) ),
46
+ 'menu_title' => apply_filters( 'wpmtst_fields_menu_title', __( 'Forms', 'strong-testimonials' ) ),
47
  'capability' => 'strong_testimonials_fields',
48
+ 'menu_slug' => 'testimonial-fields',
49
+ 'function' => 'wpmtst_form_admin',
50
  );
51
  }
52
 
admin/partials/views/option-client-section.php CHANGED
@@ -22,6 +22,7 @@
22
  <input id="add-field"
23
  type="button"
24
  name="add-field"
 
25
  value="<?php _e( 'Add Field', 'strong-testimonials' ); ?>"
26
  class="button-secondary" />
27
  </div>
22
  <input id="add-field"
23
  type="button"
24
  name="add-field"
25
+ source="view[data]"
26
  value="<?php _e( 'Add Field', 'strong-testimonials' ); ?>"
27
  class="button-secondary" />
28
  </div>
admin/partials/views/option-content.php CHANGED
@@ -93,7 +93,7 @@
93
  <div class="row-inner subgroup">
94
 
95
  <!-- action: full post or in place -->
96
- <div class="row-inner">
97
  <div class="inline">
98
  <?php _e( 'Add a <strong>Read more</strong> link to', 'strong-testimonials' ); ?>
99
  </div>
@@ -188,6 +188,12 @@
188
  </span>
189
  <p class="inline description"><?php _e( 'Leave blank to leave content expanded without a link.', 'strong-testimonials' ); ?></p>
190
  </div>
 
 
 
 
 
 
191
  </div>
192
 
193
  <!-- automatic or both -->
93
  <div class="row-inner subgroup">
94
 
95
  <!-- action: full post or in place -->
96
+ <div class="row-inner">
97
  <div class="inline">
98
  <?php _e( 'Add a <strong>Read more</strong> link to', 'strong-testimonials' ); ?>
99
  </div>
188
  </span>
189
  <p class="inline description"><?php _e( 'Leave blank to leave content expanded without a link.', 'strong-testimonials' ); ?></p>
190
  </div>
191
+ <div class="html-content-checkbox">
192
+ <input class="checkbox" id="view-html-content" name="view[data][html_content]" value="1" type="checkbox" <?php checked( $view['html_content'] ); ?>/>
193
+ <label for="view-html-content">
194
+ <?php _e( 'Show <strong>html content</strong>.', 'strong-testimonials' ); ?>
195
+ </label>
196
+ </div>
197
  </div>
198
 
199
  <!-- automatic or both -->
admin/partials/views/option-pagination.php CHANGED
@@ -24,6 +24,7 @@ $links .= '</span>';
24
  <option value="standard" <?php selected( 'standard', $view['pagination_settings']['type'] ); ?>>
25
  <?php _e( 'WordPress standard', 'strong-testimonials' ); ?>
26
  </option>
 
27
  </select>
28
  </label>
29
  </div>
24
  <option value="standard" <?php selected( 'standard', $view['pagination_settings']['type'] ); ?>>
25
  <?php _e( 'WordPress standard', 'strong-testimonials' ); ?>
26
  </option>
27
+ <?php do_action( 'wpmtst_form_pagination_options_after', $view ) ?>
28
  </select>
29
  </label>
30
  </div>
admin/partials/views/option-thumbnail.php CHANGED
@@ -74,15 +74,17 @@
74
  <option value="no" <?php selected( $view['gravatar'], 'no' ); ?>><?php _e( 'show nothing', 'strong-testimonials' ); ?></option>
75
  <option value="yes" <?php selected( $view['gravatar'], 'yes' ); ?>><?php _e( 'show Gravatar', 'strong-testimonials' ); ?></option>
76
  <option value="if" <?php selected( $view['gravatar'], 'if' ); ?>><?php _e( 'show Gravatar only if found', 'strong-testimonials' ); ?></option>
 
77
  </select>
78
  </div>
79
  <div class="inline">
80
- <div class="then fast then_not_no then_yes then_if" style="display: none;">
81
  <p class="description tall">
82
  <a href="<?php echo admin_url( 'options-discussion.php' ); ?>"><?php _e( 'Gravatar settings', 'strong-testimonials' ); ?></a>
83
  </p>
84
  </div>
85
  </div>
 
86
  </div>
87
  </div>
88
 
74
  <option value="no" <?php selected( $view['gravatar'], 'no' ); ?>><?php _e( 'show nothing', 'strong-testimonials' ); ?></option>
75
  <option value="yes" <?php selected( $view['gravatar'], 'yes' ); ?>><?php _e( 'show Gravatar', 'strong-testimonials' ); ?></option>
76
  <option value="if" <?php selected( $view['gravatar'], 'if' ); ?>><?php _e( 'show Gravatar only if found', 'strong-testimonials' ); ?></option>
77
+ <?php do_action('wpmtst_avatar_options', $view) ?>
78
  </select>
79
  </div>
80
  <div class="inline">
81
+ <div class="then fast then_not_no then_not_default then_not_initials then_not_wp_avatars then_yes then_if" style="display: none;">
82
  <p class="description tall">
83
  <a href="<?php echo admin_url( 'options-discussion.php' ); ?>"><?php _e( 'Gravatar settings', 'strong-testimonials' ); ?></a>
84
  </p>
85
  </div>
86
  </div>
87
+ <?php do_action('after_no_featured_image', $view) ?>
88
  </div>
89
  </div>
90
 
admin/partials/views/option-title.php CHANGED
@@ -46,6 +46,8 @@ if ( '0' == $view['title_link'] ) {
46
  <option value="<?php echo $url['name']; ?>" <?php selected( $url['name'], $view['title_link'] ); ?>><?php echo $url['label']; ?></option>
47
  <?php } ?>
48
  </select>
 
 
49
  </div>
50
  </div>
51
  </div>
46
  <option value="<?php echo $url['name']; ?>" <?php selected( $url['name'], $view['title_link'] ); ?>><?php echo $url['label']; ?></option>
47
  <?php } ?>
48
  </select>
49
+
50
+ <?php do_action('wpmtst_view_editor_after_group_fields_title') ?>
51
  </div>
52
  </div>
53
  </div>
admin/settings/class-strong-testimonials-settings-compat.php CHANGED
@@ -142,7 +142,7 @@ class Strong_Testimonials_Settings_Compat {
142
  }
143
 
144
  }
145
-
146
  return $input;
147
  }
148
 
@@ -162,11 +162,11 @@ class Strong_Testimonials_Settings_Compat {
162
  */
163
  public function settings_top() {
164
  $this->settings_intro();
 
165
  $this->settings_page_loading();
166
  $this->settings_prerender();
167
  $this->settings_monitor();
168
  $this->settings_controller();
169
- $this->settings_lazyload();
170
  }
171
 
172
  /**
@@ -244,9 +244,29 @@ class Strong_Testimonials_Settings_Compat {
244
  </table>
245
 
246
  <h2><?php _e( 'Compatibility Settings', 'strong-testimonials' ); ?></h2>
247
-
248
  <?php
249
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
250
 
251
  /**
252
  * Page Loading
@@ -812,128 +832,6 @@ class Strong_Testimonials_Settings_Compat {
812
  </div>
813
  <?php
814
  }
815
-
816
- /**
817
- * Lazy load
818
- *
819
- * @since 2.31.0
820
- */
821
- public function settings_lazyload() {
822
- ?>
823
- <table class="form-table" cellpadding="0" cellspacing="0">
824
- <tr valign="top">
825
- <th scope="row">
826
- <?php _e( 'Lazy Loading Images', 'strong-testimonials' ); ?>
827
- </th>
828
- <td>
829
- <div class="row header">
830
- <p><?php _e( 'Watch for lazy loading images in themes and plugins.', 'strong-testimonials' ); ?></p>
831
- </div>
832
- <fieldset>
833
- <?php $this->settings_page_lazyload_enabled(); ?>
834
- <?php $this->settings_page_lazyload_classes(); ?>
835
- </fieldset>
836
- </td>
837
- </tr>
838
- </table>
839
- <?php
840
- }
841
-
842
- /**
843
- * Lazy load > Enabled
844
- *
845
- * @since 2.31.0
846
- */
847
- public function settings_page_lazyload_enabled() {
848
- $checked = checked( $this->options['lazyload']['enabled'], 1, false );
849
- ?>
850
- <div class="row">
851
- <div>
852
- <label for="lazyload-enabled">
853
- <input id="lazyload-enabled"
854
- name="wpmtst_compat_options[lazyload][enabled]"
855
- data-group="lazyload"
856
- type="checkbox"
857
- <?php echo $checked; ?> />
858
- <?php _e( 'Enable watcher', 'strong-testimonials' ); ?>
859
- </label>
860
- </div>
861
- <div data-sub="lazyload">
862
- <p class="about"><?php _e( 'Most lazy loading techniques use one or two CSS class names to indicate which images to lazy load and when the lazy loading is finished.', 'strong-testimonials' ); ?></p>
863
- <p class="about"><?php _e( 'Contact support for your theme or plugin to ask if it uses CSS class names.', 'strong-testimonials' ); ?></p>
864
- </div>
865
- </div>
866
- <?php
867
- }
868
-
869
- /**
870
- * Lazy load > CSS classes
871
- *
872
- * @since 2.31.0
873
- */
874
- public function settings_page_lazyload_classes() {
875
- ?>
876
- <div class="row" data-sub="lazyload">
877
- <div>
878
- <label>
879
- <?php _e( 'CSS Class Names', 'strong-testimonials' ); ?>
880
- </label>
881
- </div>
882
- <div class="lazyload-pairs">
883
- <?php
884
- if ( isset( $this->options['lazyload']['classes'] ) ) {
885
- foreach ( $this->options['lazyload']['classes'] as $key => $pair ) {
886
- $this->settings_page_lazyload_class_inputs( $key, $pair );
887
- }
888
- }
889
- ?>
890
- <div class="pair-actions">
891
- <input class="button"
892
- id="add-pair"
893
- value="<?php esc_attr_e( 'Add Classes', 'strong-testimonials' ); ?>"
894
- type="button" />
895
- </div>
896
- </div>
897
- </div>
898
- <?php
899
- }
900
-
901
- /**
902
- * Lazy load > CSS classes > Individual pair
903
- *
904
- * @since 2.31.0
905
- */
906
- private function settings_page_lazyload_class_inputs( $key, $pair ) {
907
- ?>
908
- <div class="pair">
909
- <label>
910
- <?php _ex( 'start', 'noun', 'strong-testimonials' ); ?>
911
- <input class="element code"
912
- name="wpmtst_compat_options[lazyload][classes][<?php echo $key; ?>][start]"
913
- type="text"
914
- value="<?php echo esc_attr( $pair['start'] ); ?>" />
915
- </label>
916
- <span class="pair-sep"></span>
917
- <label>
918
- <?php _ex( 'finish', 'noun', 'strong-testimonials' ); ?>
919
- <input class="element code"
920
- name="wpmtst_compat_options[lazyload][classes][<?php echo $key; ?>][finish]"
921
- type="text"
922
- value="<?php echo esc_attr( $pair['finish'] ); ?>" />
923
- </label>
924
- </div>
925
- <?php
926
- }
927
-
928
- /**
929
- * [Add Pair] Ajax receiver
930
- */
931
- public function add_lazyload_pair() {
932
- ob_start();
933
- $this->settings_page_lazyload_class_inputs( $_REQUEST['key'], array( 'start' => '', 'finish' => '' ) );
934
- wp_send_json_success( ob_get_clean() );
935
- }
936
-
937
  }
938
 
939
  new Strong_Testimonials_Settings_Compat();
142
  }
143
 
144
  }
145
+ $input['random_js'] = wpmtst_sanitize_checkbox( $input, 'random_js' );
146
  return $input;
147
  }
148
 
162
  */
163
  public function settings_top() {
164
  $this->settings_intro();
165
+ $this->settings_random_js();
166
  $this->settings_page_loading();
167
  $this->settings_prerender();
168
  $this->settings_monitor();
169
  $this->settings_controller();
 
170
  }
171
 
172
  /**
244
  </table>
245
 
246
  <h2><?php _e( 'Compatibility Settings', 'strong-testimonials' ); ?></h2>
247
+
248
  <?php
249
  }
250
+
251
+ public function settings_random_js() {
252
+ ?>
253
+ <table class="form-table" cellpadding="0" cellspacing="0">
254
+ <tr valign="top">
255
+ <th scope="row">
256
+ <?php _e( 'Random JS', 'strong-testimonials' ); ?>
257
+ </th>
258
+ <td>
259
+ <fieldset>
260
+ <label>
261
+ <input type="checkbox" name="wpmtst_compat_options[random_js]" <?php checked( $this->options['random_js'] ) ?> />
262
+ <?php _e( 'Randomize testimonials via javascript to ensure proper behaviour. Check this if using page caching plugins (WP Rocket, Super Cache, W3 Total Cache etc.)', 'strong-testimonials' ); ?>
263
+ <?php _e( 'Off by default.', 'strong-testimonials' ); ?>
264
+ </label>
265
+ </fieldset>
266
+ </td>
267
+ </tr>
268
+ </table> <?php
269
+ }
270
 
271
  /**
272
  * Page Loading
832
  </div>
833
  <?php
834
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
835
  }
836
 
837
  new Strong_Testimonials_Settings_Compat();
admin/settings/class-strong-testimonials-settings-form.php CHANGED
@@ -136,7 +136,7 @@ class Strong_Testimonials_Settings_Form {
136
  $input['default_recipient'] = maybe_unserialize( $input['default_recipient'] );
137
  $input['email_subject'] = isset( $input['email_subject'] ) ? wp_kses_post( trim( $input['email_subject'] ) ) : '';
138
  $input['email_message'] = isset( $input['email_message'] ) ? wp_kses_post( rtrim( $input['email_message'] ) ) : '';
139
-
140
  foreach ( $input['messages'] as $key => $message ) {
141
  if ( 'submission-success' == $key ) {
142
  $input['messages'][ $key ]['text'] = $message['text'];
@@ -147,7 +147,6 @@ class Strong_Testimonials_Settings_Form {
147
  $input['messages'][ $key ]['text'] = wp_kses_data( $message['text'] );
148
  }
149
  }
150
-
151
  $input['scrolltop_error'] = wpmtst_sanitize_checkbox( $input, 'scrolltop_error' );
152
  $input['scrolltop_error_offset'] = intval( sanitize_text_field( $input['scrolltop_error_offset'] ) );
153
  $input['scrolltop_success'] = wpmtst_sanitize_checkbox( $input, 'scrolltop_success' );
136
  $input['default_recipient'] = maybe_unserialize( $input['default_recipient'] );
137
  $input['email_subject'] = isset( $input['email_subject'] ) ? wp_kses_post( trim( $input['email_subject'] ) ) : '';
138
  $input['email_message'] = isset( $input['email_message'] ) ? wp_kses_post( rtrim( $input['email_message'] ) ) : '';
139
+
140
  foreach ( $input['messages'] as $key => $message ) {
141
  if ( 'submission-success' == $key ) {
142
  $input['messages'][ $key ]['text'] = $message['text'];
147
  $input['messages'][ $key ]['text'] = wp_kses_data( $message['text'] );
148
  }
149
  }
 
150
  $input['scrolltop_error'] = wpmtst_sanitize_checkbox( $input, 'scrolltop_error' );
151
  $input['scrolltop_error_offset'] = intval( sanitize_text_field( $input['scrolltop_error_offset'] ) );
152
  $input['scrolltop_success'] = wpmtst_sanitize_checkbox( $input, 'scrolltop_success' );
admin/settings/class-strong-testimonials-settings-general.php CHANGED
@@ -82,7 +82,9 @@ class Strong_Testimonials_Settings_General {
82
  public static function sanitize_options( $input ) {
83
  $input['embed_width'] = $input['embed_width'] ? (int) sanitize_text_field( $input['embed_width'] ) : '';
84
  $input['nofollow'] = wpmtst_sanitize_checkbox( $input, 'nofollow' );
85
- $input['disable_rewrite'] = wpmtst_sanitize_checkbox( $input, 'disable_rewrite' );
 
 
86
  $input['pending_indicator'] = wpmtst_sanitize_checkbox( $input, 'pending_indicator' );
87
  $input['remove_whitespace'] = wpmtst_sanitize_checkbox( $input, 'remove_whitespace' );
88
  /* @todo : delete commented line. For the moment let it be */
@@ -92,10 +94,12 @@ class Strong_Testimonials_Settings_General {
92
  $input['support_comments'] = wpmtst_sanitize_checkbox( $input, 'support_comments' );
93
  $input['support_custom_fields'] = wpmtst_sanitize_checkbox( $input, 'support_custom_fields' );
94
  $input['single_testimonial_slug'] = sanitize_text_field( $input['single_testimonial_slug'] );
95
- $input['no_lazyload'] = wpmtst_sanitize_checkbox( $input, 'no_lazyload' );
 
96
  $input['touch_enabled'] = wpmtst_sanitize_checkbox( $input, 'touch_enabled' );
97
-
98
- return $input;
 
99
  }
100
 
101
  }
82
  public static function sanitize_options( $input ) {
83
  $input['embed_width'] = $input['embed_width'] ? (int) sanitize_text_field( $input['embed_width'] ) : '';
84
  $input['nofollow'] = wpmtst_sanitize_checkbox( $input, 'nofollow' );
85
+ $input['noopener'] = wpmtst_sanitize_checkbox( $input, 'noopener' );
86
+ $input['noreferrer'] = wpmtst_sanitize_checkbox( $input, 'noreferrer' );
87
+ $input['disable_rewrite'] = wpmtst_sanitize_checkbox( $input, 'disable_rewrite' );
88
  $input['pending_indicator'] = wpmtst_sanitize_checkbox( $input, 'pending_indicator' );
89
  $input['remove_whitespace'] = wpmtst_sanitize_checkbox( $input, 'remove_whitespace' );
90
  /* @todo : delete commented line. For the moment let it be */
94
  $input['support_comments'] = wpmtst_sanitize_checkbox( $input, 'support_comments' );
95
  $input['support_custom_fields'] = wpmtst_sanitize_checkbox( $input, 'support_custom_fields' );
96
  $input['single_testimonial_slug'] = sanitize_text_field( $input['single_testimonial_slug'] );
97
+ $input['lazyload'] = wpmtst_sanitize_checkbox( $input, 'lazyload' );
98
+ $input['no_lazyload_plugin'] = wpmtst_sanitize_checkbox( $input, 'no_lazyload_plugin' );
99
  $input['touch_enabled'] = wpmtst_sanitize_checkbox( $input, 'touch_enabled' );
100
+ $input['upsells'] = wpmtst_sanitize_checkbox( $input, 'upsells' );
101
+
102
+ return apply_filters( 'wpmtst_sanitize_general_options', $input );
103
  }
104
 
105
  }
admin/settings/class-strong-testimonials-settings.php CHANGED
@@ -25,7 +25,7 @@ class Strong_Testimonials_Settings {
25
  */
26
  public static function add_actions() {
27
  add_action( 'admin_init', array( __CLASS__, 'register_settings' ) );
28
- add_action( 'wpmtst_settings_submit_row', array( __CLASS__, 'submit_row' ) );
29
  }
30
 
31
  /**
@@ -60,7 +60,7 @@ class Strong_Testimonials_Settings {
60
  <?php do_action( 'wpmtst_settings_tabs', $tab, $url ); ?>
61
  </h2>
62
 
63
- <form id="<?php echo esc_attr( $tab ); ?>-form" method="post" action="options.php">
64
  <?php
65
  if ( isset( self::$callbacks[ $tab ] ) && wpmtst_callback_exists( self::$callbacks[ $tab ] ) ) {
66
  call_user_func( self::$callbacks[ $tab ] );
25
  */
26
  public static function add_actions() {
27
  add_action( 'admin_init', array( __CLASS__, 'register_settings' ) );
28
+ add_action( 'wpmtst_settings_submit_row', array( __CLASS__, 'submit_row' ) );
29
  }
30
 
31
  /**
60
  <?php do_action( 'wpmtst_settings_tabs', $tab, $url ); ?>
61
  </h2>
62
 
63
+ <form id="<?php echo esc_attr( $tab ); ?>-form" method="post" action="options.php" enctype="multipart/form-data">
64
  <?php
65
  if ( isset( self::$callbacks[ $tab ] ) && wpmtst_callback_exists( self::$callbacks[ $tab ] ) ) {
66
  call_user_func( self::$callbacks[ $tab ] );
admin/settings/partials/form.php CHANGED
@@ -212,12 +212,12 @@ $form_options = get_option( 'wpmtst_form_options' );
212
 
213
  <td>
214
  <div class="match-height">
215
- <fieldset>
216
- <label for="wpmtst-options-admin-notify">
217
- <input id="wpmtst-options-admin-notify" type="checkbox" name="wpmtst_form_options[admin_notify]" <?php checked( $form_options['admin_notify'] ); ?>/>
218
- <?php esc_html_e( 'Send an email upon new testimonial submission.', 'strong-testimonials' ); ?>
219
- </label>
220
- </fieldset>
221
  </div>
222
  <div class="email-container" id="admin-notify-fields" <?php echo ( $form_options['admin_notify'] ) ? '' : 'style="display: none;"'; ?>>
223
  <?php
@@ -226,7 +226,9 @@ $form_options = get_option( 'wpmtst_form_options' );
226
  include 'email.php';
227
  do_action( 'wpmtst_after_notification_fields', 'notification' );
228
  ?>
229
- </div>
 
 
230
  </td>
231
  </tr>
232
  </table>
212
 
213
  <td>
214
  <div class="match-height">
215
+ <fieldset>
216
+ <label for="wpmtst-options-admin-notify">
217
+ <input id="wpmtst-options-admin-notify" type="checkbox" name="wpmtst_form_options[admin_notify]" <?php checked( $form_options['admin_notify'] ); ?>/>
218
+ <?php esc_html_e( 'Send an email upon new testimonial submission.', 'strong-testimonials' ); ?>
219
+ </label>
220
+ </fieldset>
221
  </div>
222
  <div class="email-container" id="admin-notify-fields" <?php echo ( $form_options['admin_notify'] ) ? '' : 'style="display: none;"'; ?>>
223
  <?php
226
  include 'email.php';
227
  do_action( 'wpmtst_after_notification_fields', 'notification' );
228
  ?>
229
+ </div>
230
+ <?php do_action('wpmtst_after_notification_options', $form_options); ?>
231
+
232
  </td>
233
  </tr>
234
  </table>
admin/settings/partials/general.php CHANGED
@@ -191,7 +191,7 @@ $options = get_option( 'wpmtst_options' );
191
  <label>
192
  <input type="checkbox" name="wpmtst_options[nofollow]" <?php checked( $options['nofollow'] ); ?>>
193
  <?php _e( 'Add <code>rel="nofollow"</code> to URL custom fields.', 'strong-testimonials' ); ?>
194
- <?php _e( 'Off by default.', 'strong-testimonials' ); ?>
195
  </label>
196
  <p class="description">
197
  <?php printf( 'To edit this value on your existing testimonials in bulk, try <a href="%s" target="_blank">%s</a> and set <code>nofollow</code> to <b>default</b>, <b>yes</b> or <b>no</b>.',
@@ -201,15 +201,60 @@ $options = get_option( 'wpmtst_options' );
201
  </fieldset>
202
  </td>
203
  </tr>
204
- <?php if ( wpmtst_is_plugin_active( 'lazy-loading-responsive-images' ) ) : ?>
205
  <tr valign="top">
206
  <th scope="row">
207
- <?php _e( 'No Lazy Loading', 'strong-testimonials' ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
208
  </th>
209
  <td>
210
  <fieldset>
211
  <label>
212
- <input type="checkbox" name="wpmtst_options[no_lazyload]" <?php checked( $options['no_lazyload'] ); ?>>
213
  <?php printf( __( 'Exclude from <a href="%s" target="_blank">Lazy Loading Responsive Images</a> plugin.', 'strong-testimonials' ), esc_url( 'https://wordpress.org/plugins/lazy-loading-responsive-images/' ) ); ?>
214
  <?php _e( 'On by default.', 'strong-testimonials' ); ?>
215
  </label>
@@ -217,7 +262,22 @@ $options = get_option( 'wpmtst_options' );
217
  </td>
218
  </tr>
219
  <?php else : ?>
220
- <input type="hidden" name="wpmtst_options[no_lazyload]" value="<?php echo $options['no_lazyload']; ?>">
221
  <?php endif; ?>
222
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
223
  </table>
191
  <label>
192
  <input type="checkbox" name="wpmtst_options[nofollow]" <?php checked( $options['nofollow'] ); ?>>
193
  <?php _e( 'Add <code>rel="nofollow"</code> to URL custom fields.', 'strong-testimonials' ); ?>
194
+ <?php _e( 'On by default.', 'strong-testimonials' ); ?>
195
  </label>
196
  <p class="description">
197
  <?php printf( 'To edit this value on your existing testimonials in bulk, try <a href="%s" target="_blank">%s</a> and set <code>nofollow</code> to <b>default</b>, <b>yes</b> or <b>no</b>.',
201
  </fieldset>
202
  </td>
203
  </tr>
 
204
  <tr valign="top">
205
  <th scope="row">
206
+ <?php _e( 'Noopener Links', 'strong-testimonials' ); ?>
207
+ </th>
208
+ <td>
209
+ <fieldset>
210
+ <label>
211
+ <input type="checkbox" name="wpmtst_options[noopener]" <?php checked( $options['noopener'] ); ?>>
212
+ <?php _e( 'Add <code>rel="noopener"</code> to URL custom fields.', 'strong-testimonials' ); ?>
213
+ <?php _e( 'Off by default.', 'strong-testimonials' ); ?>
214
+ </label>
215
+ </fieldset>
216
+ </td>
217
+ </tr>
218
+
219
+ <tr valign="top">
220
+ <th scope="row">
221
+ <?php _e( 'Noreferrer Links', 'strong-testimonials' ); ?>
222
+ </th>
223
+ <td>
224
+ <fieldset>
225
+ <label>
226
+ <input type="checkbox" name="wpmtst_options[noreferrer]" <?php checked( $options['noreferrer'] ); ?>>
227
+ <?php _e( 'Add <code>rel="noreferrer"</code> to URL custom fields.', 'strong-testimonials' ); ?>
228
+ <?php _e( 'Off by default.', 'strong-testimonials' ); ?>
229
+ </label>
230
+ </fieldset>
231
+ </td>
232
+ </tr>
233
+
234
+ <tr valign="top">
235
+ <th scope="row">
236
+ <?php _e( 'Lazy Loading', 'strong-testimonials' ); ?>
237
+ </th>
238
+ <td>
239
+ <fieldset>
240
+ <label>
241
+ <input type="checkbox" name="wpmtst_options[lazyload]" <?php checked( $options['lazyload'] ); ?>>
242
+ <?php printf( __( 'Enable the Lazy Loading functionality.', 'strong-testimonials' ) ); ?>
243
+ <?php _e( 'Off by default.', 'strong-testimonials' ); ?>
244
+ </label>
245
+ </fieldset>
246
+ </td>
247
+ </tr>
248
+
249
+ <?php if ( wpmtst_is_plugin_active( 'lazy-loading-responsive-images' ) ) : ?>
250
+ <tr valign="top">
251
+ <th scope="row">
252
+ <?php _e( 'No Lazy Loading Plugin', 'strong-testimonials' ); ?>
253
  </th>
254
  <td>
255
  <fieldset>
256
  <label>
257
+ <input type="checkbox" name="wpmtst_options[no_lazyload_plugin]" <?php checked( $options['no_lazyload_plugin'] ); ?>>
258
  <?php printf( __( 'Exclude from <a href="%s" target="_blank">Lazy Loading Responsive Images</a> plugin.', 'strong-testimonials' ), esc_url( 'https://wordpress.org/plugins/lazy-loading-responsive-images/' ) ); ?>
259
  <?php _e( 'On by default.', 'strong-testimonials' ); ?>
260
  </label>
262
  </td>
263
  </tr>
264
  <?php else : ?>
265
+ <input type="hidden" name="wpmtst_options[no_lazyload_plugin]" value="<?php echo $options['no_lazyload_plugin']; ?>">
266
  <?php endif; ?>
267
+
268
+ <tr valign="top">
269
+ <th scope="row">
270
+ <?php _e( 'Upsells', 'strong-testimonials' ); ?>
271
+ </th>
272
+ <td>
273
+ <fieldset>
274
+ <label>
275
+ <input type="checkbox" name="wpmtst_options[upsells]" <?php checked( $options['upsells'] ); ?>>
276
+ <?php printf( __( 'Disable all upsells.', 'strong-testimonials' ) ); ?>
277
+ <?php _e( 'Off by default.', 'strong-testimonials' ); ?>
278
+ </label>
279
+ </fieldset>
280
+ </td>
281
+ </tr>
282
+
283
  </table>
admin/views-ajax.php CHANGED
@@ -28,7 +28,11 @@ add_action( 'wp_ajax_wpmtst_force_check', 'wpmtst_force_check' );
28
  function wpmtst_view_add_field_function() {
29
  $new_key = (int) $_REQUEST['key'];
30
  $empty_field = array( 'field' => '', 'type' => 'text', 'class' => '' );
31
- wpmtst_view_field_inputs( $new_key, $empty_field, true );
 
 
 
 
32
  wp_die();
33
  }
34
  add_action( 'wp_ajax_wpmtst_view_add_field', 'wpmtst_view_add_field_function' );
@@ -44,7 +48,11 @@ function wpmtst_view_add_field_link_function() {
44
  $field_name = $_REQUEST['fieldName'];
45
  $type = $_REQUEST['fieldType'];
46
  $empty_field = array( 'url' => '', 'link_text' => '', 'new_tab' => true );
47
- wpmtst_view_field_link( $key, $field_name, $type, $empty_field );
 
 
 
 
48
  wp_die();
49
  }
50
  add_action( 'wp_ajax_wpmtst_view_add_field_link', 'wpmtst_view_add_field_link_function' );
@@ -72,11 +80,36 @@ add_action( 'wp_ajax_wpmtst_view_get_label', 'wpmtst_view_get_label_function' );
72
  function wpmtst_view_add_field_date_function() {
73
  $key = (int) $_REQUEST['key'];
74
  $empty_field = array( 'format' => '' );
75
- wpmtst_view_field_date( $key, $empty_field );
 
 
 
 
76
  wp_die();
77
  }
78
  add_action( 'wp_ajax_wpmtst_view_add_field_date', 'wpmtst_view_add_field_date_function' );
79
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
80
 
81
  /**
82
  * Fetch the view mode description.
@@ -87,7 +120,9 @@ function wpmtst_view_get_mode_description() {
87
  $mode = $_REQUEST['mode'];
88
  $options = get_option( 'wpmtst_view_options' );
89
  if ( isset( $options['mode'][ $mode ]['description'] ) ) {
90
- echo $options['mode'][ $mode ]['description'];
 
 
91
  }
92
  wp_die();
93
  }
28
  function wpmtst_view_add_field_function() {
29
  $new_key = (int) $_REQUEST['key'];
30
  $empty_field = array( 'field' => '', 'type' => 'text', 'class' => '' );
31
+ $source = 'view[data]';
32
+ if (isset($_REQUEST['source']) && !empty($_REQUEST['source'])) {
33
+ $source = $_REQUEST['source'];
34
+ }
35
+ wpmtst_view_field_inputs( $new_key, $empty_field, true, $source );
36
  wp_die();
37
  }
38
  add_action( 'wp_ajax_wpmtst_view_add_field', 'wpmtst_view_add_field_function' );
48
  $field_name = $_REQUEST['fieldName'];
49
  $type = $_REQUEST['fieldType'];
50
  $empty_field = array( 'url' => '', 'link_text' => '', 'new_tab' => true );
51
+ $source = 'view[data]';
52
+ if (isset($_REQUEST['source']) && !empty($_REQUEST['source'])) {
53
+ $source = $_REQUEST['source'];
54
+ }
55
+ wpmtst_view_field_link( $key, $field_name, $type, $empty_field, false, $source );
56
  wp_die();
57
  }
58
  add_action( 'wp_ajax_wpmtst_view_add_field_link', 'wpmtst_view_add_field_link_function' );
80
  function wpmtst_view_add_field_date_function() {
81
  $key = (int) $_REQUEST['key'];
82
  $empty_field = array( 'format' => '' );
83
+ $source = 'view[data]';
84
+ if (isset($_REQUEST['source']) && !empty($_REQUEST['source'])) {
85
+ $source = $_REQUEST['source'];
86
+ }
87
+ wpmtst_view_field_date( $key, $empty_field, false, $source );
88
  wp_die();
89
  }
90
  add_action( 'wp_ajax_wpmtst_view_add_field_date', 'wpmtst_view_add_field_date_function' );
91
 
92
+ /**
93
+ * [Field Type: Checkbox Value] Ajax receiver
94
+ *
95
+ * @since 2.40.4
96
+ */
97
+ function wpmtst_view_add_field_checkbox_function() {
98
+ $key = (int) $_REQUEST['key'];
99
+ $field = array(
100
+ 'field' => $_REQUEST['fieldName'],
101
+ 'type' => $_REQUEST['fieldType']
102
+ );
103
+ $empty_field = array( 'custom_label' => '', 'checked_value' => '', 'unchecked_value' => '');
104
+ $source = 'view[data]';
105
+ if (isset($_REQUEST['source']) && !empty($_REQUEST['source'])) {
106
+ $source = $_REQUEST['source'];
107
+ }
108
+ wpmtst_view_field_checkbox ( $key, $field, $empty_field, $source );
109
+ wp_die();
110
+ }
111
+ add_action( 'wp_ajax_wpmtst_view_add_field_checkbox', 'wpmtst_view_add_field_checkbox_function' );
112
+
113
 
114
  /**
115
  * Fetch the view mode description.
120
  $mode = $_REQUEST['mode'];
121
  $options = get_option( 'wpmtst_view_options' );
122
  if ( isset( $options['mode'][ $mode ]['description'] ) ) {
123
+ $description = $options['mode'][ $mode ]['description'];
124
+ $description = apply_filters( 'wpmtst_mode_description', $description, $mode );
125
+ echo $description;
126
  }
127
  wp_die();
128
  }
admin/views-validate.php CHANGED
@@ -88,7 +88,8 @@ function wpmtst_sanitize_view( $input ) {
88
 
89
  $data['content'] = sanitize_text_field( $input['content'] );
90
  $data['excerpt_length'] = (int) sanitize_text_field( $input['excerpt_length'] );
91
- $data['use_default_length'] = sanitize_text_field( $input['use_default_length'] );
 
92
 
93
  $data = wpmtst_sanitize_view_readmore( $data, $input, $default_view );
94
 
@@ -512,6 +513,14 @@ function wpmtst_sanitize_view_client_section( $in ) {
512
  $format = isset( $field['format'] ) ? sanitize_text_field( $field['format'] ) : '';
513
  $out[ $key ]['format'] = $format;
514
  break;
 
 
 
 
 
 
 
 
515
  default:
516
  }
517
 
88
 
89
  $data['content'] = sanitize_text_field( $input['content'] );
90
  $data['excerpt_length'] = (int) sanitize_text_field( $input['excerpt_length'] );
91
+ $data['use_default_length'] = sanitize_text_field( $input['use_default_length'] );
92
+ $data['html_content'] = isset( $input['html_content'] ) ? 1 : 0;
93
 
94
  $data = wpmtst_sanitize_view_readmore( $data, $input, $default_view );
95
 
513
  $format = isset( $field['format'] ) ? sanitize_text_field( $field['format'] ) : '';
514
  $out[ $key ]['format'] = $format;
515
  break;
516
+ case 'checkbox':
517
+ $out[ $key ]['label'] = isset( $field['label'] ) ? sanitize_text_field( $field['label'] ) : 'label';
518
+ $out[ $key ]['custom_label'] = isset( $field['custom_label'] ) ? sanitize_text_field( $field['custom_label'] ) : '';
519
+ $out[ $key ]['checked_value'] = isset( $field['checked_value'] ) ? sanitize_text_field( $field['checked_value'] ) : '';
520
+ $out[ $key ]['checked_value_custom'] = iss