WP ULike - Version 4.2.2

Version Description

  • Added: New algorithms to get user status with less query.
  • Added: New Optimization Panel for truncate tables & delete rows from database. [PRO]
  • Added: "WP Optimize" plugin cache support.
  • Fixed: Some issues in stats panel.
  • Modified: Twitter template structure & styles.
  • Updated: Option panel framework.
Download this release

Release Info

Developer alimir
Plugin Icon 128x128 WP ULike
Version 4.2.2
Comparing to
See all releases

Code changes from version 4.2.1 to 4.2.2

Files changed (93) hide show
  1. admin/admin-hooks.php +20 -1
  2. admin/assets/css/admin.css +1 -2
  3. admin/assets/js/plugins.js +1 -1
  4. admin/classes/class-wp-ulike-admin-panel.php +1 -1
  5. admin/classes/class-wp-ulike-stats.php +1 -1
  6. admin/includes/templates/go-pro.php +11 -1
  7. admin/settings/assets/css/csf-rtl.css +71 -40
  8. admin/settings/assets/css/csf-rtl.min.css +1 -1
  9. admin/settings/assets/css/csf.css +119 -85
  10. admin/settings/assets/css/csf.min.css +1 -1
  11. admin/settings/assets/js/csf-plugins.min.js +1 -1
  12. admin/settings/assets/js/csf.js +236 -214
  13. admin/settings/assets/js/csf.min.js +2 -2
  14. admin/settings/assets/scss/csf-rtl.scss +81 -45
  15. admin/settings/assets/scss/vendor/_base.scss +23 -10
  16. admin/settings/assets/scss/vendor/_customizer.scss +2 -1
  17. admin/settings/assets/scss/vendor/_fields.scss +64 -44
  18. admin/settings/assets/scss/vendor/_helper.scss +10 -1
  19. admin/settings/assets/scss/vendor/_modal.scss +15 -31
  20. admin/settings/assets/scss/vendor/_profile.scss +3 -2
  21. admin/settings/assets/scss/vendor/_responsive.scss +17 -4
  22. admin/settings/assets/scss/vendor/_taxonomy.scss +4 -3
  23. admin/settings/assets/scss/vendor/_widget.scss +2 -1
  24. admin/settings/classes/abstract.class.php +18 -19
  25. admin/settings/classes/comment-metabox.class.php +90 -79
  26. admin/settings/classes/customize-options.class.php +37 -36
  27. admin/settings/classes/fields.class.php +49 -49
  28. admin/settings/classes/metabox.class.php +98 -90
  29. admin/settings/classes/options.class.php +183 -154
  30. admin/settings/classes/profile-options.class.php +89 -74
  31. admin/settings/classes/setup.class.php +73 -68
  32. admin/settings/classes/shortcoder.class.php +47 -43
  33. admin/settings/classes/taxonomy-options.class.php +91 -80
  34. admin/settings/classes/widgets.class.php +32 -23
  35. admin/settings/fields/accordion/accordion.php +5 -5
  36. admin/settings/fields/background/background.php +19 -19
  37. admin/settings/fields/backup/backup.php +6 -6
  38. admin/settings/fields/border/border.php +26 -28
  39. admin/settings/fields/button_set/button_set.php +27 -17
  40. admin/settings/fields/callback/callback.php +30 -0
  41. admin/settings/fields/checkbox/checkbox.php +12 -12
  42. admin/settings/fields/code_editor/code_editor.php +10 -9
  43. admin/settings/fields/color/color.php +6 -6
  44. admin/settings/fields/color_group/color_group.php +5 -7
  45. admin/settings/fields/content/content.php +8 -2
  46. admin/settings/fields/date/date.php +6 -6
  47. admin/settings/fields/dimensions/dimensions.php +19 -19
  48. admin/settings/fields/fieldset/fieldset.php +1 -1
  49. admin/settings/fields/gallery/gallery.php +8 -9
  50. admin/settings/fields/group/group.php +20 -19
  51. admin/settings/fields/heading/heading.php +2 -2
  52. admin/settings/fields/icon/{default-icons.php → fa4-icons.php} +2 -5
  53. admin/settings/fields/icon/fa5-icons.php +10 -0
  54. admin/settings/fields/icon/icon.php +5 -5
  55. admin/settings/fields/image_select/image_select.php +8 -10
  56. admin/settings/fields/link_color/link_color.php +12 -12
  57. admin/settings/fields/map/map.php +16 -17
  58. admin/settings/fields/media/media.php +15 -15
  59. admin/settings/fields/notice/notice.php +2 -2
  60. admin/settings/fields/number/number.php +7 -8
  61. admin/settings/fields/palette/palette.php +7 -9
  62. admin/settings/fields/radio/radio.php +10 -10
  63. admin/settings/fields/repeater/repeater.php +15 -15
  64. admin/settings/fields/select/select.php +25 -24
  65. admin/settings/fields/slider/slider.php +8 -8
  66. admin/settings/fields/sortable/sortable.php +8 -8
  67. admin/settings/fields/sorter/sorter.php +11 -13
  68. admin/settings/fields/spacing/spacing.php +23 -23
  69. admin/settings/fields/spinner/spinner.php +9 -7
  70. admin/settings/fields/subheading/subheading.php +2 -2
  71. admin/settings/fields/submessage/submessage.php +2 -2
  72. admin/settings/fields/switcher/switcher.php +7 -9
  73. admin/settings/fields/tabbed/tabbed.php +6 -6
  74. admin/settings/fields/text/text.php +2 -2
  75. admin/settings/fields/textarea/textarea.php +6 -6
  76. admin/settings/fields/typography/google-fonts.php +1 -1
  77. admin/settings/fields/typography/typography.php +68 -64
  78. admin/settings/fields/upload/upload.php +4 -4
  79. admin/settings/fields/wp_editor/wp_editor.php +7 -9
  80. admin/settings/functions/actions.php +83 -61
  81. admin/settings/functions/customize.php +10 -11
  82. admin/settings/functions/helpers.php +0 -53
  83. admin/settings/functions/sanitize.php +2 -2
  84. admin/settings/functions/validate.php +10 -10
  85. assets/css/wp-ulike.css +47 -204
  86. assets/css/wp-ulike.min.css +1 -1
  87. assets/img/icons/twitter-heart.png +0 -0
  88. assets/js/wp-ulike.js +1 -1
  89. inc/classes/class-wp-ulike.php +46 -21
  90. inc/general-functions.php +14 -151
  91. inc/general-hooks.php +23 -1
  92. readme.txt +10 -2
  93. wp-ulike.php +2 -4
admin/admin-hooks.php CHANGED
@@ -455,4 +455,23 @@ function wp_ulike_upgrade_deprecated_options_value(){
455
  // Update option values
456
  update_option( 'wp_ulike_settings', $final_options_stack );
457
  }
458
- add_filter( 'admin_init', 'wp_ulike_upgrade_deprecated_options_value' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
455
  // Update option values
456
  update_option( 'wp_ulike_settings', $final_options_stack );
457
  }
458
+ add_filter( 'admin_init', 'wp_ulike_upgrade_deprecated_options_value' );
459
+
460
+ /**
461
+ * Admin init controller
462
+ *
463
+ * @return void
464
+ */
465
+ function wp_ulike_admin_init_controller() {
466
+ global $pagenow;
467
+
468
+ $has_ulike = isset( $_GET['page'] ) && strpos( $_GET['page'], WP_ULIKE_SLUG ) !== false;
469
+ $has_assets = defined( 'WP_ULIKE_PRO_DOMAIN' ) && in_array( $pagenow, array( 'post.php', 'post-new.php' ) );
470
+
471
+ if( ! $has_ulike && ! $has_assets ) {
472
+ remove_action( 'admin_enqueue_scripts', 'CSF::add_admin_enqueue_scripts', 20 );
473
+ remove_action( 'admin_footer', 'csf_set_icons' );
474
+ remove_action( 'customize_controls_print_footer_scripts', 'csf_set_icons' );
475
+ }
476
+ }
477
+ add_action( 'admin_init', 'wp_ulike_admin_init_controller' );
admin/assets/css/admin.css CHANGED
@@ -142,8 +142,7 @@ https://wordpress.org/plugins/wp-ulike/
142
  .wp-ulike-simple-table.table-bordered { border: 0; }
143
  .wp-ulike-simple-table.table-bordered > thead > tr > th, .wp-ulike-simple-table.table-bordered > thead > tr > td, .wp-ulike-simple-table.table-bordered > tbody > tr > th, .wp-ulike-simple-table.table-bordered > tbody > tr > td, .wp-ulike-simple-table.table-bordered > tfoot > tr > th, .wp-ulike-simple-table.table-bordered > tfoot > tr > td { border: 0; border-bottom: 1px solid #e0e0e0; }
144
  .wp-ulike-simple-table.table-bordered > thead > tr > th, .wp-ulike-simple-table.table-bordered > thead > tr > td { border-bottom-width: 2px; }
145
-
146
- .wp-ulike-table-icon { width: 18px; height: 18px; }
147
 
148
  /** RTL support */
149
  .rtl form.wp-ulike p.submit { margin-right: inherit; margin-left: 20px; }
142
  .wp-ulike-simple-table.table-bordered { border: 0; }
143
  .wp-ulike-simple-table.table-bordered > thead > tr > th, .wp-ulike-simple-table.table-bordered > thead > tr > td, .wp-ulike-simple-table.table-bordered > tbody > tr > th, .wp-ulike-simple-table.table-bordered > tbody > tr > td, .wp-ulike-simple-table.table-bordered > tfoot > tr > th, .wp-ulike-simple-table.table-bordered > tfoot > tr > td { border: 0; border-bottom: 1px solid #e0e0e0; }
144
  .wp-ulike-simple-table.table-bordered > thead > tr > th, .wp-ulike-simple-table.table-bordered > thead > tr > td { border-bottom-width: 2px; }
145
+ .wp-ulike-simple-table .wp-ulike-table-icon { width: 18px; height: 18px; }
 
146
 
147
  /** RTL support */
148
  .rtl form.wp-ulike p.submit { margin-right: inherit; margin-left: 20px; }
admin/assets/js/plugins.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! WP ULike - v4.2.1
2
  * https://wpulike.com
3
  * TechnoWich 2020;
4
  */
1
+ /*! WP ULike - v4.2.2
2
  * https://wpulike.com
3
  * TechnoWich 2020;
4
  */
admin/classes/class-wp-ulike-admin-panel.php CHANGED
@@ -42,7 +42,7 @@ if ( ! class_exists( 'wp_ulike_admin_panel' ) ) {
42
  'menu_icon' => 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMjUgMjUiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDI1IDI1OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PHBhdGggY2xhc3M9InN0MCIgZD0iTTIzLjksNy4xTDIzLjksNy4xYy0xLjUtMS41LTMuOS0xLjUtNS40LDBsLTEuNSwxLjVsMS40LDEuNGwxLjUtMS41YzAuNC0wLjQsMC44LTAuNiwxLjMtMC42YzAuNSwwLDEuMSwwLjIsMS40LDAuNmMwLjcsMC44LDAuNywyLTAuMSwyLjdsLTEsMWMtMC41LDAuNS0xLjIsMC41LTEuNiwwYy0wLjktMC45LTUuMS01LjEtNS4xLTUuMWMtMC43LTAuNy0xLjctMS4xLTIuNy0xLjFsMCwwYy0xLDAtMiwwLjQtMi43LDEuMUM5LDcuNCw4LjgsNy43LDguNiw4LjFMOC41LDguM2wxLjYsMS42bDAuMS0wLjVjMC4yLTEsMS4yLTEuNywyLjMtMS41YzAuNCwwLjEsMC43LDAuMiwxLDAuNWw1LjksNS45TDE2LjYsMTdMMTIuNywxM2wwLDBjLTAuMS0wLjEtMC40LTAuNC0yLjEtMi4xbC00LTRDNSw1LjQsMi42LDUuNCwxLjEsNi45Yy0xLjUsMS41LTEuNSwzLjksMCw1LjRsNiw2YzAuMywwLjMsMC44LDAuNSwxLjIsMC41bDAsMGMwLjUsMCwwLjktMC4yLDEuMi0wLjVsMi41LTIuNWwtMS40LTEuNGwtMi40LDIuNGwtNS45LTUuOWMtMC43LTAuOC0wLjctMiwwLjEtMi43YzAuNy0wLjcsMS45LTAuNywyLjYsMGw0LDRjMC4xLDAuMSwwLjEsMC4yLDAuMiwwLjJsNiw2YzAuMywwLjMsMC44LDAuNSwxLjMsMC41YzAsMCwwLDAsMCwwYzAuNSwwLDAuOS0wLjIsMS4yLTAuNWw2LTZDMjUuNCwxMSwyNS40LDguNiwyMy45LDcuMXoiLz48L3N2Zz4=',
43
  'menu_position' => 313,
44
  'show_bar_menu' => false,
45
- 'show_sub_menu' => false,
46
  'show_network_menu' => false,
47
  'show_search' => true,
48
  'show_reset_all' => true,
42
  'menu_icon' => 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMjUgMjUiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDI1IDI1OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PHBhdGggY2xhc3M9InN0MCIgZD0iTTIzLjksNy4xTDIzLjksNy4xYy0xLjUtMS41LTMuOS0xLjUtNS40LDBsLTEuNSwxLjVsMS40LDEuNGwxLjUtMS41YzAuNC0wLjQsMC44LTAuNiwxLjMtMC42YzAuNSwwLDEuMSwwLjIsMS40LDAuNmMwLjcsMC44LDAuNywyLTAuMSwyLjdsLTEsMWMtMC41LDAuNS0xLjIsMC41LTEuNiwwYy0wLjktMC45LTUuMS01LjEtNS4xLTUuMWMtMC43LTAuNy0xLjctMS4xLTIuNy0xLjFsMCwwYy0xLDAtMiwwLjQtMi43LDEuMUM5LDcuNCw4LjgsNy43LDguNiw4LjFMOC41LDguM2wxLjYsMS42bDAuMS0wLjVjMC4yLTEsMS4yLTEuNywyLjMtMS41YzAuNCwwLjEsMC43LDAuMiwxLDAuNWw1LjksNS45TDE2LjYsMTdMMTIuNywxM2wwLDBjLTAuMS0wLjEtMC40LTAuNC0yLjEtMi4xbC00LTRDNSw1LjQsMi42LDUuNCwxLjEsNi45Yy0xLjUsMS41LTEuNSwzLjksMCw1LjRsNiw2YzAuMywwLjMsMC44LDAuNSwxLjIsMC41bDAsMGMwLjUsMCwwLjktMC4yLDEuMi0wLjVsMi41LTIuNWwtMS40LTEuNGwtMi40LDIuNGwtNS45LTUuOWMtMC43LTAuOC0wLjctMiwwLjEtMi43YzAuNy0wLjcsMS45LTAuNywyLjYsMGw0LDRjMC4xLDAuMSwwLjEsMC4yLDAuMiwwLjJsNiw2YzAuMywwLjMsMC44LDAuNSwxLjMsMC41YzAsMCwwLDAsMCwwYzAuNSwwLDAuOS0wLjIsMS4yLTAuNWw2LTZDMjUuNCwxMSwyNS40LDguNiwyMy45LDcuMXoiLz48L3N2Zz4=',
43
  'menu_position' => 313,
44
  'show_bar_menu' => false,
45
+ 'show_sub_menu' => true,
46
  'show_network_menu' => false,
47
  'show_search' => true,
48
  'show_reset_all' => true,
admin/classes/class-wp-ulike-stats.php CHANGED
@@ -106,7 +106,7 @@ if ( ! class_exists( 'wp_ulike_stats' ) ) {
106
  $results = $this->select_data( $table );
107
  // Create chart dataset
108
  foreach( $results as $result ){
109
- $output['label'][] = !empty( $result->labels ) ? date_i18n( "M j, Y", strtotime( $result->labels ) ) : array();
110
  $output['data'][] = !empty( $result->counts ) ? $result->counts : array();
111
  }
112
  // Add chart options
106
  $results = $this->select_data( $table );
107
  // Create chart dataset
108
  foreach( $results as $result ){
109
+ $output['label'][] = !empty( $result->labels ) ? date_i18n( "Y-m-d", strtotime( $result->labels ) ) : array();
110
  $output['data'][] = !empty( $result->counts ) ? $result->counts : array();
111
  }
112
  // Add chart options
admin/includes/templates/go-pro.php CHANGED
@@ -59,6 +59,11 @@
59
  <td><img class="wp-ulike-table-icon" src="<?php echo WP_ULIKE_ASSETS_URL; ?>/img/svg/cross-remove.svg" alt="Cross Remove" /></td>
60
  <td><img class="wp-ulike-table-icon" src="<?php echo WP_ULIKE_ASSETS_URL; ?>/img/svg/checkmark.svg" alt="Checkmark" /></td>
61
  </tr>
 
 
 
 
 
62
  <tr>
63
  <td>Professional Schema.org Generator + Start Ratings</td>
64
  <td><img class="wp-ulike-table-icon" src="<?php echo WP_ULIKE_ASSETS_URL; ?>/img/svg/cross-remove.svg" alt="Cross Remove" /></td>
@@ -75,7 +80,12 @@
75
  <td><img class="wp-ulike-table-icon" src="<?php echo WP_ULIKE_ASSETS_URL; ?>/img/svg/checkmark.svg" alt="Checkmark" /></td>
76
  </tr>
77
  <tr>
78
- <td>Progressive Log Management Panel, with advanced search capabilities.</td>
 
 
 
 
 
79
  <td><img class="wp-ulike-table-icon" src="<?php echo WP_ULIKE_ASSETS_URL; ?>/img/svg/cross-remove.svg" alt="Cross Remove" /></td>
80
  <td><img class="wp-ulike-table-icon" src="<?php echo WP_ULIKE_ASSETS_URL; ?>/img/svg/checkmark.svg" alt="Checkmark" /></td>
81
  </tr>
59
  <td><img class="wp-ulike-table-icon" src="<?php echo WP_ULIKE_ASSETS_URL; ?>/img/svg/cross-remove.svg" alt="Cross Remove" /></td>
60
  <td><img class="wp-ulike-table-icon" src="<?php echo WP_ULIKE_ASSETS_URL; ?>/img/svg/checkmark.svg" alt="Checkmark" /></td>
61
  </tr>
62
+ <tr>
63
+ <td>Supports Rest APIs with a variety of routes for use in Apps</td>
64
+ <td><img class="wp-ulike-table-icon" src="<?php echo WP_ULIKE_ASSETS_URL; ?>/img/svg/cross-remove.svg" alt="Cross Remove" /></td>
65
+ <td><img class="wp-ulike-table-icon" src="<?php echo WP_ULIKE_ASSETS_URL; ?>/img/svg/checkmark.svg" alt="Checkmark" /></td>
66
+ </tr>
67
  <tr>
68
  <td>Professional Schema.org Generator + Start Ratings</td>
69
  <td><img class="wp-ulike-table-icon" src="<?php echo WP_ULIKE_ASSETS_URL; ?>/img/svg/cross-remove.svg" alt="Cross Remove" /></td>
80
  <td><img class="wp-ulike-table-icon" src="<?php echo WP_ULIKE_ASSETS_URL; ?>/img/svg/checkmark.svg" alt="Checkmark" /></td>
81
  </tr>
82
  <tr>
83
+ <td>Progressive Log Management Panel, with advanced search capabilities</td>
84
+ <td><img class="wp-ulike-table-icon" src="<?php echo WP_ULIKE_ASSETS_URL; ?>/img/svg/cross-remove.svg" alt="Cross Remove" /></td>
85
+ <td><img class="wp-ulike-table-icon" src="<?php echo WP_ULIKE_ASSETS_URL; ?>/img/svg/checkmark.svg" alt="Checkmark" /></td>
86
+ </tr>
87
+ <tr>
88
+ <td>Database optimization panel with various options.</td>
89
  <td><img class="wp-ulike-table-icon" src="<?php echo WP_ULIKE_ASSETS_URL; ?>/img/svg/cross-remove.svg" alt="Cross Remove" /></td>
90
  <td><img class="wp-ulike-table-icon" src="<?php echo WP_ULIKE_ASSETS_URL; ?>/img/svg/checkmark.svg" alt="Checkmark" /></td>
91
  </tr>
admin/settings/assets/css/csf-rtl.css CHANGED
@@ -36,6 +36,11 @@
36
  * 02. 19. Field: link_color
37
  * 02. 20. Field: color_group
38
  * 02. 21. Field: palette
 
 
 
 
 
39
  * 03. Taxonomy
40
  * 04. Profile
41
  * 05. Modal
@@ -198,8 +203,7 @@
198
  float: right;
199
  }
200
  .csf-field .csf-fieldset {
201
- margin-left: 0;
202
- margin-right: 30%;
203
  }
204
 
205
  .csf-pseudo-field {
@@ -242,7 +246,7 @@
242
  * 02. 04. Field: upload
243
  */
244
  .csf-field-upload .csf--remove,
245
- .csf-field-upload .csf--buttons {
246
  margin-left: 0;
247
  margin-right: 5px;
248
  }
@@ -301,7 +305,7 @@
301
  /**
302
  * 02. 11. Field: tabbed
303
  */
304
- .csf-field-tabbed .csf-tabbed-nav .fa {
305
  padding-right: 0;
306
  padding-left: 5px;
307
  }
@@ -334,17 +338,27 @@
334
  * 02. 14. Field: border, spacing, dimensions
335
  */
336
  .csf-field-dimensions .csf--input,
 
337
  .csf-field-spacing .csf--input,
338
- .csf-field-border .csf--input {
339
- float: right;
340
- margin-right: 0;
341
- margin-left: 15px;
342
  }
343
- .csf-field-dimensions .csf--left,
344
- .csf-field-spacing .csf--left,
345
- .csf-field-border .csf--left {
 
 
 
346
  float: right;
347
  }
 
 
 
 
 
 
348
 
349
  /**
350
  * 02. 15. Field: background
@@ -366,21 +380,19 @@
366
  */
367
  .csf-field-spinner .csf--spin {
368
  float: right;
 
369
  }
370
 
371
  /**
372
  * 02. 17. Field: slider
373
  */
374
- .csf-field-slider .ui-slider {
375
  direction: ltr;
 
 
376
  }
377
- .csf-field-slider input[type="text"] {
378
- margin-left: 0;
379
- margin-right: 15px;
380
- }
381
- .csf-field-slider em {
382
- padding-left: 0;
383
- padding-right: 5px;
384
  }
385
 
386
  /**
@@ -417,20 +429,52 @@
417
  }
418
 
419
  /**
420
- * 03. Taxonomy
421
  */
422
- .csf-taxonomy-add-fields .csf-fieldset {
423
  margin-right: 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
424
  }
 
 
 
 
425
  .csf-taxonomy-add-fields .csf-field > .csf-fieldset > .csf-help {
426
  left: -5px;
427
  right: auto;
428
  }
429
 
430
- .csf-taxonomy-edit-fields .csf-fieldset {
431
- margin-left: 0;
432
- margin-right: 225px;
433
- }
434
  .csf-taxonomy-edit-fields .csf-field > .csf-fieldset > .csf-help {
435
  right: auto;
436
  left: -5px;
@@ -443,22 +487,9 @@
443
  padding-right: 0;
444
  padding-left: 7px;
445
  }
446
- .csf-profile > .csf-field > .csf-fieldset {
447
- margin-left: 0;
448
- margin-right: 220px;
449
- }
450
- .csf-profile > .csf-field > .csf-help {
451
- left: 0;
452
- right: auto;
453
- }
454
-
455
- .csf-taxonomy-edit-fields .csf-fieldset {
456
- margin-left: 0;
457
- margin-right: 225px;
458
- }
459
- .csf-taxonomy-edit-fields .csf-field > .csf-fieldset > .csf-help {
460
- right: auto;
461
  left: -5px;
 
462
  }
463
 
464
  /**
36
  * 02. 19. Field: link_color
37
  * 02. 20. Field: color_group
38
  * 02. 21. Field: palette
39
+ * 02. 22. Field: accordion
40
+ * 02. 23. Field: date
41
+ * 02. 24. Field: map
42
+ * 02. 25. Field: sortable
43
+ * 02. 26. Field: number
44
  * 03. Taxonomy
45
  * 04. Profile
46
  * 05. Modal
203
  float: right;
204
  }
205
  .csf-field .csf-fieldset {
206
+ float: left;
 
207
  }
208
 
209
  .csf-pseudo-field {
246
  * 02. 04. Field: upload
247
  */
248
  .csf-field-upload .csf--remove,
249
+ .csf-field-upload .csf--button {
250
  margin-left: 0;
251
  margin-right: 5px;
252
  }
305
  /**
306
  * 02. 11. Field: tabbed
307
  */
308
+ .csf-field-tabbed .csf-tabbed-nav .csf--icon {
309
  padding-right: 0;
310
  padding-left: 5px;
311
  }
338
  * 02. 14. Field: border, spacing, dimensions
339
  */
340
  .csf-field-dimensions .csf--input,
341
+ .csf-field-dimensions .csf-fieldset,
342
  .csf-field-spacing .csf--input,
343
+ .csf-field-spacing .csf-fieldset,
344
+ .csf-field-border .csf--input,
345
+ .csf-field-border .csf-fieldset {
346
+ direction: ltr;
347
  }
348
+ .csf-field-dimensions .csf--inputs,
349
+ .csf-field-dimensions .csf--color,
350
+ .csf-field-spacing .csf--inputs,
351
+ .csf-field-spacing .csf--color,
352
+ .csf-field-border .csf--inputs,
353
+ .csf-field-border .csf--color {
354
  float: right;
355
  }
356
+ .csf-field-dimensions .csf--color,
357
+ .csf-field-spacing .csf--color,
358
+ .csf-field-border .csf--color {
359
+ margin-right: 4px;
360
+ direction: rtl;
361
+ }
362
 
363
  /**
364
  * 02. 15. Field: background
380
  */
381
  .csf-field-spinner .csf--spin {
382
  float: right;
383
+ direction: ltr;
384
  }
385
 
386
  /**
387
  * 02. 17. Field: slider
388
  */
389
+ .csf-field-slider .csf-slider-ui {
390
  direction: ltr;
391
+ margin-right: 0;
392
+ margin-left: 15px;
393
  }
394
+ .csf-field-slider .csf--input {
395
+ direction: ltr;
 
 
 
 
 
396
  }
397
 
398
  /**
429
  }
430
 
431
  /**
432
+ * 02. 22. Field: accordion
433
  */
434
+ .csf-field-accordion .csf--icon {
435
  margin-right: 0;
436
+ margin-left: 2px;
437
+ }
438
+
439
+ /**
440
+ * 02. 23. Field: date
441
+ */
442
+ .csf-field-date .csf--to {
443
+ margin-left: 0;
444
+ margin-right: 7px;
445
+ }
446
+
447
+ /**
448
+ * 02. 24. Field: map
449
+ */
450
+ .csf-field-map .csf--map-input:last-child {
451
+ padding-left: 0;
452
+ padding-right: 10px;
453
+ }
454
+
455
+ /**
456
+ * 02. 25. Field: sortable
457
+ */
458
+ .csf-field-sortable .csf--sortable-helper {
459
+ border-left: none;
460
+ border-right: 1px solid #eee;
461
+ }
462
+
463
+ /**
464
+ * 02. 26. Field: number
465
+ */
466
+ .csf-field-number .csf--wrap {
467
+ float: right;
468
  }
469
+
470
+ /**
471
+ * 03. Taxonomy
472
+ */
473
  .csf-taxonomy-add-fields .csf-field > .csf-fieldset > .csf-help {
474
  left: -5px;
475
  right: auto;
476
  }
477
 
 
 
 
 
478
  .csf-taxonomy-edit-fields .csf-field > .csf-fieldset > .csf-help {
479
  right: auto;
480
  left: -5px;
487
  padding-right: 0;
488
  padding-left: 7px;
489
  }
490
+ .csf-profile > .csf-field > .csf-fieldset > .csf-help {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
491
  left: -5px;
492
+ right: auto;
493
  }
494
 
495
  /**
admin/settings/assets/css/csf-rtl.min.css CHANGED
@@ -1 +1 @@
1
- .csf{margin-left:20px;margin-right:0}.csf-header h1{float:right}.csf-header fieldset{float:left}.csf-buttons{float:left;direction:ltr}.csf-header-left{float:right}.csf-header-right{float:left}.csf-nav{float:right}.csf-nav ul{clear:right}.csf-nav ul li .csf-section-active:after{right:auto;left:0;border-left-color:#fff;border-right-color:transparent}.csf-nav ul li .csf-arrow:after{content:"\f053";right:auto;left:10px}.csf-nav ul li.csf-tab-active .csf-arrow:after{-moz-transform:rotate(-90deg);-ms-transform:rotate(-90deg);-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.csf-nav ul ul li a{padding-right:25px;padding-left:15px}.csf-nav ul ul:before{left:auto;right:15px}.csf-nav .fa{margin-left:5px;margin-right:0}.csf-nav-background{left:auto;right:0}.csf-content{margin-left:0;margin-right:225px}.csf-sections{float:right}.csf-show-all .csf-content{margin-right:0;overflow:hidden}.csf-expand-all{float:right;right:auto;left:40px;margin-right:0;margin-left:4px}.csf-search{float:right}.csf-search input{margin:0 0 0 5px}.csf-copyright{float:right}.csf-metabox{margin:-6px -12px -12px -12px}.csf-metabox .csf-section-title{padding:20px}.csf-metabox .csf-section-title .fa{margin-left:5px;margin-right:0}.csf-section-title .fa{margin-left:5px;margin-right:0}.csf-field .csf-title{float:right}.csf-field .csf-fieldset{margin-left:0;margin-right:30%}.csf-pseudo-field{padding:0 0 0 5px!important}.csf-field-typography select{margin:0;width:100%}.csf-field-typography .csf--blocks-inputs .csf--blocks{flex-direction:row-reverse}.csf-field-checkbox .csf--inline-list li,.csf-field-radio .csf--inline-list li{margin-right:0;margin-left:15px}.csf-field-switcher .csf--switcher{float:right}.csf-field-switcher .csf--label{float:right;margin-left:0;margin-right:5px}.csf-field-upload .csf--buttons,.csf-field-upload .csf--remove{margin-left:0;margin-right:5px}.csf-field-group .csf-cloneable-title{padding:15px 10px 15px 65px}.csf-field-group .csf-cloneable-helper{right:auto;left:10px}.csf-field-repeater .csf-repeater-helper{border-left:0;border-right:1px solid #eee}.csf-help{right:auto;left:5px}.csf-field-icon .button{margin-right:0;margin-left:5px}.csf-field-icon .csf-icon-preview i{margin-right:0;margin-left:5px}.csf-field-gallery ul li{margin-right:0;margin-left:5px}.csf-field-gallery .button{margin-right:0;margin-left:5px}.csf-field-tabbed .csf-tabbed-nav .fa{padding-right:0;padding-left:5px}.csf-field-tabbed .csf-tabbed-nav a{margin-right:0;margin-left:5px}.csf-field-media .button{margin-left:0;margin-right:7px}.csf-field-media .hidden+.button{margin-right:0}.csf-notice{border-left:none;border-right-style:solid;border-right-width:4px}.csf-field-border .csf--input,.csf-field-dimensions .csf--input,.csf-field-spacing .csf--input{float:right;margin-right:0;margin-left:15px}.csf-field-border .csf--left,.csf-field-dimensions .csf--left,.csf-field-spacing .csf--left{float:right}.csf-field-background .csf--block{float:right}.csf-field-background .csf--media,.csf-field-background .csf--select{padding-right:0}.csf-field-background .csf--title{margin-right:0;margin-left:5px}.csf-field-spinner .csf--spin{float:right}.csf-field-slider .ui-slider{direction:ltr}.csf-field-slider input[type=text]{margin-left:0;margin-right:15px}.csf-field-slider em{padding-left:0;padding-right:5px}.csf-field-button_set .csf--button-group{float:right}.csf-field-link_color .csf--left{float:right;margin-right:0;margin-left:10px}.csf-field-color_group .csf--left{float:right;margin-right:0;margin-left:10px}.csf-field-palette .csf--palette{margin-right:0;margin-left:10px}.csf-taxonomy-add-fields .csf-fieldset{margin-right:0}.csf-taxonomy-add-fields .csf-field>.csf-fieldset>.csf-help{left:-5px;right:auto}.csf-taxonomy-edit-fields .csf-fieldset{margin-left:0;margin-right:225px}.csf-taxonomy-edit-fields .csf-field>.csf-fieldset>.csf-help{right:auto;left:-5px}.csf-profile>h2>.fa{padding-right:0;padding-left:7px}.csf-profile>.csf-field>.csf-fieldset{margin-left:0;margin-right:220px}.csf-profile>.csf-field>.csf-help{left:0;right:auto}.csf-taxonomy-edit-fields .csf-fieldset{margin-left:0;margin-right:225px}.csf-taxonomy-edit-fields .csf-field>.csf-fieldset>.csf-help{right:auto;left:-5px}.csf-modal-content .csf-field{padding:15px 15px 15px 30px}.csf-modal-title{padding:0 16px 0 36px}.csf-modal-close{right:auto;left:0}.control-section .csf-field .csf-fieldset{margin-right:0}@media only screen and (max-width:1200px){.csf-metabox .csf-field .csf-fieldset{margin-left:0}}@media only screen and (max-width:782px){.csf .csf-content,.csf .csf-fieldset{margin-right:0}}.csf-field .csf--transparent-slider{margin-left:0;margin-right:2px}.csf-field .csf--transparent-slider .ui-slider-handle{margin:0 -11px}.csf-field .csf--transparent-offset{background-position:center right}.csf-field .csf--transparent-text{right:auto;left:10px}
1
+ .csf{margin-left:20px;margin-right:0}.csf-header h1{float:right}.csf-header fieldset{float:left}.csf-buttons{float:left;direction:ltr}.csf-header-left{float:right}.csf-header-right{float:left}.csf-nav{float:right}.csf-nav ul{clear:right}.csf-nav ul li .csf-section-active:after{right:auto;left:0;border-left-color:#fff;border-right-color:transparent}.csf-nav ul li .csf-arrow:after{content:"\f053";right:auto;left:10px}.csf-nav ul li.csf-tab-active .csf-arrow:after{-moz-transform:rotate(-90deg);-ms-transform:rotate(-90deg);-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.csf-nav ul ul li a{padding-right:25px;padding-left:15px}.csf-nav ul ul:before{left:auto;right:15px}.csf-nav .fa{margin-left:5px;margin-right:0}.csf-nav-background{left:auto;right:0}.csf-content{margin-left:0;margin-right:225px}.csf-sections{float:right}.csf-show-all .csf-content{margin-right:0;overflow:hidden}.csf-expand-all{float:right;right:auto;left:40px;margin-right:0;margin-left:4px}.csf-search{float:right}.csf-search input{margin:0 0 0 5px}.csf-copyright{float:right}.csf-metabox{margin:-6px -12px -12px -12px}.csf-metabox .csf-section-title{padding:20px}.csf-metabox .csf-section-title .fa{margin-left:5px;margin-right:0}.csf-section-title .fa{margin-left:5px;margin-right:0}.csf-field .csf-title{float:right}.csf-field .csf-fieldset{float:left}.csf-pseudo-field{padding:0 0 0 5px!important}.csf-field-typography select{margin:0;width:100%}.csf-field-typography .csf--blocks-inputs .csf--blocks{flex-direction:row-reverse}.csf-field-checkbox .csf--inline-list li,.csf-field-radio .csf--inline-list li{margin-right:0;margin-left:15px}.csf-field-switcher .csf--switcher{float:right}.csf-field-switcher .csf--label{float:right;margin-left:0;margin-right:5px}.csf-field-upload .csf--button,.csf-field-upload .csf--remove{margin-left:0;margin-right:5px}.csf-field-group .csf-cloneable-title{padding:15px 10px 15px 65px}.csf-field-group .csf-cloneable-helper{right:auto;left:10px}.csf-field-repeater .csf-repeater-helper{border-left:0;border-right:1px solid #eee}.csf-help{right:auto;left:5px}.csf-field-icon .button{margin-right:0;margin-left:5px}.csf-field-icon .csf-icon-preview i{margin-right:0;margin-left:5px}.csf-field-gallery ul li{margin-right:0;margin-left:5px}.csf-field-gallery .button{margin-right:0;margin-left:5px}.csf-field-tabbed .csf-tabbed-nav .csf--icon{padding-right:0;padding-left:5px}.csf-field-tabbed .csf-tabbed-nav a{margin-right:0;margin-left:5px}.csf-field-media .button{margin-left:0;margin-right:7px}.csf-field-media .hidden+.button{margin-right:0}.csf-notice{border-left:none;border-right-style:solid;border-right-width:4px}.csf-field-border .csf--input,.csf-field-border .csf-fieldset,.csf-field-dimensions .csf--input,.csf-field-dimensions .csf-fieldset,.csf-field-spacing .csf--input,.csf-field-spacing .csf-fieldset{direction:ltr}.csf-field-border .csf--color,.csf-field-border .csf--inputs,.csf-field-dimensions .csf--color,.csf-field-dimensions .csf--inputs,.csf-field-spacing .csf--color,.csf-field-spacing .csf--inputs{float:right}.csf-field-border .csf--color,.csf-field-dimensions .csf--color,.csf-field-spacing .csf--color{margin-right:4px;direction:rtl}.csf-field-background .csf--block{float:right}.csf-field-background .csf--media,.csf-field-background .csf--select{padding-right:0}.csf-field-background .csf--title{margin-right:0;margin-left:5px}.csf-field-spinner .csf--spin{float:right;direction:ltr}.csf-field-slider .csf-slider-ui{direction:ltr;margin-right:0;margin-left:15px}.csf-field-slider .csf--input{direction:ltr}.csf-field-button_set .csf--button-group{float:right}.csf-field-link_color .csf--left{float:right;margin-right:0;margin-left:10px}.csf-field-color_group .csf--left{float:right;margin-right:0;margin-left:10px}.csf-field-palette .csf--palette{margin-right:0;margin-left:10px}.csf-field-accordion .csf--icon{margin-right:0;margin-left:2px}.csf-field-date .csf--to{margin-left:0;margin-right:7px}.csf-field-map .csf--map-input:last-child{padding-left:0;padding-right:10px}.csf-field-sortable .csf--sortable-helper{border-left:none;border-right:1px solid #eee}.csf-field-number .csf--wrap{float:right}.csf-taxonomy-add-fields .csf-field>.csf-fieldset>.csf-help{left:-5px;right:auto}.csf-taxonomy-edit-fields .csf-field>.csf-fieldset>.csf-help{right:auto;left:-5px}.csf-profile>h2>.fa{padding-right:0;padding-left:7px}.csf-profile>.csf-field>.csf-fieldset>.csf-help{left:-5px;right:auto}.csf-modal-content .csf-field{padding:15px 15px 15px 30px}.csf-modal-title{padding:0 16px 0 36px}.csf-modal-close{right:auto;left:0}.control-section .csf-field .csf-fieldset{margin-right:0}@media only screen and (max-width:1200px){.csf-metabox .csf-field .csf-fieldset{margin-left:0}}@media only screen and (max-width:782px){.csf .csf-content,.csf .csf-fieldset{margin-right:0}}.csf-field .csf--transparent-slider{margin-left:0;margin-right:2px}.csf-field .csf--transparent-slider .ui-slider-handle{margin:0 -11px}.csf-field .csf--transparent-offset{background-position:center right}.csf-field .csf--transparent-text{right:auto;left:10px}
admin/settings/assets/css/csf.css CHANGED
@@ -218,7 +218,8 @@
218
  .csf-nav ul li .csf-arrow:after {
219
  content: "\f054";
220
  display: inline-block;
221
- font-family: "FontAwesome";
 
222
  font-size: 9px;
223
  line-height: 1;
224
  position: absolute;
@@ -247,10 +248,10 @@
247
  font-size: 12px;
248
  padding: 12px 14px 12px 24px;
249
  }
250
- .csf-nav .fa {
251
  width: 20px;
252
  margin-right: 5px;
253
- font-size: 14px;
254
  text-align: center;
255
  }
256
  .csf-nav .csf-label-error {
@@ -313,7 +314,7 @@
313
  font-weight: bold;
314
  text-transform: uppercase;
315
  }
316
- .csf-section-title .fa {
317
  margin-right: 5px;
318
  }
319
 
@@ -362,8 +363,8 @@
362
  padding: 0 8px;
363
  margin-right: 4px;
364
  z-index: 1;
365
- font-size: 14px;
366
- line-height: 28px;
367
  cursor: pointer;
368
  user-select: none;
369
  -moz-border-radius: 2px;
@@ -389,8 +390,8 @@
389
  margin: 0 2px 0 0;
390
  border: none;
391
  font-size: 12px;
392
- line-height: 28px;
393
- min-height: 28px;
394
  text-align: inherit;
395
  padding: 0 10px;
396
  -moz-border-radius: 2px;
@@ -424,10 +425,17 @@
424
  }
425
 
426
  .block-editor-page .csf-metabox {
427
- margin: -6px -14px -12px -14px;
 
 
 
 
 
428
  }
429
 
430
  .csf-restore-wrapper {
 
 
431
  text-align: right;
432
  padding: 10px;
433
  border-top: 1px solid #eee;
@@ -459,7 +467,8 @@
459
  margin-bottom: 10px;
460
  }
461
  #side-sortables .csf-field .csf-fieldset {
462
- margin-left: 0;
 
463
  }
464
  #side-sortables .csf-notice {
465
  padding: 12px;
@@ -666,7 +675,8 @@
666
  color: #23282d;
667
  }
668
  .csf-field .csf-fieldset {
669
- margin-left: 25%;
 
670
  }
671
 
672
  .csf-pseudo-field {
@@ -715,6 +725,7 @@
715
  .csf-field-accordion .csf--icon {
716
  width: 20px;
717
  text-align: center;
 
718
  }
719
  .csf-field-accordion .csf-accordion-content {
720
  display: none;
@@ -761,9 +772,6 @@
761
  .csf-field-background .csf--attributes-hidden {
762
  display: none;
763
  }
764
- .csf-field-background .wp-color-result.button {
765
- margin-bottom: 0;
766
- }
767
 
768
  /**
769
  * 03. 04. Field: backup
@@ -959,8 +967,10 @@
959
  max-width: 100%;
960
  }
961
  .csf-field-color .button.wp-picker-clear {
 
962
  margin-left: 6px;
963
- padding: 2px 8px;
 
964
  }
965
 
966
  /**
@@ -1041,7 +1051,8 @@
1041
  top: auto;
1042
  left: auto;
1043
  right: auto;
1044
- font-family: "FontAwesome";
 
1045
  font-size: 12px;
1046
  text-align: center;
1047
  width: 41px;
@@ -1280,10 +1291,10 @@
1280
  }
1281
  .csf-field-icon .csf-icon-preview i {
1282
  display: inline-block;
1283
- font-size: 14px;
1284
  width: 30px;
1285
- height: 26px;
1286
- line-height: 26px;
1287
  margin-right: 5px;
1288
  text-align: center;
1289
  vertical-align: top;
@@ -1325,12 +1336,13 @@
1325
  top: 0;
1326
  left: 0;
1327
  text-align: center;
1328
- font-size: 11px;
1329
- font-family: FontAwesome;
 
1330
  content: "\f00c";
1331
- width: 15px;
1332
- height: 15px;
1333
- line-height: 15px;
1334
  opacity: 0;
1335
  color: #fff;
1336
  background-color: #222;
@@ -1481,12 +1493,13 @@
1481
  top: 0;
1482
  left: 0;
1483
  text-align: center;
1484
- font-size: 11px;
1485
- font-family: FontAwesome;
 
1486
  content: "\f00c";
1487
- width: 15px;
1488
- height: 15px;
1489
- line-height: 15px;
1490
  opacity: 0;
1491
  color: #fff;
1492
  background-color: #222;
@@ -1616,11 +1629,14 @@
1616
  border-left: 0;
1617
  background-color: #f5f5f5;
1618
  }
 
 
 
1619
  .csf-field-slider input[type=number] {
1620
  position: relative;
1621
  z-index: 1;
 
1622
  width: 50px;
1623
- margin: 0 0 0 15px;
1624
  text-align: center;
1625
  }
1626
  .csf-field-slider .csf--is-unit {
@@ -1692,13 +1708,13 @@
1692
  border-left: 1px solid #eee;
1693
  background-color: #f7f7f7;
1694
  }
1695
- .csf-field-sortable .csf--sortable-helper .fa {
1696
  display: inline-block;
1697
  cursor: pointer;
1698
  width: 50px;
1699
  color: #555;
1700
  }
1701
- .csf-field-sortable .csf--sortable-helper .fa:hover {
1702
  opacity: 0.5;
1703
  }
1704
  .csf-field-sortable .widget-placeholder {
@@ -1817,8 +1833,10 @@
1817
  background-color: #ddd;
1818
  }
1819
  .csf-field-spinner .ui-button:before {
1820
- font-family: FontAwesome;
 
1821
  font-size: 14px;
 
1822
  }
1823
  .csf-field-spinner .ui-spinner-down {
1824
  order: 1;
@@ -2277,7 +2295,7 @@
2277
  top: 0;
2278
  right: 0;
2279
  padding: 5px;
2280
- font-size: 14px;
2281
  color: #aaa;
2282
  }
2283
  .csf-help .csf-help-text {
@@ -2314,7 +2332,8 @@
2314
  .csf-field .chosen-container-single .chosen-single abbr {
2315
  top: 0;
2316
  right: 20px;
2317
- font-family: FontAwesome;
 
2318
  font-size: 12px;
2319
  height: 100%;
2320
  width: 18px;
@@ -2329,7 +2348,8 @@
2329
  color: #555;
2330
  }
2331
  .csf-field .chosen-container-multi .chosen-choices li.search-choice .search-choice-close {
2332
- font-family: FontAwesome;
 
2333
  font-size: 12px;
2334
  height: 100%;
2335
  width: 18px;
@@ -2346,7 +2366,8 @@
2346
  color: #555;
2347
  }
2348
  .csf-field .chosen-container-single .chosen-single div b {
2349
- font-family: FontAwesome;
 
2350
  font-size: 14px;
2351
  color: #aaa;
2352
  background: none;
@@ -2374,17 +2395,21 @@
2374
  background: none;
2375
  }
2376
  .csf-field .chosen-container-single .chosen-search:before {
2377
- font-family: FontAwesome;
2378
- position: absolute;
2379
- content: "\f002";
2380
  font-size: 11px;
2381
- right: 10px;
2382
- top: 7px;
 
 
2383
  color: #aaa;
2384
  }
2385
  .csf-field .wp-picker-container {
2386
  display: inline-block;
2387
  }
 
 
 
2388
  .csf-field .csf--transparent-wrap {
2389
  display: none;
2390
  position: relative;
@@ -2508,7 +2533,8 @@
2508
  margin-bottom: 5px;
2509
  }
2510
  .csf-widgets > .csf-field .csf-fieldset {
2511
- margin-left: 0;
 
2512
  }
2513
  .csf-widgets .csf-field-text input {
2514
  width: 100%;
@@ -2542,7 +2568,8 @@
2542
  color: inherit;
2543
  }
2544
  .control-section .csf-field .csf-fieldset {
2545
- margin-left: 0;
 
2546
  }
2547
  .control-section .csf-help {
2548
  top: -5px;
@@ -2703,7 +2730,8 @@
2703
  font-weight: normal;
2704
  }
2705
  .csf-taxonomy-add-fields > .csf-field > .csf-fieldset {
2706
- margin-left: 0;
 
2707
  }
2708
  .csf-taxonomy-add-fields > .csf-field > .csf-fieldset > .csf-help {
2709
  right: -5px;
@@ -2716,7 +2744,7 @@
2716
  padding: 20px 0;
2717
  }
2718
  .csf-taxonomy-edit-fields > .csf-field > .csf-title {
2719
- width: 225px;
2720
  }
2721
  .csf-taxonomy-edit-fields > .csf-field > .csf-title h4 {
2722
  font-size: 14px;
@@ -2726,7 +2754,7 @@
2726
  vertical-align: middle;
2727
  }
2728
  .csf-taxonomy-edit-fields > .csf-field > .csf-fieldset {
2729
- margin-left: 225px;
2730
  }
2731
  .csf-taxonomy-edit-fields > .csf-field > .csf-fieldset > .csf-help {
2732
  top: -5px;
@@ -2748,11 +2776,12 @@
2748
  padding-right: 7px;
2749
  }
2750
  .csf-profile > .csf-field {
 
2751
  padding: 15px 0;
2752
  border-top: none !important;
2753
  }
2754
  .csf-profile > .csf-field > .csf-title {
2755
- width: 220px;
2756
  }
2757
  .csf-profile > .csf-field > .csf-title h4 {
2758
  font-size: 14px;
@@ -2762,7 +2791,7 @@
2762
  vertical-align: middle;
2763
  }
2764
  .csf-profile > .csf-field > .csf-fieldset {
2765
- margin-left: 220px;
2766
  }
2767
  .csf-profile > .csf-field > .csf-fieldset > .csf-help {
2768
  top: -15px;
@@ -2841,12 +2870,6 @@
2841
  .csf-modal-content .csf-shortcode-button {
2842
  display: none;
2843
  }
2844
- .csf-modal-content .csf-fieldset {
2845
- margin-left: 25%;
2846
- }
2847
- .csf-modal-content .csf-title {
2848
- width: 20%;
2849
- }
2850
  .csf-modal-content .csf-field {
2851
  padding: 15px 30px 15px 15px;
2852
  }
@@ -3019,39 +3042,30 @@
3019
  background-color: #f7f7f7;
3020
  }
3021
  .csf-modal-icon .csf-icon-search {
3022
- width: 250px;
3023
  height: 40px;
3024
  line-height: 40px;
3025
  }
3026
- .csf-modal-icon a {
3027
- display: inline-block;
3028
- padding: 4px;
3029
  cursor: pointer;
3030
- }
3031
- .csf-modal-icon a .csf-icon {
3032
- position: relative;
3033
- padding: 4px;
3034
  display: inline-block;
3035
- font-size: 14px;
3036
- width: 30px;
3037
- height: 26px;
3038
- line-height: 26px;
3039
- text-align: center;
3040
- vertical-align: top;
3041
  color: #555;
 
3042
  border: 1px solid #ccc;
3043
  background-color: #f7f7f7;
3044
- -moz-border-radius: 3px;
3045
- -webkit-border-radius: 3px;
3046
- border-radius: 3px;
3047
- -moz-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
3048
- -webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
3049
- box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
3050
- -moz-box-sizing: content-box;
3051
- -webkit-box-sizing: content-box;
3052
- box-sizing: content-box;
3053
  }
3054
- .csf-modal-icon a:hover .csf-icon {
3055
  color: #fff;
3056
  border-color: #222;
3057
  background-color: #222;
@@ -3147,10 +3161,18 @@
3147
  /**
3148
  * 08. Helper
3149
  */
3150
- .csf-text-desc,
3151
  .csf-text-subtitle {
 
3152
  font-weight: 400;
 
 
 
 
 
 
 
3153
  margin-top: 10px;
 
3154
  color: #999;
3155
  }
3156
 
@@ -3159,6 +3181,7 @@
3159
  }
3160
 
3161
  .csf-text-error {
 
3162
  color: #d02c21;
3163
  }
3164
 
@@ -3624,7 +3647,8 @@
3624
  margin-bottom: 10px;
3625
  }
3626
  .csf-metabox .csf-field .csf-fieldset {
3627
- margin-left: 0;
 
3628
  }
3629
  }
3630
  @media only screen and (max-width: 782px) {
@@ -3688,7 +3712,14 @@
3688
  margin-bottom: 10px;
3689
  }
3690
  .csf-field .csf-fieldset {
3691
- margin-left: 0;
 
 
 
 
 
 
 
3692
  }
3693
 
3694
  .csf-modal-inner {
@@ -3716,13 +3747,16 @@
3716
  height: 252px;
3717
  }
3718
 
3719
- .csf-profile > .csf-field > .csf-title {
 
3720
  float: none;
3721
  width: 100%;
3722
  margin-bottom: 10px;
3723
  }
3724
- .csf-profile > .csf-field > .csf-fieldset {
3725
- margin-left: 0;
 
 
3726
  }
3727
  }
3728
  /**
218
  .csf-nav ul li .csf-arrow:after {
219
  content: "\f054";
220
  display: inline-block;
221
+ font-family: "Font Awesome 5 Pro", "Font Awesome 5 Free", "FontAwesome";
222
+ font-weight: 900;
223
  font-size: 9px;
224
  line-height: 1;
225
  position: absolute;
248
  font-size: 12px;
249
  padding: 12px 14px 12px 24px;
250
  }
251
+ .csf-nav .csf-tab-icon {
252
  width: 20px;
253
  margin-right: 5px;
254
+ font-size: 13px;
255
  text-align: center;
256
  }
257
  .csf-nav .csf-label-error {
314
  font-weight: bold;
315
  text-transform: uppercase;
316
  }
317
+ .csf-section-title .csf-section-icon {
318
  margin-right: 5px;
319
  }
320
 
363
  padding: 0 8px;
364
  margin-right: 4px;
365
  z-index: 1;
366
+ font-size: 13px;
367
+ line-height: 30px;
368
  cursor: pointer;
369
  user-select: none;
370
  -moz-border-radius: 2px;
390
  margin: 0 2px 0 0;
391
  border: none;
392
  font-size: 12px;
393
+ line-height: 30px;
394
+ min-height: 30px;
395
  text-align: inherit;
396
  padding: 0 10px;
397
  -moz-border-radius: 2px;
425
  }
426
 
427
  .block-editor-page .csf-metabox {
428
+ margin: -6px -14px -14px -14px;
429
+ }
430
+
431
+ .block-editor-editor-skeleton__content .csf-metabox {
432
+ border-left: 1px solid #e2e4e7;
433
+ border-right: 1px solid #e2e4e7;
434
  }
435
 
436
  .csf-restore-wrapper {
437
+ position: relative;
438
+ z-index: 1000000;
439
  text-align: right;
440
  padding: 10px;
441
  border-top: 1px solid #eee;
467
  margin-bottom: 10px;
468
  }
469
  #side-sortables .csf-field .csf-fieldset {
470
+ float: none;
471
+ width: 100%;
472
  }
473
  #side-sortables .csf-notice {
474
  padding: 12px;
675
  color: #23282d;
676
  }
677
  .csf-field .csf-fieldset {
678
+ float: right;
679
+ width: calc(80% - 20px);
680
  }
681
 
682
  .csf-pseudo-field {
725
  .csf-field-accordion .csf--icon {
726
  width: 20px;
727
  text-align: center;
728
+ margin-right: 2px;
729
  }
730
  .csf-field-accordion .csf-accordion-content {
731
  display: none;
772
  .csf-field-background .csf--attributes-hidden {
773
  display: none;
774
  }
 
 
 
775
 
776
  /**
777
  * 03. 04. Field: backup
967
  max-width: 100%;
968
  }
969
  .csf-field-color .button.wp-picker-clear {
970
+ padding: 0 8px;
971
  margin-left: 6px;
972
+ line-height: 2.54545455;
973
+ min-height: 30px;
974
  }
975
 
976
  /**
1051
  top: auto;
1052
  left: auto;
1053
  right: auto;
1054
+ font-family: "Font Awesome 5 Pro", "Font Awesome 5 Free", "FontAwesome";
1055
+ font-weight: 900;
1056
  font-size: 12px;
1057
  text-align: center;
1058
  width: 41px;
1291
  }
1292
  .csf-field-icon .csf-icon-preview i {
1293
  display: inline-block;
1294
+ font-size: 16px;
1295
  width: 30px;
1296
+ height: 28px;
1297
+ line-height: 28px;
1298
  margin-right: 5px;
1299
  text-align: center;
1300
  vertical-align: top;
1336
  top: 0;
1337
  left: 0;
1338
  text-align: center;
1339
+ font-size: 10px;
1340
+ font-family: "Font Awesome 5 Pro", "Font Awesome 5 Free", "FontAwesome";
1341
+ font-weight: 900;
1342
  content: "\f00c";
1343
+ width: 16px;
1344
+ height: 16px;
1345
+ line-height: 14px;
1346
  opacity: 0;
1347
  color: #fff;
1348
  background-color: #222;
1493
  top: 0;
1494
  left: 0;
1495
  text-align: center;
1496
+ font-size: 10px;
1497
+ font-family: "Font Awesome 5 Pro", "Font Awesome 5 Free", "FontAwesome";
1498
+ font-weight: 900;
1499
  content: "\f00c";
1500
+ width: 16px;
1501
+ height: 16px;
1502
+ line-height: 14px;
1503
  opacity: 0;
1504
  color: #fff;
1505
  background-color: #222;
1629
  border-left: 0;
1630
  background-color: #f5f5f5;
1631
  }
1632
+ .csf-field-slider .csf-slider-ui {
1633
+ margin-right: 15px;
1634
+ }
1635
  .csf-field-slider input[type=number] {
1636
  position: relative;
1637
  z-index: 1;
1638
+ margin: 0;
1639
  width: 50px;
 
1640
  text-align: center;
1641
  }
1642
  .csf-field-slider .csf--is-unit {
1708
  border-left: 1px solid #eee;
1709
  background-color: #f7f7f7;
1710
  }
1711
+ .csf-field-sortable .csf--sortable-helper i {
1712
  display: inline-block;
1713
  cursor: pointer;
1714
  width: 50px;
1715
  color: #555;
1716
  }
1717
+ .csf-field-sortable .csf--sortable-helper i:hover {
1718
  opacity: 0.5;
1719
  }
1720
  .csf-field-sortable .widget-placeholder {
1833
  background-color: #ddd;
1834
  }
1835
  .csf-field-spinner .ui-button:before {
1836
+ font-family: "Font Awesome 5 Pro", "Font Awesome 5 Free", "FontAwesome";
1837
+ font-weight: 900;
1838
  font-size: 14px;
1839
+ line-height: 14px;
1840
  }
1841
  .csf-field-spinner .ui-spinner-down {
1842
  order: 1;
2295
  top: 0;
2296
  right: 0;
2297
  padding: 5px;
2298
+ font-size: 13px;
2299
  color: #aaa;
2300
  }
2301
  .csf-help .csf-help-text {
2332
  .csf-field .chosen-container-single .chosen-single abbr {
2333
  top: 0;
2334
  right: 20px;
2335
+ font-family: "Font Awesome 5 Pro", "Font Awesome 5 Free", "FontAwesome";
2336
+ font-weight: 900;
2337
  font-size: 12px;
2338
  height: 100%;
2339
  width: 18px;
2348
  color: #555;
2349
  }
2350
  .csf-field .chosen-container-multi .chosen-choices li.search-choice .search-choice-close {
2351
+ font-family: "Font Awesome 5 Pro", "Font Awesome 5 Free", "FontAwesome";
2352
+ font-weight: 900;
2353
  font-size: 12px;
2354
  height: 100%;
2355
  width: 18px;
2366
  color: #555;
2367
  }
2368
  .csf-field .chosen-container-single .chosen-single div b {
2369
+ font-family: "Font Awesome 5 Pro", "Font Awesome 5 Free", "FontAwesome";
2370
+ font-weight: 900;
2371
  font-size: 14px;
2372
  color: #aaa;
2373
  background: none;
2395
  background: none;
2396
  }
2397
  .csf-field .chosen-container-single .chosen-search:before {
2398
+ font-family: "Font Awesome 5 Pro", "Font Awesome 5 Free", "FontAwesome";
2399
+ font-weight: 900;
 
2400
  font-size: 11px;
2401
+ content: "\f002";
2402
+ position: absolute;
2403
+ right: 12px;
2404
+ top: 10px;
2405
  color: #aaa;
2406
  }
2407
  .csf-field .wp-picker-container {
2408
  display: inline-block;
2409
  }
2410
+ .csf-field .wp-picker-container .wp-color-result.button {
2411
+ margin-bottom: 0;
2412
+ }
2413
  .csf-field .csf--transparent-wrap {
2414
  display: none;
2415
  position: relative;
2533
  margin-bottom: 5px;
2534
  }
2535
  .csf-widgets > .csf-field .csf-fieldset {
2536
+ float: none;
2537
+ width: 100%;
2538
  }
2539
  .csf-widgets .csf-field-text input {
2540
  width: 100%;
2568
  color: inherit;
2569
  }
2570
  .control-section .csf-field .csf-fieldset {
2571
+ float: none;
2572
+ width: 100%;
2573
  }
2574
  .control-section .csf-help {
2575
  top: -5px;
2730
  font-weight: normal;
2731
  }
2732
  .csf-taxonomy-add-fields > .csf-field > .csf-fieldset {
2733
+ float: none;
2734
+ width: 100%;
2735
  }
2736
  .csf-taxonomy-add-fields > .csf-field > .csf-fieldset > .csf-help {
2737
  right: -5px;
2744
  padding: 20px 0;
2745
  }
2746
  .csf-taxonomy-edit-fields > .csf-field > .csf-title {
2747
+ width: 200px;
2748
  }
2749
  .csf-taxonomy-edit-fields > .csf-field > .csf-title h4 {
2750
  font-size: 14px;
2754
  vertical-align: middle;
2755
  }
2756
  .csf-taxonomy-edit-fields > .csf-field > .csf-fieldset {
2757
+ width: calc(100% - 220px);
2758
  }
2759
  .csf-taxonomy-edit-fields > .csf-field > .csf-fieldset > .csf-help {
2760
  top: -5px;
2776
  padding-right: 7px;
2777
  }
2778
  .csf-profile > .csf-field {
2779
+ max-width: 800px;
2780
  padding: 15px 0;
2781
  border-top: none !important;
2782
  }
2783
  .csf-profile > .csf-field > .csf-title {
2784
+ width: 200px;
2785
  }
2786
  .csf-profile > .csf-field > .csf-title h4 {
2787
  font-size: 14px;
2791
  vertical-align: middle;
2792
  }
2793
  .csf-profile > .csf-field > .csf-fieldset {
2794
+ width: calc(100% - 220px);
2795
  }
2796
  .csf-profile > .csf-field > .csf-fieldset > .csf-help {
2797
  top: -15px;
2870
  .csf-modal-content .csf-shortcode-button {
2871
  display: none;
2872
  }
 
 
 
 
 
 
2873
  .csf-modal-content .csf-field {
2874
  padding: 15px 30px 15px 15px;
2875
  }
3042
  background-color: #f7f7f7;
3043
  }
3044
  .csf-modal-icon .csf-icon-search {
3045
+ width: 50%;
3046
  height: 40px;
3047
  line-height: 40px;
3048
  }
3049
+ .csf-modal-icon i {
 
 
3050
  cursor: pointer;
 
 
 
 
3051
  display: inline-block;
3052
+ margin: 4px;
3053
+ width: 35px;
3054
+ height: 35px;
3055
+ line-height: 35px;
3056
+ font-size: 16px;
 
3057
  color: #555;
3058
+ text-align: center;
3059
  border: 1px solid #ccc;
3060
  background-color: #f7f7f7;
3061
+ -moz-border-radius: 2px;
3062
+ -webkit-border-radius: 2px;
3063
+ border-radius: 2px;
3064
+ -moz-box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.05);
3065
+ -webkit-box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.05);
3066
+ box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.05);
 
 
 
3067
  }
3068
+ .csf-modal-icon i:hover {
3069
  color: #fff;
3070
  border-color: #222;
3071
  background-color: #222;
3161
  /**
3162
  * 08. Helper
3163
  */
 
3164
  .csf-text-subtitle {
3165
+ margin-top: 10px;
3166
  font-weight: 400;
3167
+ color: #999;
3168
+ }
3169
+
3170
+ .csf-text-desc {
3171
+ clear: both;
3172
+ float: left;
3173
+ width: 100%;
3174
  margin-top: 10px;
3175
+ font-weight: 400;
3176
  color: #999;
3177
  }
3178
 
3181
  }
3182
 
3183
  .csf-text-error {
3184
+ margin-top: 5px;
3185
  color: #d02c21;
3186
  }
3187
 
3647
  margin-bottom: 10px;
3648
  }
3649
  .csf-metabox .csf-field .csf-fieldset {
3650
+ float: none;
3651
+ width: 100%;
3652
  }
3653
  }
3654
  @media only screen and (max-width: 782px) {
3712
  margin-bottom: 10px;
3713
  }
3714
  .csf-field .csf-fieldset {
3715
+ float: none;
3716
+ width: 100%;
3717
+ }
3718
+
3719
+ .csf-field-color .button.wp-picker-clear {
3720
+ padding: 0 8px;
3721
+ line-height: 2.14285714;
3722
+ min-height: 32px;
3723
  }
3724
 
3725
  .csf-modal-inner {
3747
  height: 252px;
3748
  }
3749
 
3750
+ .csf-profile > .csf-field > .csf-title,
3751
+ .csf-taxonomy-edit-fields > .csf-field > .csf-title {
3752
  float: none;
3753
  width: 100%;
3754
  margin-bottom: 10px;
3755
  }
3756
+ .csf-profile > .csf-field > .csf-fieldset,
3757
+ .csf-taxonomy-edit-fields > .csf-field > .csf-fieldset {
3758
+ float: none;
3759
+ width: 100%;
3760
  }
3761
  }
3762
  /**
admin/settings/assets/css/csf.min.css CHANGED
@@ -1 +1 @@
1
- .csf{position:relative}.csf label{padding:0;margin:0;display:inline-block}.csf-ab-icon{top:2px}#screen-meta-links+.csf-options{margin-top:40px}.csf-options{margin-top:20px;margin-right:20px}.csf-header{position:relative}.csf-header-inner{padding:25px}.csf-header-inner h1{float:left;font-size:1.5em;line-height:26px;font-weight:400;margin:0}.csf-header-inner h1 small{font-size:11px;font-weight:500}.csf-sticky .csf-header-inner{position:fixed;z-index:99999;top:32px;-moz-box-shadow:0 5px 25px rgba(0,0,0,.125);-webkit-box-shadow:0 5px 25px rgba(0,0,0,.125);box-shadow:0 5px 25px rgba(0,0,0,.125)}.csf-buttons{float:right;-moz-transition:opacity .2s;-o-transition:opacity .2s;-webkit-transition:opacity .2s;transition:opacity .2s}.csf-buttons .button{margin:0 2px;line-height:26px}.csf-buttons .button:focus{outline:0!important;box-shadow:none!important}.csf-buttons .csf-save{min-width:72px}.csf-header-left{float:left}.csf-header-right{float:right}.csf-nav{display:block;position:relative;z-index:10;float:left;width:225px}.csf-nav ul{clear:left;margin:0;list-style-type:none}.csf-nav ul li{margin-bottom:0}.csf-nav ul li a{font-size:13px;position:relative;display:block;padding:14px 12px;text-decoration:none;-moz-transition:all .3s ease;-o-transition:all .3s ease;-webkit-transition:all .3s ease;transition:all .3s ease}.csf-nav ul li a:focus{outline:0;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.csf-nav ul li .csf-section-active:after{content:" ";position:absolute;right:0;top:50%;height:0;width:0;pointer-events:none;border:solid transparent;border-right-color:#fff;border-width:4px;margin-top:-4px}.csf-nav ul li .csf-arrow:after{content:"\f054";display:inline-block;font-family:FontAwesome;font-size:9px;line-height:1;position:absolute;right:10px;top:50%;margin-top:-4px;-moz-transform:rotate(0);-ms-transform:rotate(0);-webkit-transform:rotate(0);transform:rotate(0)}.csf-nav ul li.csf-tab-active .csf-arrow:after{-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-webkit-transform:rotate(90deg);transform:rotate(90deg)}.csf-nav ul li.csf-tab-active ul{display:block}.csf-nav ul ul{display:none;position:relative}.csf-nav ul ul li a{font-size:12px;padding:12px 14px 12px 24px}.csf-nav .fa{width:20px;margin-right:5px;font-size:14px;text-align:center}.csf-nav .csf-label-error{margin-left:4px;vertical-align:top}.csf-nav-background{position:absolute;top:0;left:0;bottom:0;z-index:9;width:225px}.csf-wrapper{position:relative}.csf-content{position:relative;margin-left:225px;background-color:#fff;-moz-transition:opacity .2s;-o-transition:opacity .2s;-webkit-transition:opacity .2s;transition:opacity .2s}.csf-sections{float:left;width:100%}.csf-section{display:none}.csf-section-title{display:none;padding:20px 30px;background-color:#f5f5f5;border-top:1px solid #eee;border-bottom:1px solid #eee}.csf-section-title h3{margin:0;padding:0;font-size:13px;font-weight:700;text-transform:uppercase}.csf-section-title .fa{margin-right:5px}.csf-footer{padding:20px;font-size:11px}.csf-copyright{float:left;margin-top:5px}.csf-search-all .csf-nav,.csf-search-all .csf-nav-background,.csf-show-all .csf-nav,.csf-show-all .csf-nav-background{display:none}.csf-search-all .csf-content,.csf-show-all .csf-content{margin-left:0}.csf-search-all .csf-section,.csf-search-all .csf-section-title,.csf-show-all .csf-section,.csf-show-all .csf-section-title{display:block!important}.csf-search-all .csf-section-title{display:none!important}.csf-expand-all{float:left;padding:0 8px;margin-right:4px;z-index:1;font-size:14px;line-height:28px;cursor:pointer;user-select:none;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;-moz-transition:all .2s;-o-transition:all .2s;-webkit-transition:all .2s;transition:all .2s}.csf-expand-all span{font-size:11px;vertical-align:middle}.csf-search{float:left}.csf-search input{margin:0 2px 0 0;border:none;font-size:12px;line-height:28px;min-height:28px;text-align:inherit;padding:0 10px;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.csf-search input:focus{-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.csf-saving .csf-buttons,.csf-saving .csf-content{cursor:default;pointer-events:none;opacity:.5}.csf-metabox{margin:-6px -12px -12px -12px}.csf-metabox .csf-section-title{padding:20px}.block-editor-page .csf-metabox{margin:-6px -14px -12px -14px}.csf-restore-wrapper{text-align:right;padding:10px;border-top:1px solid #eee}.csf-restore-wrapper .csf-button-cancel,.csf-restore-wrapper input{display:none}.csf-restore-wrapper span{-webkit-user-select:none;user-select:none}.csf-restore-wrapper input:checked~.csf-button-restore{display:none}.csf-restore-wrapper input:checked~.csf-button-cancel{display:inline-block}#side-sortables .csf-section-title{padding:12px}#side-sortables .csf-field{padding:12px}#side-sortables .csf-field .csf-title{float:none;width:100%;margin-bottom:10px}#side-sortables .csf-field .csf-fieldset{margin-left:0}#side-sortables .csf-notice{padding:12px}.csf-comment-metabox{margin:-6px -12px -12px -12px}.csf-comment-metabox .csf-section-title{padding:20px}.csf-tooltip{position:absolute;z-index:5000001;font-size:12px;line-height:1.4;text-align:center;text-decoration:none;padding:6px 12px;max-width:200px;color:#fff;background-color:#000;background-color:rgba(0,0,0,.85);-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px}.csf-theme-dark .csf-header-inner{background-color:#050505}.csf-theme-dark .csf-header-inner h1{color:#fff}.csf-theme-dark .csf-header-inner h1 small{color:#555}.csf-theme-dark .csf-expand-all{color:#999;background-color:#222}.csf-theme-dark .csf-expand-all:hover{color:#fff;background-color:#333}.csf-theme-dark .csf-search input{color:#fff;background-color:#222}.csf-theme-dark .csf-search:focus{background-color:#444}.csf-theme-dark .csf-search::-webkit-input-placeholder{color:#666}.csf-theme-dark .csf-nav ul li a{color:#999;background-color:#222;border-bottom:1px solid #2f2f2f}.csf-theme-dark .csf-nav ul li a:hover{color:#fff}.csf-theme-dark .csf-nav ul li .csf-section-active{color:#fff;background-color:#111}.csf-theme-dark .csf-nav ul ul li a{background-color:#191919;border-bottom:1px solid #2f2f2f}.csf-theme-dark .csf-nav ul ul li .csf-section-active{background-color:#101010}.csf-theme-dark .csf-nav ul ul:before{background-color:rgba(34,34,34,.75)}.csf-theme-dark .csf-nav>ul>li:last-child>a{border-bottom:none}.csf-theme-dark .csf-nav-background{background-color:#222}.csf-theme-dark .csf-footer{color:#555;background-color:#050505}.csf-theme-light .csf-container{border:1px solid #e5e5e5;-moz-box-shadow:0 0 15px rgba(0,0,0,.04);-webkit-box-shadow:0 0 15px rgba(0,0,0,.04);box-shadow:0 0 15px rgba(0,0,0,.04)}.csf-theme-light .csf-header-inner{border-bottom:1px solid #e5e5e5;background-color:#f5f5f5;background:linear-gradient(#fefefe,#f5f5f5)}.csf-theme-light .csf-header-inner h1 small{color:#999}.csf-theme-light .csf-expand-all{color:#999;background-color:#fff;-moz-box-shadow:0 1px 1px rgba(0,0,0,.05);-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05)}.csf-theme-light .csf-expand-all:hover{color:#555}.csf-theme-light .csf-search input{color:#555;background-color:#fff;-moz-box-shadow:0 1px 1px rgba(0,0,0,.05);-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05)}.csf-theme-light .csf-search input::-webkit-input-placeholder{color:#bbb}.csf-theme-light .csf-nav ul li a{color:#666;background-color:#f5f5f5;border-bottom:1px solid #e5e5e5}.csf-theme-light .csf-nav ul li a:hover{color:#222}.csf-theme-light .csf-nav ul li .csf-section-active{color:#222;background-color:#fff}.csf-theme-light .csf-nav ul li .csf-section-active:after{display:none}.csf-theme-light .csf-nav ul ul li a{background-color:#eee;border-bottom:1px solid #e5e5e5}.csf-theme-light .csf-nav>ul>li:last-child>a{border-bottom:none}.csf-theme-light .csf-nav-background{background-color:#f5f5f5}.csf-theme-light .csf-footer{color:#555;border-top:1px solid #e5e5e5;background-color:#f5f5f5;background:linear-gradient(#fafafa,#f5f5f5)}.csf-field{position:relative;padding:30px}.csf-field+.csf-field:not(.hidden){border-top:1px solid #eee}.csf-field p:first-child{margin-top:0}.csf-field p:last-child{margin-bottom:0}.csf-field:after,.csf-field:before{content:" ";display:table}.csf-field:after{clear:both}.csf-field h4{margin-top:0}.csf-field .csf-title{position:relative;width:20%;float:left}.csf-field .csf-title h4{margin:0;color:#23282d}.csf-field .csf-fieldset{margin-left:25%}.csf-pseudo-field{padding:0 5px 0 0!important;display:inline-block}.csf-pseudo-field+.csf-pseudo-field{border:0}.csf-pseudo-field pre{display:none}.csf-field-accordion .csf-accordion-item{position:relative;margin-bottom:5px}.csf-field-accordion .csf-accordion-item h4{font-size:1em}.csf-field-accordion .csf-accordion-title{display:block;cursor:pointer;position:relative;margin:0;padding:15px;min-height:0;font-size:100%;user-select:none;border:1px solid #ccd0d4;background-color:#fafafa;box-shadow:0 1px 1px rgba(0,0,0,.04);transition:border-color .15s}.csf-field-accordion .csf-accordion-title:active,.csf-field-accordion .csf-accordion-title:focus,.csf-field-accordion .csf-accordion-title:hover{outline:0;border-color:#999}.csf-field-accordion .csf-accordion-icon{width:14px;text-align:center}.csf-field-accordion .csf--icon{width:20px;text-align:center}.csf-field-accordion .csf-accordion-content{display:none;padding:0;border:1px solid #ccd0d4;border-top:none;background-color:#fff;box-shadow:0 1px 1px rgba(0,0,0,.04)}.csf-field-accordion .csf-accordion-content>.csf-field{padding:15px}.csf-field-accordion .csf-accordion-open{display:block}.csf-field-background .csf-field{border:0!important;padding:0;margin-bottom:6px;margin-right:6px}.csf-field-background .csf--title{color:#777;font-size:12px}.csf-field-background .csf--background-colors{display:flex}.csf-field-background .csf--background-attributes{display:flex;flex-wrap:wrap}.csf-field-background .csf--background-attributes select{min-width:100%;margin:0}.csf-field-background .csf--background-attributes .csf-field{flex:1}.csf-field-background .csf--attributes-hidden{display:none}.csf-field-background .wp-color-result.button{margin-bottom:0}.csf-field-backup textarea{width:100%;min-height:200px;margin-bottom:5px}.csf-field-backup small{display:inline-block;margin:5px}.csf-field-backup hr{margin:20px 0;border:none;border-bottom:1px solid #e5e5e5}.csf-field-border .csf--inputs,.csf-field-dimensions .csf--inputs,.csf-field-spacing .csf--inputs{float:left;display:flex;flex-wrap:wrap}.csf-field-border .csf--input,.csf-field-dimensions .csf--input,.csf-field-spacing .csf--input{display:flex;padding-right:6px;padding-bottom:4px;box-sizing:border-box}.csf-field-border .csf--input select,.csf-field-dimensions .csf--input select,.csf-field-spacing .csf--input select{margin:0}.csf-field-border .csf--input input,.csf-field-dimensions .csf--input input,.csf-field-spacing .csf--input input{position:relative;z-index:1;margin:0;width:65px;max-width:100%;text-align:center}.csf-field-border .csf--color,.csf-field-dimensions .csf--color,.csf-field-spacing .csf--color{float:left}.csf-field-border .csf--label,.csf-field-dimensions .csf--label,.csf-field-spacing .csf--label{display:flex;flex-direction:column;justify-content:center;user-select:none;min-width:20px;max-width:100%;padding:0 4px;font-size:12px;text-align:center;color:#555;border:1px solid #7b776c;background-color:#f5f5f5}.csf-field-border .csf--icon,.csf-field-dimensions .csf--icon,.csf-field-spacing .csf--icon{border-right:0;border-radius:4px 0 0 4px}.csf-field-border .csf--icon+input,.csf-field-dimensions .csf--icon+input,.csf-field-spacing .csf--icon+input{border-top-left-radius:0;border-bottom-left-radius:0}.csf-field-border .csf--unit,.csf-field-dimensions .csf--unit,.csf-field-spacing .csf--unit{border-left:0;border-radius:0 4px 4px 0}.csf-field-border .csf--is-unit,.csf-field-dimensions .csf--is-unit,.csf-field-spacing .csf--is-unit{border-top-right-radius:0;border-bottom-right-radius:0}.csf-field-button_set .csf--buttons{display:inline-block}.csf-field-button_set .csf--button{position:relative;z-index:1;float:left;cursor:pointer;padding:7px 14px;min-width:40px;text-align:center;color:#555;border:1px solid #ccc;background-color:#f7f7f7;user-select:none;-webkit-user-select:none;box-shadow:0 1px 0 rgba(0,0,0,.1)}.csf-field-button_set .csf--button:first-child{border-radius:4px 0 0 4px}.csf-field-button_set .csf--button:last-child{border-radius:0 4px 4px 0}.csf-field-button_set .csf--button:not(:first-child){margin-left:-1px}.csf-field-button_set .csf--button:hover{background-color:#eee}.csf-field-button_set .csf--active,.csf-field-button_set .csf--active:hover{z-index:2;color:#fff;border-color:#006799;background-color:#0085ba}.csf-field-button_set input{display:none}.csf-field-checkbox ul,.csf-field-radio ul{margin:0;padding:0 1px;list-style-type:none;overflow-y:auto;max-height:305px}.csf-field-checkbox ul ul,.csf-field-radio ul ul{max-height:none}.csf-field-checkbox .csf--inline-list li,.csf-field-radio .csf--inline-list li{display:inline-block;margin-right:15px}.csf-field-checkbox input[type=radio]:checked:before,.csf-field-radio input[type=radio]:checked:before{line-height:10px}.csf-field-checkbox .csf-checker,.csf-field-radio .csf-checker{cursor:pointer}.csf-field-code_editor .CodeMirror{width:100%;height:400px}.csf-field-code_editor .cm-s-default{border:1px solid #ccd0d4}.csf-field-code_editor textarea{width:100%;height:400px}.csf-field-color>input{opacity:.75;width:115px;max-width:100%}.csf-field-color .button.wp-picker-clear{margin-left:6px;padding:2px 8px}.csf-field-color_group .csf--left{float:left;margin-right:10px;margin-bottom:5px}.csf-field-color_group .csf--title{color:#999;margin-bottom:5px}.csf-field-fieldset .csf-fieldset-content{border:1px solid #ccd0d4;background-color:#fff;box-shadow:0 1px 1px rgba(0,0,0,.04)}.csf-field-fieldset .csf-fieldset-content>.csf-field{padding:15px}.csf-field-fieldset .csf-field-subheading{font-size:13px}.csf-field-date input{margin:0}.csf-field-date .csf--to{margin-left:7px}.csf-datepicker-wrapper{margin-top:5px;width:auto;background-color:#fff;z-index:9999999!important;-moz-box-shadow:0 0 30px rgba(0,0,0,.15);-webkit-box-shadow:0 0 30px rgba(0,0,0,.15);box-shadow:0 0 30px rgba(0,0,0,.15)}.csf-datepicker-wrapper *{float:none;margin:0;padding:0;font-family:inherit;font-weight:400;font-style:normal;text-decoration:none;border:0;border-radius:0;box-shadow:none}.csf-datepicker-wrapper .ui-datepicker-header,.csf-datepicker-wrapper .ui-widget-header{color:#fff;background:#00a0d2}.csf-datepicker-wrapper .ui-datepicker-header .ui-state-hover{cursor:pointer}.csf-datepicker-wrapper .ui-datepicker-title{font-size:14px;line-height:40px;text-align:center}.csf-datepicker-wrapper .ui-datepicker-next,.csf-datepicker-wrapper .ui-datepicker-prev{position:static;top:auto;left:auto;right:auto;font-family:FontAwesome;font-size:12px;text-align:center;width:41px;height:40px;line-height:40px;color:#fff;background-color:rgba(255,255,255,.1);text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.csf-datepicker-wrapper .ui-datepicker-next span,.csf-datepicker-wrapper .ui-datepicker-prev span{display:none}.csf-datepicker-wrapper .ui-datepicker-prev{float:left}.csf-datepicker-wrapper .ui-datepicker-next{float:right}.csf-datepicker-wrapper .ui-datepicker-prev:before{content:'\f053'}.csf-datepicker-wrapper .ui-datepicker-next:before{content:'\f054'}.csf-datepicker-wrapper .ui-datepicker-next-hover,.csf-datepicker-wrapper .ui-datepicker-prev-hover{opacity:.75}.csf-datepicker-wrapper tbody .ui-datepicker-week-col{background-color:#f7f7f7}.csf-datepicker-wrapper .ui-datepicker-buttonpane{padding:10px;text-align:center;background-color:#f7f7f7}.csf-datepicker-wrapper .ui-datepicker-buttonpane button{cursor:pointer;margin:0 5px;padding:7px 14px;border:1px solid #eee;background-color:#fff}.csf-datepicker-wrapper select{margin:0 4px}.csf-datepicker-wrapper select option{color:#555}.csf-datepicker-wrapper table{font-size:13px;border-collapse:collapse;width:100%}.csf-datepicker-wrapper thead{color:#fff;background:#32373c}.csf-datepicker-wrapper th{text-align:center;padding:7px;border:1px solid #444}.csf-datepicker-wrapper td{text-align:center;border:1px solid #f4f4f4}.csf-datepicker-wrapper td.ui-datepicker-other-month{border:transparent}.csf-datepicker-wrapper td .ui-state-default{color:#555;width:auto;display:block;padding:6px 12px}.csf-datepicker-wrapper td .ui-state-active,.csf-datepicker-wrapper td .ui-state-hover{color:#fff;background-color:#0073aa}.csf-datepicker-wrapper td.ui-state-disabled .ui-state-default{opacity:.5}.csf-field-gallery input{display:none}.csf-field-gallery ul{margin:0;padding:0;list-style-type:none}.csf-field-gallery ul li{display:inline-block;position:relative;padding:4px;margin:0 5px 10px 0;border:1px solid #ccc;background-color:#f9f9f9;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;-moz-box-shadow:0 1px 0 rgba(0,0,0,.08);-webkit-box-shadow:0 1px 0 rgba(0,0,0,.08);box-shadow:0 1px 0 rgba(0,0,0,.08)}.csf-field-gallery ul li img{max-height:60px;display:inline-block;vertical-align:middle}.csf-field-gallery .button{margin-right:5px;margin-bottom:5px}.csf-field-group .csf-cloneable-hidden{display:none!important}.csf-field-group .csf-cloneable-wrapper{position:relative}.csf-field-group .csf-cloneable-item{display:none;position:relative;margin-bottom:5px}.csf-field-group .csf-cloneable-item h4{font-size:1em}.csf-field-group .ui-accordion .csf-cloneable-item{display:block}.csf-field-group .csf-cloneable-content{border:1px solid #ccd0d4;background-color:#fff;box-shadow:0 1px 1px rgba(0,0,0,.04)}.csf-field-group .csf-cloneable-content>.csf-field{padding:15px}.csf-field-group .csf-cloneable-title{display:block;cursor:pointer;position:relative;user-select:none;margin:0;padding:15px 65px 15px 10px;min-height:0;font-size:100%;border:1px solid #ccd0d4;background-color:#fafafa;box-shadow:0 1px 1px rgba(0,0,0,.04);transition:border-color .15s}.csf-field-group .csf-cloneable-title:active,.csf-field-group .csf-cloneable-title:focus,.csf-field-group .csf-cloneable-title:hover{border-color:#999;outline:0}.csf-field-group .csf-cloneable-helper{position:absolute;top:12px;right:10px;z-index:1;font-size:14px;line-height:1em}.csf-field-group .csf-cloneable-helper i{display:inline-block;cursor:pointer;padding:5px;color:#999}.csf-field-group .csf-cloneable-helper i:hover{color:#555}.csf-field-group .csf-cloneable-content{padding:0;border-top:0}.csf-field-group .csf-cloneable-title-number,.csf-field-group .csf-cloneable-title-prefix{margin-right:5px}.csf-field-group .csf-cloneable-alert{display:none;margin-bottom:5px;padding:10px 20px;color:#a94442;border:1px solid #ebccd1;background-color:#f2dede}.csf-field-group .widget-placeholder{margin-bottom:10px;border:1px dashed #f1c40f;background-color:#fffae4}.csf-field-group .csf-cloneable-header-icon{display:inline-block;text-align:center;font-size:14px;width:17px;text-indent:0;vertical-align:text-top}.csf-field-group .csf-cloneable-placeholder{background-color:#ddd;margin-top:4px;width:100px;height:10px;font-size:10px;line-height:10px;display:inline-block;vertical-align:top;border-radius:2px}.csf-field-icon input{display:none}.csf-field-icon .button{margin-right:5px}.csf-field-icon .csf-icon-preview i{display:inline-block;font-size:14px;width:30px;height:26px;line-height:26px;margin-right:5px;text-align:center;vertical-align:top;color:#555;border:1px solid #ccc;background-color:#f7f7f7;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;-moz-box-shadow:0 1px 0 rgba(0,0,0,.08);-webkit-box-shadow:0 1px 0 rgba(0,0,0,.08);box-shadow:0 1px 0 rgba(0,0,0,.08);-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}.csf-field-image_select .csf--image{cursor:pointer;position:relative;display:inline-block;max-width:100%;margin:0 5px 5px 0;vertical-align:bottom;border:2px solid transparent;background-color:#fff;user-select:none;-webkit-user-select:none;-moz-transition:all .2s;-o-transition:all .2s;-webkit-transition:all .2s;transition:all .2s}.csf-field-image_select .csf--image:before{position:absolute;top:0;left:0;text-align:center;font-size:11px;font-family:FontAwesome;content:"\f00c";width:15px;height:15px;line-height:15px;opacity:0;color:#fff;background-color:#222;transition:opacity .2s}.csf-field-image_select .csf--active{border-color:#222;box-shadow:0 0 20px rgba(0,0,0,.2)}.csf-field-image_select .csf--active:before{opacity:1}.csf-field-image_select img{vertical-align:top}.csf-field-image_select input{display:none}.csf-field-link_color .csf--left{float:left;margin-right:10px;margin-bottom:5px}.csf-field-link_color .csf--title{color:#777;margin-bottom:5px}.csf-field-map input{width:100%}.csf-field-map input[type=text].ui-autocomplete-loading{background-position-x:calc(100% - 5px)}.csf-field-map .csf--map-search+.csf--map-osm-wrap{margin-top:10px}.csf-field-map .csf--map-osm-wrap{position:relative;padding:5px;border:1px solid #eee;background-color:#fff;box-shadow:0 1px 1px rgba(0,0,0,.04)}.csf-field-map .csf--map-osm{position:relative;z-index:1;min-height:250px}.csf-field-map .csf--map-inputs{margin-top:10px;display:flex;justify-content:space-between}.csf-field-map .csf--map-input{flex:1}.csf-field-map .csf--map-input:last-child{padding-left:10px}.csf-field-map label{display:block;color:#777;font-size:12px;margin:0 0 2px 0}.csf-map-ui-autocomplate{z-index:999999;border-radius:4px;overflow:hidden}.csf-field-media .csf--placeholder{display:flex}.csf-field-media .csf--placeholder input{width:100%;margin:0}.csf-field-media .button{margin-left:5px}.csf-field-media .hidden+.button{margin-left:0}.csf-field-media .csf--preview{position:relative}.csf-field-media .csf--preview .fa-times{position:absolute;z-index:1;right:4px;top:4px;font-size:14px;width:22px;height:22px;line-height:22px;text-align:center;text-decoration:none;color:#fff;background-color:#d33;opacity:.8;transition:all .2s}.csf-field-media .csf--preview .fa-times:hover{opacity:1}.csf-field-media .csf--preview .fa-times:focus{box-shadow:none}.csf-field-palette .csf--palette{position:relative;display:inline-block;cursor:pointer;border:2px solid #ddd;margin-right:10px;margin-bottom:10px;user-select:none;-webkit-user-select:none;transition:all .2s}.csf-field-palette .csf--palette span{vertical-align:middle;display:inline-block;width:22px;height:60px;line-height:60px;overflow:hidden;text-indent:-999px}.csf-field-palette .csf--palette:before{position:absolute;top:0;left:0;text-align:center;font-size:11px;font-family:FontAwesome;content:"\f00c";width:15px;height:15px;line-height:15px;opacity:0;color:#fff;background-color:#222;transition:opacity .2s}.csf-field-palette .csf--active{border-color:#222;box-shadow:0 0 20px rgba(0,0,0,.2)}.csf-field-palette .csf--active:before{opacity:1}.csf-field-palette input{display:none}.csf-field-repeater .csf-field-text input{width:100%}.csf-field-repeater .csf-repeater-hidden{display:none!important}.csf-field-repeater .csf-repeater-wrapper .csf-repeater-item{display:table;width:100%;margin-bottom:5px;border:1px solid #eee}.csf-field-repeater .csf-repeater-wrapper .csf-repeater-item h4{font-size:1em}.csf-field-repeater .csf-repeater-content{width:100%;display:table-cell;vertical-align:middle;background-color:#fff}.csf-field-repeater .csf-repeater-content>.csf-field{padding:15px}.csf-field-repeater .csf-repeater-helper{width:100%;display:table-cell;vertical-align:middle;text-align:center;font-size:14px;line-height:1em;border-left:1px solid #eee;background-color:#f7f7f7}.csf-field-repeater .csf-repeater-helper i{display:inline-block;cursor:pointer;color:#999;padding:5px}.csf-field-repeater .csf-repeater-helper i:hover{color:#555}.csf-field-repeater .csf-repeater-helper-inner{width:75px}.csf-field-repeater .csf-repeater-alert{display:none;margin-bottom:5px;padding:10px 20px;color:#a94442;border:1px solid #ebccd1;background-color:#f2dede}.csf-field-repeater .widget-placeholder{height:50px;margin-bottom:3px;border:1px dashed #f1c40f;background-color:#fffae4}.csf-field-repeater .ui-sortable-helper{height:50px!important;overflow:hidden!important;border-color:#ccc!important;background-color:#eee!important;opacity:.5}.csf-field-repeater .ui-sortable-helper .csf-repeater-content,.csf-field-repeater .ui-sortable-helper .csf-repeater-helper{display:none}.csf-field-select .csf-fieldset{min-height:30px}.csf-field-select .csf-chosen{display:none}.csf-field-select select{max-width:100%;margin:0}.csf-field-slider .csf--wrap{display:flex;align-items:center}.csf-field-slider .csf--input{display:flex}.csf-field-slider .csf--unit{display:flex;justify-content:center;flex-direction:column;user-select:none;padding:0 6px;font-size:11px;line-height:1;border-radius:0 4px 4px 0;color:#555;border:1px solid #7e8993;border-left:0;background-color:#f5f5f5}.csf-field-slider input[type=number]{position:relative;z-index:1;width:50px;margin:0 0 0 15px;text-align:center}.csf-field-slider .csf--is-unit{border-top-right-radius:0;border-bottom-right-radius:0}.csf-field-slider .ui-slider{position:relative;width:100%;height:3px;border:none;background:#ddd;border-radius:2px}.csf-field-slider .ui-slider-range{height:3px;border:none;background:#333;border-radius:2px}.csf-field-slider .ui-slider-handle{position:absolute;width:16px;height:16px;top:-7px;margin-left:-8px;border:none;background:#333;border-radius:2px}.csf-field-slider .ui-slider-handle:hover,.csf-field-slider .ui-state-active{cursor:pointer;background:#111}.csf-field-sortable .csf-field-text input{width:100%;max-width:100%}.csf-field-sortable .csf--sortable .csf--sortable-item{display:table;width:100%;margin-bottom:5px;border:1px solid #eee}.csf-field-sortable .csf--sortable .csf--sortable-item h4{font-size:1em}.csf-field-sortable .csf--sortable-content{width:100%;display:table-cell;vertical-align:middle;background-color:#fff}.csf-field-sortable .csf--sortable-content>.csf-field{padding:15px}.csf-field-sortable .csf--sortable-helper{width:100%;display:table-cell;vertical-align:middle;text-align:center;font-size:14px;line-height:1em;border-left:1px solid #eee;background-color:#f7f7f7}.csf-field-sortable .csf--sortable-helper .fa{display:inline-block;cursor:pointer;width:50px;color:#555}.csf-field-sortable .csf--sortable-helper .fa:hover{opacity:.5}.csf-field-sortable .widget-placeholder{height:50px;margin-bottom:3px;border:1px dashed #f1c40f;background-color:#fffae4}.csf-field-sortable .ui-sortable-helper{height:50px!important;overflow:hidden!important;border-color:#ccc!important;background-color:#eee!important;opacity:.5}.csf-field-sortable .ui-sortable-helper .csf--sortable-content,.csf-field-sortable .ui-sortable-helper .csf--sortable-helper{display:none}.csf-field-sorter .ui-sortable-placeholder{height:20px;border:1px dashed #f1c40f;background-color:#fffae4}.csf-field-sorter .csf-modules{float:left;width:50%;box-sizing:border-box}.csf-field-sorter .csf-modules:first-child{padding-right:15px}.csf-field-sorter .csf-modules:last-child{padding-left:15px}.csf-field-sorter .csf-disabled,.csf-field-sorter .csf-enabled{padding:5px 15px;border:1px dashed #ddd;background-color:#fff}.csf-field-sorter .csf-disabled li{-moz-transition:opacity .15s;-o-transition:opacity .15s;-webkit-transition:opacity .15s;transition:opacity .15s;opacity:.5}.csf-field-sorter .csf-disabled .ui-sortable-helper{opacity:1}.csf-field-sorter .csf-sorter-title{font-size:13px;font-weight:600;padding:10px;text-align:center;border:1px dashed #ddd;border-bottom:none;background-color:#f8f8f8;text-transform:uppercase}.csf-field-sorter ul{list-style-type:none;margin:0;padding:0;min-height:62px}.csf-field-sorter ul li{margin:10px 0;padding:10px 15px;cursor:move;font-weight:700;text-align:center;border:1px solid #e5e5e5;background-color:#fafafa;-moz-transition:border-color .15s;-o-transition:border-color .15s;-webkit-transition:border-color .15s;transition:border-color .15s}.csf-field-sorter ul li:hover{border-color:#bbb}.csf-field-spinner .csf--spin{display:flex}.csf-field-spinner .ui-spinner{display:flex}.csf-field-spinner .ui-button-text-only{display:flex;flex-direction:column;justify-content:center;text-align:center;min-width:20px;padding:0 4px;color:#555;border:1px solid #7e8993;background-color:#f5f5f5}.csf-field-spinner .ui-button{cursor:pointer}.csf-field-spinner .ui-button:hover{background-color:#e7e7e7}.csf-field-spinner .ui-button:active{background-color:#ddd}.csf-field-spinner .ui-button:before{font-family:FontAwesome;font-size:14px}.csf-field-spinner .ui-spinner-down{order:1;border-right:0;border-radius:4px 0 0 4px}.csf-field-spinner .ui-spinner-down:before{content:"\f0d9"}.csf-field-spinner .ui-spinner-input{order:2}.csf-field-spinner .csf--unit{order:3;border-left:0;user-select:none}.csf-field-spinner .ui-spinner-up{order:4;border-left:0;border-radius:0 4px 4px 0}.csf-field-spinner .ui-spinner-up:before{content:"\f0da"}.csf-field-spinner input{position:relative;z-index:1;width:50px;text-align:center;margin:0;padding:0 8px;border-radius:0}.csf-field-spinner .ui-button-text{display:none}.csf-field-switcher .csf--switcher{float:left;cursor:pointer;position:relative;width:60px;height:26px;padding:0;margin:0;overflow:hidden;border-radius:4px;background-color:#ed6f6f;user-select:none;-webkit-user-select:none}.csf-field-switcher .csf--ball{position:absolute;top:4px;left:4px;width:24px;height:18px;background-color:#fff;border-radius:4px;transition:all .1s;box-shadow:1px 1px 1px rgba(0,0,0,.15)}.csf-field-switcher .csf--off,.csf-field-switcher .csf--on{position:absolute;top:0;left:0;right:0;font-size:11px;line-height:26px;font-weight:500;font-style:normal;text-align:center;text-transform:uppercase;color:#fff;padding-right:28px;opacity:0;transition:all .1s}.csf-field-switcher .csf--off{padding-right:0;padding-left:28px;opacity:1}.csf-field-switcher .csf--active{background:#4fb845}.csf-field-switcher .csf--active .csf--on{opacity:1}.csf-field-switcher .csf--active .csf--off{opacity:0}.csf-field-switcher .csf--active .csf--ball{left:100%;margin-left:-28px}.csf-field-switcher .csf--label{float:left;margin-top:4px;margin-left:8px;font-weight:400;color:#999}.csf-field-switcher input{display:none}.csf-field-tabbed .csf-tabbed-section{border:1px solid #ccd0d4;background-color:#fff;box-shadow:0 1px 1px rgba(0,0,0,.04)}.csf-field-tabbed .csf-tabbed-section>.csf-field{padding:15px}.csf-field-tabbed .csf-tabbed-nav .csf--icon{padding-right:5px}.csf-field-tabbed .csf-tabbed-nav a{display:inline-block;padding:12px 15px;margin-top:1px;margin-right:5px;margin-bottom:-1px;position:relative;text-decoration:none;color:#444;font-weight:600;border:1px solid #ccd0d4;background-color:#f3f3f3;transition:all .2s}.csf-field-tabbed .csf-tabbed-nav a:hover{background-color:#f9f9f9}.csf-field-tabbed .csf-tabbed-nav a.csf-tabbed-active{background-color:#fff;border-bottom-color:#fff}.csf-field-tabbed .csf-tabbed-nav a:focus{outline:0;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.csf-field-text input{width:50%;max-width:100%;margin:0}.csf-field-textarea textarea{width:100%;max-width:100%;min-height:125px}.csf-field-textarea .csf-shortcode-button{margin-bottom:10px;margin-right:5px}.csf-field-typography select,.csf-field-typography textarea{min-width:100%;margin:0}.csf-field-typography .csf--title{color:#777;margin:0 0 2px 0;font-size:12px}.csf-field-typography .csf--title small{vertical-align:top}.csf-field-typography .csf--blocks{display:flex;flex-wrap:wrap}.csf-field-typography .csf--block{flex:1;padding-right:6px;padding-bottom:6px}.csf-field-typography .csf--input{margin:0;min-width:100%}.csf-field-typography .csf--input-wrap{position:relative}.csf-field-typography .csf--unit{position:absolute;z-index:1;right:4px;top:4px;bottom:4px;padding:2px 6px;color:#666;font-size:11px;line-height:1;border-radius:2px;background:#eee;user-select:none;display:flex;justify-content:center;flex-direction:column}.csf-field-typography .csf--preview{font-size:16px;line-height:20px;padding:20px;color:#222;border:1px solid #eee;background-color:#fff;border-radius:2.5px;user-select:none;-webkit-user-select:none;transition:background-color .2s,border-color .2s}.csf-field-typography .csf--block-preview{cursor:pointer;position:relative;overflow:hidden;margin-top:10px;max-width:100%}.csf-field-typography .csf--black-background{border-color:#000;background-color:#000}.csf-field-typography .csf--toggle{position:absolute;top:5px;right:10px;color:#999}.csf-field-typography .csf--block-extra-styles{margin-top:5px}.csf-field-upload input{width:100%;margin:0}.csf-field-upload .csf--wrap{display:flex}.csf-field-upload .button{margin-left:5px}.csf-field-wp_editor .csf-wp-editor{float:left;width:100%}.csf-field-wp_editor .mce-toolbar-grp{border:none}.csf-field-wp_editor .mce-btn.mce-active button,.csf-field-wp_editor .mce-btn.mce-active i,.csf-field-wp_editor .mce-btn.mce-active:hover button,.csf-field-wp_editor .mce-btn.mce-active:hover i{color:#23282d}.csf-field-wp_editor .wp-media-buttons{position:relative;z-index:2}.csf-field-wp_editor .wp-editor-tabs{position:relative;z-index:1}.csf-field-wp_editor .csf-no-tinymce{border:1px solid #e5e5e5}.csf-field-wp_editor .csf-no-quicktags .wp-media-buttons{float:none;display:block}.csf-field-wp_editor .csf-no-quicktags .mce-tinymce{box-shadow:none;border:1px solid #e5e5e5}.csf-field-wp_editor textarea{width:100%;max-width:100%;margin:0;box-shadow:none}.csf-field-heading{font-size:1.5em;font-weight:700;color:#23282d;background-color:#f5f5f5}.csf-field-subheading{font-size:14px;font-weight:700;padding-top:17px;padding-bottom:17px;color:#23282d;background-color:#f7f7f7}.csf-field-submessage{padding:0!important;border:0!important}.csf-field-submessage+.csf-field{border-top:0!important}.csf-submessage{font-size:12px;padding:17px 30px;border-top:1px solid transparent;border-bottom:1px solid transparent}.csf-submessage-success{color:#3c763d;border-color:#d6e9c6;background-color:#dff0d8}.csf-submessage-info{color:#31708f;border-color:#bce8f1;background-color:#d9edf7}.csf-submessage-warning{color:#8a6d3b;border-color:#faebcc;background-color:#fcf8e3}.csf-submessage-danger{color:#a94442;border-color:#ebccd1;background-color:#f2dede}.csf-submessage-normal{color:#23282d;border-color:#eee;background-color:#f7f7f7}.csf-field-notice{background-color:#f7f7f7}.csf-notice{padding:12px;background-color:#fff;border-left-style:solid;border-left-width:4px;box-shadow:0 1px 1px rgba(0,0,0,.1)}.csf-notice-success{border-color:#46b450}.csf-notice-info{border-color:#339fd4}.csf-notice-warning{border-color:#ffbc00}.csf-notice-danger{border-color:#dc3232}.csf-notice-normal{border-color:#222}.csf-field-number input{width:100%;margin:0}.csf-field-number .csf--wrap{position:relative;float:left;width:100px}.csf-field-number .csf--unit{position:absolute;z-index:1;right:4px;top:4px;bottom:4px;padding:2px 6px;color:#666;font-size:11px;line-height:1;border-radius:2px;background:#eee;user-select:none;display:flex;justify-content:center;flex-direction:column}.csf-help{cursor:help;position:absolute;top:0;right:0;padding:5px;font-size:14px;color:#aaa}.csf-help .csf-help-text{display:none}.csf-image-preview{display:inline-block;position:relative;padding:4px;min-width:44px;min-height:22px;margin-bottom:10px;border:1px solid #ccc;background-color:#f9f9f9;-moz-box-shadow:0 1px 0 rgba(0,0,0,.08);-webkit-box-shadow:0 1px 0 rgba(0,0,0,.08);box-shadow:0 1px 0 rgba(0,0,0,.08)}.csf-image-preview img{max-height:90px;display:inline-block;vertical-align:middle}.csf-field-custom .csf-field{padding:0}.csf-field .chosen-container-single .chosen-single{height:28px;line-height:26px}.csf-field .chosen-container-single .chosen-single abbr{top:0;right:20px;font-family:FontAwesome;font-size:12px;height:100%;width:18px;color:#aaa;text-align:center;background:0 0}.csf-field .chosen-container-single .chosen-single abbr:before{content:"\f00d"}.csf-field .chosen-container-single .chosen-single abbr:hover{color:#555}.csf-field .chosen-container-multi .chosen-choices li.search-choice .search-choice-close{font-family:FontAwesome;font-size:12px;height:100%;width:18px;color:#aaa;text-align:center;background:0 0}.csf-field .chosen-container-multi .chosen-choices li.search-choice .search-choice-close:before{content:"\f00d";display:inline-block;padding-top:3px}.csf-field .chosen-container-multi .chosen-choices li.search-choice .search-choice-close:hover{color:#555}.csf-field .chosen-container-single .chosen-single div b{font-family:FontAwesome;font-size:14px;color:#aaa;background:0 0}.csf-field .chosen-container-single .chosen-single div b:before{content:"\f107"}.csf-field .chosen-container-single .chosen-single div b:hover{color:#555}.csf-field .chosen-container-multi .chosen-choices li.search-choice-placeholder{border:1px dashed #aaa;margin:3px 5px 3px 0}.csf-field .chosen-container-multi .ui-sortable li.search-choice span{cursor:move}.csf-field .chosen-container-active.chosen-with-drop .chosen-single div b:before{content:"\f106"}.csf-field .chosen-container-single .chosen-single-with-deselect span{margin-right:40px}.csf-field .chosen-container-single .chosen-search input[type=text]{background:0 0}.csf-field .chosen-container-single .chosen-search:before{font-family:FontAwesome;position:absolute;content:"\f002";font-size:11px;right:10px;top:7px;color:#aaa}.csf-field .wp-picker-container{display:inline-block}.csf-field .csf--transparent-wrap{display:none;position:relative;top:-1px;width:235px;padding:9px 10px;border:1px solid #dfdfdf;border-top:none;background-color:#fff}.csf-field .wp-picker-active .csf--transparent-wrap{display:block}.csf-field .csf--transparent-slider{position:absolute;width:190px;margin-left:2px;height:18px}.csf-field .csf--transparent-slider .ui-slider-handle{position:absolute;top:-3px;bottom:-3px;z-index:5;border-color:#aaa;border-style:solid;border-width:4px 3px;width:10px;height:16px;margin:0 -5px;background:0 0;cursor:ew-resize;opacity:.9;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;-moz-box-shadow:0 1px 2px rgba(0,0,0,.2);-webkit-box-shadow:0 1px 2px rgba(0,0,0,.2);box-shadow:0 1px 2px rgba(0,0,0,.2)}.csf-field .csf--transparent-slider .ui-slider-handle:before{content:" ";position:absolute;left:-2px;right:-2px;top:-3px;bottom:-3px;border:2px solid #fff;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px}.csf-field .csf--transparent-offset{height:18px;width:200px;background:url(../images/checkerboard.png) repeat-y center left scroll #fff;-moz-box-shadow:0 0 5px rgba(0,0,0,.4) inset;-webkit-box-shadow:0 0 5px rgba(0,0,0,.4) inset;box-shadow:0 0 5px rgba(0,0,0,.4) inset;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px}.csf-field .csf--transparent-text{position:absolute;top:12px;right:10px;width:30px;font-size:12px;line-height:12px;text-align:center;color:#999}.csf-field .csf--transparent-button{cursor:pointer;user-select:none;margin-top:10px;font-size:11px;text-align:center;border-radius:2px;padding:3px 7px;box-shadow:0 1px 0 rgba(0,0,0,.1);letter-spacing:.2px;color:#777;border:1px solid #ccc;background-color:#f7f7f7;transition:background-color .2s,border-color .2s,color .2s}.csf-field .csf--transparent-active .wp-color-result{background-image:url(../images/checkerboard.png);background-size:135px;background-position:center left;background-color:transparent!important}.csf-field .csf--transparent-active .csf--transparent-button{color:#fff;border-color:#3ea032;background-color:#4fb845}.csf-field .csf--transparent-active .fa:before{content:"\f205"}.csf-widgets>.csf-field{position:relative;top:-1px;margin-right:-15px;margin-left:-15px;padding:12px 15px}.csf-widgets>.csf-field .csf-field{margin-left:0;margin-right:0}.csf-widgets>.csf-field .csf-title{float:none;width:100%;margin-bottom:5px}.csf-widgets>.csf-field .csf-fieldset{margin-left:0}.csf-widgets .csf-field-text input{width:100%}.csf-widgets .csf-field-notice .csf-notice{padding:15px}.control-section .csf-widgets>.csf-field{margin-right:-10px;margin-left:-10px;padding:10px 12px}.control-section .csf-field{padding:0}.control-section .csf-field .csf-title{float:none;width:100%;margin-bottom:6px}.control-section .csf-field .csf-title h4{display:block;font-size:13px;line-height:1;font-weight:600;color:inherit}.control-section .csf-field .csf-fieldset{margin-left:0}.control-section .csf-help{top:-5px;right:-5px}.control-section .csf-field-select select{width:100%}.control-section .csf-field-heading{color:inherit;font-size:14px;line-height:1em;margin-right:-15px;margin-left:-15px;padding:15px}.control-section .csf-field-subheading{color:inherit;font-size:11px;margin-right:-15px;margin-left:-15px;padding:10px 15px}.control-section .csf-text-subtitle{margin-top:4px;font-size:12px}.control-section .csf-field-submessage .csf-submessage{margin-right:-15px;margin-left:-15px;padding:15px}.control-section .csf-fieldset .csf-field-heading,.control-section .csf-fieldset .csf-field-subheading,.control-section .csf-fieldset .csf-field-submessage .csf-submessage{margin-left:0;margin-right:0}.control-section .csf-field-date .csf--to{margin-left:0}.control-section .csf-field-sorter ul li{padding:5px}.control-section .csf-field-sorter .csf-modules{float:none;width:100%}.control-section .csf-field-sorter .csf-modules:first-child{padding-right:0;padding-bottom:15px}.control-section .csf-field-background .csf--background-attributes{flex-direction:column}.control-section .csf-field-spacing input{width:90px}.control-section .csf-field-border .csf--input{flex:1 50%}.control-section .csf-field-border input,.control-section .csf-field-border select{width:100%}.control-section .csf-field-spinner input{width:50px}.control-section .csf-field-number .csf--wrap{width:100%}.control-section .csf-field-backup .csf-export-data{display:none}.control-section .csf-field-fieldset .csf-fieldset-content{border-color:#e5e5e5}.control-section .csf-field-fieldset .csf-field{padding:10px}.control-section .csf-field-fieldset .csf-field .csf-title{margin-bottom:5px}.control-section .csf-field-fieldset .csf-field h4{font-size:12px}.control-section .csf-field-accordion .csf-field,.control-section .csf-field-group .csf-field,.control-section .csf-field-repeater .csf-field,.control-section .csf-field-sortable .csf-field,.control-section .csf-field-tabbed .csf-field{padding:10px}.control-section .csf-field-accordion .csf-field .csf-title,.control-section .csf-field-group .csf-field .csf-title,.control-section .csf-field-repeater .csf-field .csf-title,.control-section .csf-field-sortable .csf-field .csf-title,.control-section .csf-field-tabbed .csf-field .csf-title{margin-bottom:5px}.control-section .csf-field-accordion .csf-field h4,.control-section .csf-field-group .csf-field h4,.control-section .csf-field-repeater .csf-field h4,.control-section .csf-field-sortable .csf-field h4,.control-section .csf-field-tabbed .csf-field h4{font-size:12px}.control-section .csf-dependency-control.hidden{display:none!important}.csf-taxonomy>.csf-field{border-top:none!important}.csf-taxonomy>.csf-field-heading{font-size:1.1em;padding:20px!important;border:1px solid #ddd}.csf-taxonomy>.csf-field-subheading{font-size:12px;padding:15px!important;border:1px solid #ddd}.csf-taxonomy>.csf-field-submessage .csf-submessage{padding:15px;border-left-width:1px;border-left-style:solid;border-right-width:1px;border-right-style:solid}.csf-taxonomy>.csf-field-notice{background-color:transparent}.csf-taxonomy .csf-section-title{display:block;padding:15px;background-color:#f9f9f9;border:1px solid #e5e5e5;-moz-box-shadow:0 1px 1px rgba(0,0,0,.04);-webkit-box-shadow:0 1px 1px rgba(0,0,0,.04);box-shadow:0 1px 1px rgba(0,0,0,.04)}.csf-taxonomy-add-fields>.csf-field{padding:8px 0}.csf-taxonomy-add-fields>.csf-field>.csf-title{float:none;width:100%;padding:2px 2px 4px 0}.csf-taxonomy-add-fields>.csf-field>.csf-title h4{font-size:12px;font-weight:400}.csf-taxonomy-add-fields>.csf-field>.csf-fieldset{margin-left:0}.csf-taxonomy-add-fields>.csf-field>.csf-fieldset>.csf-help{right:-5px}.csf-taxonomy-add-fields+p.submit{margin-top:0}.csf-taxonomy-edit-fields>.csf-field{padding:20px 0}.csf-taxonomy-edit-fields>.csf-field>.csf-title{width:225px}.csf-taxonomy-edit-fields>.csf-field>.csf-title h4{font-size:14px;font-weight:600;line-height:1.3;display:inline-block;vertical-align:middle}.csf-taxonomy-edit-fields>.csf-field>.csf-fieldset{margin-left:225px}.csf-taxonomy-edit-fields>.csf-field>.csf-fieldset>.csf-help{top:-5px;right:-5px}.csf-taxonomy-edit-fields>.csf-field-submessage{margin:20px 0}.csf-taxonomy-edit-fields>.csf-field-heading,.csf-taxonomy-edit-fields>.csf-field-subheading{margin:20px 0;border:1px solid #ddd}.csf-profile>h2>.fa{padding-right:7px}.csf-profile>.csf-field{padding:15px 0;border-top:none!important}.csf-profile>.csf-field>.csf-title{width:220px}.csf-profile>.csf-field>.csf-title h4{font-size:14px;font-weight:600;line-height:1.3;display:inline-block;vertical-align:middle}.csf-profile>.csf-field>.csf-fieldset{margin-left:220px}.csf-profile>.csf-field>.csf-fieldset>.csf-help{top:-15px;right:-5px}.csf-profile>.csf-field-heading{font-size:1.1em}.csf-profile>.csf-field-subheading{font-size:12px}.csf-profile>.csf-field-heading,.csf-profile>.csf-field-subheading{margin:10px 0;padding:15px!important;border:1px solid #ddd}.csf-profile>.csf-field-submessage{margin:20px 0}.csf-profile>.csf-field-submessage .csf-submessage{padding:10px;border-left-width:1px;border-left-style:solid;border-right-width:1px;border-right-style:solid}.csf-profile>.csf-field-notice{background-color:transparent}.csf-modal{display:none;position:fixed;z-index:100101;top:0;left:0;width:100%;height:100%}.csf-modal-icon{z-index:100102}.csf-modal-table{display:table;width:100%;height:100%}.csf-modal-table-cell{display:table-cell;vertical-align:middle;margin:100px 0}.csf-modal-inner{position:relative;z-index:10;width:760px;height:750px;margin:0 auto;background-color:#fff}.csf-modal-content{position:relative;overflow:hidden;overflow-y:auto;height:595px}.csf-modal-content .csf-shortcode-button{display:none}.csf-modal-content .csf-fieldset{margin-left:25%}.csf-modal-content .csf-title{width:20%}.csf-modal-content .csf-field{padding:15px 30px 15px 15px}.csf-modal-content a:active,.csf-modal-content a:focus{outline:0;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.csf-modal-content h4{font-size:13px}.csf-modal-content h4 small{font-style:italic;font-weight:400;color:#aaa}.csf-modal-title{position:relative;background-color:#fcfcfc;border-bottom:1px solid #ddd;height:36px;font-size:16px;font-weight:600;line-height:36px;margin:0;padding:0 36px 0 16px}.csf-modal-header{width:100%;padding:14px 0;background-color:#f5f5f5;border-bottom:1px solid #eee}.csf-modal-header select{display:block;width:250px;margin:0 auto;font-size:13px;line-height:1;height:30px;min-height:30px;background-color:#fff}.csf-modal-close{color:#666;padding:0;position:absolute;top:0;right:0;width:36px;height:36px;text-align:center;background:0 0;border:none;cursor:pointer}.csf-modal-close:before{font:normal 20px/36px dashicons;content:"\f158";vertical-align:top;width:36px;height:36px}.csf-modal-close:hover{opacity:.5}.csf-modal-insert-wrapper{text-align:center;width:100%;padding:15px 0;background-color:#f5f5f5;border-top:1px solid #eee}.csf-modal-overlay{position:absolute;top:0;left:0;width:100%;height:100%;background-color:#000;opacity:.5}.csf--repeatable{padding:15px 15px 0 15px}.csf--repeat-button-block{text-align:center;padding-bottom:15px}.csf--repeat-shortcode{position:relative;margin-bottom:15px;border:1px dashed #ddd}.csf--repeat-shortcode:first-child .csf-repeat-remove{display:none}.csf--repeat-shortcode .csf-repeat-remove{position:absolute;right:10px;top:10px;z-index:10;cursor:pointer;display:inline-block;font-size:11px;width:18px;height:18px;line-height:18px;text-align:center;border-radius:2px;color:#fff;background-color:#e14d43;opacity:.5}.csf--repeat-shortcode .csf-repeat-remove:hover{opacity:1}.csf-shortcode-single .csf-modal-inner{height:750px}.csf-shortcode-single .csf-modal-content{height:652px}.elementor-editor-active .csf-shortcode-button{margin-left:5px}.elementor-editor-active .csf-modal .hidden{display:none!important}.csf-shortcode-block{text-align:center;padding:14px;font-size:13px;background-color:#f5f5f5;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif}.csf-shortcode-block .button{margin:10px 0}.csf-modal-icon .csf-icon-title{padding:15px 0;margin:4px;font-size:14px;font-weight:700;text-align:center;border:1px solid #eee;background-color:#f7f7f7}.csf-modal-icon .csf-icon-search{width:250px;height:40px;line-height:40px}.csf-modal-icon a{display:inline-block;padding:4px;cursor:pointer}.csf-modal-icon a .csf-icon{position:relative;padding:4px;display:inline-block;font-size:14px;width:30px;height:26px;line-height:26px;text-align:center;vertical-align:top;color:#555;border:1px solid #ccc;background-color:#f7f7f7;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;-moz-box-shadow:0 1px 0 rgba(0,0,0,.08);-webkit-box-shadow:0 1px 0 rgba(0,0,0,.08);box-shadow:0 1px 0 rgba(0,0,0,.08);-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}.csf-modal-icon a:hover .csf-icon{color:#fff;border-color:#222;background-color:#222}.csf-modal-icon .csf-modal-content{padding:10px;height:618px}.csf-modal-icon .csf-text-error{padding:10px}.csf-modal-loading{display:none;position:absolute;left:15px;top:15px}.csf-loading{position:relative;width:20px;height:20px;background:#ccc;-moz-border-radius:20px;-webkit-border-radius:20px;border-radius:20px;-moz-box-shadow:0 2px 5px rgba(0,0,0,.07);-webkit-box-shadow:0 2px 5px rgba(0,0,0,.07);box-shadow:0 2px 5px rgba(0,0,0,.07)}.csf-loading:after{position:absolute;top:50%;left:50%;width:4px;height:4px;content:"";margin-top:-2px;margin-left:-2px;background-color:#fff;-moz-animation-duration:.5s;-webkit-animation-duration:.5s;animation-duration:.5s;-moz-animation-iteration-count:infinite;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-moz-animation-timing-function:linear;-webkit-animation-timing-function:linear;animation-timing-function:linear;-moz-animation-name:csfLoader;-webkit-animation-name:csfLoader;animation-name:csfLoader;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px}@-moz-keyframes csfLoader{0%{-moz-transform:rotate(0) translateX(-6px) rotate(0);transform:rotate(0) translateX(-6px) rotate(0)}100%{-moz-transform:rotate(360deg) translateX(-6px) rotate(-360deg);transform:rotate(360deg) translateX(-6px) rotate(-360deg)}}@-webkit-keyframes csfLoader{0%{-webkit-transform:rotate(0) translateX(-6px) rotate(0);transform:rotate(0) translateX(-6px) rotate(0)}100%{-webkit-transform:rotate(360deg) translateX(-6px) rotate(-360deg);transform:rotate(360deg) translateX(-6px) rotate(-360deg)}}@keyframes csfLoader{0%{-moz-transform:rotate(0) translateX(-6px) rotate(0);-ms-transform:rotate(0) translateX(-6px) rotate(0);-webkit-transform:rotate(0) translateX(-6px) rotate(0);transform:rotate(0) translateX(-6px) rotate(0)}100%{-moz-transform:rotate(360deg) translateX(-6px) rotate(-360deg);-ms-transform:rotate(360deg) translateX(-6px) rotate(-360deg);-webkit-transform:rotate(360deg) translateX(-6px) rotate(-360deg);transform:rotate(360deg) translateX(-6px) rotate(-360deg)}}.csf-text-desc,.csf-text-subtitle{font-weight:400;margin-top:10px;color:#999}.csf-text-success{color:#2b542c}.csf-text-error{color:#d02c21}.csf-text-info{color:#31708f}.csf-text-warning{color:#ffb900}.csf-text-muted{color:#aaa}.csf-text-left{text-align:left}.csf-text-center{text-align:center}.csf-text-right{text-align:right}.csf-block-left{float:left}.csf-block-right{float:right}.csf-full-width{width:100%}.csf-full-half{width:50%}.csf-table{width:100%;display:table}.csf-table-cell{display:table-cell;vertical-align:middle}.csf-table-expanded{width:100%}.csf-nowrap{white-space:nowrap}.csf-text-highlight{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px}.csf-text-highlight-gray{padding:2px 4px;font-size:90%;background-color:#f0f0f0;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px}.csf-hidden{display:none}.csf-hide{display:none!important}.csf-show{display:block!important}.csf-opacity{opacity:.5}.csf-warning-primary{color:#fff!important;border-color:#dc3545!important;background:#dc3545!important}.csf-warning-primary:focus,.csf-warning-primary:hover{border-color:#bd2130!important;background:#bd2130!important}.csf-warning-primary:focus{box-shadow:0 0 0 1px #fff,0 0 0 3px #bd2130!important}.csf-warning-primary:active{border-color:#bd2130!important;background:#bd2130!important}.csf-form-result{display:none;float:left;padding:0 8px;margin-right:4px;font-size:11px;line-height:28px;user-select:none;border-radius:2px}.csf-form-show{display:block}.csf-form-success{color:#fff;background-color:#46b450}.csf-form-warning{color:#8a6d3b;background-color:#faebcc}.csf-label-error{position:relative;top:-2px;display:inline-block;font-size:10px;line-height:10px;height:10px;width:10px;padding:1px;font-style:normal;text-align:center;color:#fff;vertical-align:middle;background-color:#e10000;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px}.csf-no-option{padding:30px}.csf-input-number{-moz-appearance:textfield}.csf-input-number::-webkit-inner-spin-button,.csf-input-number::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.csf-welcome-wrap{position:relative;margin:25px 40px 0 20px;font-size:15px;max-width:1200px}.csf-welcome-wrap p{font-size:14px;line-height:1.5}.csf-welcome-wrap h1{margin:.2em 200px 0 0;padding:0;color:#32373c;line-height:1.2em;font-size:2.8em;font-weight:400}.csf-welcome-wrap .csf-logo{position:absolute;overflow:hidden;top:0;right:0;height:160px;width:140px;background-image:linear-gradient(45deg,#2d67cb,#ad19f3);box-shadow:0 1px 4px rgba(0,0,0,.25),inset 0 0 0 4px rgba(0,0,0,.25)}.csf-welcome-wrap .csf-logo .csf--effects i{position:absolute;width:200px;height:100px;background-color:rgba(0,0,0,.15);transform:rotate(-45deg)}.csf-welcome-wrap .csf-logo .csf--effects i:nth-child(1){bottom:-20px;right:-70px}.csf-welcome-wrap .csf-logo .csf--effects i:nth-child(2){bottom:-35px;right:-80px}.csf-welcome-wrap .csf-logo .csf--effects i:nth-child(3){bottom:-50px;right:-90px}.csf-welcome-wrap .csf-logo .csf--effects i:nth-child(4){bottom:-65px;right:-100px}.csf-welcome-wrap .csf-logo .csf--wp-logos{position:relative;padding-top:25px;text-align:center}.csf-welcome-wrap .csf-logo .csf--wp-logo{position:absolute;left:20px;width:20px;height:20px;background-repeat:no-repeat;background-position:center center;background-image:url(../images/wp-logo.svg)}.csf-welcome-wrap .csf-logo .csf--wp-plugin-logo{display:inline-block;width:50px;height:50px;border:3px solid #fff;background-size:40px;background-repeat:no-repeat;background-position:center center;background-image:url(../images/wp-plugin-logo.svg);border-radius:100%;vertical-align:middle}.csf-welcome-wrap .csf-logo .csf--text{position:absolute;left:0;right:0;top:90px;color:#fff;font-size:13px;line-height:1.2em;font-weight:600;text-align:center;text-transform:uppercase;text-shadow:1px 1px 0 rgba(0,0,0,.25)}.csf-welcome-wrap .csf-logo .csf--version{top:auto;left:auto;right:8px;bottom:4px;font-size:11px;text-transform:lowercase}.csf-welcome-wrap .csf-about-text{font-weight:400;line-height:1.6em;font-size:19px;margin:1em 200px 1em 0;color:#555d66}.csf-welcome-wrap .csf-demo-button{margin:1em 200px 2em 0}.csf-welcome-wrap .nav-tab-wrapper{margin-bottom:20px}.csf-welcome-wrap ul{list-style-type:disc;padding-left:15px}.csf-welcome-wrap .csf--col{float:left;padding-right:20px;box-sizing:border-box}.csf-welcome-wrap .csf--col-2{width:50%}.csf-welcome-wrap .csf--col-3{width:33.333%}.csf-welcome-wrap .csf--col-4{width:25%}.csf-welcome-wrap .csf--col-5{width:20%}.csf-welcome-wrap .csf--col-last{padding-right:0}.csf-welcome-wrap .csf--col-upgrade{padding:10px 0;text-align:center;border-top:1px solid #e5e5e5}.csf--table-compare tfoot td,.csf--table-compare thead td{text-align:center}.csf--table-compare td{font-size:14px;text-align:center;vertical-align:middle;padding:10px}.csf--table-compare td:first-child{text-align:left}.csf--table-compare tfoot td{padding:15px 0}.csf--table-compare .fa{font-size:18px}.csf--table-compare .fa-check-circle{color:#46b450}.csf--table-compare .fa-times-circle{color:#dc3232}.csf-welcome-cols{clear:both;margin:20px 0;background-color:#fff;padding:0 0;border-radius:2px;border:1px solid #e5e5e5}.csf-welcome-cols .csf--col{width:25%;float:left;padding:20px;text-align:center;box-sizing:border-box;min-height:200px;border-right:1px solid #e5e5e5}.csf-welcome-cols .csf--block,.csf-welcome-cols .csf--left{float:left;width:20%;padding:0 30px;text-align:center;box-sizing:border-box}.csf-welcome-cols .csf--block{width:80%}.csf-welcome-cols .csf--col-first{border-bottom:1px solid #e5e5e5}.csf-welcome-cols .csf--last{border-right:none}.csf-welcome-cols .csf--space{height:20px}.csf-welcome-cols .csf--icon{display:inline-block;font-size:20px;width:30px;height:30px;line-height:30px;text-align:center;margin-bottom:10px;color:#fff;background-color:#555;border-radius:30px}.csf-welcome-cols .csf--active{background-color:#5cb85c}.csf-welcome-cols .csf--deactive{background-color:#e14d43}.csf-welcome-cols .csf--title{font-weight:700;display:block}.csf-welcome-cols p:last-child{margin-bottom:0}.csf-features-cols .csf--key-features{width:30%}.csf-features-cols .csf--available-fields{width:70%}.csf-code-block{margin:20px 0;padding:5px 20px;background-color:#fff;border-radius:2px;box-shadow:0 1px 1px rgba(0,0,0,.15)}.csf-code-block pre{font-size:13px;color:#0073aa}.csf-code-block pre span{color:#999}.csf--table-fields td{font-size:14px}.csf--upgrade a{color:#5cb85c;font-weight:700}.csf--upgrade a:focus,.csf--upgrade a:hover{color:#4aa14a;outline:0;box-shadow:none}@media only screen and (max-width:782px){.csf-welcome-cols .csf--col{width:100%;min-height:auto;border-right:none;border-bottom:1px solid #e5e5e5}.csf-features-cols .csf--key-features{width:100%}.csf-features-cols .csf--available-fields{width:100%}}@media only screen and (max-width:1200px){.csf-metabox .csf-field .csf-title{float:none;width:100%;margin-bottom:10px}.csf-metabox .csf-field .csf-fieldset{margin-left:0}}@media only screen and (max-width:782px){.csf-header-inner{text-align:center}.csf-header-inner h1{width:100%;margin-bottom:10px}.csf-form-result{float:none;margin-right:0;margin-bottom:10px}.csf-header-left,.csf-header-right,.csf-search{width:100%}.csf-search{text-align:center;margin-bottom:15px}.csf-footer{text-align:center}.csf-buttons{float:none}.csf-copyright{float:none;margin-top:10px}.csf-expand-all,.csf-nav,.csf-nav-background,.csf-reset-section{display:none!important}.csf-content{margin-left:0}.csf-section,.csf-section-title{display:block!important}.csf-field .csf-title{float:none;width:100%;margin-bottom:10px}.csf-field .csf-fieldset{margin-left:0}.csf-modal-inner{width:350px;height:400px}.csf-modal-content{height:237px}.csf-icon-dialog .csf-modal-inner{width:305px;height:380px}.csf-icon-dialog .csf-modal-content{height:267px}.csf-modal-icon .csf-modal-inner{width:330px;height:385px}.csf-modal-icon .csf-modal-content{height:252px}.csf-profile>.csf-field>.csf-title{float:none;width:100%;margin-bottom:10px}.csf-profile>.csf-field>.csf-fieldset{margin-left:0}}.chosen-container{position:relative;display:inline-block;vertical-align:middle;font-size:13px;user-select:none}.chosen-container *{box-sizing:border-box}.chosen-container .chosen-drop{position:absolute;top:100%;z-index:1010;width:100%;border:1px solid #aaa;border-top:0;background:#fff;box-shadow:0 4px 5px rgba(0,0,0,.15);clip:rect(0,0,0,0);clip-path:inset(100% 100%)}.chosen-container.chosen-with-drop .chosen-drop{clip:auto;clip-path:none}.chosen-container a{cursor:pointer}.chosen-container .chosen-single .group-name,.chosen-container .search-choice .group-name{margin-right:4px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-weight:400;color:#999}.chosen-container .chosen-single .group-name:after,.chosen-container .search-choice .group-name:after{content:":";padding-left:2px;vertical-align:top}.chosen-container-single .chosen-single{position:relative;display:block;overflow:hidden;padding:0 0 0 8px;height:25px;border:1px solid #aaa;border-radius:5px;background-color:#fff;background:linear-gradient(#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%);background-clip:padding-box;box-shadow:0 0 3px #fff inset,0 1px 1px rgba(0,0,0,.1);color:#444;text-decoration:none;white-space:nowrap;line-height:24px}.chosen-container-single .chosen-default{color:#999}.chosen-container-single .chosen-single span{display:block;overflow:hidden;margin-right:26px;text-overflow:ellipsis;white-space:nowrap}.chosen-container-single .chosen-single-with-deselect span{margin-right:38px}.chosen-container-single .chosen-single abbr{position:absolute;top:6px;right:26px;display:block;width:12px;height:12px;font-size:1px}.chosen-container-single .chosen-single div{position:absolute;top:0;right:0;display:block;width:18px;height:100%}.chosen-container-single .chosen-single div b{display:block;width:100%;height:100%}.chosen-container-single .chosen-search{position:relative;z-index:1010;margin:0;padding:3px 4px;white-space:nowrap}.chosen-container-single .chosen-search input[type=text]{margin:1px 0;padding:4px 20px 4px 5px;width:100%;height:auto;outline:0;border:1px solid #aaa;font-size:1em;font-family:sans-serif;line-height:normal;border-radius:0}.chosen-container-single .chosen-drop{margin-top:-1px;border-radius:0 0 4px 4px;background-clip:padding-box}.chosen-container-single.chosen-container-single-nosearch .chosen-search{position:absolute;clip:rect(0,0,0,0);clip-path:inset(100% 100%)}.chosen-container .chosen-results{color:#444;position:relative;overflow-x:hidden;overflow-y:auto;margin:0 4px 4px 0;padding:0 0 0 4px;max-height:240px;-webkit-overflow-scrolling:touch}.chosen-container .chosen-results li{display:none;margin:0;padding:5px 6px;list-style:none;line-height:15px;word-wrap:break-word;-webkit-touch-callout:none}.chosen-container .chosen-results li.active-result{display:list-item;cursor:pointer}.chosen-container .chosen-results li.disabled-result{display:list-item;color:#ccc;cursor:default}.chosen-container .chosen-results li.highlighted{background-color:#3875d7;background-image:linear-gradient(#3875d7 20%,#2a62bc 90%);color:#fff}.chosen-container .chosen-results li.no-results{color:#777;display:list-item;background:#f4f4f4}.chosen-container .chosen-results li.group-result{display:list-item;font-weight:700;cursor:default}.chosen-container .chosen-results li.group-option{padding-left:15px}.chosen-container .chosen-results li em{font-style:normal;text-decoration:underline}.chosen-container-multi .chosen-choices{position:relative;overflow:hidden;margin:0;padding:0 5px;width:100%;height:auto;border:1px solid #aaa;background-color:#fff;background-image:linear-gradient(#eee 1%,#fff 15%);cursor:text}.chosen-container-multi .chosen-choices li{float:left;list-style:none}.chosen-container-multi .chosen-choices li.search-field{margin:0;padding:0;white-space:nowrap}.chosen-container-multi .chosen-choices li.search-field input[type=text]{margin:1px 0;padding:0;outline:0;border:0!important;background:0 0!important;box-shadow:none;color:#999;font-size:100%;font-family:sans-serif;line-height:normal;border-radius:0;width:25px;height:25px;min-height:25px}.chosen-container-multi .chosen-choices li.search-choice{position:relative;margin:3px 5px 3px 0;padding:3px 20px 3px 6px;border:1px solid #aaa;max-width:100%;border-radius:3px;background-color:#eee;background-image:linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-size:100% 19px;background-repeat:repeat-x;background-clip:padding-box;box-shadow:0 0 2px #fff inset,0 1px 0 rgba(0,0,0,.05);color:#333;line-height:13px;cursor:default}.chosen-container-multi .chosen-choices li.search-choice span{word-wrap:break-word;white-space:nowrap}.chosen-container-multi .chosen-choices li.search-choice .search-choice-close{position:absolute;top:0;right:0;display:block;width:12px;height:12px;font-size:1px}.chosen-container-multi .chosen-choices li.search-choice-disabled{padding-right:5px;border:1px solid #ccc;background-color:#e4e4e4;background-image:linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);color:#666}.chosen-container-multi .chosen-choices li.search-choice-focus{background:#d4d4d4}.chosen-container-multi .chosen-results{margin:0;padding:0}.chosen-container-multi .chosen-drop .result-selected{display:list-item;color:#ccc;cursor:default}.chosen-container-active .chosen-single{border:1px solid #5897fb;box-shadow:0 0 5px rgba(0,0,0,.3)}.chosen-container-active.chosen-with-drop .chosen-single{border:1px solid #aaa;border-bottom-right-radius:0;border-bottom-left-radius:0;background-image:linear-gradient(#eee 20%,#fff 80%);box-shadow:0 1px 0 #fff inset}.chosen-container-active.chosen-with-drop .chosen-single div{border-left:none;background:0 0}.chosen-container-active .chosen-choices{border:1px solid #5897fb;box-shadow:0 0 5px rgba(0,0,0,.3)}.chosen-container-active .chosen-choices li.search-field input[type=text]{color:#222!important}.chosen-disabled{opacity:.5!important;cursor:default}.chosen-disabled .chosen-single{cursor:default}.chosen-disabled .chosen-choices .search-choice .search-choice-close{cursor:default}.chosen-rtl{text-align:right}.chosen-rtl .chosen-single{overflow:visible;padding:0 8px 0 0}.chosen-rtl .chosen-single span{margin-right:0;margin-left:26px;direction:rtl}.chosen-rtl .chosen-single-with-deselect span{margin-left:38px}.chosen-rtl .chosen-single div{right:auto;left:3px}.chosen-rtl .chosen-single abbr{right:auto;left:26px}.chosen-rtl .chosen-choices li{float:right}.chosen-rtl .chosen-choices li.search-field input[type=text]{direction:rtl}.chosen-rtl .chosen-choices li.search-choice{margin:3px 5px 3px 0;padding:3px 5px 3px 19px}.chosen-rtl .chosen-choices li.search-choice .search-choice-close{right:auto;left:4px}.chosen-rtl.chosen-container-single .chosen-results{margin:0 0 4px 4px;padding:0 4px 0 0}.chosen-rtl .chosen-results li.group-option{padding-right:15px;padding-left:0}.chosen-rtl.chosen-container-active.chosen-with-drop .chosen-single div{border-right:none}.chosen-rtl .chosen-search input[type=text]{padding:4px 5px 4px 20px;direction:rtl}
1
+ .csf{position:relative}.csf label{padding:0;margin:0;display:inline-block}.csf-ab-icon{top:2px}#screen-meta-links+.csf-options{margin-top:40px}.csf-options{margin-top:20px;margin-right:20px}.csf-header{position:relative}.csf-header-inner{padding:25px}.csf-header-inner h1{float:left;font-size:1.5em;line-height:26px;font-weight:400;margin:0}.csf-header-inner h1 small{font-size:11px;font-weight:500}.csf-sticky .csf-header-inner{position:fixed;z-index:99999;top:32px;-moz-box-shadow:0 5px 25px rgba(0,0,0,.125);-webkit-box-shadow:0 5px 25px rgba(0,0,0,.125);box-shadow:0 5px 25px rgba(0,0,0,.125)}.csf-buttons{float:right;-moz-transition:opacity .2s;-o-transition:opacity .2s;-webkit-transition:opacity .2s;transition:opacity .2s}.csf-buttons .button{margin:0 2px;line-height:26px}.csf-buttons .button:focus{outline:0!important;box-shadow:none!important}.csf-buttons .csf-save{min-width:72px}.csf-header-left{float:left}.csf-header-right{float:right}.csf-nav{display:block;position:relative;z-index:10;float:left;width:225px}.csf-nav ul{clear:left;margin:0;list-style-type:none}.csf-nav ul li{margin-bottom:0}.csf-nav ul li a{font-size:13px;position:relative;display:block;padding:14px 12px;text-decoration:none;-moz-transition:all .3s ease;-o-transition:all .3s ease;-webkit-transition:all .3s ease;transition:all .3s ease}.csf-nav ul li a:focus{outline:0;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.csf-nav ul li .csf-section-active:after{content:" ";position:absolute;right:0;top:50%;height:0;width:0;pointer-events:none;border:solid transparent;border-right-color:#fff;border-width:4px;margin-top:-4px}.csf-nav ul li .csf-arrow:after{content:"\f054";display:inline-block;font-family:"Font Awesome 5 Pro","Font Awesome 5 Free",FontAwesome;font-weight:900;font-size:9px;line-height:1;position:absolute;right:10px;top:50%;margin-top:-4px;-moz-transform:rotate(0);-ms-transform:rotate(0);-webkit-transform:rotate(0);transform:rotate(0)}.csf-nav ul li.csf-tab-active .csf-arrow:after{-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-webkit-transform:rotate(90deg);transform:rotate(90deg)}.csf-nav ul li.csf-tab-active ul{display:block}.csf-nav ul ul{display:none;position:relative}.csf-nav ul ul li a{font-size:12px;padding:12px 14px 12px 24px}.csf-nav .csf-tab-icon{width:20px;margin-right:5px;font-size:13px;text-align:center}.csf-nav .csf-label-error{margin-left:4px;vertical-align:top}.csf-nav-background{position:absolute;top:0;left:0;bottom:0;z-index:9;width:225px}.csf-wrapper{position:relative}.csf-content{position:relative;margin-left:225px;background-color:#fff;-moz-transition:opacity .2s;-o-transition:opacity .2s;-webkit-transition:opacity .2s;transition:opacity .2s}.csf-sections{float:left;width:100%}.csf-section{display:none}.csf-section-title{display:none;padding:20px 30px;background-color:#f5f5f5;border-top:1px solid #eee;border-bottom:1px solid #eee}.csf-section-title h3{margin:0;padding:0;font-size:13px;font-weight:700;text-transform:uppercase}.csf-section-title .csf-section-icon{margin-right:5px}.csf-footer{padding:20px;font-size:11px}.csf-copyright{float:left;margin-top:5px}.csf-search-all .csf-nav,.csf-search-all .csf-nav-background,.csf-show-all .csf-nav,.csf-show-all .csf-nav-background{display:none}.csf-search-all .csf-content,.csf-show-all .csf-content{margin-left:0}.csf-search-all .csf-section,.csf-search-all .csf-section-title,.csf-show-all .csf-section,.csf-show-all .csf-section-title{display:block!important}.csf-search-all .csf-section-title{display:none!important}.csf-expand-all{float:left;padding:0 8px;margin-right:4px;z-index:1;font-size:13px;line-height:30px;cursor:pointer;user-select:none;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;-moz-transition:all .2s;-o-transition:all .2s;-webkit-transition:all .2s;transition:all .2s}.csf-expand-all span{font-size:11px;vertical-align:middle}.csf-search{float:left}.csf-search input{margin:0 2px 0 0;border:none;font-size:12px;line-height:30px;min-height:30px;text-align:inherit;padding:0 10px;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.csf-search input:focus{-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.csf-saving .csf-buttons,.csf-saving .csf-content{cursor:default;pointer-events:none;opacity:.5}.csf-metabox{margin:-6px -12px -12px -12px}.csf-metabox .csf-section-title{padding:20px}.block-editor-page .csf-metabox{margin:-6px -14px -14px -14px}.block-editor-editor-skeleton__content .csf-metabox{border-left:1px solid #e2e4e7;border-right:1px solid #e2e4e7}.csf-restore-wrapper{position:relative;z-index:1000000;text-align:right;padding:10px;border-top:1px solid #eee}.csf-restore-wrapper .csf-button-cancel,.csf-restore-wrapper input{display:none}.csf-restore-wrapper span{-webkit-user-select:none;user-select:none}.csf-restore-wrapper input:checked~.csf-button-restore{display:none}.csf-restore-wrapper input:checked~.csf-button-cancel{display:inline-block}#side-sortables .csf-section-title{padding:12px}#side-sortables .csf-field{padding:12px}#side-sortables .csf-field .csf-title{float:none;width:100%;margin-bottom:10px}#side-sortables .csf-field .csf-fieldset{float:none;width:100%}#side-sortables .csf-notice{padding:12px}.csf-comment-metabox{margin:-6px -12px -12px -12px}.csf-comment-metabox .csf-section-title{padding:20px}.csf-tooltip{position:absolute;z-index:5000001;font-size:12px;line-height:1.4;text-align:center;text-decoration:none;padding:6px 12px;max-width:200px;color:#fff;background-color:#000;background-color:rgba(0,0,0,.85);-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px}.csf-theme-dark .csf-header-inner{background-color:#050505}.csf-theme-dark .csf-header-inner h1{color:#fff}.csf-theme-dark .csf-header-inner h1 small{color:#555}.csf-theme-dark .csf-expand-all{color:#999;background-color:#222}.csf-theme-dark .csf-expand-all:hover{color:#fff;background-color:#333}.csf-theme-dark .csf-search input{color:#fff;background-color:#222}.csf-theme-dark .csf-search:focus{background-color:#444}.csf-theme-dark .csf-search::-webkit-input-placeholder{color:#666}.csf-theme-dark .csf-nav ul li a{color:#999;background-color:#222;border-bottom:1px solid #2f2f2f}.csf-theme-dark .csf-nav ul li a:hover{color:#fff}.csf-theme-dark .csf-nav ul li .csf-section-active{color:#fff;background-color:#111}.csf-theme-dark .csf-nav ul ul li a{background-color:#191919;border-bottom:1px solid #2f2f2f}.csf-theme-dark .csf-nav ul ul li .csf-section-active{background-color:#101010}.csf-theme-dark .csf-nav ul ul:before{background-color:rgba(34,34,34,.75)}.csf-theme-dark .csf-nav>ul>li:last-child>a{border-bottom:none}.csf-theme-dark .csf-nav-background{background-color:#222}.csf-theme-dark .csf-footer{color:#555;background-color:#050505}.csf-theme-light .csf-container{border:1px solid #e5e5e5;-moz-box-shadow:0 0 15px rgba(0,0,0,.04);-webkit-box-shadow:0 0 15px rgba(0,0,0,.04);box-shadow:0 0 15px rgba(0,0,0,.04)}.csf-theme-light .csf-header-inner{border-bottom:1px solid #e5e5e5;background-color:#f5f5f5;background:linear-gradient(#fefefe,#f5f5f5)}.csf-theme-light .csf-header-inner h1 small{color:#999}.csf-theme-light .csf-expand-all{color:#999;background-color:#fff;-moz-box-shadow:0 1px 1px rgba(0,0,0,.05);-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05)}.csf-theme-light .csf-expand-all:hover{color:#555}.csf-theme-light .csf-search input{color:#555;background-color:#fff;-moz-box-shadow:0 1px 1px rgba(0,0,0,.05);-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05)}.csf-theme-light .csf-search input::-webkit-input-placeholder{color:#bbb}.csf-theme-light .csf-nav ul li a{color:#666;background-color:#f5f5f5;border-bottom:1px solid #e5e5e5}.csf-theme-light .csf-nav ul li a:hover{color:#222}.csf-theme-light .csf-nav ul li .csf-section-active{color:#222;background-color:#fff}.csf-theme-light .csf-nav ul li .csf-section-active:after{display:none}.csf-theme-light .csf-nav ul ul li a{background-color:#eee;border-bottom:1px solid #e5e5e5}.csf-theme-light .csf-nav>ul>li:last-child>a{border-bottom:none}.csf-theme-light .csf-nav-background{background-color:#f5f5f5}.csf-theme-light .csf-footer{color:#555;border-top:1px solid #e5e5e5;background-color:#f5f5f5;background:linear-gradient(#fafafa,#f5f5f5)}.csf-field{position:relative;padding:30px}.csf-field+.csf-field:not(.hidden){border-top:1px solid #eee}.csf-field p:first-child{margin-top:0}.csf-field p:last-child{margin-bottom:0}.csf-field:after,.csf-field:before{content:" ";display:table}.csf-field:after{clear:both}.csf-field h4{margin-top:0}.csf-field .csf-title{position:relative;width:20%;float:left}.csf-field .csf-title h4{margin:0;color:#23282d}.csf-field .csf-fieldset{float:right;width:calc(80% - 20px)}.csf-pseudo-field{padding:0 5px 0 0!important;display:inline-block}.csf-pseudo-field+.csf-pseudo-field{border:0}.csf-pseudo-field pre{display:none}.csf-field-accordion .csf-accordion-item{position:relative;margin-bottom:5px}.csf-field-accordion .csf-accordion-item h4{font-size:1em}.csf-field-accordion .csf-accordion-title{display:block;cursor:pointer;position:relative;margin:0;padding:15px;min-height:0;font-size:100%;user-select:none;border:1px solid #ccd0d4;background-color:#fafafa;box-shadow:0 1px 1px rgba(0,0,0,.04);transition:border-color .15s}.csf-field-accordion .csf-accordion-title:active,.csf-field-accordion .csf-accordion-title:focus,.csf-field-accordion .csf-accordion-title:hover{outline:0;border-color:#999}.csf-field-accordion .csf-accordion-icon{width:14px;text-align:center}.csf-field-accordion .csf--icon{width:20px;text-align:center;margin-right:2px}.csf-field-accordion .csf-accordion-content{display:none;padding:0;border:1px solid #ccd0d4;border-top:none;background-color:#fff;box-shadow:0 1px 1px rgba(0,0,0,.04)}.csf-field-accordion .csf-accordion-content>.csf-field{padding:15px}.csf-field-accordion .csf-accordion-open{display:block}.csf-field-background .csf-field{border:0!important;padding:0;margin-bottom:6px;margin-right:6px}.csf-field-background .csf--title{color:#777;font-size:12px}.csf-field-background .csf--background-colors{display:flex}.csf-field-background .csf--background-attributes{display:flex;flex-wrap:wrap}.csf-field-background .csf--background-attributes select{min-width:100%;margin:0}.csf-field-background .csf--background-attributes .csf-field{flex:1}.csf-field-background .csf--attributes-hidden{display:none}.csf-field-backup textarea{width:100%;min-height:200px;margin-bottom:5px}.csf-field-backup small{display:inline-block;margin:5px}.csf-field-backup hr{margin:20px 0;border:none;border-bottom:1px solid #e5e5e5}.csf-field-border .csf--inputs,.csf-field-dimensions .csf--inputs,.csf-field-spacing .csf--inputs{float:left;display:flex;flex-wrap:wrap}.csf-field-border .csf--input,.csf-field-dimensions .csf--input,.csf-field-spacing .csf--input{display:flex;padding-right:6px;padding-bottom:4px;box-sizing:border-box}.csf-field-border .csf--input select,.csf-field-dimensions .csf--input select,.csf-field-spacing .csf--input select{margin:0}.csf-field-border .csf--input input,.csf-field-dimensions .csf--input input,.csf-field-spacing .csf--input input{position:relative;z-index:1;margin:0;width:65px;max-width:100%;text-align:center}.csf-field-border .csf--color,.csf-field-dimensions .csf--color,.csf-field-spacing .csf--color{float:left}.csf-field-border .csf--label,.csf-field-dimensions .csf--label,.csf-field-spacing .csf--label{display:flex;flex-direction:column;justify-content:center;user-select:none;min-width:20px;max-width:100%;padding:0 4px;font-size:12px;text-align:center;color:#555;border:1px solid #7b776c;background-color:#f5f5f5}.csf-field-border .csf--icon,.csf-field-dimensions .csf--icon,.csf-field-spacing .csf--icon{border-right:0;border-radius:4px 0 0 4px}.csf-field-border .csf--icon+input,.csf-field-dimensions .csf--icon+input,.csf-field-spacing .csf--icon+input{border-top-left-radius:0;border-bottom-left-radius:0}.csf-field-border .csf--unit,.csf-field-dimensions .csf--unit,.csf-field-spacing .csf--unit{border-left:0;border-radius:0 4px 4px 0}.csf-field-border .csf--is-unit,.csf-field-dimensions .csf--is-unit,.csf-field-spacing .csf--is-unit{border-top-right-radius:0;border-bottom-right-radius:0}.csf-field-button_set .csf--buttons{display:inline-block}.csf-field-button_set .csf--button{position:relative;z-index:1;float:left;cursor:pointer;padding:7px 14px;min-width:40px;text-align:center;color:#555;border:1px solid #ccc;background-color:#f7f7f7;user-select:none;-webkit-user-select:none;box-shadow:0 1px 0 rgba(0,0,0,.1)}.csf-field-button_set .csf--button:first-child{border-radius:4px 0 0 4px}.csf-field-button_set .csf--button:last-child{border-radius:0 4px 4px 0}.csf-field-button_set .csf--button:not(:first-child){margin-left:-1px}.csf-field-button_set .csf--button:hover{background-color:#eee}.csf-field-button_set .csf--active,.csf-field-button_set .csf--active:hover{z-index:2;color:#fff;border-color:#006799;background-color:#0085ba}.csf-field-button_set input{display:none}.csf-field-checkbox ul,.csf-field-radio ul{margin:0;padding:0 1px;list-style-type:none;overflow-y:auto;max-height:305px}.csf-field-checkbox ul ul,.csf-field-radio ul ul{max-height:none}.csf-field-checkbox .csf--inline-list li,.csf-field-radio .csf--inline-list li{display:inline-block;margin-right:15px}.csf-field-checkbox input[type=radio]:checked:before,.csf-field-radio input[type=radio]:checked:before{line-height:10px}.csf-field-checkbox .csf-checker,.csf-field-radio .csf-checker{cursor:pointer}.csf-field-code_editor .CodeMirror{width:100%;height:400px}.csf-field-code_editor .cm-s-default{border:1px solid #ccd0d4}.csf-field-code_editor textarea{width:100%;height:400px}.csf-field-color>input{opacity:.75;width:115px;max-width:100%}.csf-field-color .button.wp-picker-clear{padding:0 8px;margin-left:6px;line-height:2.54545455;min-height:30px}.csf-field-color_group .csf--left{float:left;margin-right:10px;margin-bottom:5px}.csf-field-color_group .csf--title{color:#999;margin-bottom:5px}.csf-field-fieldset .csf-fieldset-content{border:1px solid #ccd0d4;background-color:#fff;box-shadow:0 1px 1px rgba(0,0,0,.04)}.csf-field-fieldset .csf-fieldset-content>.csf-field{padding:15px}.csf-field-fieldset .csf-field-subheading{font-size:13px}.csf-field-date input{margin:0}.csf-field-date .csf--to{margin-left:7px}.csf-datepicker-wrapper{margin-top:5px;width:auto;background-color:#fff;z-index:9999999!important;-moz-box-shadow:0 0 30px rgba(0,0,0,.15);-webkit-box-shadow:0 0 30px rgba(0,0,0,.15);box-shadow:0 0 30px rgba(0,0,0,.15)}.csf-datepicker-wrapper *{float:none;margin:0;padding:0;font-family:inherit;font-weight:400;font-style:normal;text-decoration:none;border:0;border-radius:0;box-shadow:none}.csf-datepicker-wrapper .ui-datepicker-header,.csf-datepicker-wrapper .ui-widget-header{color:#fff;background:#00a0d2}.csf-datepicker-wrapper .ui-datepicker-header .ui-state-hover{cursor:pointer}.csf-datepicker-wrapper .ui-datepicker-title{font-size:14px;line-height:40px;text-align:center}.csf-datepicker-wrapper .ui-datepicker-next,.csf-datepicker-wrapper .ui-datepicker-prev{position:static;top:auto;left:auto;right:auto;font-family:"Font Awesome 5 Pro","Font Awesome 5 Free",FontAwesome;font-weight:900;font-size:12px;text-align:center;width:41px;height:40px;line-height:40px;color:#fff;background-color:rgba(255,255,255,.1);text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.csf-datepicker-wrapper .ui-datepicker-next span,.csf-datepicker-wrapper .ui-datepicker-prev span{display:none}.csf-datepicker-wrapper .ui-datepicker-prev{float:left}.csf-datepicker-wrapper .ui-datepicker-next{float:right}.csf-datepicker-wrapper .ui-datepicker-prev:before{content:'\f053'}.csf-datepicker-wrapper .ui-datepicker-next:before{content:'\f054'}.csf-datepicker-wrapper .ui-datepicker-next-hover,.csf-datepicker-wrapper .ui-datepicker-prev-hover{opacity:.75}.csf-datepicker-wrapper tbody .ui-datepicker-week-col{background-color:#f7f7f7}.csf-datepicker-wrapper .ui-datepicker-buttonpane{padding:10px;text-align:center;background-color:#f7f7f7}.csf-datepicker-wrapper .ui-datepicker-buttonpane button{cursor:pointer;margin:0 5px;padding:7px 14px;border:1px solid #eee;background-color:#fff}.csf-datepicker-wrapper select{margin:0 4px}.csf-datepicker-wrapper select option{color:#555}.csf-datepicker-wrapper table{font-size:13px;border-collapse:collapse;width:100%}.csf-datepicker-wrapper thead{color:#fff;background:#32373c}.csf-datepicker-wrapper th{text-align:center;padding:7px;border:1px solid #444}.csf-datepicker-wrapper td{text-align:center;border:1px solid #f4f4f4}.csf-datepicker-wrapper td.ui-datepicker-other-month{border:transparent}.csf-datepicker-wrapper td .ui-state-default{color:#555;width:auto;display:block;padding:6px 12px}.csf-datepicker-wrapper td .ui-state-active,.csf-datepicker-wrapper td .ui-state-hover{color:#fff;background-color:#0073aa}.csf-datepicker-wrapper td.ui-state-disabled .ui-state-default{opacity:.5}.csf-field-gallery input{display:none}.csf-field-gallery ul{margin:0;padding:0;list-style-type:none}.csf-field-gallery ul li{display:inline-block;position:relative;padding:4px;margin:0 5px 10px 0;border:1px solid #ccc;background-color:#f9f9f9;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;-moz-box-shadow:0 1px 0 rgba(0,0,0,.08);-webkit-box-shadow:0 1px 0 rgba(0,0,0,.08);box-shadow:0 1px 0 rgba(0,0,0,.08)}.csf-field-gallery ul li img{max-height:60px;display:inline-block;vertical-align:middle}.csf-field-gallery .button{margin-right:5px;margin-bottom:5px}.csf-field-group .csf-cloneable-hidden{display:none!important}.csf-field-group .csf-cloneable-wrapper{position:relative}.csf-field-group .csf-cloneable-item{display:none;position:relative;margin-bottom:5px}.csf-field-group .csf-cloneable-item h4{font-size:1em}.csf-field-group .ui-accordion .csf-cloneable-item{display:block}.csf-field-group .csf-cloneable-content{border:1px solid #ccd0d4;background-color:#fff;box-shadow:0 1px 1px rgba(0,0,0,.04)}.csf-field-group .csf-cloneable-content>.csf-field{padding:15px}.csf-field-group .csf-cloneable-title{display:block;cursor:pointer;position:relative;user-select:none;margin:0;padding:15px 65px 15px 10px;min-height:0;font-size:100%;border:1px solid #ccd0d4;background-color:#fafafa;box-shadow:0 1px 1px rgba(0,0,0,.04);transition:border-color .15s}.csf-field-group .csf-cloneable-title:active,.csf-field-group .csf-cloneable-title:focus,.csf-field-group .csf-cloneable-title:hover{border-color:#999;outline:0}.csf-field-group .csf-cloneable-helper{position:absolute;top:12px;right:10px;z-index:1;font-size:14px;line-height:1em}.csf-field-group .csf-cloneable-helper i{display:inline-block;cursor:pointer;padding:5px;color:#999}.csf-field-group .csf-cloneable-helper i:hover{color:#555}.csf-field-group .csf-cloneable-content{padding:0;border-top:0}.csf-field-group .csf-cloneable-title-number,.csf-field-group .csf-cloneable-title-prefix{margin-right:5px}.csf-field-group .csf-cloneable-alert{display:none;margin-bottom:5px;padding:10px 20px;color:#a94442;border:1px solid #ebccd1;background-color:#f2dede}.csf-field-group .widget-placeholder{margin-bottom:10px;border:1px dashed #f1c40f;background-color:#fffae4}.csf-field-group .csf-cloneable-header-icon{display:inline-block;text-align:center;font-size:14px;width:17px;text-indent:0;vertical-align:text-top}.csf-field-group .csf-cloneable-placeholder{background-color:#ddd;margin-top:4px;width:100px;height:10px;font-size:10px;line-height:10px;display:inline-block;vertical-align:top;border-radius:2px}.csf-field-icon input{display:none}.csf-field-icon .button{margin-right:5px}.csf-field-icon .csf-icon-preview i{display:inline-block;font-size:16px;width:30px;height:28px;line-height:28px;margin-right:5px;text-align:center;vertical-align:top;color:#555;border:1px solid #ccc;background-color:#f7f7f7;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;-moz-box-shadow:0 1px 0 rgba(0,0,0,.08);-webkit-box-shadow:0 1px 0 rgba(0,0,0,.08);box-shadow:0 1px 0 rgba(0,0,0,.08);-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}.csf-field-image_select .csf--image{cursor:pointer;position:relative;display:inline-block;max-width:100%;margin:0 5px 5px 0;vertical-align:bottom;border:2px solid transparent;background-color:#fff;user-select:none;-webkit-user-select:none;-moz-transition:all .2s;-o-transition:all .2s;-webkit-transition:all .2s;transition:all .2s}.csf-field-image_select .csf--image:before{position:absolute;top:0;left:0;text-align:center;font-size:10px;font-family:"Font Awesome 5 Pro","Font Awesome 5 Free",FontAwesome;font-weight:900;content:"\f00c";width:16px;height:16px;line-height:14px;opacity:0;color:#fff;background-color:#222;transition:opacity .2s}.csf-field-image_select .csf--active{border-color:#222;box-shadow:0 0 20px rgba(0,0,0,.2)}.csf-field-image_select .csf--active:before{opacity:1}.csf-field-image_select img{vertical-align:top}.csf-field-image_select input{display:none}.csf-field-link_color .csf--left{float:left;margin-right:10px;margin-bottom:5px}.csf-field-link_color .csf--title{color:#777;margin-bottom:5px}.csf-field-map input{width:100%}.csf-field-map input[type=text].ui-autocomplete-loading{background-position-x:calc(100% - 5px)}.csf-field-map .csf--map-search+.csf--map-osm-wrap{margin-top:10px}.csf-field-map .csf--map-osm-wrap{position:relative;padding:5px;border:1px solid #eee;background-color:#fff;box-shadow:0 1px 1px rgba(0,0,0,.04)}.csf-field-map .csf--map-osm{position:relative;z-index:1;min-height:250px}.csf-field-map .csf--map-inputs{margin-top:10px;display:flex;justify-content:space-between}.csf-field-map .csf--map-input{flex:1}.csf-field-map .csf--map-input:last-child{padding-left:10px}.csf-field-map label{display:block;color:#777;font-size:12px;margin:0 0 2px 0}.csf-map-ui-autocomplate{z-index:999999;border-radius:4px;overflow:hidden}.csf-field-media .csf--placeholder{display:flex}.csf-field-media .csf--placeholder input{width:100%;margin:0}.csf-field-media .button{margin-left:5px}.csf-field-media .hidden+.button{margin-left:0}.csf-field-media .csf--preview{position:relative}.csf-field-media .csf--preview .fa-times{position:absolute;z-index:1;right:4px;top:4px;font-size:14px;width:22px;height:22px;line-height:22px;text-align:center;text-decoration:none;color:#fff;background-color:#d33;opacity:.8;transition:all .2s}.csf-field-media .csf--preview .fa-times:hover{opacity:1}.csf-field-media .csf--preview .fa-times:focus{box-shadow:none}.csf-field-palette .csf--palette{position:relative;display:inline-block;cursor:pointer;border:2px solid #ddd;margin-right:10px;margin-bottom:10px;user-select:none;-webkit-user-select:none;transition:all .2s}.csf-field-palette .csf--palette span{vertical-align:middle;display:inline-block;width:22px;height:60px;line-height:60px;overflow:hidden;text-indent:-999px}.csf-field-palette .csf--palette:before{position:absolute;top:0;left:0;text-align:center;font-size:10px;font-family:"Font Awesome 5 Pro","Font Awesome 5 Free",FontAwesome;font-weight:900;content:"\f00c";width:16px;height:16px;line-height:14px;opacity:0;color:#fff;background-color:#222;transition:opacity .2s}.csf-field-palette .csf--active{border-color:#222;box-shadow:0 0 20px rgba(0,0,0,.2)}.csf-field-palette .csf--active:before{opacity:1}.csf-field-palette input{display:none}.csf-field-repeater .csf-field-text input{width:100%}.csf-field-repeater .csf-repeater-hidden{display:none!important}.csf-field-repeater .csf-repeater-wrapper .csf-repeater-item{display:table;width:100%;margin-bottom:5px;border:1px solid #eee}.csf-field-repeater .csf-repeater-wrapper .csf-repeater-item h4{font-size:1em}.csf-field-repeater .csf-repeater-content{width:100%;display:table-cell;vertical-align:middle;background-color:#fff}.csf-field-repeater .csf-repeater-content>.csf-field{padding:15px}.csf-field-repeater .csf-repeater-helper{width:100%;display:table-cell;vertical-align:middle;text-align:center;font-size:14px;line-height:1em;border-left:1px solid #eee;background-color:#f7f7f7}.csf-field-repeater .csf-repeater-helper i{display:inline-block;cursor:pointer;color:#999;padding:5px}.csf-field-repeater .csf-repeater-helper i:hover{color:#555}.csf-field-repeater .csf-repeater-helper-inner{width:75px}.csf-field-repeater .csf-repeater-alert{display:none;margin-bottom:5px;padding:10px 20px;color:#a94442;border:1px solid #ebccd1;background-color:#f2dede}.csf-field-repeater .widget-placeholder{height:50px;margin-bottom:3px;border:1px dashed #f1c40f;background-color:#fffae4}.csf-field-repeater .ui-sortable-helper{height:50px!important;overflow:hidden!important;border-color:#ccc!important;background-color:#eee!important;opacity:.5}.csf-field-repeater .ui-sortable-helper .csf-repeater-content,.csf-field-repeater .ui-sortable-helper .csf-repeater-helper{display:none}.csf-field-select .csf-fieldset{min-height:30px}.csf-field-select .csf-chosen{display:none}.csf-field-select select{max-width:100%;margin:0}.csf-field-slider .csf--wrap{display:flex;align-items:center}.csf-field-slider .csf--input{display:flex}.csf-field-slider .csf--unit{display:flex;justify-content:center;flex-direction:column;user-select:none;padding:0 6px;font-size:11px;line-height:1;border-radius:0 4px 4px 0;color:#555;border:1px solid #7e8993;border-left:0;background-color:#f5f5f5}.csf-field-slider .csf-slider-ui{margin-right:15px}.csf-field-slider input[type=number]{position:relative;z-index:1;margin:0;width:50px;text-align:center}.csf-field-slider .csf--is-unit{border-top-right-radius:0;border-bottom-right-radius:0}.csf-field-slider .ui-slider{position:relative;width:100%;height:3px;border:none;background:#ddd;border-radius:2px}.csf-field-slider .ui-slider-range{height:3px;border:none;background:#333;border-radius:2px}.csf-field-slider .ui-slider-handle{position:absolute;width:16px;height:16px;top:-7px;margin-left:-8px;border:none;background:#333;border-radius:2px}.csf-field-slider .ui-slider-handle:hover,.csf-field-slider .ui-state-active{cursor:pointer;background:#111}.csf-field-sortable .csf-field-text input{width:100%;max-width:100%}.csf-field-sortable .csf--sortable .csf--sortable-item{display:table;width:100%;margin-bottom:5px;border:1px solid #eee}.csf-field-sortable .csf--sortable .csf--sortable-item h4{font-size:1em}.csf-field-sortable .csf--sortable-content{width:100%;display:table-cell;vertical-align:middle;background-color:#fff}.csf-field-sortable .csf--sortable-content>.csf-field{padding:15px}.csf-field-sortable .csf--sortable-helper{width:100%;display:table-cell;vertical-align:middle;text-align:center;font-size:14px;line-height:1em;border-left:1px solid #eee;background-color:#f7f7f7}.csf-field-sortable .csf--sortable-helper i{display:inline-block;cursor:pointer;width:50px;color:#555}.csf-field-sortable .csf--sortable-helper i:hover{opacity:.5}.csf-field-sortable .widget-placeholder{height:50px;margin-bottom:3px;border:1px dashed #f1c40f;background-color:#fffae4}.csf-field-sortable .ui-sortable-helper{height:50px!important;overflow:hidden!important;border-color:#ccc!important;background-color:#eee!important;opacity:.5}.csf-field-sortable .ui-sortable-helper .csf--sortable-content,.csf-field-sortable .ui-sortable-helper .csf--sortable-helper{display:none}.csf-field-sorter .ui-sortable-placeholder{height:20px;border:1px dashed #f1c40f;background-color:#fffae4}.csf-field-sorter .csf-modules{float:left;width:50%;box-sizing:border-box}.csf-field-sorter .csf-modules:first-child{padding-right:15px}.csf-field-sorter .csf-modules:last-child{padding-left:15px}.csf-field-sorter .csf-disabled,.csf-field-sorter .csf-enabled{padding:5px 15px;border:1px dashed #ddd;background-color:#fff}.csf-field-sorter .csf-disabled li{-moz-transition:opacity .15s;-o-transition:opacity .15s;-webkit-transition:opacity .15s;transition:opacity .15s;opacity:.5}.csf-field-sorter .csf-disabled .ui-sortable-helper{opacity:1}.csf-field-sorter .csf-sorter-title{font-size:13px;font-weight:600;padding:10px;text-align:center;border:1px dashed #ddd;border-bottom:none;background-color:#f8f8f8;text-transform:uppercase}.csf-field-sorter ul{list-style-type:none;margin:0;padding:0;min-height:62px}.csf-field-sorter ul li{margin:10px 0;padding:10px 15px;cursor:move;font-weight:700;text-align:center;border:1px solid #e5e5e5;background-color:#fafafa;-moz-transition:border-color .15s;-o-transition:border-color .15s;-webkit-transition:border-color .15s;transition:border-color .15s}.csf-field-sorter ul li:hover{border-color:#bbb}.csf-field-spinner .csf--spin{display:flex}.csf-field-spinner .ui-spinner{display:flex}.csf-field-spinner .ui-button-text-only{display:flex;flex-direction:column;justify-content:center;text-align:center;min-width:20px;padding:0 4px;color:#555;border:1px solid #7e8993;background-color:#f5f5f5}.csf-field-spinner .ui-button{cursor:pointer}.csf-field-spinner .ui-button:hover{background-color:#e7e7e7}.csf-field-spinner .ui-button:active{background-color:#ddd}.csf-field-spinner .ui-button:before{font-family:"Font Awesome 5 Pro","Font Awesome 5 Free",FontAwesome;font-weight:900;font-size:14px;line-height:14px}.csf-field-spinner .ui-spinner-down{order:1;border-right:0;border-radius:4px 0 0 4px}.csf-field-spinner .ui-spinner-down:before{content:"\f0d9"}.csf-field-spinner .ui-spinner-input{order:2}.csf-field-spinner .csf--unit{order:3;border-left:0;user-select:none}.csf-field-spinner .ui-spinner-up{order:4;border-left:0;border-radius:0 4px 4px 0}.csf-field-spinner .ui-spinner-up:before{content:"\f0da"}.csf-field-spinner input{position:relative;z-index:1;width:50px;text-align:center;margin:0;padding:0 8px;border-radius:0}.csf-field-spinner .ui-button-text{display:none}.csf-field-switcher .csf--switcher{float:left;cursor:pointer;position:relative;width:60px;height:26px;padding:0;margin:0;overflow:hidden;border-radius:4px;background-color:#ed6f6f;user-select:none;-webkit-user-select:none}.csf-field-switcher .csf--ball{position:absolute;top:4px;left:4px;width:24px;height:18px;background-color:#fff;border-radius:4px;transition:all .1s;box-shadow:1px 1px 1px rgba(0,0,0,.15)}.csf-field-switcher .csf--off,.csf-field-switcher .csf--on{position:absolute;top:0;left:0;right:0;font-size:11px;line-height:26px;font-weight:500;font-style:normal;text-align:center;text-transform:uppercase;color:#fff;padding-right:28px;opacity:0;transition:all .1s}.csf-field-switcher .csf--off{padding-right:0;padding-left:28px;opacity:1}.csf-field-switcher .csf--active{background:#4fb845}.csf-field-switcher .csf--active .csf--on{opacity:1}.csf-field-switcher .csf--active .csf--off{opacity:0}.csf-field-switcher .csf--active .csf--ball{left:100%;margin-left:-28px}.csf-field-switcher .csf--label{float:left;margin-top:4px;margin-left:8px;font-weight:400;color:#999}.csf-field-switcher input{display:none}.csf-field-tabbed .csf-tabbed-section{border:1px solid #ccd0d4;background-color:#fff;box-shadow:0 1px 1px rgba(0,0,0,.04)}.csf-field-tabbed .csf-tabbed-section>.csf-field{padding:15px}.csf-field-tabbed .csf-tabbed-nav .csf--icon{padding-right:5px}.csf-field-tabbed .csf-tabbed-nav a{display:inline-block;padding:12px 15px;margin-top:1px;margin-right:5px;margin-bottom:-1px;position:relative;text-decoration:none;color:#444;font-weight:600;border:1px solid #ccd0d4;background-color:#f3f3f3;transition:all .2s}.csf-field-tabbed .csf-tabbed-nav a:hover{background-color:#f9f9f9}.csf-field-tabbed .csf-tabbed-nav a.csf-tabbed-active{background-color:#fff;border-bottom-color:#fff}.csf-field-tabbed .csf-tabbed-nav a:focus{outline:0;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.csf-field-text input{width:50%;max-width:100%;margin:0}.csf-field-textarea textarea{width:100%;max-width:100%;min-height:125px}.csf-field-textarea .csf-shortcode-button{margin-bottom:10px;margin-right:5px}.csf-field-typography select,.csf-field-typography textarea{min-width:100%;margin:0}.csf-field-typography .csf--title{color:#777;margin:0 0 2px 0;font-size:12px}.csf-field-typography .csf--title small{vertical-align:top}.csf-field-typography .csf--blocks{display:flex;flex-wrap:wrap}.csf-field-typography .csf--block{flex:1;padding-right:6px;padding-bottom:6px}.csf-field-typography .csf--input{margin:0;min-width:100%}.csf-field-typography .csf--input-wrap{position:relative}.csf-field-typography .csf--unit{position:absolute;z-index:1;right:4px;top:4px;bottom:4px;padding:2px 6px;color:#666;font-size:11px;line-height:1;border-radius:2px;background:#eee;user-select:none;display:flex;justify-content:center;flex-direction:column}.csf-field-typography .csf--preview{font-size:16px;line-height:20px;padding:20px;color:#222;border:1px solid #eee;background-color:#fff;border-radius:2.5px;user-select:none;-webkit-user-select:none;transition:background-color .2s,border-color .2s}.csf-field-typography .csf--block-preview{cursor:pointer;position:relative;overflow:hidden;margin-top:10px;max-width:100%}.csf-field-typography .csf--black-background{border-color:#000;background-color:#000}.csf-field-typography .csf--toggle{position:absolute;top:5px;right:10px;color:#999}.csf-field-typography .csf--block-extra-styles{margin-top:5px}.csf-field-upload input{width:100%;margin:0}.csf-field-upload .csf--wrap{display:flex}.csf-field-upload .button{margin-left:5px}.csf-field-wp_editor .csf-wp-editor{float:left;width:100%}.csf-field-wp_editor .mce-toolbar-grp{border:none}.csf-field-wp_editor .mce-btn.mce-active button,.csf-field-wp_editor .mce-btn.mce-active i,.csf-field-wp_editor .mce-btn.mce-active:hover button,.csf-field-wp_editor .mce-btn.mce-active:hover i{color:#23282d}.csf-field-wp_editor .wp-media-buttons{position:relative;z-index:2}.csf-field-wp_editor .wp-editor-tabs{position:relative;z-index:1}.csf-field-wp_editor .csf-no-tinymce{border:1px solid #e5e5e5}.csf-field-wp_editor .csf-no-quicktags .wp-media-buttons{float:none;display:block}.csf-field-wp_editor .csf-no-quicktags .mce-tinymce{box-shadow:none;border:1px solid #e5e5e5}.csf-field-wp_editor textarea{width:100%;max-width:100%;margin:0;box-shadow:none}.csf-field-heading{font-size:1.5em;font-weight:700;color:#23282d;background-color:#f5f5f5}.csf-field-subheading{font-size:14px;font-weight:700;padding-top:17px;padding-bottom:17px;color:#23282d;background-color:#f7f7f7}.csf-field-submessage{padding:0!important;border:0!important}.csf-field-submessage+.csf-field{border-top:0!important}.csf-submessage{font-size:12px;padding:17px 30px;border-top:1px solid transparent;border-bottom:1px solid transparent}.csf-submessage-success{color:#3c763d;border-color:#d6e9c6;background-color:#dff0d8}.csf-submessage-info{color:#31708f;border-color:#bce8f1;background-color:#d9edf7}.csf-submessage-warning{color:#8a6d3b;border-color:#faebcc;background-color:#fcf8e3}.csf-submessage-danger{color:#a94442;border-color:#ebccd1;background-color:#f2dede}.csf-submessage-normal{color:#23282d;border-color:#eee;background-color:#f7f7f7}.csf-field-notice{background-color:#f7f7f7}.csf-notice{padding:12px;background-color:#fff;border-left-style:solid;border-left-width:4px;box-shadow:0 1px 1px rgba(0,0,0,.1)}.csf-notice-success{border-color:#46b450}.csf-notice-info{border-color:#339fd4}.csf-notice-warning{border-color:#ffbc00}.csf-notice-danger{border-color:#dc3232}.csf-notice-normal{border-color:#222}.csf-field-number input{width:100%;margin:0}.csf-field-number .csf--wrap{position:relative;float:left;width:100px}.csf-field-number .csf--unit{position:absolute;z-index:1;right:4px;top:4px;bottom:4px;padding:2px 6px;color:#666;font-size:11px;line-height:1;border-radius:2px;background:#eee;user-select:none;display:flex;justify-content:center;flex-direction:column}.csf-help{cursor:help;position:absolute;top:0;right:0;padding:5px;font-size:13px;color:#aaa}.csf-help .csf-help-text{display:none}.csf-image-preview{display:inline-block;position:relative;padding:4px;min-width:44px;min-height:22px;margin-bottom:10px;border:1px solid #ccc;background-color:#f9f9f9;-moz-box-shadow:0 1px 0 rgba(0,0,0,.08);-webkit-box-shadow:0 1px 0 rgba(0,0,0,.08);box-shadow:0 1px 0 rgba(0,0,0,.08)}.csf-image-preview img{max-height:90px;display:inline-block;vertical-align:middle}.csf-field-custom .csf-field{padding:0}.csf-field .chosen-container-single .chosen-single{height:28px;line-height:26px}.csf-field .chosen-container-single .chosen-single abbr{top:0;right:20px;font-family:"Font Awesome 5 Pro","Font Awesome 5 Free",FontAwesome;font-weight:900;font-size:12px;height:100%;width:18px;color:#aaa;text-align:center;background:0 0}.csf-field .chosen-container-single .chosen-single abbr:before{content:"\f00d"}.csf-field .chosen-container-single .chosen-single abbr:hover{color:#555}.csf-field .chosen-container-multi .chosen-choices li.search-choice .search-choice-close{font-family:"Font Awesome 5 Pro","Font Awesome 5 Free",FontAwesome;font-weight:900;font-size:12px;height:100%;width:18px;color:#aaa;text-align:center;background:0 0}.csf-field .chosen-container-multi .chosen-choices li.search-choice .search-choice-close:before{content:"\f00d";display:inline-block;padding-top:3px}.csf-field .chosen-container-multi .chosen-choices li.search-choice .search-choice-close:hover{color:#555}.csf-field .chosen-container-single .chosen-single div b{font-family:"Font Awesome 5 Pro","Font Awesome 5 Free",FontAwesome;font-weight:900;font-size:14px;color:#aaa;background:0 0}.csf-field .chosen-container-single .chosen-single div b:before{content:"\f107"}.csf-field .chosen-container-single .chosen-single div b:hover{color:#555}.csf-field .chosen-container-multi .chosen-choices li.search-choice-placeholder{border:1px dashed #aaa;margin:3px 5px 3px 0}.csf-field .chosen-container-multi .ui-sortable li.search-choice span{cursor:move}.csf-field .chosen-container-active.chosen-with-drop .chosen-single div b:before{content:"\f106"}.csf-field .chosen-container-single .chosen-single-with-deselect span{margin-right:40px}.csf-field .chosen-container-single .chosen-search input[type=text]{background:0 0}.csf-field .chosen-container-single .chosen-search:before{font-family:"Font Awesome 5 Pro","Font Awesome 5 Free",FontAwesome;font-weight:900;font-size:11px;content:"\f002";position:absolute;right:12px;top:10px;color:#aaa}.csf-field .wp-picker-container{display:inline-block}.csf-field .wp-picker-container .wp-color-result.button{margin-bottom:0}.csf-field .csf--transparent-wrap{display:none;position:relative;top:-1px;width:235px;padding:9px 10px;border:1px solid #dfdfdf;border-top:none;background-color:#fff}.csf-field .wp-picker-active .csf--transparent-wrap{display:block}.csf-field .csf--transparent-slider{position:absolute;width:190px;margin-left:2px;height:18px}.csf-field .csf--transparent-slider .ui-slider-handle{position:absolute;top:-3px;bottom:-3px;z-index:5;border-color:#aaa;border-style:solid;border-width:4px 3px;width:10px;height:16px;margin:0 -5px;background:0 0;cursor:ew-resize;opacity:.9;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;-moz-box-shadow:0 1px 2px rgba(0,0,0,.2);-webkit-box-shadow:0 1px 2px rgba(0,0,0,.2);box-shadow:0 1px 2px rgba(0,0,0,.2)}.csf-field .csf--transparent-slider .ui-slider-handle:before{content:" ";position:absolute;left:-2px;right:-2px;top:-3px;bottom:-3px;border:2px solid #fff;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px}.csf-field .csf--transparent-offset{height:18px;width:200px;background:url(../images/checkerboard.png) repeat-y center left scroll #fff;-moz-box-shadow:0 0 5px rgba(0,0,0,.4) inset;-webkit-box-shadow:0 0 5px rgba(0,0,0,.4) inset;box-shadow:0 0 5px rgba(0,0,0,.4) inset;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px}.csf-field .csf--transparent-text{position:absolute;top:12px;right:10px;width:30px;font-size:12px;line-height:12px;text-align:center;color:#999}.csf-field .csf--transparent-button{cursor:pointer;user-select:none;margin-top:10px;font-size:11px;text-align:center;border-radius:2px;padding:3px 7px;box-shadow:0 1px 0 rgba(0,0,0,.1);letter-spacing:.2px;color:#777;border:1px solid #ccc;background-color:#f7f7f7;transition:background-color .2s,border-color .2s,color .2s}.csf-field .csf--transparent-active .wp-color-result{background-image:url(../images/checkerboard.png);background-size:135px;background-position:center left;background-color:transparent!important}.csf-field .csf--transparent-active .csf--transparent-button{color:#fff;border-color:#3ea032;background-color:#4fb845}.csf-field .csf--transparent-active .fa:before{content:"\f205"}.csf-widgets>.csf-field{position:relative;top:-1px;margin-right:-15px;margin-left:-15px;padding:12px 15px}.csf-widgets>.csf-field .csf-field{margin-left:0;margin-right:0}.csf-widgets>.csf-field .csf-title{float:none;width:100%;margin-bottom:5px}.csf-widgets>.csf-field .csf-fieldset{float:none;width:100%}.csf-widgets .csf-field-text input{width:100%}.csf-widgets .csf-field-notice .csf-notice{padding:15px}.control-section .csf-widgets>.csf-field{margin-right:-10px;margin-left:-10px;padding:10px 12px}.control-section .csf-field{padding:0}.control-section .csf-field .csf-title{float:none;width:100%;margin-bottom:6px}.control-section .csf-field .csf-title h4{display:block;font-size:13px;line-height:1;font-weight:600;color:inherit}.control-section .csf-field .csf-fieldset{float:none;width:100%}.control-section .csf-help{top:-5px;right:-5px}.control-section .csf-field-select select{width:100%}.control-section .csf-field-heading{color:inherit;font-size:14px;line-height:1em;margin-right:-15px;margin-left:-15px;padding:15px}.control-section .csf-field-subheading{color:inherit;font-size:11px;margin-right:-15px;margin-left:-15px;padding:10px 15px}.control-section .csf-text-subtitle{margin-top:4px;font-size:12px}.control-section .csf-field-submessage .csf-submessage{margin-right:-15px;margin-left:-15px;padding:15px}.control-section .csf-fieldset .csf-field-heading,.control-section .csf-fieldset .csf-field-subheading,.control-section .csf-fieldset .csf-field-submessage .csf-submessage{margin-left:0;margin-right:0}.control-section .csf-field-date .csf--to{margin-left:0}.control-section .csf-field-sorter ul li{padding:5px}.control-section .csf-field-sorter .csf-modules{float:none;width:100%}.control-section .csf-field-sorter .csf-modules:first-child{padding-right:0;padding-bottom:15px}.control-section .csf-field-background .csf--background-attributes{flex-direction:column}.control-section .csf-field-spacing input{width:90px}.control-section .csf-field-border .csf--input{flex:1 50%}.control-section .csf-field-border input,.control-section .csf-field-border select{width:100%}.control-section .csf-field-spinner input{width:50px}.control-section .csf-field-number .csf--wrap{width:100%}.control-section .csf-field-backup .csf-export-data{display:none}.control-section .csf-field-fieldset .csf-fieldset-content{border-color:#e5e5e5}.control-section .csf-field-fieldset .csf-field{padding:10px}.control-section .csf-field-fieldset .csf-field .csf-title{margin-bottom:5px}.control-section .csf-field-fieldset .csf-field h4{font-size:12px}.control-section .csf-field-accordion .csf-field,.control-section .csf-field-group .csf-field,.control-section .csf-field-repeater .csf-field,.control-section .csf-field-sortable .csf-field,.control-section .csf-field-tabbed .csf-field{padding:10px}.control-section .csf-field-accordion .csf-field .csf-title,.control-section .csf-field-group .csf-field .csf-title,.control-section .csf-field-repeater .csf-field .csf-title,.control-section .csf-field-sortable .csf-field .csf-title,.control-section .csf-field-tabbed .csf-field .csf-title{margin-bottom:5px}.control-section .csf-field-accordion .csf-field h4,.control-section .csf-field-group .csf-field h4,.control-section .csf-field-repeater .csf-field h4,.control-section .csf-field-sortable .csf-field h4,.control-section .csf-field-tabbed .csf-field h4{font-size:12px}.control-section .csf-dependency-control.hidden{display:none!important}.csf-taxonomy>.csf-field{border-top:none!important}.csf-taxonomy>.csf-field-heading{font-size:1.1em;padding:20px!important;border:1px solid #ddd}.csf-taxonomy>.csf-field-subheading{font-size:12px;padding:15px!important;border:1px solid #ddd}.csf-taxonomy>.csf-field-submessage .csf-submessage{padding:15px;border-left-width:1px;border-left-style:solid;border-right-width:1px;border-right-style:solid}.csf-taxonomy>.csf-field-notice{background-color:transparent}.csf-taxonomy .csf-section-title{display:block;padding:15px;background-color:#f9f9f9;border:1px solid #e5e5e5;-moz-box-shadow:0 1px 1px rgba(0,0,0,.04);-webkit-box-shadow:0 1px 1px rgba(0,0,0,.04);box-shadow:0 1px 1px rgba(0,0,0,.04)}.csf-taxonomy-add-fields>.csf-field{padding:8px 0}.csf-taxonomy-add-fields>.csf-field>.csf-title{float:none;width:100%;padding:2px 2px 4px 0}.csf-taxonomy-add-fields>.csf-field>.csf-title h4{font-size:12px;font-weight:400}.csf-taxonomy-add-fields>.csf-field>.csf-fieldset{float:none;width:100%}.csf-taxonomy-add-fields>.csf-field>.csf-fieldset>.csf-help{right:-5px}.csf-taxonomy-add-fields+p.submit{margin-top:0}.csf-taxonomy-edit-fields>.csf-field{padding:20px 0}.csf-taxonomy-edit-fields>.csf-field>.csf-title{width:200px}.csf-taxonomy-edit-fields>.csf-field>.csf-title h4{font-size:14px;font-weight:600;line-height:1.3;display:inline-block;vertical-align:middle}.csf-taxonomy-edit-fields>.csf-field>.csf-fieldset{width:calc(100% - 220px)}.csf-taxonomy-edit-fields>.csf-field>.csf-fieldset>.csf-help{top:-5px;right:-5px}.csf-taxonomy-edit-fields>.csf-field-submessage{margin:20px 0}.csf-taxonomy-edit-fields>.csf-field-heading,.csf-taxonomy-edit-fields>.csf-field-subheading{margin:20px 0;border:1px solid #ddd}.csf-profile>h2>.fa{padding-right:7px}.csf-profile>.csf-field{max-width:800px;padding:15px 0;border-top:none!important}.csf-profile>.csf-field>.csf-title{width:200px}.csf-profile>.csf-field>.csf-title h4{font-size:14px;font-weight:600;line-height:1.3;display:inline-block;vertical-align:middle}.csf-profile>.csf-field>.csf-fieldset{width:calc(100% - 220px)}.csf-profile>.csf-field>.csf-fieldset>.csf-help{top:-15px;right:-5px}.csf-profile>.csf-field-heading{font-size:1.1em}.csf-profile>.csf-field-subheading{font-size:12px}.csf-profile>.csf-field-heading,.csf-profile>.csf-field-subheading{margin:10px 0;padding:15px!important;border:1px solid #ddd}.csf-profile>.csf-field-submessage{margin:20px 0}.csf-profile>.csf-field-submessage .csf-submessage{padding:10px;border-left-width:1px;border-left-style:solid;border-right-width:1px;border-right-style:solid}.csf-profile>.csf-field-notice{background-color:transparent}.csf-modal{display:none;position:fixed;z-index:100101;top:0;left:0;width:100%;height:100%}.csf-modal-icon{z-index:100102}.csf-modal-table{display:table;width:100%;height:100%}.csf-modal-table-cell{display:table-cell;vertical-align:middle;margin:100px 0}.csf-modal-inner{position:relative;z-index:10;width:760px;height:750px;margin:0 auto;background-color:#fff}.csf-modal-content{position:relative;overflow:hidden;overflow-y:auto;height:595px}.csf-modal-content .csf-shortcode-button{display:none}.csf-modal-content .csf-field{padding:15px 30px 15px 15px}.csf-modal-content a:active,.csf-modal-content a:focus{outline:0;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.csf-modal-content h4{font-size:13px}.csf-modal-content h4 small{font-style:italic;font-weight:400;color:#aaa}.csf-modal-title{position:relative;background-color:#fcfcfc;border-bottom:1px solid #ddd;height:36px;font-size:16px;font-weight:600;line-height:36px;margin:0;padding:0 36px 0 16px}.csf-modal-header{width:100%;padding:14px 0;background-color:#f5f5f5;border-bottom:1px solid #eee}.csf-modal-header select{display:block;width:250px;margin:0 auto;font-size:13px;line-height:1;height:30px;min-height:30px;background-color:#fff}.csf-modal-close{color:#666;padding:0;position:absolute;top:0;right:0;width:36px;height:36px;text-align:center;background:0 0;border:none;cursor:pointer}.csf-modal-close:before{font:normal 20px/36px dashicons;content:"\f158";vertical-align:top;width:36px;height:36px}.csf-modal-close:hover{opacity:.5}.csf-modal-insert-wrapper{text-align:center;width:100%;padding:15px 0;background-color:#f5f5f5;border-top:1px solid #eee}.csf-modal-overlay{position:absolute;top:0;left:0;width:100%;height:100%;background-color:#000;opacity:.5}.csf--repeatable{padding:15px 15px 0 15px}.csf--repeat-button-block{text-align:center;padding-bottom:15px}.csf--repeat-shortcode{position:relative;margin-bottom:15px;border:1px dashed #ddd}.csf--repeat-shortcode:first-child .csf-repeat-remove{display:none}.csf--repeat-shortcode .csf-repeat-remove{position:absolute;right:10px;top:10px;z-index:10;cursor:pointer;display:inline-block;font-size:11px;width:18px;height:18px;line-height:18px;text-align:center;border-radius:2px;color:#fff;background-color:#e14d43;opacity:.5}.csf--repeat-shortcode .csf-repeat-remove:hover{opacity:1}.csf-shortcode-single .csf-modal-inner{height:750px}.csf-shortcode-single .csf-modal-content{height:652px}.elementor-editor-active .csf-shortcode-button{margin-left:5px}.elementor-editor-active .csf-modal .hidden{display:none!important}.csf-shortcode-block{text-align:center;padding:14px;font-size:13px;background-color:#f5f5f5;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif}.csf-shortcode-block .button{margin:10px 0}.csf-modal-icon .csf-icon-title{padding:15px 0;margin:4px;font-size:14px;font-weight:700;text-align:center;border:1px solid #eee;background-color:#f7f7f7}.csf-modal-icon .csf-icon-search{width:50%;height:40px;line-height:40px}.csf-modal-icon i{cursor:pointer;display:inline-block;margin:4px;width:35px;height:35px;line-height:35px;font-size:16px;color:#555;text-align:center;border:1px solid #ccc;background-color:#f7f7f7;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;-moz-box-shadow:1px 1px 0 rgba(0,0,0,.05);-webkit-box-shadow:1px 1px 0 rgba(0,0,0,.05);box-shadow:1px 1px 0 rgba(0,0,0,.05)}.csf-modal-icon i:hover{color:#fff;border-color:#222;background-color:#222}.csf-modal-icon .csf-modal-content{padding:10px;height:618px}.csf-modal-icon .csf-text-error{padding:10px}.csf-modal-loading{display:none;position:absolute;left:15px;top:15px}.csf-loading{position:relative;width:20px;height:20px;background:#ccc;-moz-border-radius:20px;-webkit-border-radius:20px;border-radius:20px;-moz-box-shadow:0 2px 5px rgba(0,0,0,.07);-webkit-box-shadow:0 2px 5px rgba(0,0,0,.07);box-shadow:0 2px 5px rgba(0,0,0,.07)}.csf-loading:after{position:absolute;top:50%;left:50%;width:4px;height:4px;content:"";margin-top:-2px;margin-left:-2px;background-color:#fff;-moz-animation-duration:.5s;-webkit-animation-duration:.5s;animation-duration:.5s;-moz-animation-iteration-count:infinite;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-moz-animation-timing-function:linear;-webkit-animation-timing-function:linear;animation-timing-function:linear;-moz-animation-name:csfLoader;-webkit-animation-name:csfLoader;animation-name:csfLoader;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px}@-moz-keyframes csfLoader{0%{-moz-transform:rotate(0) translateX(-6px) rotate(0);transform:rotate(0) translateX(-6px) rotate(0)}100%{-moz-transform:rotate(360deg) translateX(-6px) rotate(-360deg);transform:rotate(360deg) translateX(-6px) rotate(-360deg)}}@-webkit-keyframes csfLoader{0%{-webkit-transform:rotate(0) translateX(-6px) rotate(0);transform:rotate(0) translateX(-6px) rotate(0)}100%{-webkit-transform:rotate(360deg) translateX(-6px) rotate(-360deg);transform:rotate(360deg) translateX(-6px) rotate(-360deg)}}@keyframes csfLoader{0%{-moz-transform:rotate(0) translateX(-6px) rotate(0);-ms-transform:rotate(0) translateX(-6px) rotate(0);-webkit-transform:rotate(0) translateX(-6px) rotate(0);transform:rotate(0) translateX(-6px) rotate(0)}100%{-moz-transform:rotate(360deg) translateX(-6px) rotate(-360deg);-ms-transform:rotate(360deg) translateX(-6px) rotate(-360deg);-webkit-transform:rotate(360deg) translateX(-6px) rotate(-360deg);transform:rotate(360deg) translateX(-6px) rotate(-360deg)}}.csf-text-subtitle{margin-top:10px;font-weight:400;color:#999}.csf-text-desc{clear:both;float:left;width:100%;margin-top:10px;font-weight:400;color:#999}.csf-text-success{color:#2b542c}.csf-text-error{margin-top:5px;color:#d02c21}.csf-text-info{color:#31708f}.csf-text-warning{color:#ffb900}.csf-text-muted{color:#aaa}.csf-text-left{text-align:left}.csf-text-center{text-align:center}.csf-text-right{text-align:right}.csf-block-left{float:left}.csf-block-right{float:right}.csf-full-width{width:100%}.csf-full-half{width:50%}.csf-table{width:100%;display:table}.csf-table-cell{display:table-cell;vertical-align:middle}.csf-table-expanded{width:100%}.csf-nowrap{white-space:nowrap}.csf-text-highlight{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px}.csf-text-highlight-gray{padding:2px 4px;font-size:90%;background-color:#f0f0f0;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px}.csf-hidden{display:none}.csf-hide{display:none!important}.csf-show{display:block!important}.csf-opacity{opacity:.5}.csf-warning-primary{color:#fff!important;border-color:#dc3545!important;background:#dc3545!important}.csf-warning-primary:focus,.csf-warning-primary:hover{border-color:#bd2130!important;background:#bd2130!important}.csf-warning-primary:focus{box-shadow:0 0 0 1px #fff,0 0 0 3px #bd2130!important}.csf-warning-primary:active{border-color:#bd2130!important;background:#bd2130!important}.csf-form-result{display:none;float:left;padding:0 8px;margin-right:4px;font-size:11px;line-height:28px;user-select:none;border-radius:2px}.csf-form-show{display:block}.csf-form-success{color:#fff;background-color:#46b450}.csf-form-warning{color:#8a6d3b;background-color:#faebcc}.csf-label-error{position:relative;top:-2px;display:inline-block;font-size:10px;line-height:10px;height:10px;width:10px;padding:1px;font-style:normal;text-align:center;color:#fff;vertical-align:middle;background-color:#e10000;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px}.csf-no-option{padding:30px}.csf-input-number{-moz-appearance:textfield}.csf-input-number::-webkit-inner-spin-button,.csf-input-number::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.csf-welcome-wrap{position:relative;margin:25px 40px 0 20px;font-size:15px;max-width:1200px}.csf-welcome-wrap p{font-size:14px;line-height:1.5}.csf-welcome-wrap h1{margin:.2em 200px 0 0;padding:0;color:#32373c;line-height:1.2em;font-size:2.8em;font-weight:400}.csf-welcome-wrap .csf-logo{position:absolute;overflow:hidden;top:0;right:0;height:160px;width:140px;background-image:linear-gradient(45deg,#2d67cb,#ad19f3);box-shadow:0 1px 4px rgba(0,0,0,.25),inset 0 0 0 4px rgba(0,0,0,.25)}.csf-welcome-wrap .csf-logo .csf--effects i{position:absolute;width:200px;height:100px;background-color:rgba(0,0,0,.15);transform:rotate(-45deg)}.csf-welcome-wrap .csf-logo .csf--effects i:nth-child(1){bottom:-20px;right:-70px}.csf-welcome-wrap .csf-logo .csf--effects i:nth-child(2){bottom:-35px;right:-80px}.csf-welcome-wrap .csf-logo .csf--effects i:nth-child(3){bottom:-50px;right:-90px}.csf-welcome-wrap .csf-logo .csf--effects i:nth-child(4){bottom:-65px;right:-100px}.csf-welcome-wrap .csf-logo .csf--wp-logos{position:relative;padding-top:25px;text-align:center}.csf-welcome-wrap .csf-logo .csf--wp-logo{position:absolute;left:20px;width:20px;height:20px;background-repeat:no-repeat;background-position:center center;background-image:url(../images/wp-logo.svg)}.csf-welcome-wrap .csf-logo .csf--wp-plugin-logo{display:inline-block;width:50px;height:50px;border:3px solid #fff;background-size:40px;background-repeat:no-repeat;background-position:center center;background-image:url(../images/wp-plugin-logo.svg);border-radius:100%;vertical-align:middle}.csf-welcome-wrap .csf-logo .csf--text{position:absolute;left:0;right:0;top:90px;color:#fff;font-size:13px;line-height:1.2em;font-weight:600;text-align:center;text-transform:uppercase;text-shadow:1px 1px 0 rgba(0,0,0,.25)}.csf-welcome-wrap .csf-logo .csf--version{top:auto;left:auto;right:8px;bottom:4px;font-size:11px;text-transform:lowercase}.csf-welcome-wrap .csf-about-text{font-weight:400;line-height:1.6em;font-size:19px;margin:1em 200px 1em 0;color:#555d66}.csf-welcome-wrap .csf-demo-button{margin:1em 200px 2em 0}.csf-welcome-wrap .nav-tab-wrapper{margin-bottom:20px}.csf-welcome-wrap ul{list-style-type:disc;padding-left:15px}.csf-welcome-wrap .csf--col{float:left;padding-right:20px;box-sizing:border-box}.csf-welcome-wrap .csf--col-2{width:50%}.csf-welcome-wrap .csf--col-3{width:33.333%}.csf-welcome-wrap .csf--col-4{width:25%}.csf-welcome-wrap .csf--col-5{width:20%}.csf-welcome-wrap .csf--col-last{padding-right:0}.csf-welcome-wrap .csf--col-upgrade{padding:10px 0;text-align:center;border-top:1px solid #e5e5e5}.csf--table-compare tfoot td,.csf--table-compare thead td{text-align:center}.csf--table-compare td{font-size:14px;text-align:center;vertical-align:middle;padding:10px}.csf--table-compare td:first-child{text-align:left}.csf--table-compare tfoot td{padding:15px 0}.csf--table-compare .fa{font-size:18px}.csf--table-compare .fa-check-circle{color:#46b450}.csf--table-compare .fa-times-circle{color:#dc3232}.csf-welcome-cols{clear:both;margin:20px 0;background-color:#fff;padding:0 0;border-radius:2px;border:1px solid #e5e5e5}.csf-welcome-cols .csf--col{width:25%;float:left;padding:20px;text-align:center;box-sizing:border-box;min-height:200px;border-right:1px solid #e5e5e5}.csf-welcome-cols .csf--block,.csf-welcome-cols .csf--left{float:left;width:20%;padding:0 30px;text-align:center;box-sizing:border-box}.csf-welcome-cols .csf--block{width:80%}.csf-welcome-cols .csf--col-first{border-bottom:1px solid #e5e5e5}.csf-welcome-cols .csf--last{border-right:none}.csf-welcome-cols .csf--space{height:20px}.csf-welcome-cols .csf--icon{display:inline-block;font-size:20px;width:30px;height:30px;line-height:30px;text-align:center;margin-bottom:10px;color:#fff;background-color:#555;border-radius:30px}.csf-welcome-cols .csf--active{background-color:#5cb85c}.csf-welcome-cols .csf--deactive{background-color:#e14d43}.csf-welcome-cols .csf--title{font-weight:700;display:block}.csf-welcome-cols p:last-child{margin-bottom:0}.csf-features-cols .csf--key-features{width:30%}.csf-features-cols .csf--available-fields{width:70%}.csf-code-block{margin:20px 0;padding:5px 20px;background-color:#fff;border-radius:2px;box-shadow:0 1px 1px rgba(0,0,0,.15)}.csf-code-block pre{font-size:13px;color:#0073aa}.csf-code-block pre span{color:#999}.csf--table-fields td{font-size:14px}.csf--upgrade a{color:#5cb85c;font-weight:700}.csf--upgrade a:focus,.csf--upgrade a:hover{color:#4aa14a;outline:0;box-shadow:none}@media only screen and (max-width:782px){.csf-welcome-cols .csf--col{width:100%;min-height:auto;border-right:none;border-bottom:1px solid #e5e5e5}.csf-features-cols .csf--key-features{width:100%}.csf-features-cols .csf--available-fields{width:100%}}@media only screen and (max-width:1200px){.csf-metabox .csf-field .csf-title{float:none;width:100%;margin-bottom:10px}.csf-metabox .csf-field .csf-fieldset{float:none;width:100%}}@media only screen and (max-width:782px){.csf-header-inner{text-align:center}.csf-header-inner h1{width:100%;margin-bottom:10px}.csf-form-result{float:none;margin-right:0;margin-bottom:10px}.csf-header-left,.csf-header-right,.csf-search{width:100%}.csf-search{text-align:center;margin-bottom:15px}.csf-footer{text-align:center}.csf-buttons{float:none}.csf-copyright{float:none;margin-top:10px}.csf-expand-all,.csf-nav,.csf-nav-background,.csf-reset-section{display:none!important}.csf-content{margin-left:0}.csf-section,.csf-section-title{display:block!important}.csf-field .csf-title{float:none;width:100%;margin-bottom:10px}.csf-field .csf-fieldset{float:none;width:100%}.csf-field-color .button.wp-picker-clear{padding:0 8px;line-height:2.14285714;min-height:32px}.csf-modal-inner{width:350px;height:400px}.csf-modal-content{height:237px}.csf-icon-dialog .csf-modal-inner{width:305px;height:380px}.csf-icon-dialog .csf-modal-content{height:267px}.csf-modal-icon .csf-modal-inner{width:330px;height:385px}.csf-modal-icon .csf-modal-content{height:252px}.csf-profile>.csf-field>.csf-title,.csf-taxonomy-edit-fields>.csf-field>.csf-title{float:none;width:100%;margin-bottom:10px}.csf-profile>.csf-field>.csf-fieldset,.csf-taxonomy-edit-fields>.csf-field>.csf-fieldset{float:none;width:100%}}.chosen-container{position:relative;display:inline-block;vertical-align:middle;font-size:13px;user-select:none}.chosen-container *{box-sizing:border-box}.chosen-container .chosen-drop{position:absolute;top:100%;z-index:1010;width:100%;border:1px solid #aaa;border-top:0;background:#fff;box-shadow:0 4px 5px rgba(0,0,0,.15);clip:rect(0,0,0,0);clip-path:inset(100% 100%)}.chosen-container.chosen-with-drop .chosen-drop{clip:auto;clip-path:none}.chosen-container a{cursor:pointer}.chosen-container .chosen-single .group-name,.chosen-container .search-choice .group-name{margin-right:4px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-weight:400;color:#999}.chosen-container .chosen-single .group-name:after,.chosen-container .search-choice .group-name:after{content:":";padding-left:2px;vertical-align:top}.chosen-container-single .chosen-single{position:relative;display:block;overflow:hidden;padding:0 0 0 8px;height:25px;border:1px solid #aaa;border-radius:5px;background-color:#fff;background:linear-gradient(#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%);background-clip:padding-box;box-shadow:0 0 3px #fff inset,0 1px 1px rgba(0,0,0,.1);color:#444;text-decoration:none;white-space:nowrap;line-height:24px}.chosen-container-single .chosen-default{color:#999}.chosen-container-single .chosen-single span{display:block;overflow:hidden;margin-right:26px;text-overflow:ellipsis;white-space:nowrap}.chosen-container-single .chosen-single-with-deselect span{margin-right:38px}.chosen-container-single .chosen-single abbr{position:absolute;top:6px;right:26px;display:block;width:12px;height:12px;font-size:1px}.chosen-container-single .chosen-single div{position:absolute;top:0;right:0;display:block;width:18px;height:100%}.chosen-container-single .chosen-single div b{display:block;width:100%;height:100%}.chosen-container-single .chosen-search{position:relative;z-index:1010;margin:0;padding:3px 4px;white-space:nowrap}.chosen-container-single .chosen-search input[type=text]{margin:1px 0;padding:4px 20px 4px 5px;width:100%;height:auto;outline:0;border:1px solid #aaa;font-size:1em;font-family:sans-serif;line-height:normal;border-radius:0}.chosen-container-single .chosen-drop{margin-top:-1px;border-radius:0 0 4px 4px;background-clip:padding-box}.chosen-container-single.chosen-container-single-nosearch .chosen-search{position:absolute;clip:rect(0,0,0,0);clip-path:inset(100% 100%)}.chosen-container .chosen-results{color:#444;position:relative;overflow-x:hidden;overflow-y:auto;margin:0 4px 4px 0;padding:0 0 0 4px;max-height:240px;-webkit-overflow-scrolling:touch}.chosen-container .chosen-results li{display:none;margin:0;padding:5px 6px;list-style:none;line-height:15px;word-wrap:break-word;-webkit-touch-callout:none}.chosen-container .chosen-results li.active-result{display:list-item;cursor:pointer}.chosen-container .chosen-results li.disabled-result{display:list-item;color:#ccc;cursor:default}.chosen-container .chosen-results li.highlighted{background-color:#3875d7;background-image:linear-gradient(#3875d7 20%,#2a62bc 90%);color:#fff}.chosen-container .chosen-results li.no-results{color:#777;display:list-item;background:#f4f4f4}.chosen-container .chosen-results li.group-result{display:list-item;font-weight:700;cursor:default}.chosen-container .chosen-results li.group-option{padding-left:15px}.chosen-container .chosen-results li em{font-style:normal;text-decoration:underline}.chosen-container-multi .chosen-choices{position:relative;overflow:hidden;margin:0;padding:0 5px;width:100%;height:auto;border:1px solid #aaa;background-color:#fff;background-image:linear-gradient(#eee 1%,#fff 15%);cursor:text}.chosen-container-multi .chosen-choices li{float:left;list-style:none}.chosen-container-multi .chosen-choices li.search-field{margin:0;padding:0;white-space:nowrap}.chosen-container-multi .chosen-choices li.search-field input[type=text]{margin:1px 0;padding:0;outline:0;border:0!important;background:0 0!important;box-shadow:none;color:#999;font-size:100%;font-family:sans-serif;line-height:normal;border-radius:0;width:25px;height:25px;min-height:25px}.chosen-container-multi .chosen-choices li.search-choice{position:relative;margin:3px 5px 3px 0;padding:3px 20px 3px 6px;border:1px solid #aaa;max-width:100%;border-radius:3px;background-color:#eee;background-image:linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-size:100% 19px;background-repeat:repeat-x;background-clip:padding-box;box-shadow:0 0 2px #fff inset,0 1px 0 rgba(0,0,0,.05);color:#333;line-height:13px;cursor:default}.chosen-container-multi .chosen-choices li.search-choice span{word-wrap:break-word;white-space:nowrap}.chosen-container-multi .chosen-choices li.search-choice .search-choice-close{position:absolute;top:0;right:0;display:block;width:12px;height:12px;font-size:1px}.chosen-container-multi .chosen-choices li.search-choice-disabled{padding-right:5px;border:1px solid #ccc;background-color:#e4e4e4;background-image:linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);color:#666}.chosen-container-multi .chosen-choices li.search-choice-focus{background:#d4d4d4}.chosen-container-multi .chosen-results{margin:0;padding:0}.chosen-container-multi .chosen-drop .result-selected{display:list-item;color:#ccc;cursor:default}.chosen-container-active .chosen-single{border:1px solid #5897fb;box-shadow:0 0 5px rgba(0,0,0,.3)}.chosen-container-active.chosen-with-drop .chosen-single{border:1px solid #aaa;border-bottom-right-radius:0;border-bottom-left-radius:0;background-image:linear-gradient(#eee 20%,#fff 80%);box-shadow:0 1px 0 #fff inset}.chosen-container-active.chosen-with-drop .chosen-single div{border-left:none;background:0 0}.chosen-container-active .chosen-choices{border:1px solid #5897fb;box-shadow:0 0 5px rgba(0,0,0,.3)}.chosen-container-active .chosen-choices li.search-field input[type=text]{color:#222!important}.chosen-disabled{opacity:.5!important;cursor:default}.chosen-disabled .chosen-single{cursor:default}.chosen-disabled .chosen-choices .search-choice .search-choice-close{cursor:default}.chosen-rtl{text-align:right}.chosen-rtl .chosen-single{overflow:visible;padding:0 8px 0 0}.chosen-rtl .chosen-single span{margin-right:0;margin-left:26px;direction:rtl}.chosen-rtl .chosen-single-with-deselect span{margin-left:38px}.chosen-rtl .chosen-single div{right:auto;left:3px}.chosen-rtl .chosen-single abbr{right:auto;left:26px}.chosen-rtl .chosen-choices li{float:right}.chosen-rtl .chosen-choices li.search-field input[type=text]{direction:rtl}.chosen-rtl .chosen-choices li.search-choice{margin:3px 5px 3px 0;padding:3px 5px 3px 19px}.chosen-rtl .chosen-choices li.search-choice .search-choice-close{right:auto;left:4px}.chosen-rtl.chosen-container-single .chosen-results{margin:0 0 4px 4px;padding:0 4px 0 0}.chosen-rtl .chosen-results li.group-option{padding-right:15px;padding-left:0}.chosen-rtl.chosen-container-active.chosen-with-drop .chosen-single div{border-right:none}.chosen-rtl .chosen-search input[type=text]{padding:4px 5px 4px 20px;direction:rtl}
admin/settings/assets/js/csf-plugins.min.js CHANGED
@@ -1,3 +1,3 @@
1
- /* Codestar Framework | A Simple and Lightweight WordPress Option Framework - v2.1.3.x*/
2
 
3
  !function(t){function e(e,s){this.element=t(e),this.options=s,this.init()}e.prototype.init=function(){this.element.chosen(this.options),this.container=this.element.next(".chosen-container"),this.search_field=this.container.find(".chosen-search-input"),this.is_multiple=this.container.hasClass("chosen-container-multi"),this.is_typing=!1,this.chosenXhr=null,this.events()},e.prototype.events=function(){var t=this;this.search_field.on("compositionstart",function(){t.is_typing=!0}),this.search_field.on("compositionend",function(){t.is_typing=!1,t.update_list()}),this.search_field.on("keyup",function(){t.update_list()}),this.search_field.on("focus",function(){t.search_field_focused()})},e.prototype.search_field_focused=function(){this.search_welcome_message(),0===this.options.min_length&&0===this.search_field.val().length&&this.update_list()},e.prototype.search_welcome_message=function(){var e=t.trim(this.search_field.val()),s=this.container.find(".chosen-results");0===s.children().length&&0===e.length&&s.html('<li class="no-results">'+this.options.typing_text.replace("%s",this.options.min_length-e.length)+"</li>")},e.prototype.update_list=function(){var e=this;if(this.search_welcome_message(),!this.is_typing){var s=t.trim(this.search_field.val()),i=s.length<this.options.min_length?this.options.typing_text.replace("%s",this.options.min_length-s.length):this.options.searching_text;this.container.find(".no-results").text(i),s!==this.search_field.data("prevVal")&&(this.search_field.data("prevVal",s),this.timer&&clearTimeout(this.timer),s.length<this.options.min_length||(this.timer=setTimeout(function(){e.chosenXhr&&e.chosenXhr.abort(),e.options.data.term=s,e.chosenXhr=window.wp.ajax.post("csf-chosen",e.options.data).done(function(t){e.show_results(t)}).fail(function(t){e.container.find(".no-results").text(t.error)})},this.options.type_delay)))}},e.prototype.show_results=function(e){var s=this;if(!this.is_typing&&null!==e){if(0===e.length)return this.element.data().chosen.no_results_clear(),void this.element.data().chosen.no_results(this.search_field.val());var i=[];this.element.find("option").each(function(){t(this).is(":selected")?i.push(t(this).val()+"-"+t(this).text()):t(this).attr("value").length&&t(this).remove()}),t.each(e,function(e,n){-1===t.inArray(n.value+"-"+n.text,i)&&t("<option />").attr("value",n.value).html(n.text).appendTo(s.element)});var n=this.search_field.val(),r=this.search_field.innerWidth();if(this.element.trigger("chosen:updated"),this.is_multiple){var o=this.element.parent().find(".csf-hidden-select").val()||[];this.element.CSFChosenOrder(o,!0),this.search_field.css("width",r)}this.search_field.val(n),null!==this.chosenXhr.done&&this.chosenXhr.done(e)}},t.fn.CSFAjaxChosen=function(t){return this.each(function(){new e(this,t)})}}(jQuery),function(){var t,e,s=[].indexOf||function(t){for(var e=0,s=this.length;e<s;e++)if(e in this&&this[e]===t)return e;return-1},i={}.hasOwnProperty;e=function(){function t(){}return t.insertAt=function(t,e,s){return s.insertBefore(t,s.children[e].nextSibling)},t.getFlattenedOptionsAndGroups=function(t){var e,s,i,n,r,o,h,l,c;for(e=[],o=0,l=(i=Array.prototype.filter.call(t.childNodes,function(t){var e;return"OPTION"===(e=t.nodeName.toUpperCase())||"OPTGROUP"===e})).length;o<l;o++)if(s=i[o],e.push(s),"OPTGROUP"===s.nodeName.toUpperCase())for(h=0,c=(r=Array.prototype.filter.call(s.childNodes,function(t){return"OPTION"===t.nodeName.toUpperCase()})).length;h<c;h++)n=r[h],e.push(n);return e},t.isValidMultipleSelectElement=function(t){return null!=t&&"SELECT"===t.nodeName&&t.multiple},t.getChosenUIContainer=function(t){return""!==t.id?document.getElementById(t.id.replace(/-/g,"_")+"_chosen"):this.searchChosenUIContainer(t)},t.isChosenified=function(t){return null!=this.getChosenUIContainer(t)},t.forceSelection=function(t,e){var i,n,r,o;for(r=this.getFlattenedOptionsAndGroups(t),i=0;i<r.length;)o=(n=r[i]).getAttribute("value"),s.call(e,o)>=0?(n.selected=!0,n.setAttribute("selected","")):(n.selected=!1,n.removeAttribute("selected")),i++;return this.triggerEvent(t,"chosen:updated")},t.CSFChosenOrder=function(t,e,s){var i,n,r,o,h,l,c,a,u,_,d,p,f,g;if(null!=this.getDOMElement&&(t=this.getDOMElement(t)),this.isValidMultipleSelectElement(t)&&null!=(n=this.getChosenUIContainer(t))&&e instanceof Array){for(e=e.map(Function.prototype.call,String.prototype.trim),c=this.getFlattenedOptionsAndGroups(t),null!=s&&!0===s&&this.forceSelection(t,e),g=[],r=_=0,p=e.length;_<p;r=++_){for(h=e[r],a=null,o=d=0,f=c.length;d<f;o=++d)c[o].value===h&&(a=o);i=n.querySelectorAll(".search-choice"),u=this.relAttributeName,null!=(l=Array.prototype.filter.call(i,function(t){return null!=t.querySelector("a.search-choice-close["+u+'="'+a+'"]')})[0])&&(n.querySelector("ul.chosen-choices"),g.push(this.insertAt(l,r,n.querySelector("ul.chosen-choices"))))}return g}},t}(),(t=jQuery).fn.extend({CSFChosenOrder:function(t,e){return _CSFChosenOrder.CSFChosenOrder(this,t,e)}}),this._CSFChosenOrder=function(s){function n(){return n.__super__.constructor.apply(this,arguments)}return function(t,e){for(var s in e)i.call(e,s)&&(t[s]=e[s]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(n,e),n.relAttributeName="data-option-array-index",n.isjQueryObject=function(t){return"undefined"!=typeof jQuery&&null!==jQuery&&t instanceof jQuery},n.getDOMElement=function(t){return this.isjQueryObject(t)?t.get(0):t},n.searchChosenUIContainer=function(e){return null!=t(e).data("chosen")?t(e).data("chosen").container[0]:t(e).next(".chosen-container.chosen-container-multi").get(0)},n.triggerEvent=function(e,s){return t(e).trigger(s)},n}()}.call(this),function(){var t,e,s,i,n=function(t,e){return function(){return t.apply(e,arguments)}},r={}.hasOwnProperty;(i=function(){function t(){this.options_index=0,this.parsed=[]}return t.prototype.add_node=function(t){return"OPTGROUP"===t.nodeName.toUpperCase()?this.add_group(t):this.add_option(t)},t.prototype.add_group=function(t){var e,s,i,n,r,o;for(e=this.parsed.length,this.parsed.push({array_index:e,group:!0,label:t.label,title:t.title?t.title:void 0,children:0,disabled:t.disabled,classes:t.className}),o=[],s=0,i=(r=t.childNodes).length;s<i;s++)n=r[s],o.push(this.add_option(n,e,t.disabled));return o},t.prototype.add_option=function(t,e,s){if("OPTION"===t.nodeName.toUpperCase())return""!==t.text?(null!=e&&(this.parsed[e].children+=1),this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:t.value,text:t.text,html:t.innerHTML,title:t.title?t.title:void 0,selected:t.selected,disabled:!0===s?s:t.disabled,group_array_index:e,group_label:null!=e?this.parsed[e].label:null,classes:t.className,style:t.style.cssText})):this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:!0}),this.options_index+=1},t}()).select_to_array=function(t){var e,s,n,r,o;for(r=new i,s=0,n=(o=t.childNodes).length;s<n;s++)e=o[s],r.add_node(e);return r.parsed},e=function(){function t(e,s){this.form_field=e,this.options=null!=s?s:{},this.label_click_handler=n(this.label_click_handler,this),t.browser_is_supported()&&(this.is_multiple=this.form_field.multiple,this.set_default_text(),this.set_default_values(),this.setup(),this.set_up_html(),this.register_observers(),this.on_ready())}return t.prototype.set_default_values=function(){var t,e;return this.click_test_action=(t=this,function(e){return t.test_active_click(e)}),this.activate_action=(e=this,function(t){return e.activate_field(t)}),this.active_field=!1,this.mouse_on_container=!1,this.results_showing=!1,this.result_highlighted=null,this.is_rtl=this.options.rtl||/\bchosen-rtl\b/.test(this.form_field.className),this.allow_single_deselect=null!=this.options.allow_single_deselect&&null!=this.form_field.options[0]&&""===this.form_field.options[0].text&&this.options.allow_single_deselect,this.disable_search_threshold=this.options.disable_search_threshold||0,this.disable_search=this.options.disable_search||!1,this.enable_split_word_search=null==this.options.enable_split_word_search||this.options.enable_split_word_search,this.group_search=null==this.options.group_search||this.options.group_search,this.search_contains=this.options.search_contains||!1,this.single_backstroke_delete=null==this.options.single_backstroke_delete||this.options.single_backstroke_delete,this.max_selected_options=this.options.max_selected_options||1/0,this.inherit_select_classes=this.options.inherit_select_classes||!1,this.display_selected_options=null==this.options.display_selected_options||this.options.display_selected_options,this.display_disabled_options=null==this.options.display_disabled_options||this.options.display_disabled_options,this.include_group_label_in_selected=this.options.include_group_label_in_selected||!1,this.max_shown_results=this.options.max_shown_results||Number.POSITIVE_INFINITY,this.case_sensitive_search=this.options.case_sensitive_search||!1,this.hide_results_on_select=null==this.options.hide_results_on_select||this.options.hide_results_on_select},t.prototype.set_default_text=function(){return this.form_field.getAttribute("data-placeholder")?this.default_text=this.form_field.getAttribute("data-placeholder"):this.is_multiple?this.default_text=this.options.placeholder_text_multiple||this.options.placeholder_text||t.default_multiple_text:this.default_text=this.options.placeholder_text_single||this.options.placeholder_text||t.default_single_text,this.default_text=this.escape_html(this.default_text),this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||t.default_no_result_text},t.prototype.choice_label=function(t){return this.include_group_label_in_selected&&null!=t.group_label?"<b class='group-name'>"+this.escape_html(t.group_label)+"</b>"+t.html:t.html},t.prototype.mouse_enter=function(){return this.mouse_on_container=!0},t.prototype.mouse_leave=function(){return this.mouse_on_container=!1},t.prototype.input_focus=function(t){if(this.is_multiple){if(!this.active_field)return setTimeout((e=this,function(){return e.container_mousedown()}),50)}else if(!this.active_field)return this.activate_field();var e},t.prototype.input_blur=function(t){if(!this.mouse_on_container)return this.active_field=!1,setTimeout((e=this,function(){return e.blur_test()}),100);var e},t.prototype.label_click_handler=function(t){return this.is_multiple?this.container_mousedown(t):this.activate_field()},t.prototype.results_option_build=function(t){var e,s,i,n,r,o,h;for(e="",h=0,n=0,r=(o=this.results_data).length;n<r&&(i="",""!==(i=(s=o[n]).group?this.result_add_group(s):this.result_add_option(s))&&(h++,e+=i),(null!=t?t.first:void 0)&&(s.selected&&this.is_multiple?this.choice_build(s):s.selected&&!this.is_multiple&&this.single_set_selected_text(this.choice_label(s))),!(h>=this.max_shown_results));n++);return e},t.prototype.result_add_option=function(t){var e,s;return t.search_match&&this.include_option_in_results(t)?(e=[],t.disabled||t.selected&&this.is_multiple||e.push("active-result"),!t.disabled||t.selected&&this.is_multiple||e.push("disabled-result"),t.selected&&e.push("result-selected"),null!=t.group_array_index&&e.push("group-option"),""!==t.classes&&e.push(t.classes),(s=document.createElement("li")).className=e.join(" "),t.style&&(s.style.cssText=t.style),s.setAttribute("data-option-array-index",t.array_index),s.innerHTML=t.highlighted_html||t.html,t.title&&(s.title=t.title),this.outerHTML(s)):""},t.prototype.result_add_group=function(t){var e,s;return(t.search_match||t.group_match)&&t.active_options>0?((e=[]).push("group-result"),t.classes&&e.push(t.classes),(s=document.createElement("li")).className=e.join(" "),s.innerHTML=t.highlighted_html||this.escape_html(t.label),t.title&&(s.title=t.title),this.outerHTML(s)):""},t.prototype.results_update_field=function(){if(this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.results_build(),this.results_showing)return this.winnow_results()},t.prototype.reset_single_select_options=function(){var t,e,s,i,n;for(n=[],t=0,e=(s=this.results_data).length;t<e;t++)(i=s[t]).selected?n.push(i.selected=!1):n.push(void 0);return n},t.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},t.prototype.results_search=function(t){return this.results_showing?this.winnow_results():this.results_show()},t.prototype.winnow_results=function(t){var e,s,i,n,r,o,h,l,c,a,u,_,d,p,f;for(this.no_results_clear(),a=0,e=(h=this.get_search_text()).replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),c=this.get_search_regex(e),i=0,n=(l=this.results_data).length;i<n;i++)(r=l[i]).search_match=!1,u=null,_=null,r.highlighted_html="",this.include_option_in_results(r)&&(r.group&&(r.group_match=!1,r.active_options=0),null!=r.group_array_index&&this.results_data[r.group_array_index]&&(0===(u=this.results_data[r.group_array_index]).active_options&&u.search_match&&(a+=1),u.active_options+=1),f=r.group?r.label:r.text,r.group&&!this.group_search||(_=this.search_string_match(f,c),r.search_match=null!=_,r.search_match&&!r.group&&(a+=1),r.search_match?(h.length&&(d=_.index,o=f.slice(0,d),s=f.slice(d,d+h.length),p=f.slice(d+h.length),r.highlighted_html=this.escape_html(o)+"<em>"+this.escape_html(s)+"</em>"+this.escape_html(p)),null!=u&&(u.group_match=!0)):null!=r.group_array_index&&this.results_data[r.group_array_index].search_match&&(r.search_match=!0)));return this.result_clear_highlight(),a<1&&h.length?(this.update_results_content(""),this.no_results(h)):(this.update_results_content(this.results_option_build()),(null!=t?t.skip_highlight:void 0)?void 0:this.winnow_results_set_highlight())},t.prototype.get_search_regex=function(t){var e,s;return s=this.search_contains?t:"(^|\\s|\\b)"+t+"[^\\s]*",this.enable_split_word_search||this.search_contains||(s="^"+s),e=this.case_sensitive_search?"":"i",new RegExp(s,e)},t.prototype.search_string_match=function(t,e){var s;return s=e.exec(t),!this.search_contains&&(null!=s?s[1]:void 0)&&(s.index+=1),s},t.prototype.choices_count=function(){var t,e,s;if(null!=this.selected_option_count)return this.selected_option_count;for(this.selected_option_count=0,t=0,e=(s=this.form_field.options).length;t<e;t++)s[t].selected&&(this.selected_option_count+=1);return this.selected_option_count},t.prototype.choices_click=function(t){if(t.preventDefault(),this.activate_field(),!this.results_showing&&!this.is_disabled)return this.results_show()},t.prototype.keydown_checker=function(t){var e,s;switch(s=null!=(e=t.which)?e:t.keyCode,this.search_field_scale(),8!==s&&this.pending_backstroke&&this.clear_backstroke(),s){case 8:this.backstroke_length=this.get_search_field_value().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(t),this.mouse_on_container=!1;break;case 13:case 27:this.results_showing&&t.preventDefault();break;case 32:this.disable_search&&t.preventDefault();break;case 38:t.preventDefault(),this.keyup_arrow();break;case 40:t.preventDefault(),this.keydown_arrow()}},t.prototype.keyup_checker=function(t){var e,s;switch(s=null!=(e=t.which)?e:t.keyCode,this.search_field_scale(),s){case 8:this.is_multiple&&this.backstroke_length<1&&this.choices_count()>0?this.keydown_backstroke():this.pending_backstroke||(this.result_clear_highlight(),this.results_search());break;case 13:t.preventDefault(),this.results_showing&&this.result_select(t);break;case 27:this.results_showing&&this.results_hide();break;case 9:case 16:case 17:case 18:case 38:case 40:case 91:break;default:this.results_search()}},t.prototype.clipboard_event_checker=function(t){var e;if(!this.is_disabled)return setTimeout((e=this,function(){return e.results_search()}),50)},t.prototype.container_width=function(){return null!=this.options.width?this.options.width:this.form_field.offsetWidth+"px"},t.prototype.include_option_in_results=function(t){return!(this.is_multiple&&!this.display_selected_options&&t.selected)&&(!(!this.display_disabled_options&&t.disabled)&&!t.empty)},t.prototype.search_results_touchstart=function(t){return this.touch_started=!0,this.search_results_mouseover(t)},t.prototype.search_results_touchmove=function(t){return this.touch_started=!1,this.search_results_mouseout(t)},t.prototype.search_results_touchend=function(t){if(this.touch_started)return this.search_results_mouseup(t)},t.prototype.outerHTML=function(t){var e;return t.outerHTML?t.outerHTML:((e=document.createElement("div")).appendChild(t),e.innerHTML)},t.prototype.get_single_html=function(){return'<a class="chosen-single chosen-default">\n <span>'+this.default_text+'</span>\n <div><b></b></div>\n</a>\n<div class="chosen-drop">\n <div class="chosen-search">\n <input class="chosen-search-input" type="text" autocomplete="off" />\n </div>\n <ul class="chosen-results"></ul>\n</div>'},t.prototype.get_multi_html=function(){return'<ul class="chosen-choices">\n <li class="search-field">\n <input class="chosen-search-input" type="text" autocomplete="off" value="'+this.default_text+'" />\n </li>\n</ul>\n<div class="chosen-drop">\n <ul class="chosen-results"></ul>\n</div>'},t.prototype.get_no_results_html=function(t){return'<li class="no-results">\n '+this.results_none_found+" <span>"+this.escape_html(t)+"</span>\n</li>"},t.browser_is_supported=function(){return"Microsoft Internet Explorer"===window.navigator.appName?document.documentMode>=8:!(/iP(od|hone)/i.test(window.navigator.userAgent)||/IEMobile/i.test(window.navigator.userAgent)||/Windows Phone/i.test(window.navigator.userAgent)||/BlackBerry/i.test(window.navigator.userAgent)||/BB10/i.test(window.navigator.userAgent)||/Android.*Mobile/i.test(window.navigator.userAgent))},t.default_multiple_text="Select Some Options",t.default_single_text="Select an Option",t.default_no_result_text="No results match",t}(),(t=jQuery).fn.extend({chosen:function(i){return e.browser_is_supported()?this.each(function(e){var n,r;r=(n=t(this)).data("chosen"),"destroy"!==i?r instanceof s||n.data("chosen",new s(this,i)):r instanceof s&&r.destroy()}):this}}),s=function(s){function n(){return n.__super__.constructor.apply(this,arguments)}return function(t,e){for(var s in e)r.call(e,s)&&(t[s]=e[s]);function i(){this.constructor=t}i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype}(n,e),n.prototype.setup=function(){return this.form_field_jq=t(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex},n.prototype.set_up_html=function(){var e,s;return(e=["chosen-container"]).push("chosen-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&e.push(this.form_field.className),this.is_rtl&&e.push("chosen-rtl"),s={class:e.join(" "),title:this.form_field.title},this.form_field.id.length&&(s.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chosen"),this.container=t("<div />",s),this.container.width(this.container_width()),this.is_multiple?this.container.html(this.get_multi_html()):this.container.html(this.get_single_html()),this.form_field_jq.hide().after(this.container),this.dropdown=this.container.find("div.chosen-drop").first(),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chosen-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chosen-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chosen-search").first(),this.selected_item=this.container.find(".chosen-single").first()),this.results_build(),this.set_tab_index(),this.set_label_behavior()},n.prototype.on_ready=function(){return this.form_field_jq.trigger("chosen:ready",{chosen:this})},n.prototype.register_observers=function(){var t,e,s,i,n,r,o,h,l,c,a,u,_,d,p,f,g,m,v,y,b,w,x,k;return this.container.on("touchstart.chosen",(t=this,function(e){t.container_mousedown(e)})),this.container.on("touchend.chosen",(e=this,function(t){e.container_mouseup(t)})),this.container.on("mousedown.chosen",(s=this,function(t){s.container_mousedown(t)})),this.container.on("mouseup.chosen",(i=this,function(t){i.container_mouseup(t)})),this.container.on("mouseenter.chosen",(n=this,function(t){n.mouse_enter(t)})),this.container.on("mouseleave.chosen",(r=this,function(t){r.mouse_leave(t)})),this.search_results.on("mouseup.chosen",(o=this,function(t){o.search_results_mouseup(t)})),this.search_results.on("mouseover.chosen",(h=this,function(t){h.search_results_mouseover(t)})),this.search_results.on("mouseout.chosen",(l=this,function(t){l.search_results_mouseout(t)})),this.search_results.on("mousewheel.chosen DOMMouseScroll.chosen",(c=this,function(t){c.search_results_mousewheel(t)})),this.search_results.on("touchstart.chosen",(a=this,function(t){a.search_results_touchstart(t)})),this.search_results.on("touchmove.chosen",(u=this,function(t){u.search_results_touchmove(t)})),this.search_results.on("touchend.chosen",(_=this,function(t){_.search_results_touchend(t)})),this.form_field_jq.on("chosen:updated.chosen",(d=this,function(t){d.results_update_field(t)})),this.form_field_jq.on("chosen:activate.chosen",(p=this,function(t){p.activate_field(t)})),this.form_field_jq.on("chosen:open.chosen",(f=this,function(t){f.container_mousedown(t)})),this.form_field_jq.on("chosen:close.chosen",(g=this,function(t){g.close_field(t)})),this.search_field.on("blur.chosen",(m=this,function(t){m.input_blur(t)})),this.search_field.on("keyup.chosen",(v=this,function(t){v.keyup_checker(t)})),this.search_field.on("keydown.chosen",(y=this,function(t){y.keydown_checker(t)})),this.search_field.on("focus.chosen",(b=this,function(t){b.input_focus(t)})),this.search_field.on("cut.chosen",(w=this,function(t){w.clipboard_event_checker(t)})),this.search_field.on("paste.chosen",(x=this,function(t){x.clipboard_event_checker(t)})),this.is_multiple?this.search_choices.on("click.chosen",(k=this,function(t){k.choices_click(t)})):this.container.on("click.chosen",function(t){t.preventDefault()})},n.prototype.destroy=function(){return t(this.container[0].ownerDocument).off("click.chosen",this.click_test_action),this.form_field_label.length>0&&this.form_field_label.off("click.chosen"),this.search_field[0].tabIndex&&(this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex),this.container.remove(),this.form_field_jq.removeData("chosen"),this.form_field_jq.show()},n.prototype.search_field_disabled=function(){return this.is_disabled=this.form_field.disabled||this.form_field_jq.parents("fieldset").is(":disabled"),this.container.toggleClass("chosen-disabled",this.is_disabled),this.search_field[0].disabled=this.is_disabled,this.is_multiple||this.selected_item.off("focus.chosen",this.activate_field),this.is_disabled?this.close_field():this.is_multiple?void 0:this.selected_item.on("focus.chosen",this.activate_field)},n.prototype.container_mousedown=function(e){var s;if(!this.is_disabled)return!e||"mousedown"!==(s=e.type)&&"touchstart"!==s||this.results_showing||e.preventDefault(),null!=e&&t(e.target).hasClass("search-choice-close")?void 0:(this.active_field?this.is_multiple||!e||t(e.target)[0]!==this.selected_item[0]&&!t(e.target).parents("a.chosen-single").length||(e.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),t(this.container[0].ownerDocument).on("click.chosen",this.click_test_action),this.results_show()),this.activate_field())},n.prototype.container_mouseup=function(t){if("ABBR"===t.target.nodeName&&!this.is_disabled)return this.results_reset(t)},n.prototype.search_results_mousewheel=function(t){var e;if(t.originalEvent&&(e=t.originalEvent.deltaY||-t.originalEvent.wheelDelta||t.originalEvent.detail),null!=e)return t.preventDefault(),"DOMMouseScroll"===t.type&&(e*=40),this.search_results.scrollTop(e+this.search_results.scrollTop())},n.prototype.blur_test=function(t){if(!this.active_field&&this.container.hasClass("chosen-container-active"))return this.close_field()},n.prototype.close_field=function(){return t(this.container[0].ownerDocument).off("click.chosen",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chosen-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale(),this.search_field.blur()},n.prototype.activate_field=function(){if(!this.is_disabled)return this.container.addClass("chosen-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},n.prototype.test_active_click=function(e){var s;return(s=t(e.target).closest(".chosen-container")).length&&this.container[0]===s[0]?this.active_field=!0:this.close_field()},n.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=i.select_to_array(this.form_field),this.is_multiple?this.search_choices.find("li.search-choice").remove():(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field[0].readOnly=!0,this.container.addClass("chosen-container-single-nosearch")):(this.search_field[0].readOnly=!1,this.container.removeClass("chosen-container-single-nosearch"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1},n.prototype.result_do_highlight=function(t){var e,s,i,n,r;if(t.length){if(this.result_clear_highlight(),this.result_highlight=t,this.result_highlight.addClass("highlighted"),n=(i=parseInt(this.search_results.css("maxHeight"),10))+(r=this.search_results.scrollTop()),(e=(s=this.result_highlight.position().top+this.search_results.scrollTop())+this.result_highlight.outerHeight())>=n)return this.search_results.scrollTop(e-i>0?e-i:0);if(s<r)return this.search_results.scrollTop(s)}},n.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},n.prototype.results_show=function(){return this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.container.addClass("chosen-with-drop"),this.results_showing=!0,this.search_field.focus(),this.search_field.val(this.get_search_field_value()),this.winnow_results(),this.form_field_jq.trigger("chosen:showing_dropdown",{chosen:this}))},n.prototype.update_results_content=function(t){return this.search_results.html(t)},n.prototype.results_hide=function(){return this.results_showing&&(this.result_clear_highlight(),this.container.removeClass("chosen-with-drop"),this.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:this})),this.results_showing=!1},n.prototype.set_tab_index=function(t){var e;if(this.form_field.tabIndex)return e=this.form_field.tabIndex,this.form_field.tabIndex=-1,this.search_field[0].tabIndex=e},n.prototype.set_label_behavior=function(){if(this.form_field_label=this.form_field_jq.parents("label"),!this.form_field_label.length&&this.form_field.id.length&&(this.form_field_label=t("label[for='"+this.form_field.id+"']")),this.form_field_label.length>0)return this.form_field_label.on("click.chosen",this.label_click_handler)},n.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},n.prototype.search_results_mouseup=function(e){var s;if((s=t(e.target).hasClass("active-result")?t(e.target):t(e.target).parents(".active-result").first()).length)return this.result_highlight=s,this.result_select(e),this.search_field.focus()},n.prototype.search_results_mouseover=function(e){var s;if(s=t(e.target).hasClass("active-result")?t(e.target):t(e.target).parents(".active-result").first())return this.result_do_highlight(s)},n.prototype.search_results_mouseout=function(e){if(t(e.target).hasClass("active-result")||t(e.target).parents(".active-result").first())return this.result_clear_highlight()},n.prototype.choice_build=function(e){var s,i,n;return s=t("<li />",{class:"search-choice"}).html("<span>"+this.choice_label(e)+"</span>"),e.disabled?s.addClass("search-choice-disabled"):((i=t("<a />",{class:"search-choice-close","data-option-array-index":e.array_index})).on("click.chosen",(n=this,function(t){return n.choice_destroy_link_click(t)})),s.append(i)),this.search_container.before(s)},n.prototype.choice_destroy_link_click=function(e){if(e.preventDefault(),e.stopPropagation(),!this.is_disabled)return this.choice_destroy(t(e.target))},n.prototype.choice_destroy=function(t){if(this.result_deselect(t[0].getAttribute("data-option-array-index")))return this.active_field?this.search_field.focus():this.show_search_field_default(),this.is_multiple&&this.choices_count()>0&&this.get_search_field_value().length<1&&this.results_hide(),t.parents("li").first().remove(),this.search_field_scale()},n.prototype.results_reset=function(){if(this.reset_single_select_options(),this.form_field.options[0].selected=!0,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup(),this.trigger_form_field_change(),this.active_field)return this.results_hide()},n.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},n.prototype.result_select=function(t){var e,s;if(this.result_highlight)return e=this.result_highlight,this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.is_multiple?e.removeClass("active-result"):this.reset_single_select_options(),e.addClass("result-selected"),(s=this.results_data[e[0].getAttribute("data-option-array-index")]).selected=!0,this.form_field.options[s.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(s):this.single_set_selected_text(this.choice_label(s)),this.is_multiple&&(!this.hide_results_on_select||t.metaKey||t.ctrlKey)?t.metaKey||t.ctrlKey?this.winnow_results({skip_highlight:!0}):(this.search_field.val(""),this.winnow_results()):(this.results_hide(),this.show_search_field_default()),(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex)&&this.trigger_form_field_change({selected:this.form_field.options[s.options_index].value}),this.current_selectedIndex=this.form_field.selectedIndex,t.preventDefault(),this.search_field_scale())},n.prototype.single_set_selected_text=function(t){return null==t&&(t=this.default_text),t===this.default_text?this.selected_item.addClass("chosen-default"):(this.single_deselect_control_build(),this.selected_item.removeClass("chosen-default")),this.selected_item.find("span").html(t)},n.prototype.result_deselect=function(t){var e;return e=this.results_data[t],!this.form_field.options[e.options_index].disabled&&(e.selected=!1,this.form_field.options[e.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),this.trigger_form_field_change({deselected:this.form_field.options[e.options_index].value}),this.search_field_scale(),!0)},n.prototype.single_deselect_control_build=function(){if(this.allow_single_deselect)return this.selected_item.find("abbr").length||this.selected_item.find("span").first().after('<abbr class="search-choice-close"></abbr>'),this.selected_item.addClass("chosen-single-with-deselect")},n.prototype.get_search_field_value=function(){return this.search_field.val()},n.prototype.get_search_text=function(){return t.trim(this.get_search_field_value())},n.prototype.escape_html=function(e){return t("<div/>").text(e).html()},n.prototype.winnow_results_set_highlight=function(){var t,e;if(null!=(t=(e=this.is_multiple?[]:this.search_results.find(".result-selected.active-result")).length?e.first():this.search_results.find(".active-result").first()))return this.result_do_highlight(t)},n.prototype.no_results=function(t){var e;return e=this.get_no_results_html(t),this.search_results.append(e),this.form_field_jq.trigger("chosen:no_results",{chosen:this})},n.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},n.prototype.keydown_arrow=function(){var t;return this.results_showing&&this.result_highlight?(t=this.result_highlight.nextAll("li.active-result").first())?this.result_do_highlight(t):void 0:this.results_show()},n.prototype.keyup_arrow=function(){var t;return this.results_showing||this.is_multiple?this.result_highlight?(t=this.result_highlight.prevAll("li.active-result")).length?this.result_do_highlight(t.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight()):void 0:this.results_show()},n.prototype.keydown_backstroke=function(){var t;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(t=this.search_container.siblings("li.search-choice").last()).length&&!t.hasClass("search-choice-disabled")?(this.pending_backstroke=t,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0},n.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},n.prototype.search_field_scale=function(){var e,s,i,n,r,o,h;if(this.is_multiple){for(r={position:"absolute",left:"-1000px",top:"-1000px",display:"none",whiteSpace:"pre"},s=0,i=(o=["fontSize","fontStyle","fontWeight","fontFamily","lineHeight","textTransform","letterSpacing"]).length;s<i;s++)r[n=o[s]]=this.search_field.css(n);return(e=t("<div />").css(r)).text(this.get_search_field_value()),t("body").append(e),h=e.width()+25,e.remove(),this.container.is(":visible")&&(h=Math.min(this.container.outerWidth()-10,h)),this.search_field.width(h)}},n.prototype.trigger_form_field_change=function(t){return this.form_field_jq.trigger("input",t),this.form_field_jq.trigger("change",t)},n}()}.call(this),function(t){"use strict";function e(t,e,s){this.init(t,e,s)}function s(){this.rules=[]}t.extend(e.prototype,{init:function(t,e,s){this.controller=t,this.condition=e,this.value=s,this.rules=[],this.controls=[]},evalCondition:function(e,s,i,n,r){if("=="==i)return this.checkBoolean(n)==this.checkBoolean(r);if("!="==i)return this.checkBoolean(n)!=this.checkBoolean(r);if(">="==i)return Number(r)>=Number(n);if("<="==i)return Number(r)<=Number(n);if(">"==i)return Number(r)>Number(n);if("<"==i)return Number(r)<Number(n);if("()"==i)return window[n](e,s,r);if("any"==i){if(t.isArray(r)){for(var o=r.length-1;o>=0;o--)if(-1!==t.inArray(r[o],n.split(",")))return!0}else if(-1!==t.inArray(r,n.split(",")))return!0}else if("not-any"==i)if(t.isArray(r)){for(o=r.length-1;o>=0;o--)if(-1==t.inArray(r[o],n.split(",")))return!0}else if(-1==t.inArray(r,n.split(",")))return!0;return!1},checkBoolean:function(t){switch(t){case!0:case"true":case 1:case"1":t=!0;break;case null:case!1:case"false":case 0:case"0":t=!1}return t},checkCondition:function(t){if(!this.condition)return!0;var e=t.find(this.controller),s=this.getControlValue(t,e);return void 0!==s&&(s=this.normalizeValue(e,this.value,s),this.evalCondition(t,e,this.condition,this.value,s))},normalizeValue:function(t,e,s){return"number"==typeof e?parseFloat(s):s},getControlValue:function(t,e){return e.length>1&&("radio"==e.attr("type")||"checkbox"==e.attr("type"))?e.filter(":checked").map(function(){return this.value}).get():"checkbox"==e.attr("type")||"radio"==e.attr("type")?e.is(":checked"):e.val()},createRule:function(t,s,i){var n=new e(t,s,i);return this.rules.push(n),n},include:function(t){this.controls.push(t)},applyRule:function(e,s){var i;i=void 0===s?this.checkCondition(e):s;var n=t.map(this.controls,function(t,s){return e.find(t)});i?(t(n).each(function(){t(this).removeClass("hidden")}),t(this.rules).each(function(){this.applyRule(e)})):(t(n).each(function(){t(this).addClass("hidden")}),t(this.rules).each(function(){this.applyRule(e,!1)}))}}),t.extend(s.prototype,{createRule:function(t,s,i){var n=new e(t,s,i);return this.rules.push(n),n},applyRules:function(e){t(this.rules).each(function(){this.applyRule(e)})}}),t.csf_deps={createRuleset:function(){return new s},enable:function(t,e,s){return t.on("change keyup",function(i){var n=i.target.getAttribute("data-depend-id")||i.target.getAttribute("data-sub-depend-id");-1!==s.indexOf(n)&&e.applyRules(t)}),e.applyRules(t),!0}}}(jQuery),function(t,e){if("function"==typeof define&&define.amd)define(["exports","jquery"],function(t,s){return e(t,s)});else if("undefined"!=typeof exports){var s=require("jquery");e(exports,s)}else e(t,t.jQuery||t.Zepto||t.ender||t.$)}(this,function(t,e){var s={validate:/^(?!(_nonce|_pseudo))[a-zA-Z0-9_-]*(?:\[(?:\d*|(?!(_nonce|_pseudo))[a-zA-Z0-9_-]+)\])*$/i,key:/[a-zA-Z0-9_-]+|(?=\[\])/g,named:/^[a-zA-Z0-9_-]+$/,push:/^$/,fixed:/^\d+$/};function i(t,e){var i={},n={};function r(t,e,s){return t[e]=s,t}function o(){return i}this.addPair=function(e){if(!s.validate.test(e.name))return this;var o=function(t,e){for(var i,o=t.match(s.key);void 0!==(i=o.pop());)s.push.test(i)?e=r([],(h=t.replace(/\[\]$/,""),void 0===n[h]&&(n[h]=0),n[h]++),e):s.fixed.test(i)?e=r([],i,e):s.named.test(i)&&(e=r({},i,e));var h;return e}(e.name,e.value);return i=t.extend(!0,i,o),this},this.addPairs=function(e){if(!t.isArray(e))throw new Error("formSerializer.addPairs expects an Array");for(var s=0,i=e.length;s<i;s++)this.addPair(e[s]);return this},this.serialize=o,this.serializeJSON=function(){return JSON.stringify(o())}}return i.patterns=s,i.serializeObject=function(){return new i(e,this).addPairs(this.serializeArray()).serialize()},i.serializeJSON=function(){return new i(e,this).addPairs(this.serializeArray()).serializeJSON()},void 0!==e.fn&&(e.fn.serializeObjectCSF=i.serializeObject,e.fn.serializeJSONCSF=i.serializeJSON),t.FormSerializer=i,i});
1
+ /* Codestar Framework | A Simple and Lightweight WordPress Option Framework - v2.1.5*/
2
 
3
  !function(t){function e(e,s){this.element=t(e),this.options=s,this.init()}e.prototype.init=function(){this.element.chosen(this.options),this.container=this.element.next(".chosen-container"),this.search_field=this.container.find(".chosen-search-input"),this.is_multiple=this.container.hasClass("chosen-container-multi"),this.is_typing=!1,this.chosenXhr=null,this.events()},e.prototype.events=function(){var t=this;this.search_field.on("compositionstart",function(){t.is_typing=!0}),this.search_field.on("compositionend",function(){t.is_typing=!1,t.update_list()}),this.search_field.on("keyup",function(){t.update_list()}),this.search_field.on("focus",function(){t.search_field_focused()})},e.prototype.search_field_focused=function(){this.search_welcome_message(),0===this.options.min_length&&0===this.search_field.val().length&&this.update_list()},e.prototype.search_welcome_message=function(){var e=t.trim(this.search_field.val()),s=this.container.find(".chosen-results");0===s.children().length&&0===e.length&&s.html('<li class="no-results">'+this.options.typing_text.replace("%s",this.options.min_length-e.length)+"</li>")},e.prototype.update_list=function(){var e=this;if(this.search_welcome_message(),!this.is_typing){var s=t.trim(this.search_field.val()),i=s.length<this.options.min_length?this.options.typing_text.replace("%s",this.options.min_length-s.length):this.options.searching_text;this.container.find(".no-results").text(i),s!==this.search_field.data("prevVal")&&(this.search_field.data("prevVal",s),this.timer&&clearTimeout(this.timer),s.length<this.options.min_length||(this.timer=setTimeout(function(){e.chosenXhr&&e.chosenXhr.abort(),e.options.data.term=s,e.chosenXhr=window.wp.ajax.post("csf-chosen",e.options.data).done(function(t){e.show_results(t)}).fail(function(t){e.container.find(".no-results").text(t.error)})},this.options.type_delay)))}},e.prototype.show_results=function(e){var s=this;if(!this.is_typing&&null!==e){if(0===e.length)return this.element.data().chosen.no_results_clear(),void this.element.data().chosen.no_results(this.search_field.val());var i=[];this.element.find("option").each(function(){t(this).is(":selected")?i.push(t(this).val()+"-"+t(this).text()):t(this).attr("value").length&&t(this).remove()}),t.each(e,function(e,n){-1===t.inArray(n.value+"-"+n.text,i)&&t("<option />").attr("value",n.value).html(n.text).appendTo(s.element)});var n=this.search_field.val(),r=this.search_field.innerWidth();if(this.element.trigger("chosen:updated"),this.is_multiple){var o=this.element.parent().find(".csf-hidden-select").val()||[];this.element.CSFChosenOrder(o,!0),this.search_field.css("width",r)}this.search_field.val(n),null!==this.chosenXhr.done&&this.chosenXhr.done(e)}},t.fn.CSFAjaxChosen=function(t){return this.each(function(){new e(this,t)})}}(jQuery),function(){var t,e,s=[].indexOf||function(t){for(var e=0,s=this.length;e<s;e++)if(e in this&&this[e]===t)return e;return-1},i={}.hasOwnProperty;e=function(){function t(){}return t.insertAt=function(t,e,s){return s.insertBefore(t,s.children[e].nextSibling)},t.getFlattenedOptionsAndGroups=function(t){var e,s,i,n,r,o,h,l,c;for(e=[],o=0,l=(i=Array.prototype.filter.call(t.childNodes,function(t){var e;return"OPTION"===(e=t.nodeName.toUpperCase())||"OPTGROUP"===e})).length;o<l;o++)if(s=i[o],e.push(s),"OPTGROUP"===s.nodeName.toUpperCase())for(h=0,c=(r=Array.prototype.filter.call(s.childNodes,function(t){return"OPTION"===t.nodeName.toUpperCase()})).length;h<c;h++)n=r[h],e.push(n);return e},t.isValidMultipleSelectElement=function(t){return null!=t&&"SELECT"===t.nodeName&&t.multiple},t.getChosenUIContainer=function(t){return""!==t.id?document.getElementById(t.id.replace(/-/g,"_")+"_chosen"):this.searchChosenUIContainer(t)},t.isChosenified=function(t){return null!=this.getChosenUIContainer(t)},t.forceSelection=function(t,e){var i,n,r,o;for(r=this.getFlattenedOptionsAndGroups(t),i=0;i<r.length;)o=(n=r[i]).getAttribute("value"),s.call(e,o)>=0?(n.selected=!0,n.setAttribute("selected","")):(n.selected=!1,n.removeAttribute("selected")),i++;return this.triggerEvent(t,"chosen:updated")},t.CSFChosenOrder=function(t,e,s){var i,n,r,o,h,l,c,a,u,_,d,p,f,g;if(null!=this.getDOMElement&&(t=this.getDOMElement(t)),this.isValidMultipleSelectElement(t)&&null!=(n=this.getChosenUIContainer(t))&&e instanceof Array){for(e=e.map(Function.prototype.call,String.prototype.trim),c=this.getFlattenedOptionsAndGroups(t),null!=s&&!0===s&&this.forceSelection(t,e),g=[],r=_=0,p=e.length;_<p;r=++_){for(h=e[r],a=null,o=d=0,f=c.length;d<f;o=++d)c[o].value===h&&(a=o);i=n.querySelectorAll(".search-choice"),u=this.relAttributeName,null!=(l=Array.prototype.filter.call(i,function(t){return null!=t.querySelector("a.search-choice-close["+u+'="'+a+'"]')})[0])&&(n.querySelector("ul.chosen-choices"),g.push(this.insertAt(l,r,n.querySelector("ul.chosen-choices"))))}return g}},t}(),(t=jQuery).fn.extend({CSFChosenOrder:function(t,e){return _CSFChosenOrder.CSFChosenOrder(this,t,e)}}),this._CSFChosenOrder=function(s){function n(){return n.__super__.constructor.apply(this,arguments)}return function(t,e){for(var s in e)i.call(e,s)&&(t[s]=e[s]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(n,e),n.relAttributeName="data-option-array-index",n.isjQueryObject=function(t){return"undefined"!=typeof jQuery&&null!==jQuery&&t instanceof jQuery},n.getDOMElement=function(t){return this.isjQueryObject(t)?t.get(0):t},n.searchChosenUIContainer=function(e){return null!=t(e).data("chosen")?t(e).data("chosen").container[0]:t(e).next(".chosen-container.chosen-container-multi").get(0)},n.triggerEvent=function(e,s){return t(e).trigger(s)},n}()}.call(this),function(){var t,e,s,i,n=function(t,e){return function(){return t.apply(e,arguments)}},r={}.hasOwnProperty;(i=function(){function t(){this.options_index=0,this.parsed=[]}return t.prototype.add_node=function(t){return"OPTGROUP"===t.nodeName.toUpperCase()?this.add_group(t):this.add_option(t)},t.prototype.add_group=function(t){var e,s,i,n,r,o;for(e=this.parsed.length,this.parsed.push({array_index:e,group:!0,label:t.label,title:t.title?t.title:void 0,children:0,disabled:t.disabled,classes:t.className}),o=[],s=0,i=(r=t.childNodes).length;s<i;s++)n=r[s],o.push(this.add_option(n,e,t.disabled));return o},t.prototype.add_option=function(t,e,s){if("OPTION"===t.nodeName.toUpperCase())return""!==t.text?(null!=e&&(this.parsed[e].children+=1),this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:t.value,text:t.text,html:t.innerHTML,title:t.title?t.title:void 0,selected:t.selected,disabled:!0===s?s:t.disabled,group_array_index:e,group_label:null!=e?this.parsed[e].label:null,classes:t.className,style:t.style.cssText})):this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:!0}),this.options_index+=1},t}()).select_to_array=function(t){var e,s,n,r,o;for(r=new i,s=0,n=(o=t.childNodes).length;s<n;s++)e=o[s],r.add_node(e);return r.parsed},e=function(){function t(e,s){this.form_field=e,this.options=null!=s?s:{},this.label_click_handler=n(this.label_click_handler,this),t.browser_is_supported()&&(this.is_multiple=this.form_field.multiple,this.set_default_text(),this.set_default_values(),this.setup(),this.set_up_html(),this.register_observers(),this.on_ready())}return t.prototype.set_default_values=function(){var t,e;return this.click_test_action=(t=this,function(e){return t.test_active_click(e)}),this.activate_action=(e=this,function(t){return e.activate_field(t)}),this.active_field=!1,this.mouse_on_container=!1,this.results_showing=!1,this.result_highlighted=null,this.is_rtl=this.options.rtl||/\bchosen-rtl\b/.test(this.form_field.className),this.allow_single_deselect=null!=this.options.allow_single_deselect&&null!=this.form_field.options[0]&&""===this.form_field.options[0].text&&this.options.allow_single_deselect,this.disable_search_threshold=this.options.disable_search_threshold||0,this.disable_search=this.options.disable_search||!1,this.enable_split_word_search=null==this.options.enable_split_word_search||this.options.enable_split_word_search,this.group_search=null==this.options.group_search||this.options.group_search,this.search_contains=this.options.search_contains||!1,this.single_backstroke_delete=null==this.options.single_backstroke_delete||this.options.single_backstroke_delete,this.max_selected_options=this.options.max_selected_options||1/0,this.inherit_select_classes=this.options.inherit_select_classes||!1,this.display_selected_options=null==this.options.display_selected_options||this.options.display_selected_options,this.display_disabled_options=null==this.options.display_disabled_options||this.options.display_disabled_options,this.include_group_label_in_selected=this.options.include_group_label_in_selected||!1,this.max_shown_results=this.options.max_shown_results||Number.POSITIVE_INFINITY,this.case_sensitive_search=this.options.case_sensitive_search||!1,this.hide_results_on_select=null==this.options.hide_results_on_select||this.options.hide_results_on_select},t.prototype.set_default_text=function(){return this.form_field.getAttribute("data-placeholder")?this.default_text=this.form_field.getAttribute("data-placeholder"):this.is_multiple?this.default_text=this.options.placeholder_text_multiple||this.options.placeholder_text||t.default_multiple_text:this.default_text=this.options.placeholder_text_single||this.options.placeholder_text||t.default_single_text,this.default_text=this.escape_html(this.default_text),this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||t.default_no_result_text},t.prototype.choice_label=function(t){return this.include_group_label_in_selected&&null!=t.group_label?"<b class='group-name'>"+this.escape_html(t.group_label)+"</b>"+t.html:t.html},t.prototype.mouse_enter=function(){return this.mouse_on_container=!0},t.prototype.mouse_leave=function(){return this.mouse_on_container=!1},t.prototype.input_focus=function(t){if(this.is_multiple){if(!this.active_field)return setTimeout((e=this,function(){return e.container_mousedown()}),50)}else if(!this.active_field)return this.activate_field();var e},t.prototype.input_blur=function(t){if(!this.mouse_on_container)return this.active_field=!1,setTimeout((e=this,function(){return e.blur_test()}),100);var e},t.prototype.label_click_handler=function(t){return this.is_multiple?this.container_mousedown(t):this.activate_field()},t.prototype.results_option_build=function(t){var e,s,i,n,r,o,h;for(e="",h=0,n=0,r=(o=this.results_data).length;n<r&&(i="",""!==(i=(s=o[n]).group?this.result_add_group(s):this.result_add_option(s))&&(h++,e+=i),(null!=t?t.first:void 0)&&(s.selected&&this.is_multiple?this.choice_build(s):s.selected&&!this.is_multiple&&this.single_set_selected_text(this.choice_label(s))),!(h>=this.max_shown_results));n++);return e},t.prototype.result_add_option=function(t){var e,s;return t.search_match&&this.include_option_in_results(t)?(e=[],t.disabled||t.selected&&this.is_multiple||e.push("active-result"),!t.disabled||t.selected&&this.is_multiple||e.push("disabled-result"),t.selected&&e.push("result-selected"),null!=t.group_array_index&&e.push("group-option"),""!==t.classes&&e.push(t.classes),(s=document.createElement("li")).className=e.join(" "),t.style&&(s.style.cssText=t.style),s.setAttribute("data-option-array-index",t.array_index),s.innerHTML=t.highlighted_html||t.html,t.title&&(s.title=t.title),this.outerHTML(s)):""},t.prototype.result_add_group=function(t){var e,s;return(t.search_match||t.group_match)&&t.active_options>0?((e=[]).push("group-result"),t.classes&&e.push(t.classes),(s=document.createElement("li")).className=e.join(" "),s.innerHTML=t.highlighted_html||this.escape_html(t.label),t.title&&(s.title=t.title),this.outerHTML(s)):""},t.prototype.results_update_field=function(){if(this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.results_build(),this.results_showing)return this.winnow_results()},t.prototype.reset_single_select_options=function(){var t,e,s,i,n;for(n=[],t=0,e=(s=this.results_data).length;t<e;t++)(i=s[t]).selected?n.push(i.selected=!1):n.push(void 0);return n},t.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},t.prototype.results_search=function(t){return this.results_showing?this.winnow_results():this.results_show()},t.prototype.winnow_results=function(t){var e,s,i,n,r,o,h,l,c,a,u,_,d,p,f;for(this.no_results_clear(),a=0,e=(h=this.get_search_text()).replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),c=this.get_search_regex(e),i=0,n=(l=this.results_data).length;i<n;i++)(r=l[i]).search_match=!1,u=null,_=null,r.highlighted_html="",this.include_option_in_results(r)&&(r.group&&(r.group_match=!1,r.active_options=0),null!=r.group_array_index&&this.results_data[r.group_array_index]&&(0===(u=this.results_data[r.group_array_index]).active_options&&u.search_match&&(a+=1),u.active_options+=1),f=r.group?r.label:r.text,r.group&&!this.group_search||(_=this.search_string_match(f,c),r.search_match=null!=_,r.search_match&&!r.group&&(a+=1),r.search_match?(h.length&&(d=_.index,o=f.slice(0,d),s=f.slice(d,d+h.length),p=f.slice(d+h.length),r.highlighted_html=this.escape_html(o)+"<em>"+this.escape_html(s)+"</em>"+this.escape_html(p)),null!=u&&(u.group_match=!0)):null!=r.group_array_index&&this.results_data[r.group_array_index].search_match&&(r.search_match=!0)));return this.result_clear_highlight(),a<1&&h.length?(this.update_results_content(""),this.no_results(h)):(this.update_results_content(this.results_option_build()),(null!=t?t.skip_highlight:void 0)?void 0:this.winnow_results_set_highlight())},t.prototype.get_search_regex=function(t){var e,s;return s=this.search_contains?t:"(^|\\s|\\b)"+t+"[^\\s]*",this.enable_split_word_search||this.search_contains||(s="^"+s),e=this.case_sensitive_search?"":"i",new RegExp(s,e)},t.prototype.search_string_match=function(t,e){var s;return s=e.exec(t),!this.search_contains&&(null!=s?s[1]:void 0)&&(s.index+=1),s},t.prototype.choices_count=function(){var t,e,s;if(null!=this.selected_option_count)return this.selected_option_count;for(this.selected_option_count=0,t=0,e=(s=this.form_field.options).length;t<e;t++)s[t].selected&&(this.selected_option_count+=1);return this.selected_option_count},t.prototype.choices_click=function(t){if(t.preventDefault(),this.activate_field(),!this.results_showing&&!this.is_disabled)return this.results_show()},t.prototype.keydown_checker=function(t){var e,s;switch(s=null!=(e=t.which)?e:t.keyCode,this.search_field_scale(),8!==s&&this.pending_backstroke&&this.clear_backstroke(),s){case 8:this.backstroke_length=this.get_search_field_value().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(t),this.mouse_on_container=!1;break;case 13:case 27:this.results_showing&&t.preventDefault();break;case 32:this.disable_search&&t.preventDefault();break;case 38:t.preventDefault(),this.keyup_arrow();break;case 40:t.preventDefault(),this.keydown_arrow()}},t.prototype.keyup_checker=function(t){var e,s;switch(s=null!=(e=t.which)?e:t.keyCode,this.search_field_scale(),s){case 8:this.is_multiple&&this.backstroke_length<1&&this.choices_count()>0?this.keydown_backstroke():this.pending_backstroke||(this.result_clear_highlight(),this.results_search());break;case 13:t.preventDefault(),this.results_showing&&this.result_select(t);break;case 27:this.results_showing&&this.results_hide();break;case 9:case 16:case 17:case 18:case 38:case 40:case 91:break;default:this.results_search()}},t.prototype.clipboard_event_checker=function(t){var e;if(!this.is_disabled)return setTimeout((e=this,function(){return e.results_search()}),50)},t.prototype.container_width=function(){return null!=this.options.width?this.options.width:this.form_field.offsetWidth+"px"},t.prototype.include_option_in_results=function(t){return!(this.is_multiple&&!this.display_selected_options&&t.selected)&&(!(!this.display_disabled_options&&t.disabled)&&!t.empty)},t.prototype.search_results_touchstart=function(t){return this.touch_started=!0,this.search_results_mouseover(t)},t.prototype.search_results_touchmove=function(t){return this.touch_started=!1,this.search_results_mouseout(t)},t.prototype.search_results_touchend=function(t){if(this.touch_started)return this.search_results_mouseup(t)},t.prototype.outerHTML=function(t){var e;return t.outerHTML?t.outerHTML:((e=document.createElement("div")).appendChild(t),e.innerHTML)},t.prototype.get_single_html=function(){return'<a class="chosen-single chosen-default">\n <span>'+this.default_text+'</span>\n <div><b></b></div>\n</a>\n<div class="chosen-drop">\n <div class="chosen-search">\n <input class="chosen-search-input" type="text" autocomplete="off" />\n </div>\n <ul class="chosen-results"></ul>\n</div>'},t.prototype.get_multi_html=function(){return'<ul class="chosen-choices">\n <li class="search-field">\n <input class="chosen-search-input" type="text" autocomplete="off" value="'+this.default_text+'" />\n </li>\n</ul>\n<div class="chosen-drop">\n <ul class="chosen-results"></ul>\n</div>'},t.prototype.get_no_results_html=function(t){return'<li class="no-results">\n '+this.results_none_found+" <span>"+this.escape_html(t)+"</span>\n</li>"},t.browser_is_supported=function(){return"Microsoft Internet Explorer"===window.navigator.appName?document.documentMode>=8:!(/iP(od|hone)/i.test(window.navigator.userAgent)||/IEMobile/i.test(window.navigator.userAgent)||/Windows Phone/i.test(window.navigator.userAgent)||/BlackBerry/i.test(window.navigator.userAgent)||/BB10/i.test(window.navigator.userAgent)||/Android.*Mobile/i.test(window.navigator.userAgent))},t.default_multiple_text="Select Some Options",t.default_single_text="Select an Option",t.default_no_result_text="No results match",t}(),(t=jQuery).fn.extend({chosen:function(i){return e.browser_is_supported()?this.each(function(e){var n,r;r=(n=t(this)).data("chosen"),"destroy"!==i?r instanceof s||n.data("chosen",new s(this,i)):r instanceof s&&r.destroy()}):this}}),s=function(s){function n(){return n.__super__.constructor.apply(this,arguments)}return function(t,e){for(var s in e)r.call(e,s)&&(t[s]=e[s]);function i(){this.constructor=t}i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype}(n,e),n.prototype.setup=function(){return this.form_field_jq=t(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex},n.prototype.set_up_html=function(){var e,s;return(e=["chosen-container"]).push("chosen-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&e.push(this.form_field.className),this.is_rtl&&e.push("chosen-rtl"),s={class:e.join(" "),title:this.form_field.title},this.form_field.id.length&&(s.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chosen"),this.container=t("<div />",s),this.container.width(this.container_width()),this.is_multiple?this.container.html(this.get_multi_html()):this.container.html(this.get_single_html()),this.form_field_jq.hide().after(this.container),this.dropdown=this.container.find("div.chosen-drop").first(),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chosen-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chosen-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chosen-search").first(),this.selected_item=this.container.find(".chosen-single").first()),this.results_build(),this.set_tab_index(),this.set_label_behavior()},n.prototype.on_ready=function(){return this.form_field_jq.trigger("chosen:ready",{chosen:this})},n.prototype.register_observers=function(){var t,e,s,i,n,r,o,h,l,c,a,u,_,d,p,f,g,m,v,y,b,w,x,k;return this.container.on("touchstart.chosen",(t=this,function(e){t.container_mousedown(e)})),this.container.on("touchend.chosen",(e=this,function(t){e.container_mouseup(t)})),this.container.on("mousedown.chosen",(s=this,function(t){s.container_mousedown(t)})),this.container.on("mouseup.chosen",(i=this,function(t){i.container_mouseup(t)})),this.container.on("mouseenter.chosen",(n=this,function(t){n.mouse_enter(t)})),this.container.on("mouseleave.chosen",(r=this,function(t){r.mouse_leave(t)})),this.search_results.on("mouseup.chosen",(o=this,function(t){o.search_results_mouseup(t)})),this.search_results.on("mouseover.chosen",(h=this,function(t){h.search_results_mouseover(t)})),this.search_results.on("mouseout.chosen",(l=this,function(t){l.search_results_mouseout(t)})),this.search_results.on("mousewheel.chosen DOMMouseScroll.chosen",(c=this,function(t){c.search_results_mousewheel(t)})),this.search_results.on("touchstart.chosen",(a=this,function(t){a.search_results_touchstart(t)})),this.search_results.on("touchmove.chosen",(u=this,function(t){u.search_results_touchmove(t)})),this.search_results.on("touchend.chosen",(_=this,function(t){_.search_results_touchend(t)})),this.form_field_jq.on("chosen:updated.chosen",(d=this,function(t){d.results_update_field(t)})),this.form_field_jq.on("chosen:activate.chosen",(p=this,function(t){p.activate_field(t)})),this.form_field_jq.on("chosen:open.chosen",(f=this,function(t){f.container_mousedown(t)})),this.form_field_jq.on("chosen:close.chosen",(g=this,function(t){g.close_field(t)})),this.search_field.on("blur.chosen",(m=this,function(t){m.input_blur(t)})),this.search_field.on("keyup.chosen",(v=this,function(t){v.keyup_checker(t)})),this.search_field.on("keydown.chosen",(y=this,function(t){y.keydown_checker(t)})),this.search_field.on("focus.chosen",(b=this,function(t){b.input_focus(t)})),this.search_field.on("cut.chosen",(w=this,function(t){w.clipboard_event_checker(t)})),this.search_field.on("paste.chosen",(x=this,function(t){x.clipboard_event_checker(t)})),this.is_multiple?this.search_choices.on("click.chosen",(k=this,function(t){k.choices_click(t)})):this.container.on("click.chosen",function(t){t.preventDefault()})},n.prototype.destroy=function(){return t(this.container[0].ownerDocument).off("click.chosen",this.click_test_action),this.form_field_label.length>0&&this.form_field_label.off("click.chosen"),this.search_field[0].tabIndex&&(this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex),this.container.remove(),this.form_field_jq.removeData("chosen"),this.form_field_jq.show()},n.prototype.search_field_disabled=function(){return this.is_disabled=this.form_field.disabled||this.form_field_jq.parents("fieldset").is(":disabled"),this.container.toggleClass("chosen-disabled",this.is_disabled),this.search_field[0].disabled=this.is_disabled,this.is_multiple||this.selected_item.off("focus.chosen",this.activate_field),this.is_disabled?this.close_field():this.is_multiple?void 0:this.selected_item.on("focus.chosen",this.activate_field)},n.prototype.container_mousedown=function(e){var s;if(!this.is_disabled)return!e||"mousedown"!==(s=e.type)&&"touchstart"!==s||this.results_showing||e.preventDefault(),null!=e&&t(e.target).hasClass("search-choice-close")?void 0:(this.active_field?this.is_multiple||!e||t(e.target)[0]!==this.selected_item[0]&&!t(e.target).parents("a.chosen-single").length||(e.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),t(this.container[0].ownerDocument).on("click.chosen",this.click_test_action),this.results_show()),this.activate_field())},n.prototype.container_mouseup=function(t){if("ABBR"===t.target.nodeName&&!this.is_disabled)return this.results_reset(t)},n.prototype.search_results_mousewheel=function(t){var e;if(t.originalEvent&&(e=t.originalEvent.deltaY||-t.originalEvent.wheelDelta||t.originalEvent.detail),null!=e)return t.preventDefault(),"DOMMouseScroll"===t.type&&(e*=40),this.search_results.scrollTop(e+this.search_results.scrollTop())},n.prototype.blur_test=function(t){if(!this.active_field&&this.container.hasClass("chosen-container-active"))return this.close_field()},n.prototype.close_field=function(){return t(this.container[0].ownerDocument).off("click.chosen",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chosen-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale(),this.search_field.blur()},n.prototype.activate_field=function(){if(!this.is_disabled)return this.container.addClass("chosen-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},n.prototype.test_active_click=function(e){var s;return(s=t(e.target).closest(".chosen-container")).length&&this.container[0]===s[0]?this.active_field=!0:this.close_field()},n.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=i.select_to_array(this.form_field),this.is_multiple?this.search_choices.find("li.search-choice").remove():(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field[0].readOnly=!0,this.container.addClass("chosen-container-single-nosearch")):(this.search_field[0].readOnly=!1,this.container.removeClass("chosen-container-single-nosearch"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1},n.prototype.result_do_highlight=function(t){var e,s,i,n,r;if(t.length){if(this.result_clear_highlight(),this.result_highlight=t,this.result_highlight.addClass("highlighted"),n=(i=parseInt(this.search_results.css("maxHeight"),10))+(r=this.search_results.scrollTop()),(e=(s=this.result_highlight.position().top+this.search_results.scrollTop())+this.result_highlight.outerHeight())>=n)return this.search_results.scrollTop(e-i>0?e-i:0);if(s<r)return this.search_results.scrollTop(s)}},n.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},n.prototype.results_show=function(){return this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.container.addClass("chosen-with-drop"),this.results_showing=!0,this.search_field.focus(),this.search_field.val(this.get_search_field_value()),this.winnow_results(),this.form_field_jq.trigger("chosen:showing_dropdown",{chosen:this}))},n.prototype.update_results_content=function(t){return this.search_results.html(t)},n.prototype.results_hide=function(){return this.results_showing&&(this.result_clear_highlight(),this.container.removeClass("chosen-with-drop"),this.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:this})),this.results_showing=!1},n.prototype.set_tab_index=function(t){var e;if(this.form_field.tabIndex)return e=this.form_field.tabIndex,this.form_field.tabIndex=-1,this.search_field[0].tabIndex=e},n.prototype.set_label_behavior=function(){if(this.form_field_label=this.form_field_jq.parents("label"),!this.form_field_label.length&&this.form_field.id.length&&(this.form_field_label=t("label[for='"+this.form_field.id+"']")),this.form_field_label.length>0)return this.form_field_label.on("click.chosen",this.label_click_handler)},n.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},n.prototype.search_results_mouseup=function(e){var s;if((s=t(e.target).hasClass("active-result")?t(e.target):t(e.target).parents(".active-result").first()).length)return this.result_highlight=s,this.result_select(e),this.search_field.focus()},n.prototype.search_results_mouseover=function(e){var s;if(s=t(e.target).hasClass("active-result")?t(e.target):t(e.target).parents(".active-result").first())return this.result_do_highlight(s)},n.prototype.search_results_mouseout=function(e){if(t(e.target).hasClass("active-result")||t(e.target).parents(".active-result").first())return this.result_clear_highlight()},n.prototype.choice_build=function(e){var s,i,n;return s=t("<li />",{class:"search-choice"}).html("<span>"+this.choice_label(e)+"</span>"),e.disabled?s.addClass("search-choice-disabled"):((i=t("<a />",{class:"search-choice-close","data-option-array-index":e.array_index})).on("click.chosen",(n=this,function(t){return n.choice_destroy_link_click(t)})),s.append(i)),this.search_container.before(s)},n.prototype.choice_destroy_link_click=function(e){if(e.preventDefault(),e.stopPropagation(),!this.is_disabled)return this.choice_destroy(t(e.target))},n.prototype.choice_destroy=function(t){if(this.result_deselect(t[0].getAttribute("data-option-array-index")))return this.active_field?this.search_field.focus():this.show_search_field_default(),this.is_multiple&&this.choices_count()>0&&this.get_search_field_value().length<1&&this.results_hide(),t.parents("li").first().remove(),this.search_field_scale()},n.prototype.results_reset=function(){if(this.reset_single_select_options(),this.form_field.options[0].selected=!0,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup(),this.trigger_form_field_change(),this.active_field)return this.results_hide()},n.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},n.prototype.result_select=function(t){var e,s;if(this.result_highlight)return e=this.result_highlight,this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.is_multiple?e.removeClass("active-result"):this.reset_single_select_options(),e.addClass("result-selected"),(s=this.results_data[e[0].getAttribute("data-option-array-index")]).selected=!0,this.form_field.options[s.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(s):this.single_set_selected_text(this.choice_label(s)),this.is_multiple&&(!this.hide_results_on_select||t.metaKey||t.ctrlKey)?t.metaKey||t.ctrlKey?this.winnow_results({skip_highlight:!0}):(this.search_field.val(""),this.winnow_results()):(this.results_hide(),this.show_search_field_default()),(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex)&&this.trigger_form_field_change({selected:this.form_field.options[s.options_index].value}),this.current_selectedIndex=this.form_field.selectedIndex,t.preventDefault(),this.search_field_scale())},n.prototype.single_set_selected_text=function(t){return null==t&&(t=this.default_text),t===this.default_text?this.selected_item.addClass("chosen-default"):(this.single_deselect_control_build(),this.selected_item.removeClass("chosen-default")),this.selected_item.find("span").html(t)},n.prototype.result_deselect=function(t){var e;return e=this.results_data[t],!this.form_field.options[e.options_index].disabled&&(e.selected=!1,this.form_field.options[e.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),this.trigger_form_field_change({deselected:this.form_field.options[e.options_index].value}),this.search_field_scale(),!0)},n.prototype.single_deselect_control_build=function(){if(this.allow_single_deselect)return this.selected_item.find("abbr").length||this.selected_item.find("span").first().after('<abbr class="search-choice-close"></abbr>'),this.selected_item.addClass("chosen-single-with-deselect")},n.prototype.get_search_field_value=function(){return this.search_field.val()},n.prototype.get_search_text=function(){return t.trim(this.get_search_field_value())},n.prototype.escape_html=function(e){return t("<div/>").text(e).html()},n.prototype.winnow_results_set_highlight=function(){var t,e;if(null!=(t=(e=this.is_multiple?[]:this.search_results.find(".result-selected.active-result")).length?e.first():this.search_results.find(".active-result").first()))return this.result_do_highlight(t)},n.prototype.no_results=function(t){var e;return e=this.get_no_results_html(t),this.search_results.append(e),this.form_field_jq.trigger("chosen:no_results",{chosen:this})},n.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},n.prototype.keydown_arrow=function(){var t;return this.results_showing&&this.result_highlight?(t=this.result_highlight.nextAll("li.active-result").first())?this.result_do_highlight(t):void 0:this.results_show()},n.prototype.keyup_arrow=function(){var t;return this.results_showing||this.is_multiple?this.result_highlight?(t=this.result_highlight.prevAll("li.active-result")).length?this.result_do_highlight(t.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight()):void 0:this.results_show()},n.prototype.keydown_backstroke=function(){var t;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(t=this.search_container.siblings("li.search-choice").last()).length&&!t.hasClass("search-choice-disabled")?(this.pending_backstroke=t,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0},n.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},n.prototype.search_field_scale=function(){var e,s,i,n,r,o,h;if(this.is_multiple){for(r={position:"absolute",left:"-1000px",top:"-1000px",display:"none",whiteSpace:"pre"},s=0,i=(o=["fontSize","fontStyle","fontWeight","fontFamily","lineHeight","textTransform","letterSpacing"]).length;s<i;s++)r[n=o[s]]=this.search_field.css(n);return(e=t("<div />").css(r)).text(this.get_search_field_value()),t("body").append(e),h=e.width()+25,e.remove(),this.container.is(":visible")&&(h=Math.min(this.container.outerWidth()-10,h)),this.search_field.width(h)}},n.prototype.trigger_form_field_change=function(t){return this.form_field_jq.trigger("input",t),this.form_field_jq.trigger("change",t)},n}()}.call(this),function(t){"use strict";function e(t,e,s){this.init(t,e,s)}function s(){this.rules=[]}t.extend(e.prototype,{init:function(t,e,s){this.controller=t,this.condition=e,this.value=s,this.rules=[],this.controls=[]},evalCondition:function(e,s,i,n,r){if("=="==i)return this.checkBoolean(n)==this.checkBoolean(r);if("!="==i)return this.checkBoolean(n)!=this.checkBoolean(r);if(">="==i)return Number(r)>=Number(n);if("<="==i)return Number(r)<=Number(n);if(">"==i)return Number(r)>Number(n);if("<"==i)return Number(r)<Number(n);if("()"==i)return window[n](e,s,r);if("any"==i){if(t.isArray(r)){for(var o=r.length-1;o>=0;o--)if(-1!==t.inArray(r[o],n.split(",")))return!0}else if(-1!==t.inArray(r,n.split(",")))return!0}else if("not-any"==i)if(t.isArray(r)){for(o=r.length-1;o>=0;o--)if(-1==t.inArray(r[o],n.split(",")))return!0}else if(-1==t.inArray(r,n.split(",")))return!0;return!1},checkBoolean:function(t){switch(t){case!0:case"true":case 1:case"1":t=!0;break;case null:case!1:case"false":case 0:case"0":t=!1}return t},checkCondition:function(t){if(!this.condition)return!0;var e=t.find(this.controller),s=this.getControlValue(t,e);return void 0!==s&&(s=this.normalizeValue(e,this.value,s),this.evalCondition(t,e,this.condition,this.value,s))},normalizeValue:function(t,e,s){return"number"==typeof e?parseFloat(s):s},getControlValue:function(t,e){return e.length>1&&("radio"==e.attr("type")||"checkbox"==e.attr("type"))?e.filter(":checked").map(function(){return this.value}).get():"checkbox"==e.attr("type")||"radio"==e.attr("type")?e.is(":checked"):e.val()},createRule:function(t,s,i){var n=new e(t,s,i);return this.rules.push(n),n},include:function(t){this.controls.push(t)},applyRule:function(e,s){var i;i=void 0===s?this.checkCondition(e):s;var n=t.map(this.controls,function(t,s){return e.find(t)});i?(t(n).each(function(){t(this).removeClass("hidden")}),t(this.rules).each(function(){this.applyRule(e)})):(t(n).each(function(){t(this).addClass("hidden")}),t(this.rules).each(function(){this.applyRule(e,!1)}))}}),t.extend(s.prototype,{createRule:function(t,s,i){var n=new e(t,s,i);return this.rules.push(n),n},applyRules:function(e){t(this.rules).each(function(){this.applyRule(e)})}}),t.csf_deps={createRuleset:function(){return new s},enable:function(t,e,s){return t.on("change keyup",function(i){var n=i.target.getAttribute("data-depend-id")||i.target.getAttribute("data-sub-depend-id");-1!==s.indexOf(n)&&e.applyRules(t)}),e.applyRules(t),!0}}}(jQuery),function(t,e){if("function"==typeof define&&define.amd)define(["exports","jquery"],function(t,s){return e(t,s)});else if("undefined"!=typeof exports){var s=require("jquery");e(exports,s)}else e(t,t.jQuery||t.Zepto||t.ender||t.$)}(this,function(t,e){var s={validate:/^(?!(_nonce|_pseudo))[a-zA-Z0-9_-]*(?:\[(?:\d*|(?!(_nonce|_pseudo))[a-zA-Z0-9_-]+)\])*$/i,key:/[a-zA-Z0-9_-]+|(?=\[\])/g,named:/^[a-zA-Z0-9_-]+$/,push:/^$/,fixed:/^\d+$/};function i(t,e){var i={},n={};function r(t,e,s){return t[e]=s,t}function o(){return i}this.addPair=function(e){if(!s.validate.test(e.name))return this;var o=function(t,e){for(var i,o=t.match(s.key);void 0!==(i=o.pop());)s.push.test(i)?e=r([],(h=t.replace(/\[\]$/,""),void 0===n[h]&&(n[h]=0),n[h]++),e):s.fixed.test(i)?e=r([],i,e):s.named.test(i)&&(e=r({},i,e));var h;return e}(e.name,e.value);return i=t.extend(!0,i,o),this},this.addPairs=function(e){if(!t.isArray(e))throw new Error("formSerializer.addPairs expects an Array");for(var s=0,i=e.length;s<i;s++)this.addPair(e[s]);return this},this.serialize=o,this.serializeJSON=function(){return JSON.stringify(o())}}return i.patterns=s,i.serializeObject=function(){return new i(e,this).addPairs(this.serializeArray()).serialize()},i.serializeJSON=function(){return new i(e,this).addPairs(this.serializeArray()).serializeJSON()},void 0!==e.fn&&(e.fn.serializeObjectCSF=i.serializeObject,e.fn.serializeJSONCSF=i.serializeJSON),t.FormSerializer=i,i});
admin/settings/assets/js/csf.js CHANGED
@@ -24,6 +24,7 @@
24
  $window: $(window),
25
  $document: $(document),
26
  $form_warning: null,
 
27
  form_modified: false,
28
  code_themes: [],
29
  is_rtl: $('body').hasClass('rtl'),
@@ -56,7 +57,7 @@
56
  var regex = new RegExp('('+ CSF.helper.preg_quote(field_id) +')\\[(\\d+)\\]', 'g');
57
 
58
  $selector.find(':radio').each(function() {
59
- if( this.checked || this.orginal_checked ) {
60
  this.orginal_checked = true;
61
  }
62
  });
@@ -64,7 +65,7 @@
64
  $selector.each( function( index ) {
65
  $(this).find(':input').each(function() {
66
  this.name = this.name.replace(regex, field_id +'['+ index +']');
67
- if( this.orginal_checked ) {
68
  this.checked = true;
69
  }
70
  });
@@ -81,14 +82,14 @@
81
  var context = this, args = arguments;
82
  var later = function() {
83
  timeout = null;
84
- if( !immediate ) {
85
  callback.apply(context, args);
86
  }
87
  };
88
  var callNow = ( immediate && !timeout );
89
  clearTimeout( timeout );
90
  timeout = setTimeout( later, threshold );
91
- if( callNow ) {
92
  callback.apply(context, args);
93
  }
94
  };
@@ -101,16 +102,16 @@
101
 
102
  var e, b, cookie = document.cookie, p = name + '=';
103
 
104
- if( ! cookie ) {
105
  return;
106
  }
107
 
108
  b = cookie.indexOf( '; ' + p );
109
 
110
- if( b === -1 ) {
111
  b = cookie.indexOf(p);
112
 
113
- if( b !== 0 ) {
114
  return null;
115
  }
116
  } else {
@@ -119,7 +120,7 @@
119
 
120
  e = cookie.indexOf( ';', b );
121
 
122
- if( e === -1 ) {
123
  e = cookie.length;
124
  }
125
 
@@ -134,9 +135,9 @@
134
 
135
  var d = new Date();
136
 
137
- if( typeof( expires ) === 'object' && expires.toGMTString ) {
138
  expires = expires.toGMTString();
139
- } else if( parseInt( expires, 10 ) ) {
140
  d.setTime( d.getTime() + ( parseInt( expires, 10 ) * 1000 ) );
141
  expires = d.toGMTString();
142
  } else {
@@ -172,7 +173,7 @@
172
  for( var i = 0; i < clone.length; ++i ) {
173
  for( var j = 0; j < clone[i].options.length; ++j ) {
174
 
175
- if( clone[i].options[j].selected === true ) {
176
  cloned[i].options[j].selected = true;
177
  }
178
 
@@ -214,24 +215,24 @@
214
  $hidden = $nav.closest('.csf').find('.csf-section-id'),
215
  $last_section;
216
 
217
- $(window).on('hashchange', function() {
218
 
219
  var hash = window.location.hash.match(new RegExp('tab=([^&]*)'));
220
  var slug = hash ? hash[1] : $links.first().attr('href').replace('#tab=', '');
221
  var $link = $('#csf-tab-link-'+ slug);
222
 
223
- if( $link.length > 0 ) {
224
 
225
  $link.closest('.csf-tab-depth-0').addClass('csf-tab-active').siblings().removeClass('csf-tab-active');
226
  $links.removeClass('csf-section-active');
227
  $link.addClass('csf-section-active');
228
 
229
- if( $last_section !== undefined ) {
230
  $last_section.hide();
231
  }
232
 
233
  var $section = $('#csf-section-'+slug);
234
- $section.css({display: 'block'});
235
  $section.csf_reload_script();
236
 
237
  $hidden.val(slug);
@@ -240,7 +241,7 @@
240
 
241
  }
242
 
243
- }).trigger('hashchange');
244
 
245
  });
246
  };
@@ -265,18 +266,18 @@
265
  var $link = $(this),
266
  section_id = $link.data('section');
267
 
268
- if( $last_link !== undefined ) {
269
  $last_link.removeClass('csf-section-active');
270
  }
271
 
272
- if( $last_section !== undefined ) {
273
  $last_section.hide();
274
  }
275
 
276
  $link.addClass('csf-section-active');
277
 
278
  var $section = $('#csf-section-'+section_id);
279
- $section.css({display: 'block'});
280
  $section.csf_reload_script();
281
 
282
  CSF.helper.set_cookie('csf-last-metabox-tab-'+ post_id +'-'+ unique_id, section_id);
@@ -288,7 +289,7 @@
288
 
289
  var get_cookie = CSF.helper.get_cookie('csf-last-metabox-tab-'+ post_id +'-'+ unique_id);
290
 
291
- if( get_cookie ) {
292
  $nav.find('a[data-section="'+ get_cookie +'"]').trigger('click');
293
  } else {
294
  $links.first('a').trigger('click');
@@ -301,7 +302,7 @@
301
  // Metabox Page Templates Listener
302
  //
303
  $.fn.csf_page_templates = function() {
304
- if( this.length ) {
305
 
306
  $(document).on('change', '.editor-page-attributes__template select, #page_template', function() {
307
 
@@ -319,7 +320,7 @@
319
  // Metabox Post Formats Listener
320
  //
321
  $.fn.csf_post_formats = function() {
322
- if( this.length ) {
323
 
324
  $(document).on('change', '.editor-post-format select, #formatdiv input[name="post_format"]', function() {
325
 
@@ -342,8 +343,8 @@
342
  $.fn.csf_search = function() {
343
  return this.each( function() {
344
 
345
- var $this = $(this),
346
- $input = $this.find('input');
347
 
348
  $input.on('change keyup', function() {
349
 
@@ -353,7 +354,7 @@
353
  $fields = $section.find('> .csf-field:not(.hidden)'),
354
  $titles = $fields.find('> .csf-title, .csf-search-tags');
355
 
356
- if( value.length > 3 ) {
357
 
358
  $fields.addClass('csf-hidden');
359
  $wrapper.addClass('csf-search-all');
@@ -362,7 +363,7 @@
362
 
363
  var $title = $(this);
364
 
365
- if( $title.text().match( new RegExp('.*?' + value + '.*?', 'i') ) ) {
366
 
367
  var $field = $title.closest('.csf-field');
368
 
@@ -405,7 +406,7 @@
405
  stickyTop = Math.max(offset, offsetTop - scrollTop ),
406
  winWidth = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
407
 
408
- if( stickyTop <= offset && winWidth > 782 ) {
409
  $inner.css({width: $this.outerWidth()-padding});
410
  $this.css({height: $this.outerHeight()}).addClass( 'csf-sticky' );
411
  } else {
@@ -416,7 +417,7 @@
416
  },
417
  requestTick = function() {
418
 
419
- if( !ticking ) {
420
  requestAnimationFrame( function() {
421
  stickyUpdate();
422
  ticking = false;
@@ -459,7 +460,7 @@
459
  values = $field.data('value').toString().split('|'),
460
  rules = ruleset;
461
 
462
- if( $field.data('depend-global') ) {
463
  is_global = true;
464
  }
465
 
@@ -478,9 +479,9 @@
478
 
479
  });
480
 
481
- if( depends.length ) {
482
 
483
- if( is_global ) {
484
  $.csf_deps.enable(CSF.vars.$body, ruleset, depends);
485
  } else {
486
  $.csf_deps.enable($this, ruleset, depends);
@@ -505,13 +506,13 @@
505
  $icon = $title.find('.csf-accordion-icon'),
506
  $content = $title.next();
507
 
508
- if( $icon.hasClass('fa-angle-right') ) {
509
  $icon.removeClass('fa-angle-right').addClass('fa-angle-down');
510
  } else {
511
  $icon.removeClass('fa-angle-down').addClass('fa-angle-right');
512
  }
513
 
514
- if( !$content.data( 'opened' ) ) {
515
 
516
  $content.csf_reload_script();
517
  $content.data( 'opened', true );
@@ -531,7 +532,7 @@
531
  $.fn.csf_field_backup = function() {
532
  return this.each( function() {
533
 
534
- if( window.wp.customize === undefined ) { return; }
535
 
536
  var base = this,
537
  $this = $(this),
@@ -541,10 +542,10 @@
541
 
542
  base.notification = function( message_text ) {
543
 
544
- if( wp.customize.notifications && wp.customize.OverlayNotification ) {
545
 
546
  // clear if there is any saved data.
547
- if( !wp.customize.state('saved').get() ) {
548
  wp.customize.state('changesetStatus').set('trash');
549
  wp.customize.each( function( setting ) { setting._dirty = false; });
550
  wp.customize.state('saved').set(true);
@@ -565,7 +566,7 @@
565
 
566
  e.preventDefault();
567
 
568
- if( CSF.vars.is_confirm ) {
569
 
570
  base.notification( window.csf_vars.i18n.reset_notification );
571
 
@@ -589,14 +590,14 @@
589
 
590
  e.preventDefault();
591
 
592
- if( CSF.vars.is_confirm ) {
593
 
594
  base.notification( window.csf_vars.i18n.import_notification );
595
 
596
  window.wp.ajax.post( 'csf-import', {
597
  unique: $import.data('unique'),
598
  nonce: $import.data('nonce'),
599
- import_data: $this.find('.csf-import-data').val()
600
  }).done( function( response ) {
601
  window.location.reload(true);
602
  }).fail( function( response ) {
@@ -626,24 +627,24 @@
626
  $.fn.csf_field_code_editor = function() {
627
  return this.each( function() {
628
 
629
- if( typeof CodeMirror !== 'function' ) { return; }
630
 
631
  var $this = $(this),
632
  $textarea = $this.find('textarea'),
633
  $inited = $this.find('.CodeMirror'),
634
  data_editor = $textarea.data('editor');
635
 
636
- if( $inited.length ) {
637
  $inited.remove();
638
  }
639
 
640
  var interval = setInterval(function () {
641
- if( $this.is(':visible') ) {
642
 
643
  var code_editor = CodeMirror.fromTextArea( $textarea[0], data_editor );
644
 
645
  // load code-mirror theme css.
646
- if( data_editor.theme !== 'default' && CSF.vars.code_themes.indexOf(data_editor.theme) === -1 ) {
647
 
648
  var $cssLink = $('<link>');
649
 
@@ -700,7 +701,7 @@
700
 
701
  settings = $.extend({}, settings, defaults);
702
 
703
- if( $inputs.length === 2 ) {
704
 
705
  settings = $.extend({}, settings, {
706
  onSelect: function( selectedDate ) {
@@ -721,7 +722,7 @@
721
 
722
  var $input = $(this);
723
 
724
- if( $input.hasClass('hasDatepicker') ) {
725
  $input.removeAttr('id').removeClass('hasDatepicker');
726
  }
727
 
@@ -764,10 +765,10 @@
764
 
765
  e.preventDefault();
766
 
767
- if( typeof window.wp === 'undefined' || ! window.wp.media || ! window.wp.media.gallery ) { return; }
768
 
769
  // Open media with state
770
- if( state === 'gallery' ) {
771
 
772
  wp_media_frame = window.wp.media({
773
  library: {
@@ -784,7 +785,7 @@
784
 
785
  wp_media_frame = window.wp.media.gallery.edit( '[gallery ids="'+ ids +'"]' );
786
 
787
- if( what === 'add' ) {
788
  wp_media_frame.setState('gallery-library');
789
  }
790
 
@@ -846,7 +847,7 @@
846
  min = parseInt( $wrapper.data('min') );
847
 
848
  // clear accordion arrows if multi-instance
849
- if( $wrapper.hasClass('ui-accordion') ) {
850
  $wrapper.find('.ui-accordion-header-icon').remove();
851
  }
852
 
@@ -863,21 +864,21 @@
863
  animate: false,
864
  heightStyle: 'content',
865
  icons: {
866
- 'header': 'csf-cloneable-header-icon fa fa-angle-right',
867
- 'activeHeader': 'csf-cloneable-header-icon fa fa-angle-down'
868
  },
869
  activate: function( event, ui ) {
870
 
871
  var $panel = ui.newPanel;
872
  var $header = ui.newHeader;
873
 
874
- if( $panel.length && !$panel.data( 'opened' ) ) {
875
 
876
  var $fields = $panel.children();
877
  var $first = $fields.first().find(':input').first();
878
  var $title = $header.find('.csf-cloneable-value');
879
 
880
- $first.on('keyup', function( event ) {
881
  $title.text($first.val());
882
  });
883
 
@@ -885,7 +886,7 @@
885
  $panel.data( 'opened', true );
886
  $panel.data( 'retry', false );
887
 
888
- } else if( $panel.data( 'retry' ) ) {
889
 
890
  $panel.csf_reload_script_retry();
891
  $panel.data( 'retry', false );
@@ -913,7 +914,7 @@
913
  CSF.helper.name_nested_replace( $wrapper.children('.csf-cloneable-item'), field_id );
914
  $wrapper.csf_customizer_refresh();
915
 
916
- if( is_number ) {
917
  update_title_numbers($wrapper);
918
  }
919
 
@@ -928,7 +929,7 @@
928
 
929
  $min.hide();
930
 
931
- if( max && (count+1) > max ) {
932
  $max.show();
933
  return;
934
  }
@@ -953,7 +954,7 @@
953
  $wrapper.csf_customizer_refresh();
954
  $wrapper.csf_customizer_listen({closest: true});
955
 
956
- if( is_number ) {
957
  update_title_numbers($wrapper);
958
  }
959
 
@@ -967,7 +968,7 @@
967
 
968
  $min.hide();
969
 
970
- if( max && (count+1) > max ) {
971
  $max.show();
972
  return;
973
  }
@@ -998,7 +999,7 @@
998
  $wrapper.csf_customizer_refresh();
999
  $wrapper.csf_customizer_listen({closest: true});
1000
 
1001
- if( is_number ) {
1002
  update_title_numbers($wrapper);
1003
  }
1004
 
@@ -1016,7 +1017,7 @@
1016
  $max.hide();
1017
  $min.hide();
1018
 
1019
- if( min && (count-1) < min ) {
1020
  $min.show();
1021
  return;
1022
  }
@@ -1027,7 +1028,7 @@
1027
 
1028
  $wrapper.csf_customizer_refresh();
1029
 
1030
- if( is_number ) {
1031
  update_title_numbers($wrapper);
1032
  }
1033
 
@@ -1058,7 +1059,7 @@
1058
 
1059
  CSF.vars.$icon_target = $this;
1060
 
1061
- if( !CSF.vars.icon_modal_loaded ) {
1062
 
1063
  $modal.find('.csf-modal-loading').show();
1064
 
@@ -1072,11 +1073,11 @@
1072
 
1073
  var $load = $modal.find('.csf-modal-load').html( response.content );
1074
 
1075
- $load.on('click', 'a', function( e ) {
1076
 
1077
  e.preventDefault();
1078
 
1079
- var icon = $(this).data('csf-icon');
1080
 
1081
  CSF.vars.$icon_target.find('i').removeAttr('class').addClass(icon);
1082
  CSF.vars.$icon_target.find('input').val(icon).trigger('change');
@@ -1090,13 +1091,13 @@
1090
  $modal.on('change keyup', '.csf-icon-search', function() {
1091
 
1092
  var value = $(this).val(),
1093
- $icons = $load.find('a');
1094
 
1095
  $icons.each( function() {
1096
 
1097
  var $elem = $(this);
1098
 
1099
- if( $elem.data('csf-icon').search( new RegExp( value, 'i' ) ) < 0 ) {
1100
  $elem.hide();
1101
  } else {
1102
  $elem.show();
@@ -1135,7 +1136,7 @@
1135
  $.fn.csf_field_map = function() {
1136
  return this.each( function() {
1137
 
1138
- if( typeof L === 'undefined' ) { return; }
1139
 
1140
  var $this = $(this),
1141
  $map = $this.find('.csf--map-osm'),
@@ -1172,36 +1173,54 @@
1172
  update_latlng( mapMarker.getLatLng() );
1173
  });
1174
 
1175
- if( ! $search_input.length ) {
1176
  $search_input = $( '[data-depend-id="'+ $this.find('.csf--address-field').data( 'address-field' ) +'"]' );
1177
  }
1178
 
 
 
1179
  $search_input.autocomplete({
1180
  source: function ( request, response ) {
 
 
 
 
 
 
 
 
1181
  $.get( 'https://nominatim.openstreetmap.org/search', {
1182
  format: 'json',
1183
- q: request.term,
1184
  }, function( results ) {
1185
- if( results.length ) {
1186
- response( results.map( function( item ) {
 
 
 
1187
  return {
1188
  value: item.display_name,
1189
  label: item.display_name,
1190
  lat: item.lat,
1191
  lon: item.lon
1192
  };
1193
- }, 'json' ) );
1194
  } else {
1195
- response([{
1196
  value: 'no-data',
1197
  label: 'No Results.'
1198
- }]);
1199
  }
 
 
 
 
1200
  });
 
1201
  },
1202
  select: function ( event, ui ) {
1203
 
1204
- if( ui.item.value === 'no-data' ) { return false; }
1205
 
1206
  var latLng = L.latLng( ui.item.lat, ui.item.lon );
1207
 
@@ -1247,11 +1266,11 @@
1247
 
1248
  e.preventDefault();
1249
 
1250
- if( typeof window.wp === 'undefined' || ! window.wp.media || ! window.wp.media.gallery ) {
1251
  return;
1252
  }
1253
 
1254
- if( wp_media_frame ) {
1255
  wp_media_frame.open();
1256
  return;
1257
  }
@@ -1268,7 +1287,7 @@
1268
  var attributes = wp_media_frame.state().get('selection').first().attributes;
1269
  var preview_size = $upload_button.data('preview-size') || 'thumbnail';
1270
 
1271
- if( $library.length && $library.indexOf(attributes.subtype) === -1 && $library.indexOf(attributes.type) === -1 ) {
1272
  return;
1273
  }
1274
 
@@ -1279,15 +1298,15 @@
1279
  $this.find('.csf--title').val( attributes.title );
1280
  $this.find('.csf--description').val( attributes.description );
1281
 
1282
- if( typeof attributes.sizes !== 'undefined' && typeof attributes.sizes.thumbnail !== 'undefined' && preview_size === 'thumbnail' ) {
1283
  thumbnail = attributes.sizes.thumbnail.url;
1284
- } else if( typeof attributes.sizes !== 'undefined' && typeof attributes.sizes.full !== 'undefined' ) {
1285
  thumbnail = attributes.sizes.full.url;
1286
  } else {
1287
  thumbnail = attributes.icon;
1288
  }
1289
 
1290
- if( $auto_attributes ) {
1291
  $auto_attributes.removeClass('csf--attributes-hidden');
1292
  }
1293
 
@@ -1308,7 +1327,7 @@
1308
 
1309
  e.preventDefault();
1310
 
1311
- if( $auto_attributes ) {
1312
  $auto_attributes.addClass('csf--attributes-hidden');
1313
  }
1314
 
@@ -1367,7 +1386,7 @@
1367
 
1368
  $min.hide();
1369
 
1370
- if( max && (count+1) > max ) {
1371
  $max.show();
1372
  return;
1373
  }
@@ -1401,7 +1420,7 @@
1401
 
1402
  $min.hide();
1403
 
1404
- if( max && (count+1) > max ) {
1405
  $max.show();
1406
  return;
1407
  }
@@ -1445,7 +1464,7 @@
1445
  $max.hide();
1446
  $min.hide();
1447
 
1448
- if( min && (count-1) < min ) {
1449
  $min.show();
1450
  return;
1451
  }
@@ -1476,7 +1495,7 @@
1476
  data = $input.data(),
1477
  value = $input.val() || 0;
1478
 
1479
- if( $slider.hasClass('ui-slider') ) {
1480
  $slider.empty();
1481
  }
1482
 
@@ -1491,7 +1510,7 @@
1491
  }
1492
  });
1493
 
1494
- $input.keyup( function() {
1495
  $slider.slider('value', $input.val());
1496
  });
1497
 
@@ -1539,7 +1558,7 @@
1539
 
1540
  var $el = ui.item.find('input');
1541
 
1542
- if( ui.item.parent().hasClass('csf-enabled') ) {
1543
  $el.attr('name', $el.attr('name').replace('disabled', 'enabled'));
1544
  } else {
1545
  $el.attr('name', $el.attr('name').replace('enabled', 'disabled'));
@@ -1550,7 +1569,7 @@
1550
  }
1551
  });
1552
 
1553
- if( $disabled ) {
1554
 
1555
  $disabled.sortable({
1556
  connectWith: $enabled,
@@ -1576,7 +1595,7 @@
1576
  $inited = $this.find('.ui-spinner-button'),
1577
  $unit = $input.data('unit');
1578
 
1579
- if( $inited.length ) {
1580
  $inited.remove();
1581
  }
1582
 
@@ -1585,7 +1604,7 @@
1585
  min: $input.data('min') || 0,
1586
  step: $input.data('step') || 1,
1587
  create: function( event, ui ) {
1588
- if( $unit.length ) {
1589
  $this.find('.ui-spinner-up').after('<span class="ui-button-text-only csf--unit">'+ $unit +'</span>');
1590
  }
1591
  },
@@ -1610,7 +1629,7 @@
1610
  var value = 0;
1611
  var $input = $switcher.find('input');
1612
 
1613
- if( $switcher.hasClass('csf--active') ) {
1614
  $switcher.removeClass('csf--active');
1615
  } else {
1616
  value = 1;
@@ -1687,16 +1706,16 @@
1687
  // Load google font
1688
  base.load_google_font = function( font_family, weight, style ) {
1689
 
1690
- if( font_family && typeof WebFont === 'object' ) {
1691
 
1692
  weight = weight ? weight.replace('normal', '') : '';
1693
  style = style ? style.replace('normal', '') : '';
1694
 
1695
- if( weight || style ) {
1696
  font_family = font_family +':'+ weight + style;
1697
  }
1698
 
1699
- if( loaded_fonts.indexOf( font_family ) === -1 ) {
1700
  WebFont.load({ google: { families: [font_family] } });
1701
  }
1702
 
@@ -1721,15 +1740,15 @@
1721
  var name = value;
1722
 
1723
  // is_multi
1724
- if( is_multi ) {
1725
  selected = ( condition && condition.indexOf(value) !== -1 ) ? ' selected' : '';
1726
  } else {
1727
  selected = ( condition && condition === value ) ? ' selected' : '';
1728
  }
1729
 
1730
- if( type === 'subset' ) {
1731
  name = base.sanitize_subset( value );
1732
- } else if( type === 'style' ){
1733
  name = base.sanitize_style( value );
1734
  }
1735
 
@@ -1746,17 +1765,18 @@
1746
  //
1747
  //
1748
  // Constants
1749
- var selected_styles = [];
1750
- var $typography = $this.find('.csf--typography');
1751
- var $type = $this.find('.csf--type');
1752
- var $styles = $this.find('.csf--block-font-style');
1753
- var unit = $typography.data('unit');
1754
- var exclude_fonts = $typography.data('exclude') ? $typography.data('exclude').split(',') : [];
 
1755
 
1756
  //
1757
  //
1758
  // Chosen init
1759
- if( $this.find('.csf--chosen').length ) {
1760
 
1761
  var $chosen_selects = $this.find('select');
1762
 
@@ -1765,7 +1785,7 @@
1765
  var $chosen_select = $(this),
1766
  $chosen_inited = $chosen_select.parent().find('.chosen-container');
1767
 
1768
- if( $chosen_inited.length ) {
1769
  $chosen_inited.remove();
1770
  }
1771
 
@@ -1793,7 +1813,7 @@
1793
  $.each(webfonts, function( type, group ) {
1794
 
1795
  // Check for exclude fonts
1796
- if( exclude_fonts && exclude_fonts.indexOf(type) !== -1 ) { return; }
1797
 
1798
  opts += '<optgroup label="' + group.label + '">';
1799
 
@@ -1818,7 +1838,7 @@
1818
  // Font style select
1819
  var $font_style_block = $this.find('.csf--block-font-style');
1820
 
1821
- if( $font_style_block.length ) {
1822
 
1823
  var $font_style_select = $this.find('.csf--font-style-select');
1824
  var first_style_value = $font_style_select.val() ? $font_style_select.val().replace(/normal/g, '' ) : '';
@@ -1830,7 +1850,7 @@
1830
  var style_value = $font_style_select.val();
1831
 
1832
  // set a default value
1833
- if( !style_value && selected_styles && selected_styles.indexOf('normal') === -1 ) {
1834
  style_value = selected_styles[0];
1835
  }
1836
 
@@ -1849,7 +1869,7 @@
1849
  // Extra font style select
1850
  var $extra_font_style_block = $this.find('.csf--block-extra-styles');
1851
 
1852
- if( $extra_font_style_block.length ) {
1853
  var $extra_font_style_select = $this.find('.csf--extra-styles');
1854
  var first_extra_style_value = $extra_font_style_select.val();
1855
  }
@@ -1860,7 +1880,7 @@
1860
  //
1861
  // Subsets select
1862
  var $subset_block = $this.find('.csf--block-subset');
1863
- if( $subset_block.length ) {
1864
  var $subset_select = $this.find('.csf--subset');
1865
  var first_subset_select_value = $subset_select.val();
1866
  var subset_multi_select = $subset_select.data('multiple') || false;
@@ -1877,17 +1897,17 @@
1877
  $font_family_select.on('change csf.change', function( event ) {
1878
 
1879
  // Hide subsets on change
1880
- if( $subset_block.length ) {
1881
  $subset_block.addClass('hidden');
1882
  }
1883
 
1884
  // Hide extra font style on change
1885
- if( $extra_font_style_block.length ) {
1886
  $extra_font_style_block.addClass('hidden');
1887
  }
1888
 
1889
  // Hide backup font family on change
1890
- if( $backup_font_family_block.length ) {
1891
  $backup_font_family_block.addClass('hidden');
1892
  }
1893
 
@@ -1895,23 +1915,23 @@
1895
  var value = $selected.val();
1896
  var type = $selected.data('type');
1897
 
1898
- if( type && value ) {
1899
 
1900
  // Show backup fonts if font type google or custom
1901
- if( ( type === 'google' || type === 'custom' ) && $backup_font_family_block.length ) {
1902
  $backup_font_family_block.removeClass('hidden');
1903
  }
1904
 
1905
  // Appending font style select options
1906
- if( $font_style_block.length ) {
1907
 
1908
  // set styles for multi and normal style selectors
1909
  var styles = defaultstyles;
1910
 
1911
  // Custom or gogle font styles
1912
- if( type === 'google' && webfonts[type].fonts[value][0] ) {
1913
  styles = webfonts[type].fonts[value][0];
1914
- } else if( type === 'custom' && webfonts[type].fonts[value] ) {
1915
  styles = webfonts[type].fonts[value];
1916
  }
1917
 
@@ -1931,7 +1951,7 @@
1931
  $font_style_block.removeClass('hidden');
1932
 
1933
  // Appending extra font style select options
1934
- if( type === 'google' && $extra_font_style_block.length && styles.length > 1 ) {
1935
 
1936
  // Append extra-style select options
1937
  base.append_select_options( $extra_font_style_select, styles, first_extra_style_value, 'style', true );
@@ -1947,7 +1967,7 @@
1947
  }
1948
 
1949
  // Appending google fonts subsets select options
1950
- if( type === 'google' && $subset_block.length && webfonts[type].fonts[value][1] ) {
1951
 
1952
  var subsets = webfonts[type].fonts[value][1];
1953
  var set_auto_subset = ( subsets.length < 2 && subsets[0] !== 'latin' ) ? subsets[0] : '';
@@ -1970,13 +1990,13 @@
1970
  $styles.find(':input').val('');
1971
 
1972
  // Clear subsets options if type and value empty
1973
- if( $subset_block.length ) {
1974
  $subset_select.find('option').not(':first-child').remove();
1975
  $subset_select.trigger('chosen:updated');
1976
  }
1977
 
1978
  // Clear font styles options if type and value empty
1979
- if( $font_style_block.length ) {
1980
  $font_style_select.find('option').not(':first-child').remove();
1981
  $font_style_select.trigger('chosen:updated');
1982
  }
@@ -1993,7 +2013,7 @@
1993
  // Preview
1994
  var $preview_block = $this.find('.csf--block-preview');
1995
 
1996
- if( $preview_block.length ) {
1997
 
1998
  var $preview = $this.find('.csf--preview');
1999
 
@@ -2017,29 +2037,29 @@
2017
  custom_style = $this.find('.csf--custom-style').val(),
2018
  type = $this.find('.csf--type').val();
2019
 
2020
- if( type === 'google' ) {
2021
  base.load_google_font(font_family, font_weight, font_style);
2022
  }
2023
 
2024
  var properties = {};
2025
 
2026
- if( font_family ) { properties.fontFamily = font_family; }
2027
- if( font_weight ) { properties.fontWeight = font_weight; }
2028
- if( font_style ) { properties.fontStyle = font_style; }
2029
- if( font_variant ) { properties.fontVariant = font_variant; }
2030
- if( font_size ) { properties.fontSize = font_size + unit; }
2031
- if( line_height ) { properties.lineHeight = line_height + unit; }
2032
- if( letter_spacing ) { properties.letterSpacing = letter_spacing + unit; }
2033
- if( word_spacing ) { properties.wordSpacing = word_spacing + unit; }
2034
- if( text_align ) { properties.textAlign = text_align; }
2035
- if( text_transform ) { properties.textTransform = text_transform; }
2036
- if( text_decoration ) { properties.textDecoration = text_decoration; }
2037
- if( text_color ) { properties.color = text_color; }
2038
 
2039
  $preview.removeAttr('style');
2040
 
2041
  // Customs style attribute
2042
- if( custom_style ) { $preview.attr('style', custom_style); }
2043
 
2044
  $preview.css(properties);
2045
 
@@ -2052,7 +2072,7 @@
2052
 
2053
  var $toggle = $preview_block.find('.csf--toggle');
2054
 
2055
- if( $toggle.hasClass('fa-toggle-off') ) {
2056
  $toggle.removeClass('fa-toggle-off').addClass('fa-toggle-on');
2057
  } else {
2058
  $toggle.removeClass('fa-toggle-on').addClass('fa-toggle-off');
@@ -2060,7 +2080,7 @@
2060
 
2061
  });
2062
 
2063
- if( !$preview_block.hasClass('hidden') ) {
2064
  $this.trigger('change');
2065
  }
2066
 
@@ -2087,7 +2107,7 @@
2087
  wp_media_frame;
2088
 
2089
  $input.on('change', function( e ) {
2090
- if( $input.val() ) {
2091
  $remove_button.removeClass('hidden');
2092
  } else {
2093
  $remove_button.addClass('hidden');
@@ -2098,11 +2118,11 @@
2098
 
2099
  e.preventDefault();
2100
 
2101
- if( typeof window.wp === 'undefined' || ! window.wp.media || ! window.wp.media.gallery ) {
2102
  return;
2103
  }
2104
 
2105
- if( wp_media_frame ) {
2106
  wp_media_frame.open();
2107
  return;
2108
  }
@@ -2117,7 +2137,7 @@
2117
 
2118
  var attributes = wp_media_frame.state().get('selection').first().attributes;
2119
 
2120
- if( $library.length && $library.indexOf(attributes.subtype) === -1 && $library.indexOf(attributes.type) === -1 ) {
2121
  return;
2122
  }
2123
 
@@ -2144,7 +2164,7 @@
2144
  $.fn.csf_field_wp_editor = function() {
2145
  return this.each( function() {
2146
 
2147
- if( typeof window.wp.editor === 'undefined' || typeof window.tinyMCEPreInit === 'undefined' || typeof window.tinyMCEPreInit.mceInit.csf_wp_editor === 'undefined' ) {
2148
  return;
2149
  }
2150
 
@@ -2155,7 +2175,7 @@
2155
  // If there is wp-editor remove it for avoid dupliated wp-editor conflicts.
2156
  var $has_wp_editor = $this.find('.wp-editor-wrap').length || $this.find('.mce-container').length;
2157
 
2158
- if( $has_wp_editor ) {
2159
  $editor.empty();
2160
  $editor.append($textarea);
2161
  $textarea.css('display', '');
@@ -2186,7 +2206,7 @@
2186
  // Callback for old wp editor
2187
  var wpEditor = wp.oldEditor ? wp.oldEditor : wp.editor;
2188
 
2189
- if( wpEditor && wpEditor.hasOwnProperty('autop') ) {
2190
  wp.editor.autop = wpEditor.autop;
2191
  wp.editor.removep = wpEditor.removep;
2192
  wp.editor.initialize = wpEditor.initialize;
@@ -2196,31 +2216,31 @@
2196
  default_editor_settings.tinymce = $.extend( {}, default_editor_settings.tinymce, { selector: '#'+ uid, setup: editor_on_change } );
2197
 
2198
  // Override editor tinymce settings
2199
- if( field_editor_settings.tinymce === false ) {
2200
  default_editor_settings.tinymce = false;
2201
  $editor.addClass('csf-no-tinymce');
2202
  }
2203
 
2204
  // Override editor quicktags settings
2205
- if( field_editor_settings.quicktags === false ) {
2206
  default_editor_settings.quicktags = false;
2207
  $editor.addClass('csf-no-quicktags');
2208
  }
2209
 
2210
  // Wait until :visible
2211
  var interval = setInterval(function () {
2212
- if( $this.is(':visible') ) {
2213
  window.wp.editor.initialize(uid, default_editor_settings);
2214
  clearInterval(interval);
2215
  }
2216
  });
2217
 
2218
  // Add Media buttons
2219
- if( field_editor_settings.media_buttons && window.csf_media_buttons ) {
2220
 
2221
  var $editor_buttons = $editor.find('.wp-media-buttons');
2222
 
2223
- if( $editor_buttons.length ) {
2224
 
2225
  $editor_buttons.find('.csf-shortcode-button').data('editor-id', uid);
2226
 
@@ -2247,13 +2267,13 @@
2247
  return this.each( function() {
2248
  $(this).on('click', function( e ) {
2249
 
2250
- var confirm_text = $(this).data('confirm') || window.csf_vars.i18n.confirm;
2251
- var confirm_answer = confirm( confirm_text );
2252
- CSF.vars.is_confirm = true;
2253
 
2254
- if( !confirm_answer ) {
 
 
2255
  e.preventDefault();
2256
- CSF.vars.is_confirm = false;
2257
  return false;
2258
  }
2259
 
@@ -2292,14 +2312,14 @@
2292
 
2293
  $this.on('click', function( e ) {
2294
 
2295
- if( !flooding ) {
2296
 
2297
  var $text = $this.data('save'),
2298
  $value = $this.val();
2299
 
2300
  $buttons.attr('value', $text);
2301
 
2302
- if( $this.hasClass('csf-save-ajax') ) {
2303
 
2304
  e.preventDefault();
2305
 
@@ -2314,7 +2334,7 @@
2314
  // clear errors
2315
  $('.csf-error').remove();
2316
 
2317
- if( Object.keys( response.errors ).length ) {
2318
 
2319
  var error_icon = '<i class="csf-label-error csf-error">!</i>';
2320
 
@@ -2326,16 +2346,14 @@
2326
 
2327
  $field.closest('.csf-fieldset').append( '<p class="csf-text-error csf-error">'+ error_message +'</p>' );
2328
 
2329
- if( !$link.find('.csf-error').length ) {
2330
  $link.append( error_icon );
2331
  }
2332
 
2333
- if( !$tab.find('.csf-arrow .csf-error').length ) {
2334
  $tab.find('.csf-arrow').append( error_icon );
2335
  }
2336
 
2337
- console.log(error_message);
2338
-
2339
  });
2340
 
2341
  }
@@ -2361,6 +2379,10 @@
2361
  alert( response.error );
2362
  });
2363
 
 
 
 
 
2364
  }
2365
 
2366
  }
@@ -2387,14 +2409,14 @@
2387
  CSF.vars.$form_warning = $form_warning;
2388
 
2389
  // Shows a message white leaving theme options without saving
2390
- if( $form_warning.length ) {
2391
 
2392
  window.onbeforeunload = function() {
2393
- return ( CSF.vars.form_modified ) ? true : undefined;
2394
  };
2395
 
2396
  $content.on('change keypress', ':input', function() {
2397
- if( !CSF.vars.form_modified ) {
2398
  $form_success.hide();
2399
  $form_warning.fadeIn('fast');
2400
  CSF.vars.form_modified = true;
@@ -2403,14 +2425,14 @@
2403
 
2404
  }
2405
 
2406
- if( $form_success.hasClass('csf-form-show') ) {
2407
  setTimeout( function() {
2408
  $form_success.fadeOut('fast');
2409
  }, 1000);
2410
  }
2411
 
2412
  $(document).keydown(function (event) {
2413
- if( ( event.ctrlKey || event.metaKey ) && event.which === 83 ) {
2414
  $save_button.trigger('click');
2415
  event.preventDefault();
2416
  return false;
@@ -2429,14 +2451,14 @@
2429
  var $this = $(this),
2430
  $form = $this.parents('form');
2431
 
2432
- if( $form.attr('id') === 'addtag' ) {
2433
 
2434
  var $submit = $form.find('#submit'),
2435
  $cloned = $this.find('.csf-field').csf_clone();
2436
 
2437
  $submit.on( 'click', function() {
2438
 
2439
- if( !$form.find('.form-required').hasClass('form-invalid') ) {
2440
 
2441
  $this.data('inited', false);
2442
 
@@ -2476,7 +2498,7 @@
2476
 
2477
  $.each(shortcode_values, function( shortcode_tag, shortcode_value ) {
2478
 
2479
- if( shortcode_tag === 'content' ) {
2480
 
2481
  shortcode += ']';
2482
  shortcode += shortcode_value;
@@ -2502,9 +2524,9 @@
2502
 
2503
  var shortcode = '';
2504
 
2505
- if( shortcode_value !== '' ) {
2506
 
2507
- if( typeof shortcode_value === 'object' && !$.isArray( shortcode_value ) ) {
2508
 
2509
  $.each(shortcode_value, function( sub_shortcode_tag, sub_shortcode_value ) {
2510
 
@@ -2517,7 +2539,7 @@
2517
 
2518
  }
2519
 
2520
- if( sub_shortcode_value !== '' ) {
2521
  shortcode += ' ' + sub_shortcode_tag.replace('-', '_') + '="' + sub_shortcode_value.toString() + '"';
2522
  }
2523
 
@@ -2539,7 +2561,7 @@
2539
 
2540
  var obj = ( typeof _this[0].name !== 'undefined' ) ? _this[0] : _this;
2541
 
2542
- if( obj.value.length && typeof obj.selectionStart !== 'undefined' ) {
2543
  obj.focus();
2544
  return obj.value.substring( 0, obj.selectionStart ) + currentValue + obj.value.substring( obj.selectionEnd, obj.value.length );
2545
  } else {
@@ -2553,11 +2575,11 @@
2553
 
2554
  var tinymce_editor;
2555
 
2556
- if( typeof tinymce !== 'undefined' ) {
2557
  tinymce_editor = tinymce.get( editor_id );
2558
  }
2559
 
2560
- if( tinymce_editor && !tinymce_editor.isHidden() ) {
2561
  tinymce_editor.execCommand( 'mceInsertContent', false, html );
2562
  } else {
2563
  var $editor = $('#'+editor_id);
@@ -2598,7 +2620,7 @@
2598
  $modal.show();
2599
 
2600
  // single usage trigger first shortcode
2601
- if( $modal.hasClass('csf-shortcode-single') && sc_name === undefined ) {
2602
  $select.trigger('change');
2603
  }
2604
 
@@ -2616,7 +2638,7 @@
2616
 
2617
  $load.empty();
2618
 
2619
- if( sc_key ) {
2620
 
2621
  $loading.show();
2622
 
@@ -2651,7 +2673,7 @@
2651
 
2652
  e.preventDefault();
2653
 
2654
- if( $insert.prop('disabled') || $insert.attr('disabled') ) { return; }
2655
 
2656
  var shortcode = '';
2657
  var serialize = $modal.find('.csf-field:not(.hidden)').find(':input:not(.ignore)').serializeObjectCSF();
@@ -2690,12 +2712,12 @@
2690
 
2691
  shortcode = ( shortcode === '' ) ? '['+ sc_name +']' : shortcode;
2692
 
2693
- if( gutenberg_id ) {
2694
 
2695
  var content = window.csf_gutenberg_props.attributes.hasOwnProperty('shortcode') ? window.csf_gutenberg_props.attributes.shortcode : '';
2696
  window.csf_gutenberg_props.setAttributes({shortcode: content + shortcode});
2697
 
2698
- } else if( editor_id ) {
2699
 
2700
  base.send_to_editor( shortcode, editor_id );
2701
 
@@ -2744,19 +2766,19 @@
2744
  //
2745
  // WP Color Picker
2746
  //
2747
- if( typeof Color === 'function' ) {
2748
 
2749
  Color.prototype.toString = function() {
2750
 
2751
- if( this._alpha < 1 ) {
2752
  return this.toCSS('rgba', this._alpha).replace(/\s+/g, '');
2753
  }
2754
 
2755
  var hex = parseInt( this._color, 10 ).toString( 16 );
2756
 
2757
- if( this.error ) { return ''; }
2758
 
2759
- if( hex.length < 6 ) {
2760
  for (var i = 6 - hex.length - 1; i >= 0; i--) {
2761
  hex = '0' + hex;
2762
  }
@@ -2787,7 +2809,7 @@
2787
  $container;
2788
 
2789
  // Destroy and Reinit
2790
- if( $input.hasClass('wp-color-picker') ) {
2791
  $input.closest('.wp-picker-container').after($input).remove();
2792
  }
2793
 
@@ -2811,19 +2833,19 @@
2811
  '<div class="csf--transparent-slider"></div>' +
2812
  '<div class="csf--transparent-offset"></div>' +
2813
  '<div class="csf--transparent-text"></div>' +
2814
- '<div class="csf--transparent-button">transparent <i class="fa fa-toggle-off"></i></div>' +
2815
  '</div>').appendTo( $container.find('.wp-picker-holder') ),
2816
  $transparent_slider = $transparent_wrap.find('.csf--transparent-slider'),
2817
  $transparent_text = $transparent_wrap.find('.csf--transparent-text'),
2818
  $transparent_offset = $transparent_wrap.find('.csf--transparent-offset'),
2819
  $transparent_button = $transparent_wrap.find('.csf--transparent-button');
2820
 
2821
- if( $input.val() === 'transparent' ) {
2822
  $container.addClass('csf--transparent-active');
2823
  }
2824
 
2825
  $transparent_button.on('click', function() {
2826
- if( $input.val() !== 'transparent' ) {
2827
  $input.val('transparent').trigger('change').removeClass('iris-error');
2828
  $container.addClass('csf--transparent-active');
2829
  } else {
@@ -2902,12 +2924,12 @@
2902
  no_results_text: window.csf_vars.i18n.no_results_text,
2903
  }, $this.data('chosen-settings'));
2904
 
2905
- if( $inited.length ) {
2906
  $inited.remove();
2907
  }
2908
 
2909
  // Chosen ajax
2910
- if( is_ajax ) {
2911
 
2912
  var set_ajax_options = $.extend({
2913
  data: {
@@ -2933,21 +2955,21 @@
2933
  }
2934
 
2935
  // Chosen keep options order
2936
- if( is_multiple ) {
2937
 
2938
  var $hidden_select = $this.parent().find('.csf-hidden-select');
2939
  var $hidden_value = $hidden_select.val() || [];
2940
 
2941
  $this.on('change', function(obj, result) {
2942
 
2943
- if( result && result.selected ) {
2944
  $hidden_select.append( '<option value="'+ result.selected +'" selected="selected">'+ result.selected +'</option>' );
2945
- } else if( result && result.deselected ) {
2946
  $hidden_select.find('option[value="'+ result.deselected +'"]').remove();
2947
  }
2948
 
2949
  // Force customize refresh
2950
- if( $hidden_select.children().length === 0 && window.wp.customize !== undefined ) {
2951
  window.wp.customize.control( $hidden_select.data('customize-setting-link') ).setting.set('');
2952
  }
2953
 
@@ -2961,13 +2983,13 @@
2961
  }
2962
 
2963
  // Chosen sortable
2964
- if( is_sortable ) {
2965
 
2966
  var $chosen_container = $this.parent().find('.chosen-container');
2967
  var $chosen_choices = $chosen_container.find('.chosen-choices');
2968
 
2969
  $chosen_choices.bind('mousedown', function( event ) {
2970
- if( $(event.target).is('span') ) {
2971
  event.stopPropagation();
2972
  }
2973
  });
@@ -2990,7 +3012,7 @@
2990
  $chosen_choices.find('.search-choice-close').each( function() {
2991
  var option_array_index = $(this).data('option-array-index');
2992
  $.each(chosen_object.results_data, function(index, data) {
2993
- if( data.array_index === option_array_index ){
2994
  select_options += '<option value="'+ data.value +'" selected>'+ data.value +'</option>';
2995
  }
2996
  });
@@ -3039,9 +3061,9 @@
3039
 
3040
  var $sibling = $(this);
3041
 
3042
- if( multiple ) {
3043
 
3044
- if( $sibling.hasClass('csf--active') ) {
3045
  $sibling.removeClass('csf--active');
3046
  $sibling.find('input').prop('checked', false).trigger('change');
3047
  } else {
@@ -3086,7 +3108,7 @@
3086
  },
3087
  mouseleave: function() {
3088
 
3089
- if( $tooltip !== undefined ) {
3090
  $tooltip.remove();
3091
  }
3092
 
@@ -3106,7 +3128,7 @@
3106
  var $this = $(this),
3107
  $complex = $this.closest('.csf-customize-complex');
3108
 
3109
- if( $complex.length ) {
3110
 
3111
  var $input = $complex.find(':input'),
3112
  $unique = $complex.data('unique-id'),
@@ -3142,14 +3164,14 @@
3142
 
3143
  return this.each( function() {
3144
 
3145
- if( window.wp.customize === undefined ) { return; }
3146
 
3147
  var $this = ( settings.closest ) ? $(this).closest('.csf-customize-complex') : $(this),
3148
  $input = $this.find(':input'),
3149
  unique_id = $this.data('unique-id'),
3150
  option_id = $this.data('option-id');
3151
 
3152
- if( unique_id === undefined ) { return; }
3153
 
3154
  $input.on('change keyup', CSF.helper.debounce( function() {
3155
 
@@ -3170,12 +3192,12 @@
3170
 
3171
  var $this = $(this);
3172
 
3173
- if( $this.hasClass('open') && !$this.data('inited') ) {
3174
 
3175
  var $fields = $this.find('.csf-customize-field');
3176
  var $complex = $this.find('.csf-customize-complex');
3177
 
3178
- if( $fields.length ) {
3179
  $this.csf_dependency();
3180
  $fields.csf_reload_script({dependency: false});
3181
  $complex.csf_customizer_listen();
@@ -3194,7 +3216,7 @@
3194
 
3195
  var window_width = navigator.userAgent.indexOf('AppleWebKit/') > -1 ? CSF.vars.$window.width() : window.innerWidth;
3196
 
3197
- if( window_width <= 782 && !CSF.vars.onloaded ) {
3198
  $('.csf-section').csf_reload_script();
3199
  CSF.vars.onloaded = true;
3200
  }
@@ -3205,7 +3227,7 @@
3205
  // Widgets Framework
3206
  //
3207
  $.fn.csf_widgets = function() {
3208
- if( this.length ) {
3209
 
3210
  $(document).on('widget-added widget-updated', function( event, $widget ) {
3211
  $widget.find('.csf-fields').csf_reload_script();
@@ -3230,7 +3252,7 @@
3230
 
3231
  var $this = $(this);
3232
 
3233
- if( $this.data('inited') ) {
3234
  $this.children('.csf-field-wp_editor').csf_field_wp_editor();
3235
  }
3236
 
@@ -3251,7 +3273,7 @@
3251
  var $this = $(this);
3252
 
3253
  // Avoid for conflicts
3254
- if( !$this.data('inited') ) {
3255
 
3256
  // Field plugins
3257
  $this.children('.csf-field-accordion').csf_field_accordion();
@@ -3298,7 +3320,7 @@
3298
  // Help Tooptip
3299
  $this.children('.csf-field').find('.csf-help').csf_help();
3300
 
3301
- if( settings.dependency ) {
3302
  $this.csf_dependency();
3303
  }
3304
 
@@ -3333,4 +3355,4 @@
3333
 
3334
  });
3335
 
3336
- })( jQuery, window, document );
24
  $window: $(window),
25
  $document: $(document),
26
  $form_warning: null,
27
+ is_confirm: false,
28
  form_modified: false,
29
  code_themes: [],
30
  is_rtl: $('body').hasClass('rtl'),
57
  var regex = new RegExp('('+ CSF.helper.preg_quote(field_id) +')\\[(\\d+)\\]', 'g');
58
 
59
  $selector.find(':radio').each(function() {
60
+ if ( this.checked || this.orginal_checked ) {
61
  this.orginal_checked = true;
62
  }
63
  });
65
  $selector.each( function( index ) {
66
  $(this).find(':input').each(function() {
67
  this.name = this.name.replace(regex, field_id +'['+ index +']');
68
+ if ( this.orginal_checked ) {
69
  this.checked = true;
70
  }
71
  });
82
  var context = this, args = arguments;
83
  var later = function() {
84
  timeout = null;
85
+ if ( !immediate ) {
86
  callback.apply(context, args);
87
  }
88
  };
89
  var callNow = ( immediate && !timeout );
90
  clearTimeout( timeout );
91
  timeout = setTimeout( later, threshold );
92
+ if ( callNow ) {
93
  callback.apply(context, args);
94
  }
95
  };
102
 
103
  var e, b, cookie = document.cookie, p = name + '=';
104
 
105
+ if ( ! cookie ) {
106
  return;
107
  }
108
 
109
  b = cookie.indexOf( '; ' + p );
110
 
111
+ if ( b === -1 ) {
112
  b = cookie.indexOf(p);
113
 
114
+ if ( b !== 0 ) {
115
  return null;
116
  }
117
  } else {
120
 
121
  e = cookie.indexOf( ';', b );
122
 
123
+ if ( e === -1 ) {
124
  e = cookie.length;
125
  }
126
 
135
 
136
  var d = new Date();
137
 
138
+ if ( typeof( expires ) === 'object' && expires.toGMTString ) {
139
  expires = expires.toGMTString();
140
+ } else if ( parseInt( expires, 10 ) ) {
141
  d.setTime( d.getTime() + ( parseInt( expires, 10 ) * 1000 ) );
142
  expires = d.toGMTString();
143
  } else {
173
  for( var i = 0; i < clone.length; ++i ) {
174
  for( var j = 0; j < clone[i].options.length; ++j ) {
175
 
176
+ if ( clone[i].options[j].selected === true ) {
177
  cloned[i].options[j].selected = true;
178
  }
179
 
215
  $hidden = $nav.closest('.csf').find('.csf-section-id'),
216
  $last_section;
217
 
218
+ $(window).on('hashchange csf.hashchange', function() {
219
 
220
  var hash = window.location.hash.match(new RegExp('tab=([^&]*)'));
221
  var slug = hash ? hash[1] : $links.first().attr('href').replace('#tab=', '');
222
  var $link = $('#csf-tab-link-'+ slug);
223
 
224
+ if ( $link.length > 0 ) {
225
 
226
  $link.closest('.csf-tab-depth-0').addClass('csf-tab-active').siblings().removeClass('csf-tab-active');
227
  $links.removeClass('csf-section-active');
228
  $link.addClass('csf-section-active');
229
 
230
+ if ( $last_section !== undefined ) {
231
  $last_section.hide();
232
  }
233
 
234
  var $section = $('#csf-section-'+slug);
235
+ $section.show();
236
  $section.csf_reload_script();
237
 
238
  $hidden.val(slug);
241
 
242
  }
243
 
244
+ }).trigger('csf.hashchange');
245
 
246
  });
247
  };
266
  var $link = $(this),
267
  section_id = $link.data('section');
268
 
269
+ if ( $last_link !== undefined ) {
270
  $last_link.removeClass('csf-section-active');
271
  }
272
 
273
+ if ( $last_section !== undefined ) {
274
  $last_section.hide();
275
  }
276
 
277
  $link.addClass('csf-section-active');
278
 
279
  var $section = $('#csf-section-'+section_id);
280
+ $section.show();
281
  $section.csf_reload_script();
282
 
283
  CSF.helper.set_cookie('csf-last-metabox-tab-'+ post_id +'-'+ unique_id, section_id);
289
 
290
  var get_cookie = CSF.helper.get_cookie('csf-last-metabox-tab-'+ post_id +'-'+ unique_id);
291
 
292
+ if ( get_cookie ) {
293
  $nav.find('a[data-section="'+ get_cookie +'"]').trigger('click');
294
  } else {
295
  $links.first('a').trigger('click');
302
  // Metabox Page Templates Listener
303
  //
304
  $.fn.csf_page_templates = function() {
305
+ if ( this.length ) {
306
 
307
  $(document).on('change', '.editor-page-attributes__template select, #page_template', function() {
308
 
320
  // Metabox Post Formats Listener
321
  //
322
  $.fn.csf_post_formats = function() {
323
+ if ( this.length ) {
324
 
325
  $(document).on('change', '.editor-post-format select, #formatdiv input[name="post_format"]', function() {
326
 
343
  $.fn.csf_search = function() {
344
  return this.each( function() {
345
 
346
+ var $this = $(this),
347
+ $input = $this.find('input');
348
 
349
  $input.on('change keyup', function() {
350
 
354
  $fields = $section.find('> .csf-field:not(.hidden)'),
355
  $titles = $fields.find('> .csf-title, .csf-search-tags');
356
 
357
+ if ( value.length > 3 ) {
358
 
359
  $fields.addClass('csf-hidden');
360
  $wrapper.addClass('csf-search-all');
363
 
364
  var $title = $(this);
365
 
366
+ if ( $title.text().match( new RegExp('.*?' + value + '.*?', 'i') ) ) {
367
 
368
  var $field = $title.closest('.csf-field');
369
 
406
  stickyTop = Math.max(offset, offsetTop - scrollTop ),
407
  winWidth = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
408
 
409
+ if ( stickyTop <= offset && winWidth > 782 ) {
410
  $inner.css({width: $this.outerWidth()-padding});
411
  $this.css({height: $this.outerHeight()}).addClass( 'csf-sticky' );
412
  } else {
417
  },
418
  requestTick = function() {
419
 
420
+ if ( !ticking ) {
421
  requestAnimationFrame( function() {
422
  stickyUpdate();
423
  ticking = false;
460
  values = $field.data('value').toString().split('|'),
461
  rules = ruleset;
462
 
463
+ if ( $field.data('depend-global') ) {
464
  is_global = true;
465
  }
466
 
479
 
480
  });
481
 
482
+ if ( depends.length ) {
483
 
484
+ if ( is_global ) {
485
  $.csf_deps.enable(CSF.vars.$body, ruleset, depends);
486
  } else {
487
  $.csf_deps.enable($this, ruleset, depends);
506
  $icon = $title.find('.csf-accordion-icon'),
507
  $content = $title.next();
508
 
509
+ if ( $icon.hasClass('fa-angle-right') ) {
510
  $icon.removeClass('fa-angle-right').addClass('fa-angle-down');
511
  } else {
512
  $icon.removeClass('fa-angle-down').addClass('fa-angle-right');
513
  }
514
 
515
+ if ( !$content.data( 'opened' ) ) {
516
 
517
  $content.csf_reload_script();
518
  $content.data( 'opened', true );
532
  $.fn.csf_field_backup = function() {
533
  return this.each( function() {
534
 
535
+ if ( window.wp.customize === undefined ) { return; }
536
 
537
  var base = this,
538
  $this = $(this),
542
 
543
  base.notification = function( message_text ) {
544
 
545
+ if ( wp.customize.notifications && wp.customize.OverlayNotification ) {
546
 
547
  // clear if there is any saved data.
548
+ if ( !wp.customize.state('saved').get() ) {
549
  wp.customize.state('changesetStatus').set('trash');
550
  wp.customize.each( function( setting ) { setting._dirty = false; });
551
  wp.customize.state('saved').set(true);
566
 
567
  e.preventDefault();
568
 
569
+ if ( CSF.vars.is_confirm ) {
570
 
571
  base.notification( window.csf_vars.i18n.reset_notification );
572
 
590
 
591
  e.preventDefault();
592
 
593
+ if ( CSF.vars.is_confirm ) {
594
 
595
  base.notification( window.csf_vars.i18n.import_notification );
596
 
597
  window.wp.ajax.post( 'csf-import', {
598
  unique: $import.data('unique'),
599
  nonce: $import.data('nonce'),
600
+ data: $this.find('.csf-import-data').val()
601
  }).done( function( response ) {
602
  window.location.reload(true);
603
  }).fail( function( response ) {
627
  $.fn.csf_field_code_editor = function() {
628
  return this.each( function() {
629
 
630
+ if ( typeof CodeMirror !== 'function' ) { return; }
631
 
632
  var $this = $(this),
633
  $textarea = $this.find('textarea'),
634
  $inited = $this.find('.CodeMirror'),
635
  data_editor = $textarea.data('editor');
636
 
637
+ if ( $inited.length ) {
638
  $inited.remove();
639
  }
640
 
641
  var interval = setInterval(function () {
642
+ if ( $this.is(':visible') ) {
643
 
644
  var code_editor = CodeMirror.fromTextArea( $textarea[0], data_editor );
645
 
646
  // load code-mirror theme css.
647
+ if ( data_editor.theme !== 'default' && CSF.vars.code_themes.indexOf(data_editor.theme) === -1 ) {
648
 
649
  var $cssLink = $('<link>');
650
 
701
 
702
  settings = $.extend({}, settings, defaults);
703
 
704
+ if ( $inputs.length === 2 ) {
705
 
706
  settings = $.extend({}, settings, {
707
  onSelect: function( selectedDate ) {
722
 
723
  var $input = $(this);
724
 
725
+ if ( $input.hasClass('hasDatepicker') ) {
726
  $input.removeAttr('id').removeClass('hasDatepicker');
727
  }
728
 
765
 
766
  e.preventDefault();
767
 
768
+ if ( typeof window.wp === 'undefined' || ! window.wp.media || ! window.wp.media.gallery ) { return; }
769
 
770
  // Open media with state
771
+ if ( state === 'gallery' ) {
772
 
773
  wp_media_frame = window.wp.media({
774
  library: {
785
 
786
  wp_media_frame = window.wp.media.gallery.edit( '[gallery ids="'+ ids +'"]' );
787
 
788
+ if ( what === 'add' ) {
789
  wp_media_frame.setState('gallery-library');
790
  }
791
 
847
  min = parseInt( $wrapper.data('min') );
848
 
849
  // clear accordion arrows if multi-instance
850
+ if ( $wrapper.hasClass('ui-accordion') ) {
851
  $wrapper.find('.ui-accordion-header-icon').remove();
852
  }
853
 
864
  animate: false,
865
  heightStyle: 'content',
866
  icons: {
867
+ 'header': 'csf-cloneable-header-icon fas fa-angle-right',
868
+ 'activeHeader': 'csf-cloneable-header-icon fas fa-angle-down'
869
  },
870
  activate: function( event, ui ) {
871
 
872
  var $panel = ui.newPanel;
873
  var $header = ui.newHeader;
874
 
875
+ if ( $panel.length && !$panel.data( 'opened' ) ) {
876
 
877
  var $fields = $panel.children();
878
  var $first = $fields.first().find(':input').first();
879
  var $title = $header.find('.csf-cloneable-value');
880
 
881
+ $first.on('change keyup', function( event ) {
882
  $title.text($first.val());
883
  });
884
 
886
  $panel.data( 'opened', true );
887
  $panel.data( 'retry', false );
888
 
889
+ } else if ( $panel.data( 'retry' ) ) {
890
 
891
  $panel.csf_reload_script_retry();
892
  $panel.data( 'retry', false );
914
  CSF.helper.name_nested_replace( $wrapper.children('.csf-cloneable-item'), field_id );
915
  $wrapper.csf_customizer_refresh();
916
 
917
+ if ( is_number ) {
918
  update_title_numbers($wrapper);
919
  }
920
 
929
 
930
  $min.hide();
931
 
932
+ if ( max && (count+1) > max ) {
933
  $max.show();
934
  return;
935
  }
954
  $wrapper.csf_customizer_refresh();
955
  $wrapper.csf_customizer_listen({closest: true});
956
 
957
+ if ( is_number ) {
958
  update_title_numbers($wrapper);
959
  }
960
 
968
 
969
  $min.hide();
970
 
971
+ if ( max && (count+1) > max ) {
972
  $max.show();
973
  return;
974
  }
999
  $wrapper.csf_customizer_refresh();
1000
  $wrapper.csf_customizer_listen({closest: true});
1001
 
1002
+ if ( is_number ) {
1003
  update_title_numbers($wrapper);
1004
  }
1005
 
1017
  $max.hide();
1018
  $min.hide();
1019
 
1020
+ if ( min && (count-1) < min ) {
1021
  $min.show();
1022
  return;
1023
  }
1028
 
1029
  $wrapper.csf_customizer_refresh();
1030
 
1031
+ if ( is_number ) {
1032
  update_title_numbers($wrapper);
1033
  }
1034
 
1059
 
1060
  CSF.vars.$icon_target = $this;
1061
 
1062
+ if ( !CSF.vars.icon_modal_loaded ) {
1063
 
1064
  $modal.find('.csf-modal-loading').show();
1065
 
1073
 
1074
  var $load = $modal.find('.csf-modal-load').html( response.content );
1075
 
1076
+ $load.on('click', 'i', function( e ) {
1077
 
1078
  e.preventDefault();
1079
 
1080
+ var icon = $(this).attr('title');
1081
 
1082
  CSF.vars.$icon_target.find('i').removeAttr('class').addClass(icon);
1083
  CSF.vars.$icon_target.find('input').val(icon).trigger('change');
1091
  $modal.on('change keyup', '.csf-icon-search', function() {
1092
 
1093
  var value = $(this).val(),
1094
+ $icons = $load.find('i');
1095
 
1096
  $icons.each( function() {
1097
 
1098
  var $elem = $(this);
1099
 
1100
+ if ( $elem.attr('title').search( new RegExp( value, 'i' ) ) < 0 ) {
1101
  $elem.hide();
1102
  } else {
1103
  $elem.show();
1136
  $.fn.csf_field_map = function() {
1137
  return this.each( function() {
1138
 
1139
+ if ( typeof L === 'undefined' ) { return; }
1140
 
1141
  var $this = $(this),
1142
  $map = $this.find('.csf--map-osm'),
1173
  update_latlng( mapMarker.getLatLng() );
1174
  });
1175
 
1176
+ if ( ! $search_input.length ) {
1177
  $search_input = $( '[data-depend-id="'+ $this.find('.csf--address-field').data( 'address-field' ) +'"]' );
1178
  }
1179
 
1180
+ var cache = {};
1181
+
1182
  $search_input.autocomplete({
1183
  source: function ( request, response ) {
1184
+
1185
+ var term = request.term;
1186
+
1187
+ if ( term in cache ) {
1188
+ response( cache[term] );
1189
+ return;
1190
+ }
1191
+
1192
  $.get( 'https://nominatim.openstreetmap.org/search', {
1193
  format: 'json',
1194
+ q: term,
1195
  }, function( results ) {
1196
+
1197
+ var data;
1198
+
1199
+ if ( results.length ) {
1200
+ data = results.map( function( item ) {
1201
  return {
1202
  value: item.display_name,
1203
  label: item.display_name,
1204
  lat: item.lat,
1205
  lon: item.lon
1206
  };
1207
+ }, 'json');
1208
  } else {
1209
+ data = [{
1210
  value: 'no-data',
1211
  label: 'No Results.'
1212
+ }];
1213
  }
1214
+
1215
+ cache[term] = data;
1216
+ response(data);
1217
+
1218
  });
1219
+
1220
  },
1221
  select: function ( event, ui ) {
1222
 
1223
+ if ( ui.item.value === 'no-data' ) { return false; }
1224
 
1225
  var latLng = L.latLng( ui.item.lat, ui.item.lon );
1226
 
1266
 
1267
  e.preventDefault();
1268
 
1269
+ if ( typeof window.wp === 'undefined' || ! window.wp.media || ! window.wp.media.gallery ) {
1270
  return;
1271
  }
1272
 
1273
+ if ( wp_media_frame ) {
1274
  wp_media_frame.open();
1275
  return;
1276
  }
1287
  var attributes = wp_media_frame.state().get('selection').first().attributes;
1288
  var preview_size = $upload_button.data('preview-size') || 'thumbnail';
1289
 
1290
+ if ( $library.length && $library.indexOf(attributes.subtype) === -1 && $library.indexOf(attributes.type) === -1 ) {
1291
  return;
1292
  }
1293
 
1298
  $this.find('.csf--title').val( attributes.title );
1299
  $this.find('.csf--description').val( attributes.description );
1300
 
1301
+ if ( typeof attributes.sizes !== 'undefined' && typeof attributes.sizes.thumbnail !== 'undefined' && preview_size === 'thumbnail' ) {
1302
  thumbnail = attributes.sizes.thumbnail.url;
1303
+ } else if ( typeof attributes.sizes !== 'undefined' && typeof attributes.sizes.full !== 'undefined' ) {
1304
  thumbnail = attributes.sizes.full.url;
1305
  } else {
1306
  thumbnail = attributes.icon;
1307
  }
1308
 
1309
+ if ( $auto_attributes ) {
1310
  $auto_attributes.removeClass('csf--attributes-hidden');
1311
  }
1312
 
1327
 
1328
  e.preventDefault();
1329
 
1330
+ if ( $auto_attributes ) {
1331
  $auto_attributes.addClass('csf--attributes-hidden');
1332
  }
1333
 
1386
 
1387
  $min.hide();
1388
 
1389
+ if ( max && (count+1) > max ) {
1390
  $max.show();
1391
  return;
1392
  }
1420
 
1421
  $min.hide();
1422
 
1423
+ if ( max && (count+1) > max ) {
1424
  $max.show();
1425
  return;
1426
  }
1464
  $max.hide();
1465
  $min.hide();
1466
 
1467
+ if ( min && (count-1) < min ) {
1468
  $min.show();
1469
  return;
1470
  }
1495
  data = $input.data(),
1496
  value = $input.val() || 0;
1497
 
1498
+ if ( $slider.hasClass('ui-slider') ) {
1499
  $slider.empty();
1500
  }
1501
 
1510
  }
1511
  });
1512
 
1513
+ $input.on('keyup', function() {
1514
  $slider.slider('value', $input.val());
1515
  });
1516
 
1558
 
1559
  var $el = ui.item.find('input');
1560
 
1561
+ if ( ui.item.parent().hasClass('csf-enabled') ) {
1562
  $el.attr('name', $el.attr('name').replace('disabled', 'enabled'));
1563
  } else {
1564
  $el.attr('name', $el.attr('name').replace('enabled', 'disabled'));
1569
  }
1570
  });
1571
 
1572
+ if ( $disabled ) {
1573
 
1574
  $disabled.sortable({
1575
  connectWith: $enabled,
1595
  $inited = $this.find('.ui-spinner-button'),
1596
  $unit = $input.data('unit');
1597
 
1598
+ if ( $inited.length ) {
1599
  $inited.remove();
1600
  }
1601
 
1604
  min: $input.data('min') || 0,
1605
  step: $input.data('step') || 1,
1606
  create: function( event, ui ) {
1607
+ if ( $unit.length ) {
1608
  $this.find('.ui-spinner-up').after('<span class="ui-button-text-only csf--unit">'+ $unit +'</span>');
1609
  }
1610
  },
1629
  var value = 0;
1630
  var $input = $switcher.find('input');
1631
 
1632
+ if ( $switcher.hasClass('csf--active') ) {
1633
  $switcher.removeClass('csf--active');
1634
  } else {
1635
  value = 1;
1706
  // Load google font
1707
  base.load_google_font = function( font_family, weight, style ) {
1708
 
1709
+ if ( font_family && typeof WebFont === 'object' ) {
1710
 
1711
  weight = weight ? weight.replace('normal', '') : '';
1712
  style = style ? style.replace('normal', '') : '';
1713
 
1714
+ if ( weight || style ) {
1715
  font_family = font_family +':'+ weight + style;
1716
  }
1717
 
1718
+ if ( loaded_fonts.indexOf( font_family ) === -1 ) {
1719
  WebFont.load({ google: { families: [font_family] } });
1720
  }
1721
 
1740
  var name = value;
1741
 
1742
  // is_multi
1743
+ if ( is_multi ) {
1744
  selected = ( condition && condition.indexOf(value) !== -1 ) ? ' selected' : '';
1745
  } else {
1746
  selected = ( condition && condition === value ) ? ' selected' : '';
1747
  }
1748
 
1749
+ if ( type === 'subset' ) {
1750
  name = base.sanitize_subset( value );
1751
+ } else if ( type === 'style' ){
1752
  name = base.sanitize_style( value );
1753
  }
1754
 
1765
  //
1766
  //
1767
  // Constants
1768
+ var selected_styles = [];
1769
+ var $typography = $this.find('.csf--typography');
1770
+ var $type = $this.find('.csf--type');
1771
+ var $styles = $this.find('.csf--block-font-style');
1772
+ var unit = $typography.data('unit');
1773
+ var line_height_unit = $typography.data('line-height-unit');
1774
+ var exclude_fonts = $typography.data('exclude') ? $typography.data('exclude').split(',') : [];
1775
 
1776
  //
1777
  //
1778
  // Chosen init
1779
+ if ( $this.find('.csf--chosen').length ) {
1780
 
1781
  var $chosen_selects = $this.find('select');
1782
 
1785
  var $chosen_select = $(this),
1786
  $chosen_inited = $chosen_select.parent().find('.chosen-container');
1787
 
1788
+ if ( $chosen_inited.length ) {
1789
  $chosen_inited.remove();
1790
  }
1791
 
1813
  $.each(webfonts, function( type, group ) {
1814
 
1815
  // Check for exclude fonts
1816
+ if ( exclude_fonts && exclude_fonts.indexOf(type) !== -1 ) { return; }
1817
 
1818
  opts += '<optgroup label="' + group.label + '">';
1819
 
1838
  // Font style select
1839
  var $font_style_block = $this.find('.csf--block-font-style');
1840
 
1841
+ if ( $font_style_block.length ) {
1842
 
1843
  var $font_style_select = $this.find('.csf--font-style-select');
1844
  var first_style_value = $font_style_select.val() ? $font_style_select.val().replace(/normal/g, '' ) : '';
1850
  var style_value = $font_style_select.val();
1851
 
1852
  // set a default value
1853
+ if ( !style_value && selected_styles && selected_styles.indexOf('normal') === -1 ) {
1854
  style_value = selected_styles[0];
1855
  }
1856
 
1869
  // Extra font style select
1870
  var $extra_font_style_block = $this.find('.csf--block-extra-styles');
1871
 
1872
+ if ( $extra_font_style_block.length ) {
1873
  var $extra_font_style_select = $this.find('.csf--extra-styles');
1874
  var first_extra_style_value = $extra_font_style_select.val();
1875
  }
1880
  //
1881
  // Subsets select
1882
  var $subset_block = $this.find('.csf--block-subset');
1883
+ if ( $subset_block.length ) {
1884
  var $subset_select = $this.find('.csf--subset');
1885
  var first_subset_select_value = $subset_select.val();
1886
  var subset_multi_select = $subset_select.data('multiple') || false;
1897
  $font_family_select.on('change csf.change', function( event ) {
1898
 
1899
  // Hide subsets on change
1900
+ if ( $subset_block.length ) {
1901
  $subset_block.addClass('hidden');
1902
  }
1903
 
1904
  // Hide extra font style on change
1905
+ if ( $extra_font_style_block.length ) {
1906
  $extra_font_style_block.addClass('hidden');
1907
  }
1908
 
1909
  // Hide backup font family on change
1910
+ if ( $backup_font_family_block.length ) {
1911
  $backup_font_family_block.addClass('hidden');
1912
  }
1913
 
1915
  var value = $selected.val();
1916
  var type = $selected.data('type');
1917
 
1918
+ if ( type && value ) {
1919
 
1920
  // Show backup fonts if font type google or custom
1921
+ if ( ( type === 'google' || type === 'custom' ) && $backup_font_family_block.length ) {
1922
  $backup_font_family_block.removeClass('hidden');
1923
  }
1924
 
1925
  // Appending font style select options
1926
+ if ( $font_style_block.length ) {
1927
 
1928
  // set styles for multi and normal style selectors
1929
  var styles = defaultstyles;
1930
 
1931
  // Custom or gogle font styles
1932
+ if ( type === 'google' && webfonts[type].fonts[value][0] ) {
1933
  styles = webfonts[type].fonts[value][0];
1934
+ } else if ( type === 'custom' && webfonts[type].fonts[value] ) {
1935
  styles = webfonts[type].fonts[value];
1936
  }
1937
 
1951
  $font_style_block.removeClass('hidden');
1952
 
1953
  // Appending extra font style select options
1954
+ if ( type === 'google' && $extra_font_style_block.length && styles.length > 1 ) {
1955
 
1956
  // Append extra-style select options
1957
  base.append_select_options( $extra_font_style_select, styles, first_extra_style_value, 'style', true );
1967
  }
1968
 
1969
  // Appending google fonts subsets select options
1970
+ if ( type === 'google' && $subset_block.length && webfonts[type].fonts[value][1] ) {
1971
 
1972
  var subsets = webfonts[type].fonts[value][1];
1973
  var set_auto_subset = ( subsets.length < 2 && subsets[0] !== 'latin' ) ? subsets[0] : '';
1990
  $styles.find(':input').val('');
1991
 
1992
  // Clear subsets options if type and value empty
1993
+ if ( $subset_block.length ) {
1994
  $subset_select.find('option').not(':first-child').remove();
1995
  $subset_select.trigger('chosen:updated');
1996
  }
1997
 
1998
  // Clear font styles options if type and value empty
1999
+ if ( $font_style_block.length ) {
2000
  $font_style_select.find('option').not(':first-child').remove();
2001
  $font_style_select.trigger('chosen:updated');
2002
  }
2013
  // Preview
2014
  var $preview_block = $this.find('.csf--block-preview');
2015
 
2016
+ if ( $preview_block.length ) {
2017
 
2018
  var $preview = $this.find('.csf--preview');
2019
 
2037
  custom_style = $this.find('.csf--custom-style').val(),
2038
  type = $this.find('.csf--type').val();
2039
 
2040
+ if ( type === 'google' ) {
2041
  base.load_google_font(font_family, font_weight, font_style);
2042
  }
2043
 
2044
  var properties = {};
2045
 
2046
+ if ( font_family ) { properties.fontFamily = font_family; }
2047
+ if ( font_weight ) { properties.fontWeight = font_weight; }
2048
+ if ( font_style ) { properties.fontStyle = font_style; }
2049
+ if ( font_variant ) { properties.fontVariant = font_variant; }
2050
+ if ( font_size ) { properties.fontSize = font_size + unit; }
2051
+ if ( line_height ) { properties.lineHeight = line_height + line_height_unit; }
2052
+ if ( letter_spacing ) { properties.letterSpacing = letter_spacing + unit; }
2053
+ if ( word_spacing ) { properties.wordSpacing = word_spacing + unit; }
2054
+ if ( text_align ) { properties.textAlign = text_align; }
2055
+ if ( text_transform ) { properties.textTransform = text_transform; }
2056
+ if ( text_decoration ) { properties.textDecoration = text_decoration; }
2057
+ if ( text_color ) { properties.color = text_color; }
2058
 
2059
  $preview.removeAttr('style');
2060
 
2061
  // Customs style attribute
2062
+ if ( custom_style ) { $preview.attr('style', custom_style); }
2063
 
2064
  $preview.css(properties);
2065
 
2072
 
2073
  var $toggle = $preview_block.find('.csf--toggle');
2074
 
2075
+ if ( $toggle.hasClass('fa-toggle-off') ) {
2076
  $toggle.removeClass('fa-toggle-off').addClass('fa-toggle-on');
2077
  } else {
2078
  $toggle.removeClass('fa-toggle-on').addClass('fa-toggle-off');
2080
 
2081
  });
2082
 
2083
+ if ( !$preview_block.hasClass('hidden') ) {
2084
  $this.trigger('change');
2085
  }
2086
 
2107
  wp_media_frame;
2108
 
2109
  $input.on('change', function( e ) {
2110
+ if ( $input.val() ) {
2111
  $remove_button.removeClass('hidden');
2112
  } else {
2113
  $remove_button.addClass('hidden');
2118
 
2119
  e.preventDefault();
2120
 
2121
+ if ( typeof window.wp === 'undefined' || ! window.wp.media || ! window.wp.media.gallery ) {
2122
  return;
2123
  }
2124
 
2125
+ if ( wp_media_frame ) {
2126
  wp_media_frame.open();
2127
  return;
2128
  }
2137
 
2138
  var attributes = wp_media_frame.state().get('selection').first().attributes;
2139
 
2140
+ if ( $library.length && $library.indexOf(attributes.subtype) === -1 && $library.indexOf(attributes.type) === -1 ) {
2141
  return;
2142
  }
2143
 
2164
  $.fn.csf_field_wp_editor = function() {
2165
  return this.each( function() {
2166
 
2167
+ if ( typeof window.wp.editor === 'undefined' || typeof window.tinyMCEPreInit === 'undefined' || typeof window.tinyMCEPreInit.mceInit.csf_wp_editor === 'undefined' ) {
2168
  return;
2169
  }
2170
 
2175
  // If there is wp-editor remove it for avoid dupliated wp-editor conflicts.
2176
  var $has_wp_editor = $this.find('.wp-editor-wrap').length || $this.find('.mce-container').length;
2177
 
2178
+ if ( $has_wp_editor ) {
2179
  $editor.empty();
2180
  $editor.append($textarea);
2181
  $textarea.css('display', '');
2206
  // Callback for old wp editor
2207
  var wpEditor = wp.oldEditor ? wp.oldEditor : wp.editor;
2208
 
2209
+ if ( wpEditor && wpEditor.hasOwnProperty('autop') ) {
2210
  wp.editor.autop = wpEditor.autop;
2211
  wp.editor.removep = wpEditor.removep;
2212
  wp.editor.initialize = wpEditor.initialize;
2216
  default_editor_settings.tinymce = $.extend( {}, default_editor_settings.tinymce, { selector: '#'+ uid, setup: editor_on_change } );
2217
 
2218
  // Override editor tinymce settings
2219
+ if ( field_editor_settings.tinymce === false ) {
2220
  default_editor_settings.tinymce = false;
2221
  $editor.addClass('csf-no-tinymce');
2222
  }
2223
 
2224
  // Override editor quicktags settings
2225
+ if ( field_editor_settings.quicktags === false ) {
2226
  default_editor_settings.quicktags = false;
2227
  $editor.addClass('csf-no-quicktags');
2228
  }
2229
 
2230
  // Wait until :visible
2231
  var interval = setInterval(function () {
2232
+ if ( $this.is(':visible') ) {
2233
  window.wp.editor.initialize(uid, default_editor_settings);
2234
  clearInterval(interval);
2235
  }
2236
  });
2237
 
2238
  // Add Media buttons
2239
+ if ( field_editor_settings.media_buttons && window.csf_media_buttons ) {
2240
 
2241
  var $editor_buttons = $editor.find('.wp-media-buttons');
2242
 
2243
+ if ( $editor_buttons.length ) {
2244
 
2245
  $editor_buttons.find('.csf-shortcode-button').data('editor-id', uid);
2246
 
2267
  return this.each( function() {
2268
  $(this).on('click', function( e ) {
2269
 
2270
+ var confirm_text = $(this).data('confirm') || window.csf_vars.i18n.confirm;
2271
+ var confirm_answer = confirm( confirm_text );
 
2272
 
2273
+ if ( confirm_answer ) {
2274
+ CSF.vars.is_confirm = true;
2275
+ } else {
2276
  e.preventDefault();
 
2277
  return false;
2278
  }
2279
 
2312
 
2313
  $this.on('click', function( e ) {
2314
 
2315
+ if ( !flooding ) {
2316
 
2317
  var $text = $this.data('save'),
2318
  $value = $this.val();
2319
 
2320
  $buttons.attr('value', $text);
2321
 
2322
+ if ( $this.hasClass('csf-save-ajax') ) {
2323
 
2324
  e.preventDefault();
2325
 
2334
  // clear errors
2335
  $('.csf-error').remove();
2336
 
2337
+ if ( Object.keys( response.errors ).length ) {
2338
 
2339
  var error_icon = '<i class="csf-label-error csf-error">!</i>';
2340
 
2346
 
2347
  $field.closest('.csf-fieldset').append( '<p class="csf-text-error csf-error">'+ error_message +'</p>' );
2348
 
2349
+ if ( !$link.find('.csf-error').length ) {
2350
  $link.append( error_icon );
2351
  }
2352
 
2353
+ if ( !$tab.find('.csf-arrow .csf-error').length ) {
2354
  $tab.find('.csf-arrow').append( error_icon );
2355
  }
2356
 
 
 
2357
  });
2358
 
2359
  }
2379
  alert( response.error );
2380
  });
2381
 
2382
+ } else {
2383
+
2384
+ CSF.vars.form_modified = false;
2385
+
2386
  }
2387
 
2388
  }
2409
  CSF.vars.$form_warning = $form_warning;
2410
 
2411
  // Shows a message white leaving theme options without saving
2412
+ if ( $form_warning.length ) {
2413
 
2414
  window.onbeforeunload = function() {
2415
+ return ( CSF.vars.form_modified && CSF.vars.is_confirm === false ) ? true : undefined;
2416
  };
2417
 
2418
  $content.on('change keypress', ':input', function() {
2419
+ if ( !CSF.vars.form_modified ) {
2420
  $form_success.hide();
2421
  $form_warning.fadeIn('fast');
2422
  CSF.vars.form_modified = true;
2425
 
2426
  }
2427
 
2428
+ if ( $form_success.hasClass('csf-form-show') ) {
2429
  setTimeout( function() {
2430
  $form_success.fadeOut('fast');
2431
  }, 1000);
2432
  }
2433
 
2434
  $(document).keydown(function (event) {
2435
+ if ( ( event.ctrlKey || event.metaKey ) && event.which === 83 ) {
2436
  $save_button.trigger('click');
2437
  event.preventDefault();
2438
  return false;
2451
  var $this = $(this),
2452
  $form = $this.parents('form');
2453
 
2454
+ if ( $form.attr('id') === 'addtag' ) {
2455
 
2456
  var $submit = $form.find('#submit'),
2457
  $cloned = $this.find('.csf-field').csf_clone();
2458
 
2459
  $submit.on( 'click', function() {
2460
 
2461
+ if ( !$form.find('.form-required').hasClass('form-invalid') ) {
2462
 
2463
  $this.data('inited', false);
2464
 
2498
 
2499
  $.each(shortcode_values, function( shortcode_tag, shortcode_value ) {
2500
 
2501
+ if ( shortcode_tag === 'content' ) {
2502
 
2503
  shortcode += ']';
2504
  shortcode += shortcode_value;
2524
 
2525
  var shortcode = '';
2526
 
2527
+ if ( shortcode_value !== '' ) {
2528
 
2529
+ if ( typeof shortcode_value === 'object' && !$.isArray( shortcode_value ) ) {
2530
 
2531
  $.each(shortcode_value, function( sub_shortcode_tag, sub_shortcode_value ) {
2532
 
2539
 
2540
  }
2541
 
2542
+ if ( sub_shortcode_value !== '' ) {
2543
  shortcode += ' ' + sub_shortcode_tag.replace('-', '_') + '="' + sub_shortcode_value.toString() + '"';
2544
  }
2545
 
2561
 
2562
  var obj = ( typeof _this[0].name !== 'undefined' ) ? _this[0] : _this;
2563
 
2564
+ if ( obj.value.length && typeof obj.selectionStart !== 'undefined' ) {
2565
  obj.focus();
2566
  return obj.value.substring( 0, obj.selectionStart ) + currentValue + obj.value.substring( obj.selectionEnd, obj.value.length );
2567
  } else {
2575
 
2576
  var tinymce_editor;
2577
 
2578
+ if ( typeof tinymce !== 'undefined' ) {
2579
  tinymce_editor = tinymce.get( editor_id );
2580
  }
2581
 
2582
+ if ( tinymce_editor && !tinymce_editor.isHidden() ) {
2583
  tinymce_editor.execCommand( 'mceInsertContent', false, html );
2584
  } else {
2585
  var $editor = $('#'+editor_id);
2620
  $modal.show();
2621
 
2622
  // single usage trigger first shortcode
2623
+ if ( $modal.hasClass('csf-shortcode-single') && sc_name === undefined ) {
2624
  $select.trigger('change');
2625
  }
2626
 
2638
 
2639
  $load.empty();
2640
 
2641
+ if ( sc_key ) {
2642
 
2643
  $loading.show();
2644
 
2673
 
2674
  e.preventDefault();
2675
 
2676
+ if ( $insert.prop('disabled') || $insert.attr('disabled') ) { return; }
2677
 
2678
  var shortcode = '';
2679
  var serialize = $modal.find('.csf-field:not(.hidden)').find(':input:not(.ignore)').serializeObjectCSF();
2712
 
2713
  shortcode = ( shortcode === '' ) ? '['+ sc_name +']' : shortcode;
2714
 
2715
+ if ( gutenberg_id ) {
2716
 
2717
  var content = window.csf_gutenberg_props.attributes.hasOwnProperty('shortcode') ? window.csf_gutenberg_props.attributes.shortcode : '';
2718
  window.csf_gutenberg_props.setAttributes({shortcode: content + shortcode});
2719
 
2720
+ } else if ( editor_id ) {
2721
 
2722
  base.send_to_editor( shortcode, editor_id );
2723
 
2766
  //
2767
  // WP Color Picker
2768
  //
2769
+ if ( typeof Color === 'function' ) {
2770
 
2771
  Color.prototype.toString = function() {
2772
 
2773
+ if ( this._alpha < 1 ) {
2774
  return this.toCSS('rgba', this._alpha).replace(/\s+/g, '');
2775
  }
2776
 
2777
  var hex = parseInt( this._color, 10 ).toString( 16 );
2778
 
2779
+ if ( this.error ) { return ''; }
2780
 
2781
+ if ( hex.length < 6 ) {
2782
  for (var i = 6 - hex.length - 1; i >= 0; i--) {
2783
  hex = '0' + hex;
2784
  }
2809
  $container;
2810
 
2811
  // Destroy and Reinit
2812
+ if ( $input.hasClass('wp-color-picker') ) {
2813
  $input.closest('.wp-picker-container').after($input).remove();
2814
  }
2815
 
2833
  '<div class="csf--transparent-slider"></div>' +
2834
  '<div class="csf--transparent-offset"></div>' +
2835
  '<div class="csf--transparent-text"></div>' +
2836
+ '<div class="csf--transparent-button">transparent <i class="fas fa-toggle-off"></i></div>' +
2837
  '</div>').appendTo( $container.find('.wp-picker-holder') ),
2838
  $transparent_slider = $transparent_wrap.find('.csf--transparent-slider'),
2839
  $transparent_text = $transparent_wrap.find('.csf--transparent-text'),
2840
  $transparent_offset = $transparent_wrap.find('.csf--transparent-offset'),
2841
  $transparent_button = $transparent_wrap.find('.csf--transparent-button');
2842
 
2843
+ if ( $input.val() === 'transparent' ) {
2844
  $container.addClass('csf--transparent-active');
2845
  }
2846
 
2847
  $transparent_button.on('click', function() {
2848
+ if ( $input.val() !== 'transparent' ) {
2849
  $input.val('transparent').trigger('change').removeClass('iris-error');
2850
  $container.addClass('csf--transparent-active');
2851
  } else {
2924
  no_results_text: window.csf_vars.i18n.no_results_text,
2925
  }, $this.data('chosen-settings'));
2926
 
2927
+ if ( $inited.length ) {
2928
  $inited.remove();
2929
  }
2930
 
2931
  // Chosen ajax
2932
+ if ( is_ajax ) {
2933
 
2934
  var set_ajax_options = $.extend({
2935
  data: {
2955
  }
2956
 
2957
  // Chosen keep options order
2958
+ if ( is_multiple ) {
2959
 
2960
  var $hidden_select = $this.parent().find('.csf-hidden-select');
2961
  var $hidden_value = $hidden_select.val() || [];
2962
 
2963
  $this.on('change', function(obj, result) {
2964
 
2965
+ if ( result && result.selected ) {
2966
  $hidden_select.append( '<option value="'+ result.selected +'" selected="selected">'+ result.selected +'</option>' );
2967
+ } else if ( result && result.deselected ) {
2968
  $hidden_select.find('option[value="'+ result.deselected +'"]').remove();
2969
  }
2970
 
2971
  // Force customize refresh
2972
+ if ( $hidden_select.children().length === 0 && window.wp.customize !== undefined ) {
2973
  window.wp.customize.control( $hidden_select.data('customize-setting-link') ).setting.set('');
2974
  }
2975
 
2983
  }
2984
 
2985
  // Chosen sortable
2986
+ if ( is_sortable ) {
2987
 
2988
  var $chosen_container = $this.parent().find('.chosen-container');
2989
  var $chosen_choices = $chosen_container.find('.chosen-choices');
2990
 
2991
  $chosen_choices.bind('mousedown', function( event ) {
2992
+ if ( $(event.target).is('span') ) {
2993
  event.stopPropagation();
2994
  }
2995
  });
3012
  $chosen_choices.find('.search-choice-close').each( function() {
3013
  var option_array_index = $(this).data('option-array-index');
3014
  $.each(chosen_object.results_data, function(index, data) {
3015
+ if ( data.array_index === option_array_index ){
3016
  select_options += '<option value="'+ data.value +'" selected>'+ data.value +'</option>';
3017
  }
3018
  });
3061
 
3062
  var $sibling = $(this);
3063
 
3064
+ if ( multiple ) {
3065
 
3066
+ if ( $sibling.hasClass('csf--active') ) {
3067
  $sibling.removeClass('csf--active');
3068
  $sibling.find('input').prop('checked', false).trigger('change');
3069
  } else {
3108
  },
3109
  mouseleave: function() {
3110
 
3111
+ if ( $tooltip !== undefined ) {
3112
  $tooltip.remove();
3113
  }
3114
 
3128
  var $this = $(this),
3129
  $complex = $this.closest('.csf-customize-complex');
3130
 
3131
+ if ( $complex.length ) {
3132
 
3133
  var $input = $complex.find(':input'),
3134
  $unique = $complex.data('unique-id'),
3164
 
3165
  return this.each( function() {
3166
 
3167
+ if ( window.wp.customize === undefined ) { return; }
3168
 
3169
  var $this = ( settings.closest ) ? $(this).closest('.csf-customize-complex') : $(this),
3170
  $input = $this.find(':input'),
3171
  unique_id = $this.data('unique-id'),
3172
  option_id = $this.data('option-id');
3173
 
3174
+ if ( unique_id === undefined ) { return; }
3175
 
3176
  $input.on('change keyup', CSF.helper.debounce( function() {
3177
 
3192
 
3193
  var $this = $(this);
3194
 
3195
+ if ( $this.hasClass('open') && !$this.data('inited') ) {
3196
 
3197
  var $fields = $this.find('.csf-customize-field');
3198
  var $complex = $this.find('.csf-customize-complex');
3199
 
3200
+ if ( $fields.length ) {
3201
  $this.csf_dependency();
3202
  $fields.csf_reload_script({dependency: false});
3203
  $complex.csf_customizer_listen();
3216
 
3217
  var window_width = navigator.userAgent.indexOf('AppleWebKit/') > -1 ? CSF.vars.$window.width() : window.innerWidth;
3218
 
3219
+ if ( window_width <= 782 && !CSF.vars.onloaded ) {
3220
  $('.csf-section').csf_reload_script();
3221
  CSF.vars.onloaded = true;
3222
  }
3227
  // Widgets Framework
3228
  //
3229
  $.fn.csf_widgets = function() {
3230
+ if ( this.length ) {
3231
 
3232
  $(document).on('widget-added widget-updated', function( event, $widget ) {
3233
  $widget.find('.csf-fields').csf_reload_script();
3252
 
3253
  var $this = $(this);
3254
 
3255
+ if ( $this.data('inited') ) {
3256
  $this.children('.csf-field-wp_editor').csf_field_wp_editor();
3257
  }
3258
 
3273
  var $this = $(this);
3274
 
3275
  // Avoid for conflicts
3276
+ if ( !$this.data('inited') ) {
3277
 
3278
  // Field plugins
3279
  $this.children('.csf-field-accordion').csf_field_accordion();
3320
  // Help Tooptip
3321
  $this.children('.csf-field').find('.csf-help').csf_help();
3322
 
3323
+ if ( settings.dependency ) {
3324
  $this.csf_dependency();
3325
  }
3326
 
3355
 
3356
  });
3357
 
3358
+ })( jQuery, window, document );
admin/settings/assets/js/csf.min.js CHANGED
@@ -1,3 +1,3 @@
1
- /* Codestar Framework | A Simple and Lightweight WordPress Option Framework - v2.1.3.x*/
2
 
3
- !function(e,t,n,i){"use strict";var a=a||{};a.funcs={},a.vars={onloaded:!1,$body:e("body"),$window:e(t),$document:e(n),$form_warning:null,form_modified:!1,code_themes:[],is_rtl:e("body").hasClass("rtl")},a.helper={uid:function(e){return(e||"")+Math.random().toString(36).substr(2,9)},preg_quote:function(e){return(e+"").replace(/(\[|\-|\])/g,"\\$1")},name_nested_replace:function(t,n){var i=new RegExp("("+a.helper.preg_quote(n)+")\\[(\\d+)\\]","g");t.find(":radio").each(function(){(this.checked||this.orginal_checked)&&(this.orginal_checked=!0)}),t.each(function(t){e(this).find(":input").each(function(){this.name=this.name.replace(i,n+"["+t+"]"),this.orginal_checked&&(this.checked=!0)})})},debounce:function(e,t,n){var i;return function(){var a=this,s=arguments,c=n&&!i;clearTimeout(i),i=setTimeout(function(){i=null,n||e.apply(a,s)},t),c&&e.apply(a,s)}},get_cookie:function(e){var t,i,a=n.cookie,s=e+"=";if(a){if(-1===(i=a.indexOf("; "+s))){if(0!==(i=a.indexOf(s)))return null}else i+=2;return-1===(t=a.indexOf(";",i))&&(t=a.length),decodeURIComponent(a.substring(i+s.length,t))}},set_cookie:function(e,t,i,a,s,c){var r=new Date;"object"==typeof i&&i.toGMTString?i=i.toGMTString():parseInt(i,10)?(r.setTime(r.getTime()+1e3*parseInt(i,10)),i=r.toGMTString()):i="",n.cookie=e+"="+encodeURIComponent(t)+(i?"; expires="+i:"")+(a?"; path="+a:"")+(s?"; domain="+s:"")+(c?"; secure":"")},remove_cookie:function(e,t,n,i){a.helper.set_cookie(e,"",-1e3,t,n,i)}},e.fn.csf_clone=function(){for(var t=e.fn.clone.apply(this,arguments),n=this.find("select").add(this.filter("select")),i=t.find("select").add(t.filter("select")),a=0;a<n.length;++a)for(var s=0;s<n[a].options.length;++s)!0===n[a].options[s].selected&&(i[a].options[s].selected=!0);return this.find(":radio").each(function(){this.orginal_checked=this.checked}),t},e.fn.csf_expand_all=function(){return this.each(function(){e(this).on("click",function(t){t.preventDefault(),e(".csf-wrapper").toggleClass("csf-show-all"),e(".csf-section").csf_reload_script(),e(this).find(".fa").toggleClass("fa-indent").toggleClass("fa-outdent")})})},e.fn.csf_nav_options=function(){return this.each(function(){var n,a=e(this),s=a.find("a"),c=a.closest(".csf").find(".csf-section-id");e(t).on("hashchange",function(){var a=t.location.hash.match(new RegExp("tab=([^&]*)")),r=a?a[1]:s.first().attr("href").replace("#tab=",""),o=e("#csf-tab-link-"+r);if(o.length>0){o.closest(".csf-tab-depth-0").addClass("csf-tab-active").siblings().removeClass("csf-tab-active"),s.removeClass("csf-section-active"),o.addClass("csf-section-active"),n!==i&&n.hide();var f=e("#csf-section-"+r);f.css({display:"block"}),f.csf_reload_script(),c.val(r),n=f}}).trigger("hashchange")})},e.fn.csf_nav_metabox=function(){return this.each(function(){var t,n,s=e(this),c=s.find("a"),r=s.data("unique"),o=e("#post_ID").val()||"global";c.on("click",function(s){s.preventDefault();var c=e(this),f=c.data("section");n!==i&&n.removeClass("csf-section-active"),t!==i&&t.hide(),c.addClass("csf-section-active");var l=e("#csf-section-"+f);l.css({display:"block"}),l.csf_reload_script(),a.helper.set_cookie("csf-last-metabox-tab-"+o+"-"+r,f),t=l,n=c});var f=a.helper.get_cookie("csf-last-metabox-tab-"+o+"-"+r);f?s.find('a[data-section="'+f+'"]').trigger("click"):c.first("a").trigger("click")})},e.fn.csf_page_templates=function(){this.length&&e(n).on("change",".editor-page-attributes__template select, #page_template",function(){var t=e(this).val()||"default";e(".csf-page-templates").removeClass("csf-show").addClass("csf-hide"),e(".csf-page-"+t.toLowerCase().replace(/[^a-zA-Z0-9]+/g,"-")).removeClass("csf-hide").addClass("csf-show")})},e.fn.csf_post_formats=function(){this.length&&e(n).on("change",'.editor-post-format select, #formatdiv input[name="post_format"]',function(){var t=e(this).val()||"default";t="0"===t?"default":t,e(".csf-post-formats").removeClass("csf-show").addClass("csf-hide"),e(".csf-post-format-"+t).removeClass("csf-hide").addClass("csf-show")})},e.fn.csf_search=function(){return this.each(function(){e(this).find("input").on("change keyup",function(){var t=e(this).val(),n=e(".csf-wrapper"),i=n.find(".csf-section").find("> .csf-field:not(.hidden)"),a=i.find("> .csf-title, .csf-search-tags");t.length>3?(i.addClass("csf-hidden"),n.addClass("csf-search-all"),a.each(function(){var n=e(this);if(n.text().match(new RegExp(".*?"+t+".*?","i"))){var i=n.closest(".csf-field");i.removeClass("csf-hidden"),i.parent().csf_reload_script()}})):(i.removeClass("csf-hidden"),n.removeClass("csf-search-all"))})})},e.fn.csf_sticky=function(){return this.each(function(){var i=e(this),a=e(t),s=i.find(".csf-header-inner"),c=parseInt(s.css("padding-left"))+parseInt(s.css("padding-right")),r=0,o=!1,f=function(){o||requestAnimationFrame(function(){var e,a,f;e=i.offset().top,a=Math.max(32,e-r),f=Math.max(n.documentElement.clientWidth,t.innerWidth||0),a<=32&&f>782?(s.css({width:i.outerWidth()-c}),i.css({height:i.outerHeight()}).addClass("csf-sticky")):(s.removeAttr("style"),i.removeAttr("style").removeClass("csf-sticky")),o=!1}),o=!0},l=function(){r=a.scrollTop(),f()};a.on("scroll resize",l),l()})},e.fn.csf_dependency=function(){return this.each(function(){var t=e(this),n=e.csf_deps.createRuleset(),i=[],s=!1;t.children("[data-controller]").each(function(){var t=e(this),a=t.data("controller").split("|"),c=t.data("condition").split("|"),r=t.data("value").toString().split("|"),o=n;t.data("depend-global")&&(s=!0),e.each(a,function(e,n){var a=r[e]||"",s=c[e]||c[0];(o=o.createRule('[data-depend-id="'+n+'"]',s,a)).include(t),i.push(n)})}),i.length&&(s?e.csf_deps.enable(a.vars.$body,n,i):e.csf_deps.enable(t,n,i))})},e.fn.csf_field_accordion=function(){return this.each(function(){e(this).find(".csf-accordion-title").on("click",function(){var t=e(this),n=t.find(".csf-accordion-icon"),i=t.next();n.hasClass("fa-angle-right")?n.removeClass("fa-angle-right").addClass("fa-angle-down"):n.removeClass("fa-angle-down").addClass("fa-angle-right"),i.data("opened")||(i.csf_reload_script(),i.data("opened",!0)),i.toggleClass("csf-accordion-open")})})},e.fn.csf_field_backup=function(){return this.each(function(){if(t.wp.customize!==i){var n=this,s=e(this),c=(e("body"),s.find(".csf-import")),r=s.find(".csf-reset");n.notification=function(e){wp.customize.notifications&&wp.customize.OverlayNotification&&(wp.customize.state("saved").get()||(wp.customize.state("changesetStatus").set("trash"),wp.customize.each(function(e){e._dirty=!1}),wp.customize.state("saved").set(!0)),wp.customize.notifications.add(new wp.customize.OverlayNotification("csf_field_backup_notification",{type:"info",message:e,loading:!0})))},r.on("click",function(e){e.preventDefault(),a.vars.is_confirm&&(n.notification(t.csf_vars.i18n.reset_notification),t.wp.ajax.post("csf-reset",{unique:r.data("unique"),nonce:r.data("nonce")}).done(function(e){t.location.reload(!0)}).fail(function(e){alert(e.error),wp.customize.notifications.remove("csf_field_backup_notification")}))}),c.on("click",function(e){e.preventDefault(),a.vars.is_confirm&&(n.notification(t.csf_vars.i18n.import_notification),t.wp.ajax.post("csf-import",{unique:c.data("unique"),nonce:c.data("nonce"),import_data:s.find(".csf-import-data").val()}).done(function(e){t.location.reload(!0)}).fail(function(e){alert(e.error),wp.customize.notifications.remove("csf_field_backup_notification")}))})}})},e.fn.csf_field_background=function(){return this.each(function(){e(this).find(".csf--background-image").csf_reload_script()})},e.fn.csf_field_code_editor=function(){return this.each(function(){if("function"==typeof CodeMirror){var t=e(this),n=t.find("textarea"),i=t.find(".CodeMirror"),s=n.data("editor");i.length&&i.remove();var c=setInterval(function(){if(t.is(":visible")){var i=CodeMirror.fromTextArea(n[0],s);if("default"!==s.theme&&-1===a.vars.code_themes.indexOf(s.theme)){var r=e("<link>");e("#csf-codemirror-css").after(r),r.attr({rel:"stylesheet",id:"csf-codemirror-"+s.theme+"-css",href:s.cdnURL+"/theme/"+s.theme+".min.css",type:"text/css",media:"all"}),a.vars.code_themes.push(s.theme)}CodeMirror.modeURL=s.cdnURL+"/mode/%N/%N.min.js",CodeMirror.autoLoadMode(i,s.mode),i.on("change",function(e,t){n.val(i.getValue()).trigger("change")}),clearInterval(c)}})}})},e.fn.csf_field_date=function(){return this.each(function(){var t=e(this),n=t.find("input"),i=t.find(".csf-date-settings").data("settings"),a={showAnim:"",beforeShow:function(t,n){e(n.dpDiv).addClass("csf-datepicker-wrapper")},onClose:function(t,n){e(n.dpDiv).removeClass("csf-datepicker-wrapper")}};i=e.extend({},i,a),2===n.length&&(i=e.extend({},i,{onSelect:function(t){e(this),n.first();var a=n.first().attr("id")===e(this).attr("id")?"minDate":"maxDate",s=e.datepicker.parseDate(i.dateFormat,t);n.not(this).datepicker("option",a,s)}})),n.each(function(){var t=e(this);t.hasClass("hasDatepicker")&&t.removeAttr("id").removeClass("hasDatepicker"),t.datepicker(i)})})},e.fn.csf_field_fieldset=function(){return this.each(function(){e(this).find(".csf-fieldset-content").csf_reload_script()})},e.fn.csf_field_gallery=function(){return this.each(function(){var n,i=e(this),a=i.find(".csf-edit-gallery"),s=i.find(".csf-clear-gallery"),c=i.find("ul"),r=i.find("input");i.find("img");i.on("click",".csf-button, .csf-edit-gallery",function(i){var o=e(this),f=r.val(),l=o.hasClass("csf-edit-gallery")?"edit":"add",d="add"!==l||f.length?"gallery-edit":"gallery";i.preventDefault(),void 0!==t.wp&&t.wp.media&&t.wp.media.gallery&&("gallery"===d?(n=t.wp.media({library:{type:"image"},frame:"post",state:"gallery",multiple:!0})).open():(n=t.wp.media.gallery.edit('[gallery ids="'+f+'"]'),"add"===l&&n.setState("gallery-library")),n.on("update",function(e){c.empty();var t=e.models.map(function(e){var t=e.toJSON(),n=t.sizes&&t.sizes.thumbnail&&t.sizes.thumbnail.url?t.sizes.thumbnail.url:t.url;return c.append('<li><img src="'+n+'"></li>'),t.id});r.val(t.join(",")).trigger("change"),s.removeClass("hidden"),a.removeClass("hidden")}))}),s.on("click",function(e){e.preventDefault(),c.empty(),r.val("").trigger("change"),s.addClass("hidden"),a.addClass("hidden")})})},e.fn.csf_field_group=function(){return this.each(function(){var t=e(this),n=t.children(".csf-fieldset"),i=n.length?n:t,s=i.children(".csf-cloneable-wrapper"),c=i.children(".csf-cloneable-hidden"),r=i.children(".csf-cloneable-max"),o=i.children(".csf-cloneable-min"),f=s.data("field-id"),l=s.data("unique-id"),d=Boolean(Number(s.data("title-number"))),h=parseInt(s.data("max")),p=parseInt(s.data("min"));s.hasClass("ui-accordion")&&s.find(".ui-accordion-header-icon").remove();var u=function(t){t.find(".csf-cloneable-title-number").each(function(t){e(this).html(e(this).closest(".csf-cloneable-item").index()+1+".")})};s.accordion({header:"> .csf-cloneable-item > .csf-cloneable-title",collapsible:!0,active:!1,animate:!1,heightStyle:"content",icons:{header:"csf-cloneable-header-icon fa fa-angle-right",activeHeader:"csf-cloneable-header-icon fa fa-angle-down"},activate:function(e,t){var n=t.newPanel,i=t.newHeader;if(n.length&&!n.data("opened")){var a=n.children().first().find(":input").first(),s=i.find(".csf-cloneable-value");a.on("keyup",function(e){s.text(a.val())}),n.csf_reload_script(),n.data("opened",!0),n.data("retry",!1)}else n.data("retry")&&(n.csf_reload_script_retry(),n.data("retry",!1))}}),s.sortable({axis:"y",handle:".csf-cloneable-title,.csf-cloneable-sort",helper:"original",cursor:"move",placeholder:"widget-placeholder",start:function(e,t){s.accordion({active:!1}),s.sortable("refreshPositions"),t.item.children(".csf-cloneable-content").data("retry",!0)},update:function(e,t){a.helper.name_nested_replace(s.children(".csf-cloneable-item"),f),s.csf_customizer_refresh(),d&&u(s)}}),i.children(".csf-cloneable-add").on("click",function(t){t.preventDefault();var n=s.children(".csf-cloneable-item").length;if(o.hide(),h&&n+1>h)r.show();else{var i=l+f+"["+n+"]",a=c.csf_clone(!0);a.removeClass("csf-cloneable-hidden"),a.find(':input[name!="_pseudo"]').each(function(){this.name=i+this.name.replace(this.name.startsWith("_nonce")?"_nonce":l,"")}),a.find(".csf-data-wrapper").each(function(){e(this).attr("data-unique-id",i)}),s.append(a),s.accordion("refresh"),s.accordion({active:n}),s.csf_customizer_refresh(),s.csf_customizer_listen({closest:!0}),d&&u(s)}});var v=function(t){t.preventDefault();var n=s.children(".csf-cloneable-item").length;if(o.hide(),h&&n+1>h)r.show();else{var i=e(this).parent().parent(),c=i.children(".csf-cloneable-helper").csf_clone(!0),l=i.children(".csf-cloneable-title").csf_clone(),p=i.children(".csf-cloneable-content").csf_clone(),v=new RegExp("("+a.helper.preg_quote(f)+")\\[(\\d+)\\]","g");p.find(".csf-data-wrapper").each(function(){var t=e(this);t.attr("data-unique-id",t.attr("data-unique-id").replace(v,f+"["+(i.index()+1)+"]"))});var g=e('<div class="csf-cloneable-item" />');g.append(c),g.append(l),g.append(p),s.children().eq(i.index()).after(g),a.helper.name_nested_replace(s.children(".csf-cloneable-item"),f),s.accordion("refresh"),s.csf_customizer_refresh(),s.csf_customizer_listen({closest:!0}),d&&u(s)}};s.children(".csf-cloneable-item").children(".csf-cloneable-helper").on("click",".csf-cloneable-clone",v),i.children(".csf-cloneable-hidden").children(".csf-cloneable-helper").on("click",".csf-cloneable-clone",v);var g=function(t){t.preventDefault();var n=s.children(".csf-cloneable-item").length;r.hide(),o.hide(),p&&n-1<p?o.show():(e(this).closest(".csf-cloneable-item").remove(),a.helper.name_nested_replace(s.children(".csf-cloneable-item"),f),s.csf_customizer_refresh(),d&&u(s))};s.children(".csf-cloneable-item").children(".csf-cloneable-helper").on("click",".csf-cloneable-remove",g),i.children(".csf-cloneable-hidden").children(".csf-cloneable-helper").on("click",".csf-cloneable-remove",g)})},e.fn.csf_field_icon=function(){return this.each(function(){var n=e(this);n.on("click",".csf-icon-add",function(i){i.preventDefault();var s=e(this),c=e("#csf-modal-icon");c.show(),a.vars.$icon_target=n,a.vars.icon_modal_loaded||(c.find(".csf-modal-loading").show(),t.wp.ajax.post("csf-get-icons",{nonce:s.data("nonce")}).done(function(t){c.find(".csf-modal-loading").hide(),a.vars.icon_modal_loaded=!0;var n=c.find(".csf-modal-load").html(t.content);n.on("click","a",function(t){t.preventDefault();var n=e(this).data("csf-icon");a.vars.$icon_target.find("i").removeAttr("class").addClass(n),a.vars.$icon_target.find("input").val(n).trigger("change"),a.vars.$icon_target.find(".csf-icon-preview").removeClass("hidden"),a.vars.$icon_target.find(".csf-icon-remove").removeClass("hidden"),c.hide()}),c.on("change keyup",".csf-icon-search",function(){var t=e(this).val();n.find("a").each(function(){var n=e(this);n.data("csf-icon").search(new RegExp(t,"i"))<0?n.hide():n.show()})}),c.on("click",".csf-modal-close, .csf-modal-overlay",function(){c.hide()})}).fail(function(e){c.find(".csf-modal-loading").hide(),c.find(".csf-modal-load").html(e.error),c.on("click",function(){c.hide()})}))}),n.on("click",".csf-icon-remove",function(t){t.preventDefault(),n.find(".csf-icon-preview").addClass("hidden"),n.find("input").val("").trigger("change"),e(this).addClass("hidden")})})},e.fn.csf_field_map=function(){return this.each(function(){if("undefined"!=typeof L){var t=e(this),n=t.find(".csf--map-osm"),i=t.find(".csf--map-search input"),a=t.find(".csf--latitude"),s=t.find(".csf--longitude"),c=t.find(".csf--zoom"),r=n.data("map"),o=L.map(n.get(0),r);L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'}).addTo(o);var f=L.marker(r.center,{draggable:!0}).addTo(o),l=function(e){a.val(e.lat),s.val(e.lng),c.val(o.getZoom())};o.on("click",function(e){f.setLatLng(e.latlng),l(e.latlng)}),o.on("zoom",function(){l(f.getLatLng())}),f.on("drag",function(){l(f.getLatLng())}),i.length||(i=e('[data-depend-id="'+t.find(".csf--address-field").data("address-field")+'"]')),i.autocomplete({source:function(t,n){e.get("https://nominatim.openstreetmap.org/search",{format:"json",q:t.term},function(e){e.length?n(e.map(function(e){return{value:e.display_name,label:e.display_name,lat:e.lat,lon:e.lon}},"json")):n([{value:"no-data",label:"No Results."}])})},select:function(e,t){if("no-data"===t.item.value)return!1;var n=L.latLng(t.item.lat,t.item.lon);o.panTo(n),f.setLatLng(n),l(n)},create:function(t,n){e(this).autocomplete("widget").addClass("csf-map-ui-autocomplate")}});var d=function(){var e=L.latLng(a.val(),s.val());o.panTo(e),f.setLatLng(e)};a.on("change",d),s.on("change",d)}})},e.fn.csf_field_media=function(){return this.each(function(){var n,i=e(this),a=i.find(".csf--button"),s=i.find(".csf--remove"),c=a.data("library")&&a.data("library").split(",")||"",r=!!i.hasClass("csf-assign-field-background")&&i.closest(".csf-field-background").find(".csf--auto-attributes");a.on("click",function(e){e.preventDefault(),void 0!==t.wp&&t.wp.media&&t.wp.media.gallery&&(n?n.open():((n=t.wp.media({library:{type:c}})).on("select",function(){var e,t=n.state().get("selection").first().attributes,o=a.data("preview-size")||"thumbnail";c.length&&-1===c.indexOf(t.subtype)&&-1===c.indexOf(t.type)||(i.find(".csf--id").val(t.id),i.find(".csf--width").val(t.width),i.find(".csf--height").val(t.height),i.find(".csf--alt").val(t.alt),i.find(".csf--title").val(t.title),i.find(".csf--description").val(t.description),e=void 0!==t.sizes&&void 0!==t.sizes.thumbnail&&"thumbnail"===o?t.sizes.thumbnail.url:void 0!==t.sizes&&void 0!==t.sizes.full?t.sizes.full.url:t.icon,r&&r.removeClass("csf--attributes-hidden"),s.removeClass("hidden"),i.find(".csf--preview").removeClass("hidden"),i.find(".csf--src").attr("src",e),i.find(".csf--thumbnail").val(e),i.find(".csf--url").val(t.url).trigger("change"))}),n.open()))}),s.on("click",function(e){e.preventDefault(),r&&r.addClass("csf--attributes-hidden"),s.addClass("hidden"),i.find("input").val(""),i.find(".csf--preview").addClass("hidden"),i.find(".csf--url").trigger("change")})})},e.fn.csf_field_repeater=function(){return this.each(function(){var t=e(this),n=t.children(".csf-fieldset"),i=n.length?n:t,s=i.children(".csf-repeater-wrapper"),c=i.children(".csf-repeater-hidden"),r=i.children(".csf-repeater-max"),o=i.children(".csf-repeater-min"),f=s.data("field-id"),l=s.data("unique-id"),d=parseInt(s.data("max")),h=parseInt(s.data("min"));s.children(".csf-repeater-item").children(".csf-repeater-content").csf_reload_script(),s.sortable({axis:"y",handle:".csf-repeater-sort",helper:"original",cursor:"move",placeholder:"widget-placeholder",update:function(e,t){a.helper.name_nested_replace(s.children(".csf-repeater-item"),f),s.csf_customizer_refresh(),t.item.csf_reload_script_retry()}}),i.children(".csf-repeater-add").on("click",function(t){t.preventDefault();var n=s.children(".csf-repeater-item").length;if(o.hide(),d&&n+1>d)r.show();else{var i=l+f+"["+n+"]",a=c.csf_clone(!0);a.removeClass("csf-repeater-hidden"),a.find(':input[name!="_pseudo"]').each(function(){this.name=i+this.name.replace(this.name.startsWith("_nonce")?"_nonce":l,"")}),a.find(".csf-data-wrapper").each(function(){e(this).attr("data-unique-id",i)}),s.append(a),a.children(".csf-repeater-content").csf_reload_script(),s.csf_customizer_refresh(),s.csf_customizer_listen({closest:!0})}});var p=function(t){t.preventDefault();var n=s.children(".csf-repeater-item").length;if(o.hide(),d&&n+1>d)r.show();else{var i=e(this).parent().parent().parent(),c=i.children(".csf-repeater-content").csf_clone(),l=i.children(".csf-repeater-helper").csf_clone(!0),h=new RegExp("("+a.helper.preg_quote(f)+")\\[(\\d+)\\]","g");c.find(".csf-data-wrapper").each(function(){var t=e(this);t.attr("data-unique-id",t.attr("data-unique-id").replace(h,f+"["+(i.index()+1)+"]"))});var p=e('<div class="csf-repeater-item" />');p.append(c),p.append(l),s.children().eq(i.index()).after(p),p.children(".csf-repeater-content").csf_reload_script(),a.helper.name_nested_replace(s.children(".csf-repeater-item"),f),s.csf_customizer_refresh(),s.csf_customizer_listen({closest:!0})}};s.children(".csf-repeater-item").children(".csf-repeater-helper").on("click",".csf-repeater-clone",p),i.children(".csf-repeater-hidden").children(".csf-repeater-helper").on("click",".csf-repeater-clone",p);var u=function(t){t.preventDefault();var n=s.children(".csf-repeater-item").length;r.hide(),o.hide(),h&&n-1<h?o.show():(e(this).closest(".csf-repeater-item").remove(),a.helper.name_nested_replace(s.children(".csf-repeater-item"),f),s.csf_customizer_refresh())};s.children(".csf-repeater-item").children(".csf-repeater-helper").on("click",".csf-repeater-remove",u),i.children(".csf-repeater-hidden").children(".csf-repeater-helper").on("click",".csf-repeater-remove",u)})},e.fn.csf_field_slider=function(){return this.each(function(){var t=e(this),n=t.find("input"),i=t.find(".csf-slider-ui"),a=n.data(),s=n.val()||0;i.hasClass("ui-slider")&&i.empty(),i.slider({range:"min",value:s,min:a.min,max:a.max,step:a.step,slide:function(e,t){n.val(t.value).trigger("change")}}),n.keyup(function(){i.slider("value",n.val())})})},e.fn.csf_field_sortable=function(){return this.each(function(){var t=e(this).find(".csf--sortable");t.sortable({axis:"y",helper:"original",cursor:"move",placeholder:"widget-placeholder",update:function(e,n){t.csf_customizer_refresh()}}),t.find(".csf--sortable-content").csf_reload_script()})},e.fn.csf_field_sorter=function(){return this.each(function(){var t=e(this),n=t.find(".csf-enabled"),i=t.find(".csf-disabled"),a=!!i.length&&i;n.sortable({connectWith:a,placeholder:"ui-sortable-placeholder",update:function(e,n){var i=n.item.find("input");n.item.parent().hasClass("csf-enabled")?i.attr("name",i.attr("name").replace("disabled","enabled")):i.attr("name",i.attr("name").replace("enabled","disabled")),t.csf_customizer_refresh()}}),a&&a.sortable({connectWith:n,placeholder:"ui-sortable-placeholder",update:function(e,n){t.csf_customizer_refresh()}})})},e.fn.csf_field_spinner=function(){return this.each(function(){var t=e(this),n=t.find("input"),i=t.find(".ui-spinner-button"),a=n.data("unit");i.length&&i.remove(),n.spinner({max:n.data("max")||100,min:n.data("min")||0,step:n.data("step")||1,create:function(e,n){a.length&&t.find(".ui-spinner-up").after('<span class="ui-button-text-only csf--unit">'+a+"</span>")},spin:function(e,t){n.val(t.value).trigger("change")}})})},e.fn.csf_field_switcher=function(){return this.each(function(){var t=e(this).find(".csf--switcher");t.on("click",function(){var e=0,n=t.find("input");t.hasClass("csf--active")?t.removeClass("csf--active"):(e=1,t.addClass("csf--active")),n.val(e).trigger("change")})})},e.fn.csf_field_tabbed=function(){return this.each(function(){var t=e(this),n=t.find(".csf-tabbed-nav a"),i=t.find(".csf-tabbed-section");i.eq(0).csf_reload_script(),n.on("click",function(t){t.preventDefault();var n=e(this),a=n.index(),s=i.eq(a);n.addClass("csf-tabbed-active").siblings().removeClass("csf-tabbed-active"),s.csf_reload_script(),s.removeClass("hidden").siblings().addClass("hidden")})})},e.fn.csf_field_typography=function(){return this.each(function(){var t=this,n=e(this),i=[],s=csf_typography_json.webfonts,c=csf_typography_json.googlestyles,r=csf_typography_json.defaultstyles;t.sanitize_subset=function(e){return e=(e=e.replace("-ext"," Extended")).charAt(0).toUpperCase()+e.slice(1)},t.sanitize_style=function(e){return c[e]?c[e]:e},t.load_google_font=function(e,t,n){e&&"object"==typeof WebFont&&(t=t?t.replace("normal",""):"",n=n?n.replace("normal",""):"",(t||n)&&(e=e+":"+t+n),-1===i.indexOf(e)&&WebFont.load({google:{families:[e]}}),i.push(e))},t.append_select_options=function(n,i,a,s,c){n.find("option").not(":first").remove();var r="";e.each(i,function(e,n){var i,o=n;i=c?a&&-1!==a.indexOf(n)?" selected":"":a&&a===n?" selected":"","subset"===s?o=t.sanitize_subset(n):"style"===s&&(o=t.sanitize_style(n)),r+='<option value="'+n+'"'+i+">"+o+"</option>"}),n.append(r).trigger("csf.change").trigger("chosen:updated")},t.init=function(){var i=[],c=n.find(".csf--typography"),o=n.find(".csf--type"),f=n.find(".csf--block-font-style"),l=c.data("unit"),d=c.data("exclude")?c.data("exclude").split(","):[];n.find(".csf--chosen").length&&n.find("select").each(function(){var t=e(this),n=t.parent().find(".chosen-container");n.length&&n.remove(),t.chosen({allow_single_deselect:!0,disable_search_threshold:15,width:"100%"})});var h=n.find(".csf--font-family"),p=h.val();h.find("option").not(":first-child").remove();var u="";e.each(s,function(t,n){d&&-1!==d.indexOf(t)||(u+='<optgroup label="'+n.label+'">',e.each(n.fonts,function(e,n){u+='<option value="'+(n="object"==typeof n?e:n)+'" data-type="'+t+'"'+(n===p?" selected":"")+">"+n+"</option>"}),u+="</optgroup>")}),h.append(u).trigger("chosen:updated");var v=n.find(".csf--block-font-style");if(v.length){var g=n.find(".csf--font-style-select"),_=g.val()?g.val().replace(/normal/g,""):"";g.on("change csf.change",function(e){var t=g.val();!t&&i&&-1===i.indexOf("normal")&&(t=i[0]);var a=t&&"italic"!==t&&"normal"===t?"normal":"",s=t&&"italic"!==t&&"normal"!==t?t.replace("italic",""):a,c=t&&"italic"===t.substr(-6)?"italic":"";n.find(".csf--font-weight").val(s),n.find(".csf--font-style").val(c)});var m=n.find(".csf--block-extra-styles");if(m.length)var b=n.find(".csf--extra-styles"),y=b.val()}var w=n.find(".csf--block-subset");if(w.length)var k=n.find(".csf--subset"),C=k.val(),x=k.data("multiple")||!1;var z=n.find(".csf--block-backup-font-family");h.on("change csf.change",function(e){w.length&&w.addClass("hidden"),m.length&&m.addClass("hidden"),z.length&&z.addClass("hidden");var n=h.find(":selected"),a=n.val(),c=n.data("type");if(c&&a){if("google"!==c&&"custom"!==c||!z.length||z.removeClass("hidden"),v.length){var l=r;"google"===c&&s[c].fonts[a][0]?l=s[c].fonts[a][0]:"custom"===c&&s[c].fonts[a]&&(l=s[c].fonts[a]),i=l;var d=-1!==l.indexOf("normal")?"normal":l[0],p=_&&-1!==l.indexOf(_)?_:d;t.append_select_options(g,l,p,"style"),_=!1,v.removeClass("hidden"),"google"===c&&m.length&&l.length>1&&(t.append_select_options(b,l,y,"style",!0),y=!1,m.removeClass("hidden"))}if("google"===c&&w.length&&s[c].fonts[a][1]){var u=s[c].fonts[a][1],D=u.length<2&&"latin"!==u[0]?u[0]:"",O=C&&-1!==u.indexOf(C)?C:D;O=x&&C?C:O,t.append_select_options(k,u,O,"subset",x),C=!1,w.removeClass("hidden")}}else f.find(":input").val(""),w.length&&(k.find("option").not(":first-child").remove(),k.trigger("chosen:updated")),v.length&&(g.find("option").not(":first-child").remove(),g.trigger("chosen:updated"));o.val(c)}).trigger("csf.change");var D=n.find(".csf--block-preview");if(D.length){var O=n.find(".csf--preview");n.on("change",a.helper.debounce(function(e){D.removeClass("hidden");var i=h.val(),a=n.find(".csf--font-weight").val(),s=n.find(".csf--font-style").val(),c=n.find(".csf--font-size").val(),r=n.find(".csf--font-variant").val(),o=n.find(".csf--line-height").val(),f=n.find(".csf--text-align").val(),d=n.find(".csf--text-transform").val(),p=n.find(".csf--text-decoration").val(),u=n.find(".csf--color").val(),v=n.find(".csf--word-spacing").val(),g=n.find(".csf--letter-spacing").val(),_=n.find(".csf--custom-style").val();"google"===n.find(".csf--type").val()&&t.load_google_font(i,a,s);var m={};i&&(m.fontFamily=i),a&&(m.fontWeight=a),s&&(m.fontStyle=s),r&&(m.fontVariant=r),c&&(m.fontSize=c+l),o&&(m.lineHeight=o+l),g&&(m.letterSpacing=g+l),v&&(m.wordSpacing=v+l),f&&(m.textAlign=f),d&&(m.textTransform=d),p&&(m.textDecoration=p),u&&(m.color=u),O.removeAttr("style"),_&&O.attr("style",_),O.css(m)},100)),D.on("click",function(){O.toggleClass("csf--black-background");var e=D.find(".csf--toggle");e.hasClass("fa-toggle-off")?e.removeClass("fa-toggle-off").addClass("fa-toggle-on"):e.removeClass("fa-toggle-on").addClass("fa-toggle-off")}),D.hasClass("hidden")||n.trigger("change")}},t.init()})},e.fn.csf_field_upload=function(){return this.each(function(){var n,i=e(this),a=i.find("input"),s=i.find(".csf--button"),c=i.find(".csf--remove"),r=s.data("library")&&s.data("library").split(",")||"";a.on("change",function(e){a.val()?c.removeClass("hidden"):c.addClass("hidden")}),s.on("click",function(e){e.preventDefault(),void 0!==t.wp&&t.wp.media&&t.wp.media.gallery&&(n?n.open():((n=t.wp.media({library:{type:r}})).on("select",function(){var e=n.state().get("selection").first().attributes;r.length&&-1===r.indexOf(e.subtype)&&-1===r.indexOf(e.type)||a.val(e.url).trigger("change")}),n.open()))}),c.on("click",function(e){e.preventDefault(),a.val("").trigger("change")})})},e.fn.csf_field_wp_editor=function(){return this.each(function(){if(void 0!==t.wp.editor&&void 0!==t.tinyMCEPreInit&&void 0!==t.tinyMCEPreInit.mceInit.csf_wp_editor){var n=e(this),i=n.find(".csf-wp-editor"),s=n.find("textarea");(n.find(".wp-editor-wrap").length||n.find(".mce-container").length)&&(i.empty(),i.append(s),s.css("display",""));var c=a.helper.uid("csf-editor-");s.attr("id",c);var r={tinymce:t.tinyMCEPreInit.mceInit.csf_wp_editor,quicktags:t.tinyMCEPreInit.qtInit.csf_wp_editor},o=i.data("editor-settings"),f=wp.oldEditor?wp.oldEditor:wp.editor;f&&f.hasOwnProperty("autop")&&(wp.editor.autop=f.autop,wp.editor.removep=f.removep,wp.editor.initialize=f.initialize),r.tinymce=e.extend({},r.tinymce,{selector:"#"+c,setup:function(e){e.on("change",a.helper.debounce(function(){e.save(),s.trigger("change")},250))}}),!1===o.tinymce&&(r.tinymce=!1,i.addClass("csf-no-tinymce")),!1===o.quicktags&&(r.quicktags=!1,i.addClass("csf-no-quicktags"));var l=setInterval(function(){n.is(":visible")&&(t.wp.editor.initialize(c,r),clearInterval(l))});if(o.media_buttons&&t.csf_media_buttons){var d=i.find(".wp-media-buttons");if(d.length)d.find(".csf-shortcode-button").data("editor-id",c);else{var h=e(t.csf_media_buttons);h.find(".csf-shortcode-button").data("editor-id",c),i.prepend(h)}}}})},e.fn.csf_confirm=function(){return this.each(function(){e(this).on("click",function(n){var i=e(this).data("confirm")||t.csf_vars.i18n.confirm,s=confirm(i);if(a.vars.is_confirm=!0,!s)return n.preventDefault(),a.vars.is_confirm=!1,!1})})},e.fn.serializeObject=function(){var t={};return e.each(this.serializeArray(),function(n,a){var s=a.name,c=a.value;t[s]=t[s]===i?c:e.isArray(t[s])?t[s].concat(c):[t[s],c]}),t},e.fn.csf_save=function(){return this.each(function(){var n,i=e(this),s=e(".csf-save"),c=e(".csf-options"),r=!1;i.on("click",function(o){if(!r){var f=i.data("save"),l=i.val();s.attr("value",f),i.hasClass("csf-save-ajax")&&(o.preventDefault(),c.addClass("csf-saving"),s.prop("disabled",!0),t.wp.ajax.post("csf_"+c.data("unique")+"_ajax_save",{data:e("#csf-form").serializeJSONCSF()}).done(function(t){if(e(".csf-error").remove(),Object.keys(t.errors).length){var i='<i class="csf-label-error csf-error">!</i>';e.each(t.errors,function(t,n){var a=e('[data-depend-id="'+t+'"]'),s=e("#csf-tab-link-"+(a.closest(".csf-section").index()+1)),c=s.closest(".csf-tab-depth-0");a.closest(".csf-fieldset").append('<p class="csf-text-error csf-error">'+n+"</p>"),s.find(".csf-error").length||s.append(i),c.find(".csf-arrow .csf-error").length||c.find(".csf-arrow").append(i),console.log(n)})}c.removeClass("csf-saving"),s.prop("disabled",!1).attr("value",l),r=!1,a.vars.form_modified=!1,a.vars.$form_warning.hide(),clearTimeout(n);var o=e(".csf-form-success");o.empty().append(t.notice).fadeIn("fast",function(){n=setTimeout(function(){o.fadeOut("fast")},1e3)})}).fail(function(e){alert(e.error)}))}r=!0})})},e.fn.csf_options=function(){return this.each(function(){var s=e(this),c=s.find(".csf-content"),r=s.find(".csf-form-success"),o=s.find(".csf-form-warning"),f=s.find(".csf-header .csf-save");a.vars.$form_warning=o,o.length&&(t.onbeforeunload=function(){return!!a.vars.form_modified||i},c.on("change keypress",":input",function(){a.vars.form_modified||(r.hide(),o.fadeIn("fast"),a.vars.form_modified=!0)})),r.hasClass("csf-form-show")&&setTimeout(function(){r.fadeOut("fast")},1e3),e(n).keydown(function(e){if((e.ctrlKey||e.metaKey)&&83===e.which)return f.trigger("click"),e.preventDefault(),!1})})},e.fn.csf_taxonomy=function(){return this.each(function(){var t=e(this),n=t.parents("form");if("addtag"===n.attr("id")){var i=n.find("#submit"),a=t.find(".csf-field").csf_clone();i.on("click",function(){n.find(".form-required").hasClass("form-invalid")||(t.data("inited",!1),t.empty(),t.html(a),a=a.csf_clone(),t.csf_reload_script())})}})},e.fn.csf_shortcode=function(){var s=this;return s.shortcode_parse=function(t,n){var i="";return e.each(t,function(t,a){i+="["+(n=n||t),e.each(a,function(e,t){"content"===e?(i+="]",i+=t,i+="[/"+n):i+=s.shortcode_tags(e,t)}),i+="]"}),i},s.shortcode_tags=function(t,n){var i="";return""!==n&&("object"!=typeof n||e.isArray(n)?i+=" "+t.replace("-","_")+'="'+n.toString()+'"':e.each(n,function(e,t){switch(e){case"background-image":t=t.url?t.url:""}""!==t&&(i+=" "+e.replace("-","_")+'="'+t.toString()+'"')})),i},s.insertAtChars=function(e,t){var n=void 0!==e[0].name?e[0]:e;return n.value.length&&void 0!==n.selectionStart?(n.focus(),n.value.substring(0,n.selectionStart)+t+n.value.substring(n.selectionEnd,n.value.length)):(n.focus(),t)},s.send_to_editor=function(t,n){var i;if("undefined"!=typeof tinymce&&(i=tinymce.get(n)),i&&!i.isHidden())i.execCommand("mceInsertContent",!1,t);else{var a=e("#"+n);a.val(s.insertAtChars(a,t)).trigger("change")}},this.each(function(){var c,r,o,f,l,d,h,p,u,v=e(this),g=v.find(".csf-modal-load"),_=(v.find(".csf-modal-content"),v.find(".csf-modal-insert")),m=v.find(".csf-modal-loading"),b=v.find("select"),y=v.data("modal-id"),w=v.data("nonce");e(n).on("click",'.csf-shortcode-button[data-modal-id="'+y+'"]',function(t){t.preventDefault(),u=e(this),c=u.data("editor-id")||!1,r=u.data("target-id")||!1,o=u.data("gutenberg-id")||!1,v.show(),v.hasClass("csf-shortcode-single")&&l===i&&b.trigger("change")}),b.on("change",function(){var n=e(this),i=n.find(":selected");f=n.val(),l=i.data("shortcode"),d=i.data("view")||"normal",h=i.data("group")||l,g.empty(),f?(m.show(),t.wp.ajax.post("csf-get-shortcode-"+y,{shortcode_key:f,nonce:w}).done(function(t){m.hide();var n=e(t.content).appendTo(g);_.parent().removeClass("hidden"),p=n.find(".csf--repeat-shortcode").csf_clone(),n.csf_reload_script(),n.find(".csf-fields").csf_reload_script()})):_.parent().addClass("hidden")}),_.on("click",function(n){if(n.preventDefault(),!_.prop("disabled")&&!_.attr("disabled")){var i="",a=v.find(".csf-field:not(.hidden)").find(":input:not(.ignore)").serializeObjectCSF();switch(d){case"contents":var f=l?a[l]:a;e.each(f,function(e,t){var n=l||e;i+="["+n+"]"+t+"[/"+n+"]"});break;case"group":i+="["+l,e.each(a[l],function(e,t){i+=s.shortcode_tags(e,t)}),i+="]",i+=s.shortcode_parse(a[h],h),i+="[/"+l+"]";break;case"repeater":i+=s.shortcode_parse(a[h],h);break;default:i+=s.shortcode_parse(a)}if(i=""===i?"["+l+"]":i,o){var p=t.csf_gutenberg_props.attributes.hasOwnProperty("shortcode")?t.csf_gutenberg_props.attributes.shortcode:"";t.csf_gutenberg_props.setAttributes({shortcode:p+i})}else if(c)s.send_to_editor(i,c);else{var g=r?e(r):u.parent().find("textarea");g.val(s.insertAtChars(g,i)).trigger("change")}v.hide()}}),v.on("click",".csf--repeat-button",function(e){e.preventDefault();var t=v.find(".csf--repeatable"),n=p.csf_clone(),i=n.find(".csf-repeat-remove");n.appendTo(t);n.find(".csf-fields").csf_reload_script(),a.helper.name_nested_replace(v.find(".csf--repeat-shortcode"),h),i.on("click",function(){n.remove(),a.helper.name_nested_replace(v.find(".csf--repeat-shortcode"),h)})}),v.on("click",".csf-modal-close, .csf-modal-overlay",function(){v.hide()})})},"function"==typeof Color&&(Color.prototype.toString=function(){if(this._alpha<1)return this.toCSS("rgba",this._alpha).replace(/\s+/g,"");var e=parseInt(this._color,10).toString(16);if(this.error)return"";if(e.length<6)for(var t=6-e.length-1;t>=0;t--)e="0"+e;return"#"+e}),a.funcs.parse_color=function(e){var t=e.replace(/\s+/g,""),n=-1!==t.indexOf("rgba")?parseFloat(100*t.replace(/^.*,(.+)\)/,"$1")):100;return{value:t,transparent:n,rgba:n<100}},e.fn.csf_color=function(){return this.each(function(){var n,i=e(this),s=a.funcs.parse_color(i.val()),c=!t.csf_vars.color_palette.length||t.csf_vars.color_palette;i.hasClass("wp-color-picker")&&i.closest(".wp-picker-container").after(i).remove(),i.wpColorPicker({palettes:c,change:function(e,t){var a=t.color.toString();n.removeClass("csf--transparent-active"),n.find(".csf--transparent-offset").css("background-color",a),i.val(a).trigger("change")},create:function(){n=i.closest(".wp-picker-container");var t=i.data("a8cIris"),c=e('<div class="csf--transparent-wrap"><div class="csf--transparent-slider"></div><div class="csf--transparent-offset"></div><div class="csf--transparent-text"></div><div class="csf--transparent-button">transparent <i class="fa fa-toggle-off"></i></div></div>').appendTo(n.find(".wp-picker-holder")),r=c.find(".csf--transparent-slider"),o=c.find(".csf--transparent-text"),f=c.find(".csf--transparent-offset"),l=c.find(".csf--transparent-button");"transparent"===i.val()&&n.addClass("csf--transparent-active"),l.on("click",function(){"transparent"!==i.val()?(i.val("transparent").trigger("change").removeClass("iris-error"),n.addClass("csf--transparent-active")):(i.val(t._color.toString()).trigger("change"),n.removeClass("csf--transparent-active"))}),r.slider({value:s.transparent,step:1,min:0,max:100,slide:function(e,n){var a=parseFloat(n.value/100);t._color._alpha=a,i.wpColorPicker("color",t._color.toString()),o.text(1===a||0===a?"":a)},create:function(){var e=parseFloat(s.transparent/100),c=e<1?e:"";o.text(c),f.css("background-color",s.value),n.on("click",".wp-picker-clear",function(){t._color._alpha=1,o.text(""),r.slider("option","value",100),n.removeClass("csf--transparent-active"),i.trigger("change")}),n.on("click",".wp-picker-default",function(){var e=a.funcs.parse_color(i.data("default-color")),n=parseFloat(e.transparent/100),s=n<1?n:"";t._color._alpha=n,o.text(s),r.slider("option","value",e.transparent)})}})}})})},e.fn.csf_chosen=function(){return this.each(function(){var n=e(this),a=n.parent().find(".chosen-container"),s=n.hasClass("csf-chosen-sortable")||!1,c=n.hasClass("csf-chosen-ajax")||!1,r=n.attr("multiple")||!1,o=r?"100%":"auto",f=e.extend({allow_single_deselect:!0,disable_search_threshold:10,width:o,no_results_text:t.csf_vars.i18n.no_results_text},n.data("chosen-settings"));if(a.length&&a.remove(),c){var l=e.extend({data:{type:"post",nonce:""},allow_single_deselect:!0,disable_search_threshold:-1,width:"100%",min_length:3,type_delay:500,typing_text:t.csf_vars.i18n.typing_text,searching_text:t.csf_vars.i18n.searching_text,no_results_text:t.csf_vars.i18n.no_results_text},n.data("chosen-settings"));n.CSFAjaxChosen(l)}else n.chosen(f);if(r){var d=n.parent().find(".csf-hidden-select"),h=d.val()||[];n.on("change",function(e,n){n&&n.selected?d.append('<option value="'+n.selected+'" selected="selected">'+n.selected+"</option>"):n&&n.deselected&&d.find('option[value="'+n.deselected+'"]').remove(),0===d.children().length&&t.wp.customize!==i&&t.wp.customize.control(d.data("customize-setting-link")).setting.set(""),d.trigger("change")}),n.CSFChosenOrder(h,!0)}if(s){var p=n.parent().find(".chosen-container").find(".chosen-choices");p.bind("mousedown",function(t){e(t.target).is("span")&&t.stopPropagation()}),p.sortable({items:"li:not(.search-field)",helper:"orginal",cursor:"move",placeholder:"search-choice-placeholder",start:function(e,t){t.placeholder.width(t.item.innerWidth()),t.placeholder.height(t.item.innerHeight())},update:function(t,i){var a="",s=n.data("chosen"),c=n.parent().find(".csf-hidden-select");p.find(".search-choice-close").each(function(){var t=e(this).data("option-array-index");e.each(s.results_data,function(e,n){n.array_index===t&&(a+='<option value="'+n.value+'" selected>'+n.value+"</option>")})}),c.children().remove(),c.append(a),c.trigger("change")}})}})},e.fn.csf_checkbox=function(){return this.each(function(){var t=e(this),n=t.find(".csf--input"),i=t.find(".csf--checkbox");i.on("click",function(){n.val(Number(i.prop("checked"))).trigger("change")})})},e.fn.csf_siblings=function(){return this.each(function(){var t=e(this),n=t.find(".csf--sibling"),i=t.data("multiple")||!1;n.on("click",function(){var n=e(this);i?n.hasClass("csf--active")?(n.removeClass("csf--active"),n.find("input").prop("checked",!1).trigger("change")):(n.addClass("csf--active"),n.find("input").prop("checked",!0).trigger("change")):(t.find("input").prop("checked",!1),n.find("input").prop("checked",!0).trigger("change"),n.addClass("csf--active").siblings().removeClass("csf--active"))})})},e.fn.csf_help=function(){return this.each(function(){var t,n,s=e(this);s.on({mouseenter:function(){t=e('<div class="csf-tooltip"></div>').html(s.find(".csf-help-text").html()).appendTo("body"),n=a.vars.is_rtl?s.offset().left+24:s.offset().left-t.outerWidth(),t.css({top:s.offset().top-(t.outerHeight()/2-14),left:n})},mouseleave:function(){t!==i&&t.remove()}})})},e.fn.csf_customizer_refresh=function(){return this.each(function(){var i=e(this),a=i.closest(".csf-customize-complex");if(a.length){var s=a.find(":input"),c=a.data("unique-id"),r=a.data("option-id"),o=s.serializeObjectCSF(),f=e.isEmptyObject(o)?"":o[c][r],l=t.wp.customize.control(c+"["+r+"]");l.setting._value=null,l.setting.set(f)}else i.find(":input").first().trigger("change");e(n).trigger("csf-customizer-refresh",i)})},e.fn.csf_customizer_listen=function(n){var s=e.extend({closest:!1},n);return this.each(function(){if(t.wp.customize!==i){var n=s.closest?e(this).closest(".csf-customize-complex"):e(this),c=n.find(":input"),r=n.data("unique-id"),o=n.data("option-id");r!==i&&c.on("change keyup",a.helper.debounce(function(){var i=n.find(":input").serializeObjectCSF(),a=!e.isEmptyObject(i)&&i[r]&&i[r][o]?i[r][o]:"";t.wp.customize.control(r+"["+o+"]").setting.set(a)},250))}})},e(n).on("expanded",".control-section",function(){var t=e(this);if(t.hasClass("open")&&!t.data("inited")){var n=t.find(".csf-customize-field"),i=t.find(".csf-customize-complex");n.length&&(t.csf_dependency(),n.csf_reload_script({dependency:!1}),i.csf_customizer_listen()),t.data("inited",!0)}}),a.vars.$window.on("resize csf.resize",a.helper.debounce(function(n){(navigator.userAgent.indexOf("AppleWebKit/")>-1?a.vars.$window.width():t.innerWidth)<=782&&!a.vars.onloaded&&(e(".csf-section").csf_reload_script(),a.vars.onloaded=!0)},200)).trigger("csf.resize"),e.fn.csf_widgets=function(){this.length&&(e(n).on("widget-added widget-updated",function(e,t){t.find(".csf-fields").csf_reload_script()}),e(".widgets-sortables, .control-section-sidebar").on("sortstop",function(e,t){t.item.find(".csf-fields").csf_reload_script_retry()}),e(n).on("click",".widget-top",function(t){e(this).parent().find(".csf-fields").csf_reload_script()}))},e.fn.csf_reload_script_retry=function(){return this.each(function(){var t=e(this);t.data("inited")&&t.children(".csf-field-wp_editor").csf_field_wp_editor()})},e.fn.csf_reload_script=function(t){var i=e.extend({dependency:!0},t);return this.each(function(){var t=e(this);t.data("inited")||(t.children(".csf-field-accordion").csf_field_accordion(),t.children(".csf-field-backup").csf_field_backup(),t.children(".csf-field-background").csf_field_background(),t.children(".csf-field-code_editor").csf_field_code_editor(),t.children(".csf-field-date").csf_field_date(),t.children(".csf-field-fieldset").csf_field_fieldset(),t.children(".csf-field-gallery").csf_field_gallery(),t.children(".csf-field-group").csf_field_group(),t.children(".csf-field-icon").csf_field_icon(),t.children(".csf-field-media").csf_field_media(),t.children(".csf-field-map").csf_field_map(),t.children(".csf-field-repeater").csf_field_repeater(),t.children(".csf-field-slider").csf_field_slider(),t.children(".csf-field-sortable").csf_field_sortable(),t.children(".csf-field-sorter").csf_field_sorter(),t.children(".csf-field-spinner").csf_field_spinner(),t.children(".csf-field-switcher").csf_field_switcher(),t.children(".csf-field-tabbed").csf_field_tabbed(),t.children(".csf-field-typography").csf_field_typography(),t.children(".csf-field-upload").csf_field_upload(),t.children(".csf-field-wp_editor").csf_field_wp_editor(),t.children(".csf-field-border").find(".csf-color").csf_color(),t.children(".csf-field-background").find(".csf-color").csf_color(),t.children(".csf-field-color").find(".csf-color").csf_color(),t.children(".csf-field-color_group").find(".csf-color").csf_color(),t.children(".csf-field-link_color").find(".csf-color").csf_color(),t.children(".csf-field-typography").find(".csf-color").csf_color(),t.children(".csf-field-select").find(".csf-chosen").csf_chosen(),t.children(".csf-field-checkbox").find(".csf-checkbox").csf_checkbox(),t.children(".csf-field-button_set").find(".csf-siblings").csf_siblings(),t.children(".csf-field-image_select").find(".csf-siblings").csf_siblings(),t.children(".csf-field-palette").find(".csf-siblings").csf_siblings(),t.children(".csf-field").find(".csf-help").csf_help(),i.dependency&&t.csf_dependency(),t.data("inited",!0),e(n).trigger("csf-reload-script",t))})},e(n).ready(function(){e(".csf-save").csf_save(),e(".csf-options").csf_options(),e(".csf-sticky-header").csf_sticky(),e(".csf-nav-options").csf_nav_options(),e(".csf-nav-metabox").csf_nav_metabox(),e(".csf-taxonomy").csf_taxonomy(),e(".csf-page-templates").csf_page_templates(),e(".csf-post-formats").csf_post_formats(),e(".csf-shortcode").csf_shortcode(),e(".csf-search").csf_search(),e(".csf-confirm").csf_confirm(),e(".csf-expand-all").csf_expand_all(),e(".csf-onload").csf_reload_script(),e(".widget").csf_widgets()})}(jQuery,window,document);
1
+ /* Codestar Framework | A Simple and Lightweight WordPress Option Framework - v2.1.5*/
2
 
3
+ !function(e,t,n,i){"use strict";var a=a||{};a.funcs={},a.vars={onloaded:!1,$body:e("body"),$window:e(t),$document:e(n),$form_warning:null,is_confirm:!1,form_modified:!1,code_themes:[],is_rtl:e("body").hasClass("rtl")},a.helper={uid:function(e){return(e||"")+Math.random().toString(36).substr(2,9)},preg_quote:function(e){return(e+"").replace(/(\[|\-|\])/g,"\\$1")},name_nested_replace:function(t,n){var i=new RegExp("("+a.helper.preg_quote(n)+")\\[(\\d+)\\]","g");t.find(":radio").each(function(){(this.checked||this.orginal_checked)&&(this.orginal_checked=!0)}),t.each(function(t){e(this).find(":input").each(function(){this.name=this.name.replace(i,n+"["+t+"]"),this.orginal_checked&&(this.checked=!0)})})},debounce:function(e,t,n){var i;return function(){var a=this,s=arguments,c=n&&!i;clearTimeout(i),i=setTimeout(function(){i=null,n||e.apply(a,s)},t),c&&e.apply(a,s)}},get_cookie:function(e){var t,i,a=n.cookie,s=e+"=";if(a){if(-1===(i=a.indexOf("; "+s))){if(0!==(i=a.indexOf(s)))return null}else i+=2;return-1===(t=a.indexOf(";",i))&&(t=a.length),decodeURIComponent(a.substring(i+s.length,t))}},set_cookie:function(e,t,i,a,s,c){var r=new Date;"object"==typeof i&&i.toGMTString?i=i.toGMTString():parseInt(i,10)?(r.setTime(r.getTime()+1e3*parseInt(i,10)),i=r.toGMTString()):i="",n.cookie=e+"="+encodeURIComponent(t)+(i?"; expires="+i:"")+(a?"; path="+a:"")+(s?"; domain="+s:"")+(c?"; secure":"")},remove_cookie:function(e,t,n,i){a.helper.set_cookie(e,"",-1e3,t,n,i)}},e.fn.csf_clone=function(){for(var t=e.fn.clone.apply(this,arguments),n=this.find("select").add(this.filter("select")),i=t.find("select").add(t.filter("select")),a=0;a<n.length;++a)for(var s=0;s<n[a].options.length;++s)!0===n[a].options[s].selected&&(i[a].options[s].selected=!0);return this.find(":radio").each(function(){this.orginal_checked=this.checked}),t},e.fn.csf_expand_all=function(){return this.each(function(){e(this).on("click",function(t){t.preventDefault(),e(".csf-wrapper").toggleClass("csf-show-all"),e(".csf-section").csf_reload_script(),e(this).find(".fa").toggleClass("fa-indent").toggleClass("fa-outdent")})})},e.fn.csf_nav_options=function(){return this.each(function(){var n,a=e(this),s=a.find("a"),c=a.closest(".csf").find(".csf-section-id");e(t).on("hashchange csf.hashchange",function(){var a=t.location.hash.match(new RegExp("tab=([^&]*)")),r=a?a[1]:s.first().attr("href").replace("#tab=",""),o=e("#csf-tab-link-"+r);if(o.length>0){o.closest(".csf-tab-depth-0").addClass("csf-tab-active").siblings().removeClass("csf-tab-active"),s.removeClass("csf-section-active"),o.addClass("csf-section-active"),n!==i&&n.hide();var f=e("#csf-section-"+r);f.show(),f.csf_reload_script(),c.val(r),n=f}}).trigger("csf.hashchange")})},e.fn.csf_nav_metabox=function(){return this.each(function(){var t,n,s=e(this),c=s.find("a"),r=s.data("unique"),o=e("#post_ID").val()||"global";c.on("click",function(s){s.preventDefault();var c=e(this),f=c.data("section");n!==i&&n.removeClass("csf-section-active"),t!==i&&t.hide(),c.addClass("csf-section-active");var l=e("#csf-section-"+f);l.show(),l.csf_reload_script(),a.helper.set_cookie("csf-last-metabox-tab-"+o+"-"+r,f),t=l,n=c});var f=a.helper.get_cookie("csf-last-metabox-tab-"+o+"-"+r);f?s.find('a[data-section="'+f+'"]').trigger("click"):c.first("a").trigger("click")})},e.fn.csf_page_templates=function(){this.length&&e(n).on("change",".editor-page-attributes__template select, #page_template",function(){var t=e(this).val()||"default";e(".csf-page-templates").removeClass("csf-show").addClass("csf-hide"),e(".csf-page-"+t.toLowerCase().replace(/[^a-zA-Z0-9]+/g,"-")).removeClass("csf-hide").addClass("csf-show")})},e.fn.csf_post_formats=function(){this.length&&e(n).on("change",'.editor-post-format select, #formatdiv input[name="post_format"]',function(){var t=e(this).val()||"default";t="0"===t?"default":t,e(".csf-post-formats").removeClass("csf-show").addClass("csf-hide"),e(".csf-post-format-"+t).removeClass("csf-hide").addClass("csf-show")})},e.fn.csf_search=function(){return this.each(function(){e(this).find("input").on("change keyup",function(){var t=e(this).val(),n=e(".csf-wrapper"),i=n.find(".csf-section").find("> .csf-field:not(.hidden)"),a=i.find("> .csf-title, .csf-search-tags");t.length>3?(i.addClass("csf-hidden"),n.addClass("csf-search-all"),a.each(function(){var n=e(this);if(n.text().match(new RegExp(".*?"+t+".*?","i"))){var i=n.closest(".csf-field");i.removeClass("csf-hidden"),i.parent().csf_reload_script()}})):(i.removeClass("csf-hidden"),n.removeClass("csf-search-all"))})})},e.fn.csf_sticky=function(){return this.each(function(){var i=e(this),a=e(t),s=i.find(".csf-header-inner"),c=parseInt(s.css("padding-left"))+parseInt(s.css("padding-right")),r=0,o=!1,f=function(){o||requestAnimationFrame(function(){var e,a,f;e=i.offset().top,a=Math.max(32,e-r),f=Math.max(n.documentElement.clientWidth,t.innerWidth||0),a<=32&&f>782?(s.css({width:i.outerWidth()-c}),i.css({height:i.outerHeight()}).addClass("csf-sticky")):(s.removeAttr("style"),i.removeAttr("style").removeClass("csf-sticky")),o=!1}),o=!0},l=function(){r=a.scrollTop(),f()};a.on("scroll resize",l),l()})},e.fn.csf_dependency=function(){return this.each(function(){var t=e(this),n=e.csf_deps.createRuleset(),i=[],s=!1;t.children("[data-controller]").each(function(){var t=e(this),a=t.data("controller").split("|"),c=t.data("condition").split("|"),r=t.data("value").toString().split("|"),o=n;t.data("depend-global")&&(s=!0),e.each(a,function(e,n){var a=r[e]||"",s=c[e]||c[0];(o=o.createRule('[data-depend-id="'+n+'"]',s,a)).include(t),i.push(n)})}),i.length&&(s?e.csf_deps.enable(a.vars.$body,n,i):e.csf_deps.enable(t,n,i))})},e.fn.csf_field_accordion=function(){return this.each(function(){e(this).find(".csf-accordion-title").on("click",function(){var t=e(this),n=t.find(".csf-accordion-icon"),i=t.next();n.hasClass("fa-angle-right")?n.removeClass("fa-angle-right").addClass("fa-angle-down"):n.removeClass("fa-angle-down").addClass("fa-angle-right"),i.data("opened")||(i.csf_reload_script(),i.data("opened",!0)),i.toggleClass("csf-accordion-open")})})},e.fn.csf_field_backup=function(){return this.each(function(){if(t.wp.customize!==i){var n=this,s=e(this),c=(e("body"),s.find(".csf-import")),r=s.find(".csf-reset");n.notification=function(e){wp.customize.notifications&&wp.customize.OverlayNotification&&(wp.customize.state("saved").get()||(wp.customize.state("changesetStatus").set("trash"),wp.customize.each(function(e){e._dirty=!1}),wp.customize.state("saved").set(!0)),wp.customize.notifications.add(new wp.customize.OverlayNotification("csf_field_backup_notification",{type:"info",message:e,loading:!0})))},r.on("click",function(e){e.preventDefault(),a.vars.is_confirm&&(n.notification(t.csf_vars.i18n.reset_notification),t.wp.ajax.post("csf-reset",{unique:r.data("unique"),nonce:r.data("nonce")}).done(function(e){t.location.reload(!0)}).fail(function(e){alert(e.error),wp.customize.notifications.remove("csf_field_backup_notification")}))}),c.on("click",function(e){e.preventDefault(),a.vars.is_confirm&&(n.notification(t.csf_vars.i18n.import_notification),t.wp.ajax.post("csf-import",{unique:c.data("unique"),nonce:c.data("nonce"),data:s.find(".csf-import-data").val()}).done(function(e){t.location.reload(!0)}).fail(function(e){alert(e.error),wp.customize.notifications.remove("csf_field_backup_notification")}))})}})},e.fn.csf_field_background=function(){return this.each(function(){e(this).find(".csf--background-image").csf_reload_script()})},e.fn.csf_field_code_editor=function(){return this.each(function(){if("function"==typeof CodeMirror){var t=e(this),n=t.find("textarea"),i=t.find(".CodeMirror"),s=n.data("editor");i.length&&i.remove();var c=setInterval(function(){if(t.is(":visible")){var i=CodeMirror.fromTextArea(n[0],s);if("default"!==s.theme&&-1===a.vars.code_themes.indexOf(s.theme)){var r=e("<link>");e("#csf-codemirror-css").after(r),r.attr({rel:"stylesheet",id:"csf-codemirror-"+s.theme+"-css",href:s.cdnURL+"/theme/"+s.theme+".min.css",type:"text/css",media:"all"}),a.vars.code_themes.push(s.theme)}CodeMirror.modeURL=s.cdnURL+"/mode/%N/%N.min.js",CodeMirror.autoLoadMode(i,s.mode),i.on("change",function(e,t){n.val(i.getValue()).trigger("change")}),clearInterval(c)}})}})},e.fn.csf_field_date=function(){return this.each(function(){var t=e(this),n=t.find("input"),i=t.find(".csf-date-settings").data("settings"),a={showAnim:"",beforeShow:function(t,n){e(n.dpDiv).addClass("csf-datepicker-wrapper")},onClose:function(t,n){e(n.dpDiv).removeClass("csf-datepicker-wrapper")}};i=e.extend({},i,a),2===n.length&&(i=e.extend({},i,{onSelect:function(t){e(this),n.first();var a=n.first().attr("id")===e(this).attr("id")?"minDate":"maxDate",s=e.datepicker.parseDate(i.dateFormat,t);n.not(this).datepicker("option",a,s)}})),n.each(function(){var t=e(this);t.hasClass("hasDatepicker")&&t.removeAttr("id").removeClass("hasDatepicker"),t.datepicker(i)})})},e.fn.csf_field_fieldset=function(){return this.each(function(){e(this).find(".csf-fieldset-content").csf_reload_script()})},e.fn.csf_field_gallery=function(){return this.each(function(){var n,i=e(this),a=i.find(".csf-edit-gallery"),s=i.find(".csf-clear-gallery"),c=i.find("ul"),r=i.find("input");i.find("img");i.on("click",".csf-button, .csf-edit-gallery",function(i){var o=e(this),f=r.val(),l=o.hasClass("csf-edit-gallery")?"edit":"add",d="add"!==l||f.length?"gallery-edit":"gallery";i.preventDefault(),void 0!==t.wp&&t.wp.media&&t.wp.media.gallery&&("gallery"===d?(n=t.wp.media({library:{type:"image"},frame:"post",state:"gallery",multiple:!0})).open():(n=t.wp.media.gallery.edit('[gallery ids="'+f+'"]'),"add"===l&&n.setState("gallery-library")),n.on("update",function(e){c.empty();var t=e.models.map(function(e){var t=e.toJSON(),n=t.sizes&&t.sizes.thumbnail&&t.sizes.thumbnail.url?t.sizes.thumbnail.url:t.url;return c.append('<li><img src="'+n+'"></li>'),t.id});r.val(t.join(",")).trigger("change"),s.removeClass("hidden"),a.removeClass("hidden")}))}),s.on("click",function(e){e.preventDefault(),c.empty(),r.val("").trigger("change"),s.addClass("hidden"),a.addClass("hidden")})})},e.fn.csf_field_group=function(){return this.each(function(){var t=e(this),n=t.children(".csf-fieldset"),i=n.length?n:t,s=i.children(".csf-cloneable-wrapper"),c=i.children(".csf-cloneable-hidden"),r=i.children(".csf-cloneable-max"),o=i.children(".csf-cloneable-min"),f=s.data("field-id"),l=s.data("unique-id"),d=Boolean(Number(s.data("title-number"))),h=parseInt(s.data("max")),p=parseInt(s.data("min"));s.hasClass("ui-accordion")&&s.find(".ui-accordion-header-icon").remove();var u=function(t){t.find(".csf-cloneable-title-number").each(function(t){e(this).html(e(this).closest(".csf-cloneable-item").index()+1+".")})};s.accordion({header:"> .csf-cloneable-item > .csf-cloneable-title",collapsible:!0,active:!1,animate:!1,heightStyle:"content",icons:{header:"csf-cloneable-header-icon fas fa-angle-right",activeHeader:"csf-cloneable-header-icon fas fa-angle-down"},activate:function(e,t){var n=t.newPanel,i=t.newHeader;if(n.length&&!n.data("opened")){var a=n.children().first().find(":input").first(),s=i.find(".csf-cloneable-value");a.on("change keyup",function(e){s.text(a.val())}),n.csf_reload_script(),n.data("opened",!0),n.data("retry",!1)}else n.data("retry")&&(n.csf_reload_script_retry(),n.data("retry",!1))}}),s.sortable({axis:"y",handle:".csf-cloneable-title,.csf-cloneable-sort",helper:"original",cursor:"move",placeholder:"widget-placeholder",start:function(e,t){s.accordion({active:!1}),s.sortable("refreshPositions"),t.item.children(".csf-cloneable-content").data("retry",!0)},update:function(e,t){a.helper.name_nested_replace(s.children(".csf-cloneable-item"),f),s.csf_customizer_refresh(),d&&u(s)}}),i.children(".csf-cloneable-add").on("click",function(t){t.preventDefault();var n=s.children(".csf-cloneable-item").length;if(o.hide(),h&&n+1>h)r.show();else{var i=l+f+"["+n+"]",a=c.csf_clone(!0);a.removeClass("csf-cloneable-hidden"),a.find(':input[name!="_pseudo"]').each(function(){this.name=i+this.name.replace(this.name.startsWith("_nonce")?"_nonce":l,"")}),a.find(".csf-data-wrapper").each(function(){e(this).attr("data-unique-id",i)}),s.append(a),s.accordion("refresh"),s.accordion({active:n}),s.csf_customizer_refresh(),s.csf_customizer_listen({closest:!0}),d&&u(s)}});var v=function(t){t.preventDefault();var n=s.children(".csf-cloneable-item").length;if(o.hide(),h&&n+1>h)r.show();else{var i=e(this).parent().parent(),c=i.children(".csf-cloneable-helper").csf_clone(!0),l=i.children(".csf-cloneable-title").csf_clone(),p=i.children(".csf-cloneable-content").csf_clone(),v=new RegExp("("+a.helper.preg_quote(f)+")\\[(\\d+)\\]","g");p.find(".csf-data-wrapper").each(function(){var t=e(this);t.attr("data-unique-id",t.attr("data-unique-id").replace(v,f+"["+(i.index()+1)+"]"))});var g=e('<div class="csf-cloneable-item" />');g.append(c),g.append(l),g.append(p),s.children().eq(i.index()).after(g),a.helper.name_nested_replace(s.children(".csf-cloneable-item"),f),s.accordion("refresh"),s.csf_customizer_refresh(),s.csf_customizer_listen({closest:!0}),d&&u(s)}};s.children(".csf-cloneable-item").children(".csf-cloneable-helper").on("click",".csf-cloneable-clone",v),i.children(".csf-cloneable-hidden").children(".csf-cloneable-helper").on("click",".csf-cloneable-clone",v);var g=function(t){t.preventDefault();var n=s.children(".csf-cloneable-item").length;r.hide(),o.hide(),p&&n-1<p?o.show():(e(this).closest(".csf-cloneable-item").remove(),a.helper.name_nested_replace(s.children(".csf-cloneable-item"),f),s.csf_customizer_refresh(),d&&u(s))};s.children(".csf-cloneable-item").children(".csf-cloneable-helper").on("click",".csf-cloneable-remove",g),i.children(".csf-cloneable-hidden").children(".csf-cloneable-helper").on("click",".csf-cloneable-remove",g)})},e.fn.csf_field_icon=function(){return this.each(function(){var n=e(this);n.on("click",".csf-icon-add",function(i){i.preventDefault();var s=e(this),c=e("#csf-modal-icon");c.show(),a.vars.$icon_target=n,a.vars.icon_modal_loaded||(c.find(".csf-modal-loading").show(),t.wp.ajax.post("csf-get-icons",{nonce:s.data("nonce")}).done(function(t){c.find(".csf-modal-loading").hide(),a.vars.icon_modal_loaded=!0;var n=c.find(".csf-modal-load").html(t.content);n.on("click","i",function(t){t.preventDefault();var n=e(this).attr("title");a.vars.$icon_target.find("i").removeAttr("class").addClass(n),a.vars.$icon_target.find("input").val(n).trigger("change"),a.vars.$icon_target.find(".csf-icon-preview").removeClass("hidden"),a.vars.$icon_target.find(".csf-icon-remove").removeClass("hidden"),c.hide()}),c.on("change keyup",".csf-icon-search",function(){var t=e(this).val();n.find("i").each(function(){var n=e(this);n.attr("title").search(new RegExp(t,"i"))<0?n.hide():n.show()})}),c.on("click",".csf-modal-close, .csf-modal-overlay",function(){c.hide()})}).fail(function(e){c.find(".csf-modal-loading").hide(),c.find(".csf-modal-load").html(e.error),c.on("click",function(){c.hide()})}))}),n.on("click",".csf-icon-remove",function(t){t.preventDefault(),n.find(".csf-icon-preview").addClass("hidden"),n.find("input").val("").trigger("change"),e(this).addClass("hidden")})})},e.fn.csf_field_map=function(){return this.each(function(){if("undefined"!=typeof L){var t=e(this),n=t.find(".csf--map-osm"),i=t.find(".csf--map-search input"),a=t.find(".csf--latitude"),s=t.find(".csf--longitude"),c=t.find(".csf--zoom"),r=n.data("map"),o=L.map(n.get(0),r);L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'}).addTo(o);var f=L.marker(r.center,{draggable:!0}).addTo(o),l=function(e){a.val(e.lat),s.val(e.lng),c.val(o.getZoom())};o.on("click",function(e){f.setLatLng(e.latlng),l(e.latlng)}),o.on("zoom",function(){l(f.getLatLng())}),f.on("drag",function(){l(f.getLatLng())}),i.length||(i=e('[data-depend-id="'+t.find(".csf--address-field").data("address-field")+'"]'));var d={};i.autocomplete({source:function(t,n){var i=t.term;i in d?n(d[i]):e.get("https://nominatim.openstreetmap.org/search",{format:"json",q:i},function(e){var t;t=e.length?e.map(function(e){return{value:e.display_name,label:e.display_name,lat:e.lat,lon:e.lon}},"json"):[{value:"no-data",label:"No Results."}],d[i]=t,n(t)})},select:function(e,t){if("no-data"===t.item.value)return!1;var n=L.latLng(t.item.lat,t.item.lon);o.panTo(n),f.setLatLng(n),l(n)},create:function(t,n){e(this).autocomplete("widget").addClass("csf-map-ui-autocomplate")}});var h=function(){var e=L.latLng(a.val(),s.val());o.panTo(e),f.setLatLng(e)};a.on("change",h),s.on("change",h)}})},e.fn.csf_field_media=function(){return this.each(function(){var n,i=e(this),a=i.find(".csf--button"),s=i.find(".csf--remove"),c=a.data("library")&&a.data("library").split(",")||"",r=!!i.hasClass("csf-assign-field-background")&&i.closest(".csf-field-background").find(".csf--auto-attributes");a.on("click",function(e){e.preventDefault(),void 0!==t.wp&&t.wp.media&&t.wp.media.gallery&&(n?n.open():((n=t.wp.media({library:{type:c}})).on("select",function(){var e,t=n.state().get("selection").first().attributes,o=a.data("preview-size")||"thumbnail";c.length&&-1===c.indexOf(t.subtype)&&-1===c.indexOf(t.type)||(i.find(".csf--id").val(t.id),i.find(".csf--width").val(t.width),i.find(".csf--height").val(t.height),i.find(".csf--alt").val(t.alt),i.find(".csf--title").val(t.title),i.find(".csf--description").val(t.description),e=void 0!==t.sizes&&void 0!==t.sizes.thumbnail&&"thumbnail"===o?t.sizes.thumbnail.url:void 0!==t.sizes&&void 0!==t.sizes.full?t.sizes.full.url:t.icon,r&&r.removeClass("csf--attributes-hidden"),s.removeClass("hidden"),i.find(".csf--preview").removeClass("hidden"),i.find(".csf--src").attr("src",e),i.find(".csf--thumbnail").val(e),i.find(".csf--url").val(t.url).trigger("change"))}),n.open()))}),s.on("click",function(e){e.preventDefault(),r&&r.addClass("csf--attributes-hidden"),s.addClass("hidden"),i.find("input").val(""),i.find(".csf--preview").addClass("hidden"),i.find(".csf--url").trigger("change")})})},e.fn.csf_field_repeater=function(){return this.each(function(){var t=e(this),n=t.children(".csf-fieldset"),i=n.length?n:t,s=i.children(".csf-repeater-wrapper"),c=i.children(".csf-repeater-hidden"),r=i.children(".csf-repeater-max"),o=i.children(".csf-repeater-min"),f=s.data("field-id"),l=s.data("unique-id"),d=parseInt(s.data("max")),h=parseInt(s.data("min"));s.children(".csf-repeater-item").children(".csf-repeater-content").csf_reload_script(),s.sortable({axis:"y",handle:".csf-repeater-sort",helper:"original",cursor:"move",placeholder:"widget-placeholder",update:function(e,t){a.helper.name_nested_replace(s.children(".csf-repeater-item"),f),s.csf_customizer_refresh(),t.item.csf_reload_script_retry()}}),i.children(".csf-repeater-add").on("click",function(t){t.preventDefault();var n=s.children(".csf-repeater-item").length;if(o.hide(),d&&n+1>d)r.show();else{var i=l+f+"["+n+"]",a=c.csf_clone(!0);a.removeClass("csf-repeater-hidden"),a.find(':input[name!="_pseudo"]').each(function(){this.name=i+this.name.replace(this.name.startsWith("_nonce")?"_nonce":l,"")}),a.find(".csf-data-wrapper").each(function(){e(this).attr("data-unique-id",i)}),s.append(a),a.children(".csf-repeater-content").csf_reload_script(),s.csf_customizer_refresh(),s.csf_customizer_listen({closest:!0})}});var p=function(t){t.preventDefault();var n=s.children(".csf-repeater-item").length;if(o.hide(),d&&n+1>d)r.show();else{var i=e(this).parent().parent().parent(),c=i.children(".csf-repeater-content").csf_clone(),l=i.children(".csf-repeater-helper").csf_clone(!0),h=new RegExp("("+a.helper.preg_quote(f)+")\\[(\\d+)\\]","g");c.find(".csf-data-wrapper").each(function(){var t=e(this);t.attr("data-unique-id",t.attr("data-unique-id").replace(h,f+"["+(i.index()+1)+"]"))});var p=e('<div class="csf-repeater-item" />');p.append(c),p.append(l),s.children().eq(i.index()).after(p),p.children(".csf-repeater-content").csf_reload_script(),a.helper.name_nested_replace(s.children(".csf-repeater-item"),f),s.csf_customizer_refresh(),s.csf_customizer_listen({closest:!0})}};s.children(".csf-repeater-item").children(".csf-repeater-helper").on("click",".csf-repeater-clone",p),i.children(".csf-repeater-hidden").children(".csf-repeater-helper").on("click",".csf-repeater-clone",p);var u=function(t){t.preventDefault();var n=s.children(".csf-repeater-item").length;r.hide(),o.hide(),h&&n-1<h?o.show():(e(this).closest(".csf-repeater-item").remove(),a.helper.name_nested_replace(s.children(".csf-repeater-item"),f),s.csf_customizer_refresh())};s.children(".csf-repeater-item").children(".csf-repeater-helper").on("click",".csf-repeater-remove",u),i.children(".csf-repeater-hidden").children(".csf-repeater-helper").on("click",".csf-repeater-remove",u)})},e.fn.csf_field_slider=function(){return this.each(function(){var t=e(this),n=t.find("input"),i=t.find(".csf-slider-ui"),a=n.data(),s=n.val()||0;i.hasClass("ui-slider")&&i.empty(),i.slider({range:"min",value:s,min:a.min,max:a.max,step:a.step,slide:function(e,t){n.val(t.value).trigger("change")}}),n.on("keyup",function(){i.slider("value",n.val())})})},e.fn.csf_field_sortable=function(){return this.each(function(){var t=e(this).find(".csf--sortable");t.sortable({axis:"y",helper:"original",cursor:"move",placeholder:"widget-placeholder",update:function(e,n){t.csf_customizer_refresh()}}),t.find(".csf--sortable-content").csf_reload_script()})},e.fn.csf_field_sorter=function(){return this.each(function(){var t=e(this),n=t.find(".csf-enabled"),i=t.find(".csf-disabled"),a=!!i.length&&i;n.sortable({connectWith:a,placeholder:"ui-sortable-placeholder",update:function(e,n){var i=n.item.find("input");n.item.parent().hasClass("csf-enabled")?i.attr("name",i.attr("name").replace("disabled","enabled")):i.attr("name",i.attr("name").replace("enabled","disabled")),t.csf_customizer_refresh()}}),a&&a.sortable({connectWith:n,placeholder:"ui-sortable-placeholder",update:function(e,n){t.csf_customizer_refresh()}})})},e.fn.csf_field_spinner=function(){return this.each(function(){var t=e(this),n=t.find("input"),i=t.find(".ui-spinner-button"),a=n.data("unit");i.length&&i.remove(),n.spinner({max:n.data("max")||100,min:n.data("min")||0,step:n.data("step")||1,create:function(e,n){a.length&&t.find(".ui-spinner-up").after('<span class="ui-button-text-only csf--unit">'+a+"</span>")},spin:function(e,t){n.val(t.value).trigger("change")}})})},e.fn.csf_field_switcher=function(){return this.each(function(){var t=e(this).find(".csf--switcher");t.on("click",function(){var e=0,n=t.find("input");t.hasClass("csf--active")?t.removeClass("csf--active"):(e=1,t.addClass("csf--active")),n.val(e).trigger("change")})})},e.fn.csf_field_tabbed=function(){return this.each(function(){var t=e(this),n=t.find(".csf-tabbed-nav a"),i=t.find(".csf-tabbed-section");i.eq(0).csf_reload_script(),n.on("click",function(t){t.preventDefault();var n=e(this),a=n.index(),s=i.eq(a);n.addClass("csf-tabbed-active").siblings().removeClass("csf-tabbed-active"),s.csf_reload_script(),s.removeClass("hidden").siblings().addClass("hidden")})})},e.fn.csf_field_typography=function(){return this.each(function(){var t=this,n=e(this),i=[],s=csf_typography_json.webfonts,c=csf_typography_json.googlestyles,r=csf_typography_json.defaultstyles;t.sanitize_subset=function(e){return e=(e=e.replace("-ext"," Extended")).charAt(0).toUpperCase()+e.slice(1)},t.sanitize_style=function(e){return c[e]?c[e]:e},t.load_google_font=function(e,t,n){e&&"object"==typeof WebFont&&(t=t?t.replace("normal",""):"",n=n?n.replace("normal",""):"",(t||n)&&(e=e+":"+t+n),-1===i.indexOf(e)&&WebFont.load({google:{families:[e]}}),i.push(e))},t.append_select_options=function(n,i,a,s,c){n.find("option").not(":first").remove();var r="";e.each(i,function(e,n){var i,o=n;i=c?a&&-1!==a.indexOf(n)?" selected":"":a&&a===n?" selected":"","subset"===s?o=t.sanitize_subset(n):"style"===s&&(o=t.sanitize_style(n)),r+='<option value="'+n+'"'+i+">"+o+"</option>"}),n.append(r).trigger("csf.change").trigger("chosen:updated")},t.init=function(){var i=[],c=n.find(".csf--typography"),o=n.find(".csf--type"),f=n.find(".csf--block-font-style"),l=c.data("unit"),d=c.data("line-height-unit"),h=c.data("exclude")?c.data("exclude").split(","):[];n.find(".csf--chosen").length&&n.find("select").each(function(){var t=e(this),n=t.parent().find(".chosen-container");n.length&&n.remove(),t.chosen({allow_single_deselect:!0,disable_search_threshold:15,width:"100%"})});var p=n.find(".csf--font-family"),u=p.val();p.find("option").not(":first-child").remove();var v="";e.each(s,function(t,n){h&&-1!==h.indexOf(t)||(v+='<optgroup label="'+n.label+'">',e.each(n.fonts,function(e,n){v+='<option value="'+(n="object"==typeof n?e:n)+'" data-type="'+t+'"'+(n===u?" selected":"")+">"+n+"</option>"}),v+="</optgroup>")}),p.append(v).trigger("chosen:updated");var g=n.find(".csf--block-font-style");if(g.length){var _=n.find(".csf--font-style-select"),m=_.val()?_.val().replace(/normal/g,""):"";_.on("change csf.change",function(e){var t=_.val();!t&&i&&-1===i.indexOf("normal")&&(t=i[0]);var a=t&&"italic"!==t&&"normal"===t?"normal":"",s=t&&"italic"!==t&&"normal"!==t?t.replace("italic",""):a,c=t&&"italic"===t.substr(-6)?"italic":"";n.find(".csf--font-weight").val(s),n.find(".csf--font-style").val(c)});var b=n.find(".csf--block-extra-styles");if(b.length)var y=n.find(".csf--extra-styles"),w=y.val()}var k=n.find(".csf--block-subset");if(k.length)var C=n.find(".csf--subset"),x=C.val(),z=C.data("multiple")||!1;var D=n.find(".csf--block-backup-font-family");p.on("change csf.change",function(e){k.length&&k.addClass("hidden"),b.length&&b.addClass("hidden"),D.length&&D.addClass("hidden");var n=p.find(":selected"),a=n.val(),c=n.data("type");if(c&&a){if("google"!==c&&"custom"!==c||!D.length||D.removeClass("hidden"),g.length){var l=r;"google"===c&&s[c].fonts[a][0]?l=s[c].fonts[a][0]:"custom"===c&&s[c].fonts[a]&&(l=s[c].fonts[a]),i=l;var d=-1!==l.indexOf("normal")?"normal":l[0],h=m&&-1!==l.indexOf(m)?m:d;t.append_select_options(_,l,h,"style"),m=!1,g.removeClass("hidden"),"google"===c&&b.length&&l.length>1&&(t.append_select_options(y,l,w,"style",!0),w=!1,b.removeClass("hidden"))}if("google"===c&&k.length&&s[c].fonts[a][1]){var u=s[c].fonts[a][1],v=u.length<2&&"latin"!==u[0]?u[0]:"",O=x&&-1!==u.indexOf(x)?x:v;O=z&&x?x:O,t.append_select_options(C,u,O,"subset",z),x=!1,k.removeClass("hidden")}}else f.find(":input").val(""),k.length&&(C.find("option").not(":first-child").remove(),C.trigger("chosen:updated")),g.length&&(_.find("option").not(":first-child").remove(),_.trigger("chosen:updated"));o.val(c)}).trigger("csf.change");var O=n.find(".csf--block-preview");if(O.length){var S=n.find(".csf--preview");n.on("change",a.helper.debounce(function(e){O.removeClass("hidden");var i=p.val(),a=n.find(".csf--font-weight").val(),s=n.find(".csf--font-style").val(),c=n.find(".csf--font-size").val(),r=n.find(".csf--font-variant").val(),o=n.find(".csf--line-height").val(),f=n.find(".csf--text-align").val(),h=n.find(".csf--text-transform").val(),u=n.find(".csf--text-decoration").val(),v=n.find(".csf--color").val(),g=n.find(".csf--word-spacing").val(),_=n.find(".csf--letter-spacing").val(),m=n.find(".csf--custom-style").val();"google"===n.find(".csf--type").val()&&t.load_google_font(i,a,s);var b={};i&&(b.fontFamily=i),a&&(b.fontWeight=a),s&&(b.fontStyle=s),r&&(b.fontVariant=r),c&&(b.fontSize=c+l),o&&(b.lineHeight=o+d),_&&(b.letterSpacing=_+l),g&&(b.wordSpacing=g+l),f&&(b.textAlign=f),h&&(b.textTransform=h),u&&(b.textDecoration=u),v&&(b.color=v),S.removeAttr("style"),m&&S.attr("style",m),S.css(b)},100)),O.on("click",function(){S.toggleClass("csf--black-background");var e=O.find(".csf--toggle");e.hasClass("fa-toggle-off")?e.removeClass("fa-toggle-off").addClass("fa-toggle-on"):e.removeClass("fa-toggle-on").addClass("fa-toggle-off")}),O.hasClass("hidden")||n.trigger("change")}},t.init()})},e.fn.csf_field_upload=function(){return this.each(function(){var n,i=e(this),a=i.find("input"),s=i.find(".csf--button"),c=i.find(".csf--remove"),r=s.data("library")&&s.data("library").split(",")||"";a.on("change",function(e){a.val()?c.removeClass("hidden"):c.addClass("hidden")}),s.on("click",function(e){e.preventDefault(),void 0!==t.wp&&t.wp.media&&t.wp.media.gallery&&(n?n.open():((n=t.wp.media({library:{type:r}})).on("select",function(){var e=n.state().get("selection").first().attributes;r.length&&-1===r.indexOf(e.subtype)&&-1===r.indexOf(e.type)||a.val(e.url).trigger("change")}),n.open()))}),c.on("click",function(e){e.preventDefault(),a.val("").trigger("change")})})},e.fn.csf_field_wp_editor=function(){return this.each(function(){if(void 0!==t.wp.editor&&void 0!==t.tinyMCEPreInit&&void 0!==t.tinyMCEPreInit.mceInit.csf_wp_editor){var n=e(this),i=n.find(".csf-wp-editor"),s=n.find("textarea");(n.find(".wp-editor-wrap").length||n.find(".mce-container").length)&&(i.empty(),i.append(s),s.css("display",""));var c=a.helper.uid("csf-editor-");s.attr("id",c);var r={tinymce:t.tinyMCEPreInit.mceInit.csf_wp_editor,quicktags:t.tinyMCEPreInit.qtInit.csf_wp_editor},o=i.data("editor-settings"),f=wp.oldEditor?wp.oldEditor:wp.editor;f&&f.hasOwnProperty("autop")&&(wp.editor.autop=f.autop,wp.editor.removep=f.removep,wp.editor.initialize=f.initialize),r.tinymce=e.extend({},r.tinymce,{selector:"#"+c,setup:function(e){e.on("change",a.helper.debounce(function(){e.save(),s.trigger("change")},250))}}),!1===o.tinymce&&(r.tinymce=!1,i.addClass("csf-no-tinymce")),!1===o.quicktags&&(r.quicktags=!1,i.addClass("csf-no-quicktags"));var l=setInterval(function(){n.is(":visible")&&(t.wp.editor.initialize(c,r),clearInterval(l))});if(o.media_buttons&&t.csf_media_buttons){var d=i.find(".wp-media-buttons");if(d.length)d.find(".csf-shortcode-button").data("editor-id",c);else{var h=e(t.csf_media_buttons);h.find(".csf-shortcode-button").data("editor-id",c),i.prepend(h)}}}})},e.fn.csf_confirm=function(){return this.each(function(){e(this).on("click",function(n){var i=e(this).data("confirm")||t.csf_vars.i18n.confirm;if(!confirm(i))return n.preventDefault(),!1;a.vars.is_confirm=!0})})},e.fn.serializeObject=function(){var t={};return e.each(this.serializeArray(),function(n,a){var s=a.name,c=a.value;t[s]=t[s]===i?c:e.isArray(t[s])?t[s].concat(c):[t[s],c]}),t},e.fn.csf_save=function(){return this.each(function(){var n,i=e(this),s=e(".csf-save"),c=e(".csf-options"),r=!1;i.on("click",function(o){if(!r){var f=i.data("save"),l=i.val();s.attr("value",f),i.hasClass("csf-save-ajax")?(o.preventDefault(),c.addClass("csf-saving"),s.prop("disabled",!0),t.wp.ajax.post("csf_"+c.data("unique")+"_ajax_save",{data:e("#csf-form").serializeJSONCSF()}).done(function(t){if(e(".csf-error").remove(),Object.keys(t.errors).length){var i='<i class="csf-label-error csf-error">!</i>';e.each(t.errors,function(t,n){var a=e('[data-depend-id="'+t+'"]'),s=e("#csf-tab-link-"+(a.closest(".csf-section").index()+1)),c=s.closest(".csf-tab-depth-0");a.closest(".csf-fieldset").append('<p class="csf-text-error csf-error">'+n+"</p>"),s.find(".csf-error").length||s.append(i),c.find(".csf-arrow .csf-error").length||c.find(".csf-arrow").append(i)})}c.removeClass("csf-saving"),s.prop("disabled",!1).attr("value",l),r=!1,a.vars.form_modified=!1,a.vars.$form_warning.hide(),clearTimeout(n);var o=e(".csf-form-success");o.empty().append(t.notice).fadeIn("fast",function(){n=setTimeout(function(){o.fadeOut("fast")},1e3)})}).fail(function(e){alert(e.error)})):a.vars.form_modified=!1}r=!0})})},e.fn.csf_options=function(){return this.each(function(){var s=e(this),c=s.find(".csf-content"),r=s.find(".csf-form-success"),o=s.find(".csf-form-warning"),f=s.find(".csf-header .csf-save");a.vars.$form_warning=o,o.length&&(t.onbeforeunload=function(){return!(!a.vars.form_modified||!1!==a.vars.is_confirm)||i},c.on("change keypress",":input",function(){a.vars.form_modified||(r.hide(),o.fadeIn("fast"),a.vars.form_modified=!0)})),r.hasClass("csf-form-show")&&setTimeout(function(){r.fadeOut("fast")},1e3),e(n).keydown(function(e){if((e.ctrlKey||e.metaKey)&&83===e.which)return f.trigger("click"),e.preventDefault(),!1})})},e.fn.csf_taxonomy=function(){return this.each(function(){var t=e(this),n=t.parents("form");if("addtag"===n.attr("id")){var i=n.find("#submit"),a=t.find(".csf-field").csf_clone();i.on("click",function(){n.find(".form-required").hasClass("form-invalid")||(t.data("inited",!1),t.empty(),t.html(a),a=a.csf_clone(),t.csf_reload_script())})}})},e.fn.csf_shortcode=function(){var s=this;return s.shortcode_parse=function(t,n){var i="";return e.each(t,function(t,a){i+="["+(n=n||t),e.each(a,function(e,t){"content"===e?(i+="]",i+=t,i+="[/"+n):i+=s.shortcode_tags(e,t)}),i+="]"}),i},s.shortcode_tags=function(t,n){var i="";return""!==n&&("object"!=typeof n||e.isArray(n)?i+=" "+t.replace("-","_")+'="'+n.toString()+'"':e.each(n,function(e,t){switch(e){case"background-image":t=t.url?t.url:""}""!==t&&(i+=" "+e.replace("-","_")+'="'+t.toString()+'"')})),i},s.insertAtChars=function(e,t){var n=void 0!==e[0].name?e[0]:e;return n.value.length&&void 0!==n.selectionStart?(n.focus(),n.value.substring(0,n.selectionStart)+t+n.value.substring(n.selectionEnd,n.value.length)):(n.focus(),t)},s.send_to_editor=function(t,n){var i;if("undefined"!=typeof tinymce&&(i=tinymce.get(n)),i&&!i.isHidden())i.execCommand("mceInsertContent",!1,t);else{var a=e("#"+n);a.val(s.insertAtChars(a,t)).trigger("change")}},this.each(function(){var c,r,o,f,l,d,h,p,u,v=e(this),g=v.find(".csf-modal-load"),_=(v.find(".csf-modal-content"),v.find(".csf-modal-insert")),m=v.find(".csf-modal-loading"),b=v.find("select"),y=v.data("modal-id"),w=v.data("nonce");e(n).on("click",'.csf-shortcode-button[data-modal-id="'+y+'"]',function(t){t.preventDefault(),u=e(this),c=u.data("editor-id")||!1,r=u.data("target-id")||!1,o=u.data("gutenberg-id")||!1,v.show(),v.hasClass("csf-shortcode-single")&&l===i&&b.trigger("change")}),b.on("change",function(){var n=e(this),i=n.find(":selected");f=n.val(),l=i.data("shortcode"),d=i.data("view")||"normal",h=i.data("group")||l,g.empty(),f?(m.show(),t.wp.ajax.post("csf-get-shortcode-"+y,{shortcode_key:f,nonce:w}).done(function(t){m.hide();var n=e(t.content).appendTo(g);_.parent().removeClass("hidden"),p=n.find(".csf--repeat-shortcode").csf_clone(),n.csf_reload_script(),n.find(".csf-fields").csf_reload_script()})):_.parent().addClass("hidden")}),_.on("click",function(n){if(n.preventDefault(),!_.prop("disabled")&&!_.attr("disabled")){var i="",a=v.find(".csf-field:not(.hidden)").find(":input:not(.ignore)").serializeObjectCSF();switch(d){case"contents":var f=l?a[l]:a;e.each(f,function(e,t){var n=l||e;i+="["+n+"]"+t+"[/"+n+"]"});break;case"group":i+="["+l,e.each(a[l],function(e,t){i+=s.shortcode_tags(e,t)}),i+="]",i+=s.shortcode_parse(a[h],h),i+="[/"+l+"]";break;case"repeater":i+=s.shortcode_parse(a[h],h);break;default:i+=s.shortcode_parse(a)}if(i=""===i?"["+l+"]":i,o){var p=t.csf_gutenberg_props.attributes.hasOwnProperty("shortcode")?t.csf_gutenberg_props.attributes.shortcode:"";t.csf_gutenberg_props.setAttributes({shortcode:p+i})}else if(c)s.send_to_editor(i,c);else{var g=r?e(r):u.parent().find("textarea");g.val(s.insertAtChars(g,i)).trigger("change")}v.hide()}}),v.on("click",".csf--repeat-button",function(e){e.preventDefault();var t=v.find(".csf--repeatable"),n=p.csf_clone(),i=n.find(".csf-repeat-remove");n.appendTo(t);n.find(".csf-fields").csf_reload_script(),a.helper.name_nested_replace(v.find(".csf--repeat-shortcode"),h),i.on("click",function(){n.remove(),a.helper.name_nested_replace(v.find(".csf--repeat-shortcode"),h)})}),v.on("click",".csf-modal-close, .csf-modal-overlay",function(){v.hide()})})},"function"==typeof Color&&(Color.prototype.toString=function(){if(this._alpha<1)return this.toCSS("rgba",this._alpha).replace(/\s+/g,"");var e=parseInt(this._color,10).toString(16);if(this.error)return"";if(e.length<6)for(var t=6-e.length-1;t>=0;t--)e="0"+e;return"#"+e}),a.funcs.parse_color=function(e){var t=e.replace(/\s+/g,""),n=-1!==t.indexOf("rgba")?parseFloat(100*t.replace(/^.*,(.+)\)/,"$1")):100;return{value:t,transparent:n,rgba:n<100}},e.fn.csf_color=function(){return this.each(function(){var n,i=e(this),s=a.funcs.parse_color(i.val()),c=!t.csf_vars.color_palette.length||t.csf_vars.color_palette;i.hasClass("wp-color-picker")&&i.closest(".wp-picker-container").after(i).remove(),i.wpColorPicker({palettes:c,change:function(e,t){var a=t.color.toString();n.removeClass("csf--transparent-active"),n.find(".csf--transparent-offset").css("background-color",a),i.val(a).trigger("change")},create:function(){n=i.closest(".wp-picker-container");var t=i.data("a8cIris"),c=e('<div class="csf--transparent-wrap"><div class="csf--transparent-slider"></div><div class="csf--transparent-offset"></div><div class="csf--transparent-text"></div><div class="csf--transparent-button">transparent <i class="fas fa-toggle-off"></i></div></div>').appendTo(n.find(".wp-picker-holder")),r=c.find(".csf--transparent-slider"),o=c.find(".csf--transparent-text"),f=c.find(".csf--transparent-offset"),l=c.find(".csf--transparent-button");"transparent"===i.val()&&n.addClass("csf--transparent-active"),l.on("click",function(){"transparent"!==i.val()?(i.val("transparent").trigger("change").removeClass("iris-error"),n.addClass("csf--transparent-active")):(i.val(t._color.toString()).trigger("change"),n.removeClass("csf--transparent-active"))}),r.slider({value:s.transparent,step:1,min:0,max:100,slide:function(e,n){var a=parseFloat(n.value/100);t._color._alpha=a,i.wpColorPicker("color",t._color.toString()),o.text(1===a||0===a?"":a)},create:function(){var e=parseFloat(s.transparent/100),c=e<1?e:"";o.text(c),f.css("background-color",s.value),n.on("click",".wp-picker-clear",function(){t._color._alpha=1,o.text(""),r.slider("option","value",100),n.removeClass("csf--transparent-active"),i.trigger("change")}),n.on("click",".wp-picker-default",function(){var e=a.funcs.parse_color(i.data("default-color")),n=parseFloat(e.transparent/100),s=n<1?n:"";t._color._alpha=n,o.text(s),r.slider("option","value",e.transparent)})}})}})})},e.fn.csf_chosen=function(){return this.each(function(){var n=e(this),a=n.parent().find(".chosen-container"),s=n.hasClass("csf-chosen-sortable")||!1,c=n.hasClass("csf-chosen-ajax")||!1,r=n.attr("multiple")||!1,o=r?"100%":"auto",f=e.extend({allow_single_deselect:!0,disable_search_threshold:10,width:o,no_results_text:t.csf_vars.i18n.no_results_text},n.data("chosen-settings"));if(a.length&&a.remove(),c){var l=e.extend({data:{type:"post",nonce:""},allow_single_deselect:!0,disable_search_threshold:-1,width:"100%",min_length:3,type_delay:500,typing_text:t.csf_vars.i18n.typing_text,searching_text:t.csf_vars.i18n.searching_text,no_results_text:t.csf_vars.i18n.no_results_text},n.data("chosen-settings"));n.CSFAjaxChosen(l)}else n.chosen(f);if(r){var d=n.parent().find(".csf-hidden-select"),h=d.val()||[];n.on("change",function(e,n){n&&n.selected?d.append('<option value="'+n.selected+'" selected="selected">'+n.selected+"</option>"):n&&n.deselected&&d.find('option[value="'+n.deselected+'"]').remove(),0===d.children().length&&t.wp.customize!==i&&t.wp.customize.control(d.data("customize-setting-link")).setting.set(""),d.trigger("change")}),n.CSFChosenOrder(h,!0)}if(s){var p=n.parent().find(".chosen-container").find(".chosen-choices");p.bind("mousedown",function(t){e(t.target).is("span")&&t.stopPropagation()}),p.sortable({items:"li:not(.search-field)",helper:"orginal",cursor:"move",placeholder:"search-choice-placeholder",start:function(e,t){t.placeholder.width(t.item.innerWidth()),t.placeholder.height(t.item.innerHeight())},update:function(t,i){var a="",s=n.data("chosen"),c=n.parent().find(".csf-hidden-select");p.find(".search-choice-close").each(function(){var t=e(this).data("option-array-index");e.each(s.results_data,function(e,n){n.array_index===t&&(a+='<option value="'+n.value+'" selected>'+n.value+"</option>")})}),c.children().remove(),c.append(a),c.trigger("change")}})}})},e.fn.csf_checkbox=function(){return this.each(function(){var t=e(this),n=t.find(".csf--input"),i=t.find(".csf--checkbox");i.on("click",function(){n.val(Number(i.prop("checked"))).trigger("change")})})},e.fn.csf_siblings=function(){return this.each(function(){var t=e(this),n=t.find(".csf--sibling"),i=t.data("multiple")||!1;n.on("click",function(){var n=e(this);i?n.hasClass("csf--active")?(n.removeClass("csf--active"),n.find("input").prop("checked",!1).trigger("change")):(n.addClass("csf--active"),n.find("input").prop("checked",!0).trigger("change")):(t.find("input").prop("checked",!1),n.find("input").prop("checked",!0).trigger("change"),n.addClass("csf--active").siblings().removeClass("csf--active"))})})},e.fn.csf_help=function(){return this.each(function(){var t,n,s=e(this);s.on({mouseenter:function(){t=e('<div class="csf-tooltip"></div>').html(s.find(".csf-help-text").html()).appendTo("body"),n=a.vars.is_rtl?s.offset().left+24:s.offset().left-t.outerWidth(),t.css({top:s.offset().top-(t.outerHeight()/2-14),left:n})},mouseleave:function(){t!==i&&t.remove()}})})},e.fn.csf_customizer_refresh=function(){return this.each(function(){var i=e(this),a=i.closest(".csf-customize-complex");if(a.length){var s=a.find(":input"),c=a.data("unique-id"),r=a.data("option-id"),o=s.serializeObjectCSF(),f=e.isEmptyObject(o)?"":o[c][r],l=t.wp.customize.control(c+"["+r+"]");l.setting._value=null,l.setting.set(f)}else i.find(":input").first().trigger("change");e(n).trigger("csf-customizer-refresh",i)})},e.fn.csf_customizer_listen=function(n){var s=e.extend({closest:!1},n);return this.each(function(){if(t.wp.customize!==i){var n=s.closest?e(this).closest(".csf-customize-complex"):e(this),c=n.find(":input"),r=n.data("unique-id"),o=n.data("option-id");r!==i&&c.on("change keyup",a.helper.debounce(function(){var i=n.find(":input").serializeObjectCSF(),a=!e.isEmptyObject(i)&&i[r]&&i[r][o]?i[r][o]:"";t.wp.customize.control(r+"["+o+"]").setting.set(a)},250))}})},e(n).on("expanded",".control-section",function(){var t=e(this);if(t.hasClass("open")&&!t.data("inited")){var n=t.find(".csf-customize-field"),i=t.find(".csf-customize-complex");n.length&&(t.csf_dependency(),n.csf_reload_script({dependency:!1}),i.csf_customizer_listen()),t.data("inited",!0)}}),a.vars.$window.on("resize csf.resize",a.helper.debounce(function(n){(navigator.userAgent.indexOf("AppleWebKit/")>-1?a.vars.$window.width():t.innerWidth)<=782&&!a.vars.onloaded&&(e(".csf-section").csf_reload_script(),a.vars.onloaded=!0)},200)).trigger("csf.resize"),e.fn.csf_widgets=function(){this.length&&(e(n).on("widget-added widget-updated",function(e,t){t.find(".csf-fields").csf_reload_script()}),e(".widgets-sortables, .control-section-sidebar").on("sortstop",function(e,t){t.item.find(".csf-fields").csf_reload_script_retry()}),e(n).on("click",".widget-top",function(t){e(this).parent().find(".csf-fields").csf_reload_script()}))},e.fn.csf_reload_script_retry=function(){return this.each(function(){var t=e(this);t.data("inited")&&t.children(".csf-field-wp_editor").csf_field_wp_editor()})},e.fn.csf_reload_script=function(t){var i=e.extend({dependency:!0},t);return this.each(function(){var t=e(this);t.data("inited")||(t.children(".csf-field-accordion").csf_field_accordion(),t.children(".csf-field-backup").csf_field_backup(),t.children(".csf-field-background").csf_field_background(),t.children(".csf-field-code_editor").csf_field_code_editor(),t.children(".csf-field-date").csf_field_date(),t.children(".csf-field-fieldset").csf_field_fieldset(),t.children(".csf-field-gallery").csf_field_gallery(),t.children(".csf-field-group").csf_field_group(),t.children(".csf-field-icon").csf_field_icon(),t.children(".csf-field-media").csf_field_media(),t.children(".csf-field-map").csf_field_map(),t.children(".csf-field-repeater").csf_field_repeater(),t.children(".csf-field-slider").csf_field_slider(),t.children(".csf-field-sortable").csf_field_sortable(),t.children(".csf-field-sorter").csf_field_sorter(),t.children(".csf-field-spinner").csf_field_spinner(),t.children(".csf-field-switcher").csf_field_switcher(),t.children(".csf-field-tabbed").csf_field_tabbed(),t.children(".csf-field-typography").csf_field_typography(),t.children(".csf-field-upload").csf_field_upload(),t.children(".csf-field-wp_editor").csf_field_wp_editor(),t.children(".csf-field-border").find(".csf-color").csf_color(),t.children(".csf-field-background").find(".csf-color").csf_color(),t.children(".csf-field-color").find(".csf-color").csf_color(),t.children(".csf-field-color_group").find(".csf-color").csf_color(),t.children(".csf-field-link_color").find(".csf-color").csf_color(),t.children(".csf-field-typography").find(".csf-color").csf_color(),t.children(".csf-field-select").find(".csf-chosen").csf_chosen(),t.children(".csf-field-checkbox").find(".csf-checkbox").csf_checkbox(),t.children(".csf-field-button_set").find(".csf-siblings").csf_siblings(),t.children(".csf-field-image_select").find(".csf-siblings").csf_siblings(),t.children(".csf-field-palette").find(".csf-siblings").csf_siblings(),t.children(".csf-field").find(".csf-help").csf_help(),i.dependency&&t.csf_dependency(),t.data("inited",!0),e(n).trigger("csf-reload-script",t))})},e(n).ready(function(){e(".csf-save").csf_save(),e(".csf-options").csf_options(),e(".csf-sticky-header").csf_sticky(),e(".csf-nav-options").csf_nav_options(),e(".csf-nav-metabox").csf_nav_metabox(),e(".csf-taxonomy").csf_taxonomy(),e(".csf-page-templates").csf_page_templates(),e(".csf-post-formats").csf_post_formats(),e(".csf-shortcode").csf_shortcode(),e(".csf-search").csf_search(),e(".csf-confirm").csf_confirm(),e(".csf-expand-all").csf_expand_all(),e(".csf-onload").csf_reload_script(),e(".widget").csf_widgets()})}(jQuery,window,document);
admin/settings/assets/scss/csf-rtl.scss CHANGED
@@ -36,6 +36,11 @@
36
  * 02. 19. Field: link_color
37
  * 02. 20. Field: color_group
38
  * 02. 21. Field: palette
 
 
 
 
 
39
  * 03. Taxonomy
40
  * 04. Profile
41
  * 05. Modal
@@ -220,8 +225,7 @@
220
  }
221
 
222
  .csf-fieldset{
223
- margin-left: 0;
224
- margin-right: 30%;
225
  }
226
  }
227
 
@@ -280,7 +284,7 @@
280
  .csf-field-upload{
281
 
282
  .csf--remove,
283
- .csf--buttons{
284
  margin-left: 0;
285
  margin-right: 5px;
286
  }
@@ -359,7 +363,7 @@
359
 
360
  .csf-tabbed-nav{
361
 
362
- .fa{
363
  padding-right: 0;
364
  padding-left: 5px;
365
  }
@@ -402,15 +406,20 @@
402
  .csf-field-spacing,
403
  .csf-field-border{
404
 
405
- .csf--input{
406
- float: right;
407
- margin-right: 0;
408
- margin-left: 15px;
409
  }
410
 
411
- .csf--left{
 
412
  float: right;
413
  }
 
 
 
 
 
414
  }
415
 
416
  /**
@@ -440,6 +449,7 @@
440
 
441
  .csf--spin{
442
  float: right;
 
443
  }
444
  }
445
 
@@ -448,18 +458,14 @@
448
  */
449
  .csf-field-slider{
450
 
451
- .ui-slider{
452
  direction: ltr;
 
 
453
  }
454
 
455
- input[type="text"]{
456
- margin-left: 0;
457
- margin-right: 15px;
458
- }
459
-
460
- em{
461
- padding-left: 0;
462
- padding-right: 5px;
463
  }
464
  }
465
 
@@ -509,13 +515,63 @@
509
  }
510
 
511
  /**
512
- * 03. Taxonomy
513
  */
514
- .csf-taxonomy-add-fields{
515
 
516
- .csf-fieldset{
517
  margin-right: 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
518
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
519
 
520
  .csf-field > .csf-fieldset > .csf-help{
521
  left: -5px;
@@ -525,11 +581,6 @@
525
 
526
  .csf-taxonomy-edit-fields{
527
 
528
- .csf-fieldset{
529
- margin-left: 0;
530
- margin-right: 225px;
531
- }
532
-
533
  .csf-field > .csf-fieldset > .csf-help{
534
  right: auto;
535
  left: -5px;
@@ -549,30 +600,15 @@
549
  > .csf-field{
550
 
551
  > .csf-fieldset{
552
- margin-left: 0;
553
- margin-right: 220px;
554
- }
555
 
556
- > .csf-help{
557
- left: 0;
558
- right: auto;
 
559
  }
560
  }
561
  }
562
 
563
- .csf-taxonomy-edit-fields{
564
-
565
- .csf-fieldset{
566
- margin-left: 0;
567
- margin-right: 225px;
568
- }
569
-
570
- .csf-field > .csf-fieldset > .csf-help{
571
- right: auto;
572
- left: -5px;
573
- }
574
- }
575
-
576
  /**
577
  * 05. Modal
578
  */
36
  * 02. 19. Field: link_color
37
  * 02. 20. Field: color_group
38
  * 02. 21. Field: palette
39
+ * 02. 22. Field: accordion
40
+ * 02. 23. Field: date
41
+ * 02. 24. Field: map
42
+ * 02. 25. Field: sortable
43
+ * 02. 26. Field: number
44
  * 03. Taxonomy
45
  * 04. Profile
46
  * 05. Modal
225
  }
226
 
227
  .csf-fieldset{
228
+ float: left;
 
229
  }
230
  }
231
 
284
  .csf-field-upload{
285
 
286
  .csf--remove,
287
+ .csf--button{
288
  margin-left: 0;
289
  margin-right: 5px;
290
  }
363
 
364
  .csf-tabbed-nav{
365
 
366
+ .csf--icon{
367
  padding-right: 0;
368
  padding-left: 5px;
369
  }
406
  .csf-field-spacing,
407
  .csf-field-border{
408
 
409
+ .csf--input,
410
+ .csf-fieldset{
411
+ direction: ltr;
 
412
  }
413
 
414
+ .csf--inputs,
415
+ .csf--color{
416
  float: right;
417
  }
418
+
419
+ .csf--color{
420
+ margin-right: 4px;
421
+ direction: rtl;
422
+ }
423
  }
424
 
425
  /**
449
 
450
  .csf--spin{
451
  float: right;
452
+ direction: ltr;
453
  }
454
  }
455
 
458
  */
459
  .csf-field-slider{
460
 
461
+ .csf-slider-ui{
462
  direction: ltr;
463
+ margin-right: 0;
464
+ margin-left: 15px;
465
  }
466
 
467
+ .csf--input{
468
+ direction: ltr;
 
 
 
 
 
 
469
  }
470
  }
471
 
515
  }
516
 
517
  /**
518
+ * 02. 22. Field: accordion
519
  */
520
+ .csf-field-accordion{
521
 
522
+ .csf--icon{
523
  margin-right: 0;
524
+ margin-left: 2px;
525
+ }
526
+ }
527
+
528
+ /**
529
+ * 02. 23. Field: date
530
+ */
531
+ .csf-field-date{
532
+
533
+ .csf--to {
534
+ margin-left: 0;
535
+ margin-right: 7px;
536
+ }
537
+ }
538
+
539
+ /**
540
+ * 02. 24. Field: map
541
+ */
542
+ .csf-field-map{
543
+
544
+ .csf--map-input:last-child {
545
+ padding-left: 0;
546
+ padding-right: 10px;
547
  }
548
+ }
549
+
550
+ /**
551
+ * 02. 25. Field: sortable
552
+ */
553
+ .csf-field-sortable{
554
+
555
+ .csf--sortable-helper{
556
+ border-left: none;
557
+ border-right: 1px solid #eee;
558
+ }
559
+ }
560
+
561
+ /**
562
+ * 02. 26. Field: number
563
+ */
564
+ .csf-field-number{
565
+
566
+ .csf--wrap{
567
+ float: right;
568
+ }
569
+ }
570
+
571
+ /**
572
+ * 03. Taxonomy
573
+ */
574
+ .csf-taxonomy-add-fields{
575
 
576
  .csf-field > .csf-fieldset > .csf-help{
577
  left: -5px;
581
 
582
  .csf-taxonomy-edit-fields{
583
 
 
 
 
 
 
584
  .csf-field > .csf-fieldset > .csf-help{
585
  right: auto;
586
  left: -5px;
600
  > .csf-field{
601
 
602
  > .csf-fieldset{
 
 
 
603
 
604
+ > .csf-help{
605
+ left: -5px;
606
+ right: auto;
607
+ }
608
  }
609
  }
610
  }
611
 
 
 
 
 
 
 
 
 
 
 
 
 
 
612
  /**
613
  * 05. Modal
614
  */
admin/settings/assets/scss/vendor/_base.scss CHANGED
@@ -143,7 +143,8 @@
143
  .csf-arrow:after{
144
  content: "\f054";
145
  display: inline-block;
146
- font-family: "FontAwesome";
 
147
  font-size: 9px;
148
  line-height: 1;
149
  position: absolute;
@@ -179,10 +180,10 @@
179
  }
180
  }
181
 
182
- .fa{
183
  width: 20px;
184
  margin-right: 5px;
185
- font-size: 14px;
186
  text-align: center;
187
  }
188
 
@@ -245,7 +246,7 @@
245
  text-transform: uppercase;
246
  }
247
 
248
- .fa{
249
  margin-right: 5px;
250
  }
251
  }
@@ -300,8 +301,8 @@
300
  padding: 0 8px;
301
  margin-right: 4px;
302
  z-index: 1;
303
- font-size: 14px;
304
- line-height: 28px;
305
  cursor: pointer;
306
  user-select: none;
307
  @include border-radius(2px);
@@ -323,8 +324,8 @@
323
  margin: 0 2px 0 0;
324
  border: none;
325
  font-size: 12px;
326
- line-height: 28px;
327
- min-height: 28px;
328
  text-align: inherit;
329
  padding: 0 10px;
330
  @include border-radius(2px);
@@ -360,11 +361,22 @@
360
  .block-editor-page{
361
 
362
  .csf-metabox{
363
- margin: -6px -14px -12px -14px;
 
 
 
 
 
 
 
 
364
  }
365
  }
366
 
 
367
  .csf-restore-wrapper{
 
 
368
  text-align: right;
369
  padding: 10px;
370
  border-top: 1px solid #eee;
@@ -406,7 +418,8 @@
406
  }
407
 
408
  .csf-fieldset{
409
- margin-left: 0;
 
410
  }
411
  }
412
 
143
  .csf-arrow:after{
144
  content: "\f054";
145
  display: inline-block;
146
+ font-family: "Font Awesome 5 Pro", "Font Awesome 5 Free", "FontAwesome";
147
+ font-weight: 900;
148
  font-size: 9px;
149
  line-height: 1;
150
  position: absolute;
180
  }
181
  }
182
 
183
+ .csf-tab-icon{
184
  width: 20px;
185
  margin-right: 5px;
186
+ font-size: 13px;
187
  text-align: center;
188
  }
189
 
246
  text-transform: uppercase;
247
  }
248
 
249
+ .csf-section-icon{
250
  margin-right: 5px;
251
  }
252
  }
301
  padding: 0 8px;
302
  margin-right: 4px;
303
  z-index: 1;
304
+ font-size: 13px;
305
+ line-height: 30px;
306
  cursor: pointer;
307
  user-select: none;
308
  @include border-radius(2px);
324
  margin: 0 2px 0 0;
325
  border: none;
326
  font-size: 12px;
327
+ line-height: 30px;
328
+ min-height: 30px;
329
  text-align: inherit;
330
  padding: 0 10px;
331
  @include border-radius(2px);
361
  .block-editor-page{
362
 
363
  .csf-metabox{
364
+ margin: -6px -14px -14px -14px;
365
+ }
366
+ }
367
+
368
+ .block-editor-editor-skeleton__content{
369
+
370
+ .csf-metabox{
371
+ border-left: 1px solid #e2e4e7;
372
+ border-right: 1px solid #e2e4e7;
373
  }
374
  }
375
 
376
+
377
  .csf-restore-wrapper{
378
+ position: relative;
379
+ z-index: 1000000;
380
  text-align: right;
381
  padding: 10px;
382
  border-top: 1px solid #eee;
418
  }
419
 
420
  .csf-fieldset{
421
+ float: none;
422
+ width: 100%;
423
  }
424
  }
425
 
admin/settings/assets/scss/vendor/_customizer.scss CHANGED
@@ -21,7 +21,8 @@
21
  }
22
 
23
  .csf-fieldset{
24
- margin-left: 0;
 
25
  }
26
  }
27
 
21
  }
22
 
23
  .csf-fieldset{
24
+ float: none;
25
+ width: 100%;
26
  }
27
  }
28
 
admin/settings/assets/scss/vendor/_fields.scss CHANGED
@@ -43,7 +43,8 @@
43
  }
44
 
45
  .csf-fieldset{
46
- margin-left: 25%;
 
47
  }
48
  }
49
 
@@ -104,6 +105,7 @@
104
  .csf--icon{
105
  width: 20px;
106
  text-align: center;
 
107
  }
108
 
109
  .csf-accordion-content{
@@ -162,10 +164,6 @@
162
  .csf--attributes-hidden{
163
  display: none;
164
  }
165
-
166
- .wp-color-result.button{
167
- margin-bottom: 0;
168
- }
169
  }
170
 
171
  /**
@@ -382,8 +380,10 @@
382
  }
383
 
384
  .button.wp-picker-clear{
 
385
  margin-left: 6px;
386
- padding: 2px 8px;
 
387
  }
388
  }
389
 
@@ -480,7 +480,8 @@
480
  top: auto;
481
  left: auto;
482
  right: auto;
483
- font-family: "FontAwesome";
 
484
  font-size: 12px;
485
  text-align: center;
486
  width: 41px;
@@ -766,21 +767,24 @@
766
  margin-right: 5px;
767
  }
768
 
769
- .csf-icon-preview i{
770
- display: inline-block;
771
- font-size: 14px;
772
- width: 30px;
773
- height: 26px;
774
- line-height: 26px;
775
- margin-right: 5px;
776
- text-align: center;
777
- vertical-align: top;
778
- color: #555;
779
- border: 1px solid #ccc;
780
- background-color: #f7f7f7;
781
- @include border-radius(3px);
782
- @include box-shadow(0 1px 0 rgba(black, 0.08));
783
- @include box-sizing(content-box);
 
 
 
784
  }
785
  }
786
 
@@ -807,12 +811,13 @@
807
  top: 0;
808
  left: 0;
809
  text-align: center;
810
- font-size: 11px;
811
- font-family: FontAwesome;
 
812
  content: "\f00c";
813
- width: 15px;
814
- height: 15px;
815
- line-height: 15px;
816
  opacity: 0;
817
  color: #fff;
818
  background-color: #222;
@@ -998,12 +1003,13 @@
998
  top: 0;
999
  left: 0;
1000
  text-align: center;
1001
- font-size: 11px;
1002
- font-family: FontAwesome;
 
1003
  content: "\f00c";
1004
- width: 15px;
1005
- height: 15px;
1006
- line-height: 15px;
1007
  opacity: 0;
1008
  color: #fff;
1009
  background-color: #222;
@@ -1167,11 +1173,15 @@
1167
  background-color: #f5f5f5;
1168
  }
1169
 
 
 
 
 
1170
  input[type=number]{
1171
  position: relative;
1172
  z-index: 1;
 
1173
  width: 50px;
1174
- margin: 0 0 0 15px;
1175
  text-align: center;
1176
  }
1177
 
@@ -1262,7 +1272,7 @@
1262
  border-left: 1px solid #eee;
1263
  background-color: #f7f7f7;
1264
 
1265
- .fa{
1266
  display: inline-block;
1267
  cursor: pointer;
1268
  width: 50px;
@@ -1409,8 +1419,10 @@
1409
  }
1410
 
1411
  &:before{
1412
- font-family: FontAwesome;
 
1413
  font-size: 14px;
 
1414
  }
1415
  }
1416
 
@@ -1949,7 +1961,7 @@
1949
  top: 0;
1950
  right: 0;
1951
  padding: 5px;
1952
- font-size: 14px;
1953
  color: #aaa;
1954
 
1955
  .csf-help-text{
@@ -1992,7 +2004,8 @@
1992
  .chosen-container-single .chosen-single abbr{
1993
  top: 0;
1994
  right: 20px;
1995
- font-family: FontAwesome;
 
1996
  font-size: 12px;
1997
  height: 100%;
1998
  width: 18px;
@@ -2010,7 +2023,8 @@
2010
  }
2011
 
2012
  .chosen-container-multi .chosen-choices li.search-choice .search-choice-close{
2013
- font-family: FontAwesome;
 
2014
  font-size: 12px;
2015
  height: 100%;
2016
  width: 18px;
@@ -2030,7 +2044,8 @@
2030
  }
2031
 
2032
  .chosen-container-single .chosen-single div b{
2033
- font-family: FontAwesome;
 
2034
  font-size: 14px;
2035
  color: #aaa;
2036
  background: none;
@@ -2071,18 +2086,23 @@
2071
  .chosen-container-single .chosen-search{
2072
 
2073
  &:before{
2074
- font-family: FontAwesome;
2075
- position: absolute;
2076
- content: "\f002";
2077
  font-size: 11px;
2078
- right: 10px;
2079
- top: 7px;
 
 
2080
  color: #aaa;
2081
  }
2082
  }
2083
 
2084
  .wp-picker-container{
2085
  display: inline-block;
 
 
 
 
2086
  }
2087
 
2088
  .csf--transparent-wrap{
43
  }
44
 
45
  .csf-fieldset{
46
+ float: right;
47
+ width: calc(80% - 20px);
48
  }
49
  }
50
 
105
  .csf--icon{
106
  width: 20px;
107
  text-align: center;
108
+ margin-right: 2px;
109
  }
110
 
111
  .csf-accordion-content{
164
  .csf--attributes-hidden{
165
  display: none;
166
  }
 
 
 
 
167
  }
168
 
169
  /**
380
  }
381
 
382
  .button.wp-picker-clear{
383
+ padding: 0 8px;
384
  margin-left: 6px;
385
+ line-height: 2.54545455;
386
+ min-height: 30px;
387
  }
388
  }
389
 
480
  top: auto;
481
  left: auto;
482
  right: auto;
483
+ font-family: "Font Awesome 5 Pro", "Font Awesome 5 Free", "FontAwesome";
484
+ font-weight: 900;
485
  font-size: 12px;
486
  text-align: center;
487
  width: 41px;
767
  margin-right: 5px;
768
  }
769
 
770
+ .csf-icon-preview{
771
+
772
+ i{
773
+ display: inline-block;
774
+ font-size: 16px;
775
+ width: 30px;
776
+ height: 28px;
777
+ line-height: 28px;
778
+ margin-right: 5px;
779
+ text-align: center;
780
+ vertical-align: top;
781
+ color: #555;
782
+ border: 1px solid #ccc;
783
+ background-color: #f7f7f7;
784
+ @include border-radius(3px);
785
+ @include box-shadow(0 1px 0 rgba(black, 0.08));
786
+ @include box-sizing(content-box);
787
+ }
788
  }
789
  }
790
 
811
  top: 0;
812
  left: 0;
813
  text-align: center;
814
+ font-size: 10px;
815
+ font-family: "Font Awesome 5 Pro", "Font Awesome 5 Free", "FontAwesome";
816
+ font-weight: 900;
817
  content: "\f00c";
818
+ width: 16px;
819
+ height: 16px;
820
+ line-height: 14px;
821
  opacity: 0;
822
  color: #fff;
823
  background-color: #222;
1003
  top: 0;
1004
  left: 0;
1005
  text-align: center;
1006
+ font-size: 10px;
1007
+ font-family: "Font Awesome 5 Pro", "Font Awesome 5 Free", "FontAwesome";
1008
+ font-weight: 900;
1009
  content: "\f00c";
1010
+ width: 16px;
1011
+ height: 16px;
1012
+ line-height: 14px;
1013
  opacity: 0;
1014
  color: #fff;
1015
  background-color: #222;
1173
  background-color: #f5f5f5;
1174
  }
1175
 
1176
+ .csf-slider-ui{
1177
+ margin-right: 15px;
1178
+ }
1179
+
1180
  input[type=number]{
1181
  position: relative;
1182
  z-index: 1;
1183
+ margin: 0;
1184
  width: 50px;
 
1185
  text-align: center;
1186
  }
1187
 
1272
  border-left: 1px solid #eee;
1273
  background-color: #f7f7f7;
1274
 
1275
+ i{
1276
  display: inline-block;
1277
  cursor: pointer;
1278
  width: 50px;
1419
  }
1420
 
1421
  &:before{
1422
+ font-family: "Font Awesome 5 Pro", "Font Awesome 5 Free", "FontAwesome";
1423
+ font-weight: 900;
1424
  font-size: 14px;
1425
+ line-height: 14px;
1426
  }
1427
  }
1428
 
1961
  top: 0;
1962
  right: 0;
1963
  padding: 5px;
1964
+ font-size: 13px;
1965
  color: #aaa;
1966
 
1967
  .csf-help-text{
2004
  .chosen-container-single .chosen-single abbr{
2005
  top: 0;
2006
  right: 20px;
2007
+ font-family: "Font Awesome 5 Pro", "Font Awesome 5 Free", "FontAwesome";
2008
+ font-weight: 900;
2009
  font-size: 12px;
2010
  height: 100%;
2011
  width: 18px;
2023
  }
2024
 
2025
  .chosen-container-multi .chosen-choices li.search-choice .search-choice-close{
2026
+ font-family: "Font Awesome 5 Pro", "Font Awesome 5 Free", "FontAwesome";
2027
+ font-weight: 900;
2028
  font-size: 12px;
2029
  height: 100%;
2030
  width: 18px;
2044
  }
2045
 
2046
  .chosen-container-single .chosen-single div b{
2047
+ font-family: "Font Awesome 5 Pro", "Font Awesome 5 Free", "FontAwesome";
2048
+ font-weight: 900;
2049
  font-size: 14px;
2050
  color: #aaa;
2051
  background: none;
2086
  .chosen-container-single .chosen-search{
2087
 
2088
  &:before{
2089
+ font-family: "Font Awesome 5 Pro", "Font Awesome 5 Free", "FontAwesome";
2090
+ font-weight: 900;
 
2091
  font-size: 11px;
2092
+ content: "\f002";
2093
+ position: absolute;
2094
+ right: 12px;
2095
+ top: 10px;
2096
  color: #aaa;
2097
  }
2098
  }
2099
 
2100
  .wp-picker-container{
2101
  display: inline-block;
2102
+
2103
+ .wp-color-result.button{
2104
+ margin-bottom: 0;
2105
+ }
2106
  }
2107
 
2108
  .csf--transparent-wrap{
admin/settings/assets/scss/vendor/_helper.scss CHANGED
@@ -1,10 +1,18 @@
1
  /**
2
  * 08. Helper
3
  */
4
- .csf-text-desc,
5
  .csf-text-subtitle{
 
6
  font-weight: 400;
 
 
 
 
 
 
 
7
  margin-top: 10px;
 
8
  color: #999;
9
  }
10
 
@@ -13,6 +21,7 @@
13
  }
14
 
15
  .csf-text-error{
 
16
  color: #d02c21;
17
  }
18
 
1
  /**
2
  * 08. Helper
3
  */
 
4
  .csf-text-subtitle{
5
+ margin-top: 10px;
6
  font-weight: 400;
7
+ color: #999;
8
+ }
9
+
10
+ .csf-text-desc{
11
+ clear: both;
12
+ float: left;
13
+ width: 100%;
14
  margin-top: 10px;
15
+ font-weight: 400;
16
  color: #999;
17
  }
18
 
21
  }
22
 
23
  .csf-text-error{
24
+ margin-top: 5px;
25
  color: #d02c21;
26
  }
27
 
admin/settings/assets/scss/vendor/_modal.scss CHANGED
@@ -46,14 +46,6 @@
46
  display: none;
47
  }
48
 
49
- .csf-fieldset{
50
- margin-left: 25%;
51
- }
52
-
53
- .csf-title{
54
- width: 20%;
55
- }
56
-
57
  .csf-field{
58
  padding: 15px 30px 15px 15px;
59
  }
@@ -251,35 +243,27 @@
251
  }
252
 
253
  .csf-icon-search{
254
- width: 250px;
255
  height: 40px;
256
  line-height: 40px;
257
  }
258
 
259
- a{
260
- display: inline-block;
261
- padding: 4px;
262
  cursor: pointer;
 
 
 
 
 
 
 
 
 
 
 
 
263
 
264
- .csf-icon{
265
- position: relative;
266
- padding: 4px;
267
- display: inline-block;
268
- font-size: 14px;
269
- width: 30px;
270
- height: 26px;
271
- line-height: 26px;
272
- text-align: center;
273
- vertical-align: top;
274
- color: #555;
275
- border: 1px solid #ccc;
276
- background-color: #f7f7f7;
277
- @include border-radius(3px);
278
- @include box-shadow(0 1px 0 rgba(black, 0.08));
279
- @include box-sizing(content-box);
280
- }
281
-
282
- &:hover .csf-icon{
283
  color: #fff;
284
  border-color: #222;
285
  background-color: #222;
46
  display: none;
47
  }
48
 
 
 
 
 
 
 
 
 
49
  .csf-field{
50
  padding: 15px 30px 15px 15px;
51
  }
243
  }
244
 
245
  .csf-icon-search{
246
+ width: 50%;
247
  height: 40px;
248
  line-height: 40px;
249
  }
250
 
251
+ i{
 
 
252
  cursor: pointer;
253
+ display: inline-block;
254
+ margin: 4px;
255
+ width: 35px;
256
+ height: 35px;
257
+ line-height: 35px;
258
+ font-size: 16px;
259
+ color: #555;
260
+ text-align: center;
261
+ border: 1px solid #ccc;
262
+ background-color: #f7f7f7;
263
+ @include border-radius(2px);
264
+ @include box-shadow(1px 1px 0 rgba(black, 0.05));
265
 
266
+ &:hover {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
267
  color: #fff;
268
  border-color: #222;
269
  background-color: #222;
admin/settings/assets/scss/vendor/_profile.scss CHANGED
@@ -8,11 +8,12 @@
8
  }
9
 
10
  > .csf-field{
 
11
  padding: 15px 0;
12
  border-top: none !important;
13
 
14
  > .csf-title{
15
- width: 220px;
16
 
17
  h4{
18
  font-size: 14px;
@@ -24,7 +25,7 @@
24
  }
25
 
26
  > .csf-fieldset{
27
- margin-left: 220px;
28
 
29
  > .csf-help{
30
  top: -15px;
8
  }
9
 
10
  > .csf-field{
11
+ max-width: 800px;
12
  padding: 15px 0;
13
  border-top: none !important;
14
 
15
  > .csf-title{
16
+ width: 200px;
17
 
18
  h4{
19
  font-size: 14px;
25
  }
26
 
27
  > .csf-fieldset{
28
+ width: calc(100% - 220px);
29
 
30
  > .csf-help{
31
  top: -15px;
admin/settings/assets/scss/vendor/_responsive.scss CHANGED
@@ -14,7 +14,8 @@
14
  }
15
 
16
  .csf-fieldset{
17
- margin-left: 0;
 
18
  }
19
  }
20
  }
@@ -86,7 +87,17 @@
86
  }
87
 
88
  .csf-fieldset{
89
- margin-left: 0;
 
 
 
 
 
 
 
 
 
 
90
  }
91
  }
92
 
@@ -123,7 +134,8 @@
123
  }
124
  }
125
 
126
- .csf-profile{
 
127
 
128
  > .csf-field{
129
 
@@ -134,7 +146,8 @@
134
  }
135
 
136
  > .csf-fieldset{
137
- margin-left: 0;
 
138
  }
139
  }
140
  }
14
  }
15
 
16
  .csf-fieldset{
17
+ float: none;
18
+ width: 100%;
19
  }
20
  }
21
  }
87
  }
88
 
89
  .csf-fieldset{
90
+ float: none;
91
+ width: 100%;
92
+ }
93
+ }
94
+
95
+ .csf-field-color{
96
+
97
+ .button.wp-picker-clear{
98
+ padding: 0 8px;
99
+ line-height: 2.14285714;
100
+ min-height: 32px;
101
  }
102
  }
103
 
134
  }
135
  }
136
 
137
+ .csf-profile,
138
+ .csf-taxonomy-edit-fields{
139
 
140
  > .csf-field{
141
 
146
  }
147
 
148
  > .csf-fieldset{
149
+ float: none;
150
+ width: 100%;
151
  }
152
  }
153
  }
admin/settings/assets/scss/vendor/_taxonomy.scss CHANGED
@@ -60,7 +60,8 @@
60
  }
61
 
62
  > .csf-fieldset{
63
- margin-left: 0;
 
64
 
65
  > .csf-help{
66
  right: -5px;
@@ -79,7 +80,7 @@
79
  padding: 20px 0;
80
 
81
  > .csf-title{
82
- width: 225px;
83
 
84
  h4{
85
  font-size: 14px;
@@ -91,7 +92,7 @@
91
  }
92
 
93
  > .csf-fieldset{
94
- margin-left: 225px;
95
 
96
  > .csf-help{
97
  top: -5px;
60
  }
61
 
62
  > .csf-fieldset{
63
+ float: none;
64
+ width: 100%;
65
 
66
  > .csf-help{
67
  right: -5px;
80
  padding: 20px 0;
81
 
82
  > .csf-title{
83
+ width: 200px;
84
 
85
  h4{
86
  font-size: 14px;
92
  }
93
 
94
  > .csf-fieldset{
95
+ width: calc(100% - 220px);
96
 
97
  > .csf-help{
98
  top: -5px;
admin/settings/assets/scss/vendor/_widget.scss CHANGED
@@ -22,7 +22,8 @@
22
  }
23
 
24
  .csf-fieldset{
25
- margin-left: 0;
 
26
  }
27
  }
28
 
22
  }
23
 
24
  .csf-fieldset{
25
+ float: none;
26
+ width: 100%;
27
  }
28
  }
29
 
admin/settings/classes/abstract.class.php CHANGED
@@ -7,7 +7,7 @@
7
  * @version 1.0.0
8
  *
9
  */
10
- if( ! class_exists( 'CSF_Abstract' ) ) {
11
  abstract class CSF_Abstract {
12
 
13
  public $abstract = '';
@@ -17,12 +17,12 @@ if( ! class_exists( 'CSF_Abstract' ) ) {
17
  public function __construct() {
18
 
19
  // Check for embed google web fonts
20
- if( ! empty( $this->args['enqueue_webfont'] ) ) {
21
  add_action( 'wp_enqueue_scripts', array( &$this, 'add_enqueue_google_fonts' ), 100 );
22
  }
23
 
24
  // Check for embed custom css styles
25
- if( ! empty( $this->args['output_css'] ) ) {
26
  add_action( 'wp_head', array( &$this, 'add_output_css' ), 100 );
27
  }
28
 
@@ -30,42 +30,42 @@ if( ! class_exists( 'CSF_Abstract' ) ) {
30
 
31
  public function add_enqueue_google_fonts() {
32
 
33
- if( ! empty( $this->pre_fields ) ) {
34
 
35
- foreach( $this->pre_fields as $field ) {
36
 
37
  $field_id = ( ! empty( $field['id'] ) ) ? $field['id'] : '';
38
  $field_type = ( ! empty( $field['type'] ) ) ? $field['type'] : '';
39
  $field_output = ( ! empty( $field['output'] ) ) ? $field['output'] : '';
40
  $field_check = ( $field_type === 'typography' || $field_output ) ? true : false;
41
 
42
- if( $field_type && $field_id ) {
43
 
44
  CSF::maybe_include_field( $field_type );
45
 
46
  $class_name = 'CSF_Field_' . $field_type;
47
 
48
- if( class_exists( $class_name ) ) {
49
 
50
- if( method_exists( $class_name, 'output' ) || method_exists( $class_name, 'enqueue_google_fonts' ) ) {
51
 
52
  $field_value = '';
53
 
54
- if( $field_check && ( $this->abstract === 'options' || $this->abstract === 'customize' ) ) {
55
  $field_value = ( isset( $this->options[$field_id] ) && $this->options[$field_id] !== '' ) ? $this->options[$field_id] : '';
56
- } else if( $field_check && $this->abstract === 'metabox' ) {
57
  $field_value = $this->get_meta_value( $field );
58
  }
59
 
60
  $instance = new $class_name( $field, $field_value, $this->unique, 'wp/enqueue', $this );
61
 
62
  // typography enqueue and embed google web fonts
63
- if( $field_type === 'typography' && $this->args['enqueue_webfont'] && ! empty( $field_value['font-family'] ) ) {
64
  $instance->enqueue_google_fonts();
65
  }
66
 
67
  // output css
68
- if( $field_output && $this->args['output_css'] ) {
69
  $instance->output();
70
  }
71
 
@@ -81,23 +81,22 @@ if( ! class_exists( 'CSF_Abstract' ) ) {
81
 
82
  }
83
 
84
- if( ! empty( $this->typographies ) && empty( $this->args['async_webfont'] ) ) {
85
 
86
- $query = array( 'family' => implode( '%7C', $this->typographies ) );
87
  $api = '//fonts.googleapis.com/css';
 
88
  $handle = 'csf-google-web-fonts-'. $this->unique;
89
- $src = esc_url( add_query_arg( $query, $api ) );
90
 
91
- wp_enqueue_style( $handle, $src, array(), null );
92
 
93
  }
94
 
95
- if( ! empty( $this->typographies ) && ! empty( $this->args['async_webfont'] ) ) {
96
 
97
  $api = '//ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js';
98
  echo '<script type="text/javascript">';
99
  echo 'WebFontConfig={google:{families:['. "'" . implode( "','", $this->typographies ) . "'" .']}};';
100
- echo '!function(e){var t=e.createElement("script"),s=e.scripts[0];t.src="'. $api .'",t.async=!0,s.parentNode.insertBefore(t,s)}(document);';
101
  echo '</script>';
102
 
103
  }
@@ -109,7 +108,7 @@ if( ! class_exists( 'CSF_Abstract' ) ) {
109
  $this->output_css = apply_filters( "csf_{$this->unique}_output_css", $this->output_css, $this );
110
 
111
  if ( ! empty( $this->output_css ) ) {
112
- echo '<style type="text/css">'. $this->output_css . '</style>';
113
  }
114
 
115
  }
7
  * @version 1.0.0
8
  *
9
  */
10
+ if ( ! class_exists( 'CSF_Abstract' ) ) {
11
  abstract class CSF_Abstract {
12
 
13
  public $abstract = '';
17
  public function __construct() {
18
 
19
  // Check for embed google web fonts
20
+ if ( ! empty( $this->args['enqueue_webfont'] ) ) {
21
  add_action( 'wp_enqueue_scripts', array( &$this, 'add_enqueue_google_fonts' ), 100 );
22
  }
23
 
24
  // Check for embed custom css styles
25
+ if ( ! empty( $this->args['output_css'] ) ) {
26
  add_action( 'wp_head', array( &$this, 'add_output_css' ), 100 );
27
  }
28
 
30
 
31
  public function add_enqueue_google_fonts() {
32
 
33
+ if ( ! empty( $this->pre_fields ) ) {
34
 
35
+ foreach ( $this->pre_fields as $field ) {
36
 
37
  $field_id = ( ! empty( $field['id'] ) ) ? $field['id'] : '';
38
  $field_type = ( ! empty( $field['type'] ) ) ? $field['type'] : '';
39
  $field_output = ( ! empty( $field['output'] ) ) ? $field['output'] : '';
40
  $field_check = ( $field_type === 'typography' || $field_output ) ? true : false;
41
 
42
+ if ( $field_type && $field_id ) {
43
 
44
  CSF::maybe_include_field( $field_type );
45
 
46
  $class_name = 'CSF_Field_' . $field_type;
47
 
48
+ if ( class_exists( $class_name ) ) {
49
 
50
+ if ( method_exists( $class_name, 'output' ) || method_exists( $class_name, 'enqueue_google_fonts' ) ) {
51
 
52
  $field_value = '';
53
 
54
+ if ( $field_check && ( $this->abstract === 'options' || $this->abstract === 'customize' ) ) {
55
  $field_value = ( isset( $this->options[$field_id] ) && $this->options[$field_id] !== '' ) ? $this->options[$field_id] : '';
56
+ } else if ( $field_check && $this->abstract === 'metabox' ) {
57
  $field_value = $this->get_meta_value( $field );
58
  }
59
 
60
  $instance = new $class_name( $field, $field_value, $this->unique, 'wp/enqueue', $this );
61
 
62
  // typography enqueue and embed google web fonts
63
+ if ( $field_type === 'typography' && $this->args['enqueue_webfont'] && ! empty( $field_value['font-family'] ) ) {
64
  $instance->enqueue_google_fonts();
65
  }
66
 
67
  // output css
68
+ if ( $field_output && $this->args['output_css'] ) {
69
  $instance->output();
70
  }
71
 
81
 
82
  }
83
 
84
+ if ( ! empty( $this->typographies ) && empty( $this->args['async_webfont'] ) ) {
85
 
 
86
  $api = '//fonts.googleapis.com/css';
87
+ $query = array( 'family' => implode( '%7C', $this->typographies ) );
88
  $handle = 'csf-google-web-fonts-'. $this->unique;
 
89
 
90
+ wp_enqueue_style( $handle, esc_url( add_query_arg( $query, $api ) ), array(), null );
91
 
92
  }
93
 
94
+ if ( ! empty( $this->typographies ) && ! empty( $this->args['async_webfont'] ) ) {
95
 
96
  $api = '//ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js';
97
  echo '<script type="text/javascript">';
98
  echo 'WebFontConfig={google:{families:['. "'" . implode( "','", $this->typographies ) . "'" .']}};';
99
+ echo '!function(e){var t=e.createElement("script"),s=e.scripts[0];t.src="'. esc_url( $api ) .'",t.async=!0,s.parentNode.insertBefore(t,s)}(document);';
100
  echo '</script>';
101
 
102
  }
108
  $this->output_css = apply_filters( "csf_{$this->unique}_output_css", $this->output_css, $this );
109
 
110
  if ( ! empty( $this->output_css ) ) {
111
+ echo '<style type="text/css">'. wp_strip_all_tags( $this->output_css ) .'</style>';
112
  }
113
 
114
  }
admin/settings/classes/comment-metabox.class.php CHANGED
@@ -7,7 +7,7 @@
7
  * @version 1.0.0
8
  *
9
  */
10
- if( ! class_exists( 'CSF_Comment_Metabox' ) ) {
11
  class CSF_Comment_Metabox extends CSF_Abstract{
12
 
13
  // constans
@@ -36,7 +36,7 @@ if( ! class_exists( 'CSF_Comment_Metabox' ) ) {
36
  add_action( 'add_meta_boxes_comment', array( &$this, 'add_comment_meta_box' ) );
37
  add_action( 'edit_comment', array( &$this, 'save_comment_meta_box' ) );
38
 
39
- if( ! empty( $this->args['class'] ) ) {
40
  add_filter( 'postbox_classes_comment_'. $this->unique, array( &$this, 'add_comment_metabox_classes' ) );
41
  }
42
 
@@ -54,9 +54,9 @@ if( ! class_exists( 'CSF_Comment_Metabox' ) ) {
54
 
55
  $result = array();
56
 
57
- foreach( $sections as $key => $section ) {
58
- if( ! empty( $section['fields'] ) ) {
59
- foreach( $section['fields'] as $field ) {
60
  $result[] = $field;
61
  }
62
  }
@@ -67,7 +67,7 @@ if( ! class_exists( 'CSF_Comment_Metabox' ) ) {
67
 
68
  public function add_comment_metabox_classes( $classes ) {
69
 
70
- if( ! empty( $this->args['class'] ) ) {
71
  $classes[] = $this->args['class'];
72
  }
73
 
@@ -78,15 +78,15 @@ if( ! class_exists( 'CSF_Comment_Metabox' ) ) {
78
  // add comment metabox
79
  public function add_comment_meta_box( $post_type ) {
80
 
81
- add_meta_box( $this->unique, $this->args['title'], array( &$this, 'add_comment_meta_box_content' ), 'comment', 'normal', $this->args['priority'], $this->args );
82
 
83
  }
84
 
85
  // get default value
86
  public function get_default( $field ) {
87
 
88
- $default = ( isset( $field['id'] ) && isset( $this->args['defaults'][$field['id']] ) ) ? $this->args['defaults'][$field['id']] : null;
89
- $default = ( isset( $field['default'] ) ) ? $field['default'] : $default;
90
 
91
  return $default;
92
 
@@ -97,9 +97,9 @@ if( ! class_exists( 'CSF_Comment_Metabox' ) ) {
97
 
98
  $value = null;
99
 
100
- if( ! empty( $comment_id ) && ! empty( $field['id'] ) ) {
101
 
102
- if( $this->args['data_type'] !== 'serialize' ) {
103
  $meta = get_comment_meta( $comment_id, $field['id'] );
104
  $value = ( isset( $meta[0] ) ) ? $meta[0] : null;
105
  } else {
@@ -109,7 +109,7 @@ if( ! class_exists( 'CSF_Comment_Metabox' ) ) {
109
 
110
  }
111
 
112
- $default = $this->get_default( $field );
113
  $value = ( isset( $value ) ) ? $value : $default;
114
 
115
  return $value;
@@ -121,35 +121,39 @@ if( ! class_exists( 'CSF_Comment_Metabox' ) ) {
121
 
122
  $has_nav = ( count( $this->sections ) > 1 ) ? true : false;
123
  $show_all = ( ! $has_nav ) ? ' csf-show-all' : '';
124
- $errors = ( is_object ( $comment ) ) ? get_comment_meta( $comment->comment_ID, '_csf_errors', true ) : array();
125
  $errors = ( ! empty( $errors ) ) ? $errors : array();
126
  $theme = ( $this->args['theme'] ) ? ' csf-theme-'. $this->args['theme'] : '';
127
 
128
- if( is_object ( $comment ) && ! empty( $errors ) ) {
129
- delete_comment_meta( $comment->comment_ID, '_csf_errors' );
130
  }
131
 
132
  wp_nonce_field( 'csf_comment_metabox_nonce', 'csf_comment_metabox_nonce'. $this->unique );
133
 
134
- echo '<div class="csf csf-comment-metabox'. $theme .'">';
135
 
136
- echo '<div class="csf-wrapper'. $show_all .'">';
137
 
138
- if( $has_nav ) {
139
 
140
- echo '<div class="csf-nav csf-nav-metabox" data-unique="'. $this->unique .'">';
141
 
142
  echo '<ul>';
 
143
  $tab_key = 1;
144
- foreach( $this->sections as $section ) {
145
 
 
 
 
146
  $tab_error = ( ! empty( $errors['sections'][$tab_key] ) ) ? '<i class="csf-label-error csf-error">!</i>' : '';
147
- $tab_icon = ( ! empty( $section['icon'] ) ) ? '<i class="csf-icon '. $section['icon'] .'"></i>' : '';
148
 
149
- echo '<li><a href="#" data-section="'. $this->unique .'_'. $tab_key .'">'. $tab_icon . $section['title'] . $tab_error .'</a></li>';
150
 
151
  $tab_key++;
 
152
  }
 
153
  echo '</ul>';
154
 
155
  echo '</div>';
@@ -162,25 +166,29 @@ if( ! class_exists( 'CSF_Comment_Metabox' ) ) {
162
 
163
  $section_key = 1;
164
 
165
- foreach( $this->sections as $section ) {
166
 
167
  $onload = ( ! $has_nav ) ? ' csf-onload' : '';
168
 
169
- echo '<div id="csf-section-'. $this->unique .'_'. $section_key .'" class="csf-section'. $onload .'">';
170
 
171
- $section_icon = ( ! empty( $section['icon'] ) ) ? '<i class="csf-icon '. $section['icon'] .'"></i>' : '';
172
  $section_title = ( ! empty( $section['title'] ) ) ? $section['title'] : '';
173
 
174
- echo ( $section_title || $section_icon ) ? '<div class="csf-section-title"><h3>'. $section_icon . $section_title .'</h3></div>' : '';
175
 
176
- if( ! empty( $section['fields'] ) ) {
177
 
178
  foreach ( $section['fields'] as $field ) {
179
 
180
- if( ! empty( $field['id'] ) && ! empty( $errors['fields'][$field['id']] ) ) {
181
  $field['_error'] = $errors['fields'][$field['id']];
182
  }
183
 
 
 
 
 
184
  CSF::field( $field, $this->get_meta_value( $comment->comment_ID, $field ), $this->unique, 'comment_metabox' );
185
 
186
  }
@@ -194,17 +202,18 @@ if( ! class_exists( 'CSF_Comment_Metabox' ) ) {
194
  echo '</div>';
195
 
196
  $section_key++;
 
197
  }
198
 
199
  echo '</div>';
200
 
201
  echo '<div class="clear"></div>';
202
 
203
- if( ! empty( $this->args['show_restore'] ) ) {
204
 
205
  echo '<div class="csf-restore-wrapper">';
206
  echo '<label>';
207
- echo '<input type="checkbox" name="'. $this->unique .'[_restore]" />';
208
  echo '<span class="button csf-button-restore">'. esc_html__( 'Restore', 'csf' ) .'</span>';
209
  echo '<span class="button csf-button-cancel">'. sprintf( '<small>( %s )</small> %s', esc_html__( 'update post for restore ', 'csf' ), esc_html__( 'Cancel', 'csf' ) ) .'</span>';
210
  echo '</label>';
@@ -227,85 +236,87 @@ if( ! class_exists( 'CSF_Comment_Metabox' ) ) {
227
  // save comment metabox
228
  public function save_comment_meta_box( $comment_id ) {
229
 
 
 
 
 
 
230
 
231
- if( ! wp_verify_nonce( csf_get_var( 'csf_comment_metabox_nonce'. $this->unique ), 'csf_comment_metabox_nonce' ) ) {
232
  return $comment_id;
233
  }
234
 
235
- if( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
236
- return $comment_id;
237
- }
238
 
239
- $errors = array();
240
- $request = csf_get_var( $this->unique );
241
 
242
- if( ! empty( $request ) ) {
243
 
244
- // ignore _nonce
245
- if( isset( $request['_nonce'] ) ) {
246
- unset( $request['_nonce'] );
247
- }
 
 
 
 
248
 
249
- // sanitize and validate
250
- $section_key = 1;
251
- foreach( $this->sections as $section ) {
252
 
253
- if( ! empty( $section['fields'] ) ) {
 
 
 
 
254
 
255
- foreach( $section['fields'] as $field ) {
256
 
257
- if( ! empty( $field['id'] ) ) {
258
 
259
- // sanitize
260
- if( ! empty( $field['sanitize'] ) ) {
261
 
262
- $sanitize = $field['sanitize'];
263
- $value_sanitize = isset( $request[$field['id']] ) ? $request[$field['id']] : '';
264
- $request[$field['id']] = call_user_func( $sanitize, $value_sanitize );
265
 
266
  }
267
 
268
- // validate
269
- if( ! empty( $field['validate'] ) ) {
270
 
271
- $validate = $field['validate'];
272
- $value_validate = isset( $request[$field['id']] ) ? $request[$field['id']] : '';
273
- $has_validated = call_user_func( $validate, $value_validate );
274
 
275
- if( ! empty( $has_validated ) ) {
276
 
277
- $errors['sections'][$section_key] = true;
278
- $errors['fields'][$field['id']] = $has_validated;
279
- $request[$field['id']] = $this->get_meta_value( $comment_id, $field );
280
 
281
  }
282
 
283
  }
284
 
285
- // auto sanitize
286
- if( ! isset( $request[$field['id']] ) || is_null( $request[$field['id']] ) ) {
287
- $request[$field['id']] = '';
288
- }
289
-
290
  }
291
 
292
  }
293
 
294
  }
295
 
296
- $section_key++;
 
297
  }
298
 
299
  }
300
 
301
- $request = apply_filters( "csf_{$this->unique}_save", $request, $comment_id, $this );
302
 
303
- do_action( "csf_{$this->unique}_save_before", $request, $comment_id, $this );
304
 
305
- if( empty( $request ) || ! empty( $request['_restore'] ) ) {
306
 
307
- if( $this->args['data_type'] !== 'serialize' ) {
308
- foreach ( $request as $key => $value ) {
309
  delete_comment_meta( $comment_id, $key );
310
  }
311
  } else {
@@ -314,23 +325,23 @@ if( ! class_exists( 'CSF_Comment_Metabox' ) ) {
314
 
315
  } else {
316
 
317
- if( $this->args['data_type'] !== 'serialize' ) {
318
- foreach ( $request as $key => $value ) {
319
  update_comment_meta( $comment_id, $key, $value );
320
  }
321
  } else {
322
- update_comment_meta( $comment_id, $this->unique, $request );
323
  }
324
 
325
- if( ! empty( $errors ) ) {
326
- update_comment_meta( $comment_id, '_csf_errors', $errors );
327
  }
328
 
329
  }
330
 
331
- do_action( "csf_{$this->unique}_saved", $request, $comment_id, $this );
332
 
333
- do_action( "csf_{$this->unique}_save_after", $request, $comment_id, $this );
334
 
335
  }
336
  }
7
  * @version 1.0.0
8
  *
9
  */
10
+ if ( ! class_exists( 'CSF_Comment_Metabox' ) ) {
11
  class CSF_Comment_Metabox extends CSF_Abstract{
12
 
13
  // constans
36
  add_action( 'add_meta_boxes_comment', array( &$this, 'add_comment_meta_box' ) );
37
  add_action( 'edit_comment', array( &$this, 'save_comment_meta_box' ) );
38
 
39
+ if ( ! empty( $this->args['class'] ) ) {
40
  add_filter( 'postbox_classes_comment_'. $this->unique, array( &$this, 'add_comment_metabox_classes' ) );
41
  }
42
 
54
 
55
  $result = array();
56
 
57
+ foreach ( $sections as $key => $section ) {
58
+ if ( ! empty( $section['fields'] ) ) {
59
+ foreach ( $section['fields'] as $field ) {
60
  $result[] = $field;
61
  }
62
  }
67
 
68
  public function add_comment_metabox_classes( $classes ) {
69
 
70
+ if ( ! empty( $this->args['class'] ) ) {
71
  $classes[] = $this->args['class'];
72
  }
73
 
78
  // add comment metabox
79
  public function add_comment_meta_box( $post_type ) {
80
 
81
+ add_meta_box( $this->unique, wp_kses_post( $this->args['title'] ), array( &$this, 'add_comment_meta_box_content' ), 'comment', 'normal', $this->args['priority'], $this->args );
82
 
83
  }
84
 
85
  // get default value
86
  public function get_default( $field ) {
87
 
88
+ $default = ( isset( $field['default'] ) ) ? $field['default'] : '';
89
+ $default = ( isset( $this->args['defaults'][$field['id']] ) ) ? $this->args['defaults'][$field['id']] : $default;
90
 
91
  return $default;
92
 
97
 
98
  $value = null;
99
 
100
+ if ( ! empty( $comment_id ) && ! empty( $field['id'] ) ) {
101
 
102
+ if ( $this->args['data_type'] !== 'serialize' ) {
103
  $meta = get_comment_meta( $comment_id, $field['id'] );
104
  $value = ( isset( $meta[0] ) ) ? $meta[0] : null;
105
  } else {
109
 
110
  }
111
 
112
+ $default = ( isset( $field['id'] ) ) ? $this->get_default( $field ) : '';
113
  $value = ( isset( $value ) ) ? $value : $default;
114
 
115
  return $value;
121
 
122
  $has_nav = ( count( $this->sections ) > 1 ) ? true : false;
123
  $show_all = ( ! $has_nav ) ? ' csf-show-all' : '';
124
+ $errors = ( is_object ( $comment ) ) ? get_comment_meta( $comment->comment_ID, '_csf_errors_'. $this->unique, true ) : array();
125
  $errors = ( ! empty( $errors ) ) ? $errors : array();
126
  $theme = ( $this->args['theme'] ) ? ' csf-theme-'. $this->args['theme'] : '';
127
 
128
+ if ( is_object( $comment ) && ! empty( $errors ) ) {
129
+ delete_comment_meta( $comment->comment_ID, '_csf_errors_'. $this->unique );
130
  }
131
 
132
  wp_nonce_field( 'csf_comment_metabox_nonce', 'csf_comment_metabox_nonce'. $this->unique );
133
 
134
+ echo '<div class="csf csf-comment-metabox'. esc_attr( $theme ) .'">';
135
 
136
+ echo '<div class="csf-wrapper'. esc_attr( $show_all ) .'">';
137
 
138
+ if ( $has_nav ) {
139
 
140
+ echo '<div class="csf-nav csf-nav-metabox" data-unique="'. esc_attr( $this->unique ) .'">';
141
 
142
  echo '<ul>';
143
+
144
  $tab_key = 1;
 
145
 
146
+ foreach ( $this->sections as $section ) {
147
+
148
+ $tab_icon = ( ! empty( $section['icon'] ) ) ? '<i class="csf-tab-icon '. esc_attr( $section['icon'] ) .'"></i>' : '';
149
  $tab_error = ( ! empty( $errors['sections'][$tab_key] ) ) ? '<i class="csf-label-error csf-error">!</i>' : '';
 
150
 
151
+ echo '<li><a href="#" data-section="'. esc_attr( $this->unique .'_'. $tab_key ) .'">'. wp_kses_post( $tab_icon . $section['title'] . $tab_error ) .'</a></li>';
152
 
153
  $tab_key++;
154
+
155
  }
156
+
157
  echo '</ul>';
158
 
159
  echo '</div>';
166
 
167
  $section_key = 1;
168
 
169
+ foreach ( $this->sections as $section ) {
170
 
171
  $onload = ( ! $has_nav ) ? ' csf-onload' : '';
172
 
173
+ echo '<div id="csf-section-'. esc_attr( $this->unique .'_'. $section_key ) .'" class="csf-section'. esc_attr( $onload ) .'">';
174
 
175
+ $section_icon = ( ! empty( $section['icon'] ) ) ? '<i class="csf-section-icon '. esc_attr( $section['icon'] ) .'"></i>' : '';
176
  $section_title = ( ! empty( $section['title'] ) ) ? $section['title'] : '';
177
 
178
+ echo ( $section_title || $section_icon ) ? '<div class="csf-section-title"><h3>'. wp_kses_post( $section_icon . $section_title ) .'</h3></div>' : '';
179
 
180
+ if ( ! empty( $section['fields'] ) ) {
181
 
182
  foreach ( $section['fields'] as $field ) {
183
 
184
+ if ( ! empty( $field['id'] ) && ! empty( $errors['fields'][$field['id']] ) ) {
185
  $field['_error'] = $errors['fields'][$field['id']];
186
  }
187
 
188
+ if ( ! empty( $field['id'] ) ) {
189
+ $field['default'] = $this->get_default( $field );
190
+ }
191
+
192
  CSF::field( $field, $this->get_meta_value( $comment->comment_ID, $field ), $this->unique, 'comment_metabox' );
193
 
194
  }
202
  echo '</div>';
203
 
204
  $section_key++;
205
+
206
  }
207
 
208
  echo '</div>';
209
 
210
  echo '<div class="clear"></div>';
211
 
212
+ if ( ! empty( $this->args['show_restore'] ) ) {
213
 
214
  echo '<div class="csf-restore-wrapper">';
215
  echo '<label>';
216
+ echo '<input type="checkbox" name="'. esc_attr( $this->unique ) .'[_restore]" />';
217
  echo '<span class="button csf-button-restore">'. esc_html__( 'Restore', 'csf' ) .'</span>';
218
  echo '<span class="button csf-button-cancel">'. sprintf( '<small>( %s )</small> %s', esc_html__( 'update post for restore ', 'csf' ), esc_html__( 'Cancel', 'csf' ) ) .'</span>';
219
  echo '</label>';
236
  // save comment metabox
237
  public function save_comment_meta_box( $comment_id ) {
238
 
239
+ $count = 1;
240
+ $data = array();
241
+ $errors = array();
242
+ $noncekey = 'csf_comment_metabox_nonce'. $this->unique;
243
+ $nonce = ( ! empty( $_POST[ $noncekey ] ) ) ? sanitize_text_field( wp_unslash( $_POST[ $noncekey ] ) ) : '';
244
 
245
+ if ( ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) || ! wp_verify_nonce( $nonce, 'csf_comment_metabox_nonce' ) ) {
246
  return $comment_id;
247
  }
248
 
249
+ // XSS ok.
250
+ // No worries, This "POST" requests is sanitizing in the below foreach.
251
+ $request = ( ! empty( $_POST[ $this->unique ] ) ) ? $_POST[ $this->unique ] : array();
252
 
253
+ if ( ! empty( $request ) ) {
 
254
 
255
+ foreach ( $this->sections as $section ) {
256
 
257
+ if ( ! empty( $section['fields'] ) ) {
258
+
259
+ foreach ( $section['fields'] as $field ) {
260
+
261
+ if ( ! empty( $field['id'] ) ) {
262
+
263
+ $field_id = $field['id'];
264
+ $field_value = isset( $request[$field_id] ) ? $request[$field_id] : '';
265
 
266
+ // Sanitize "post" request of field.
267
+ if ( ! isset( $field['sanitize'] ) ) {
 
268
 
269
+ if( is_array( $field_value ) ) {
270
+ $data[$field_id] = wp_kses_post_deep( $field_value );
271
+ } else {
272
+ $data[$field_id] = wp_kses_post( $field_value );
273
+ }
274
 
275
+ } else if( isset( $field['sanitize'] ) && function_exists( $field['sanitize'] ) ) {
276
 
277
+ $data[$field_id] = call_user_func( $field['sanitize'], $field_value );
278
 
279
+ } else {
 
280
 
281
+ $data[$field_id] = $field_value;
 
 
282
 
283
  }
284
 
285
+ // Validate "post" request of field.
286
+ if ( isset( $field['validate'] ) && function_exists( $field['validate'] ) ) {
287
 
288
+ $has_validated = call_user_func( $field['validate'], $field_value );
 
 
289
 
290
+ if ( ! empty( $has_validated ) ) {
291
 
292
+ $errors['sections'][$count] = true;
293
+ $errors['fields'][$field_id] = $has_validated;
294
+ $data[$field_id] = $this->get_meta_value( $comment_id, $field );
295
 
296
  }
297
 
298
  }
299
 
 
 
 
 
 
300
  }
301
 
302
  }
303
 
304
  }
305
 
306
+ $count++;
307
+
308
  }
309
 
310
  }
311
 
312
+ $data = apply_filters( "csf_{$this->unique}_save", $data, $comment_id, $this );
313
 
314
+ do_action( "csf_{$this->unique}_save_before", $data, $comment_id, $this );
315
 
316
+ if ( empty( $data ) || ! empty( $request['_restore'] ) ) {
317
 
318
+ if ( $this->args['data_type'] !== 'serialize' ) {
319
+ foreach ( $data as $key => $value ) {
320
  delete_comment_meta( $comment_id, $key );
321
  }
322
  } else {
325
 
326
  } else {
327
 
328
+ if ( $this->args['data_type'] !== 'serialize' ) {
329
+ foreach ( $data as $key => $value ) {
330
  update_comment_meta( $comment_id, $key, $value );
331
  }
332
  } else {
333
+ update_comment_meta( $comment_id, $this->unique, $data );
334
  }
335
 
336
+ if ( ! empty( $errors ) ) {
337
+ update_comment_meta( $comment_id, '_csf_errors_'. $this->unique, $errors );
338
  }
339
 
340
  }
341
 
342
+ do_action( "csf_{$this->unique}_saved", $data, $comment_id, $this );
343
 
344
+ do_action( "csf_{$this->unique}_save_after", $data, $comment_id, $this );
345
 
346
  }
347
  }
admin/settings/classes/customize-options.class.php CHANGED
@@ -7,7 +7,7 @@
7
  * @version 1.0.0
8
  *
9
  */
10
- if( ! class_exists( 'CSF_Customize_Options' ) ) {
11
  class CSF_Customize_Options extends CSF_Abstract {
12
 
13
  // constans
@@ -44,7 +44,7 @@ if( ! class_exists( 'CSF_Customize_Options' ) ) {
44
  add_action( 'customize_save_after', array( &$this, 'add_customize_save_after' ) );
45
 
46
  // Get options for enqueue actions
47
- if( is_customize_preview() ) {
48
  add_action( 'wp_enqueue_scripts', array( &$this, 'get_options' ) );
49
  }
50
 
@@ -67,8 +67,8 @@ if( ! class_exists( 'CSF_Customize_Options' ) ) {
67
  // get default value
68
  public function get_default( $field ) {
69
 
70
- $default = ( isset( $this->args['defaults'][$field['id']] ) ) ? $this->args['defaults'][$field['id']] : null;
71
- $default = ( isset( $field['default'] ) ) ? $field['default'] : $default;
72
 
73
  return $default;
74
 
@@ -77,13 +77,13 @@ if( ! class_exists( 'CSF_Customize_Options' ) ) {
77
  // get option
78
  public function get_options() {
79
 
80
- if( $this->args['database'] === 'theme_mod' ) {
81
  $this->options = get_theme_mod( $this->unique, array() );
82
  } else {
83
  $this->options = get_option( $this->unique, array() );
84
  }
85
 
86
- if( empty( $this->options ) ) {
87
  $this->options = array();
88
  }
89
 
@@ -96,17 +96,17 @@ if( ! class_exists( 'CSF_Customize_Options' ) ) {
96
 
97
  $tmp_options = $this->options;
98
 
99
- if( ! empty( $this->pre_fields ) ) {
100
- foreach( $this->pre_fields as $field ) {
101
- if( ! empty( $field['id'] ) ) {
102
  $this->options[$field['id']] = ( isset( $this->options[$field['id']] ) ) ? $this->options[$field['id']] : $this->get_default( $field );
103
  }
104
  }
105
  }
106
 
107
- if( $this->args['save_defaults'] && empty( $this->args['show_in_customizer'] ) && empty( $tmp_options ) ) {
108
 
109
- if( $this->args['database'] === 'theme_mod' ) {
110
  set_theme_mod( $this->unique, $this->options );
111
  } else {
112
  update_option( $this->unique, $this->options );
@@ -120,9 +120,9 @@ if( ! class_exists( 'CSF_Customize_Options' ) ) {
120
 
121
  $result = array();
122
 
123
- foreach( $sections as $key => $section ) {
124
- if( ! empty( $section['fields'] ) ) {
125
- foreach( $section['fields'] as $field ) {
126
  $result[] = $field;
127
  }
128
  }
@@ -137,15 +137,15 @@ if( ! class_exists( 'CSF_Customize_Options' ) ) {
137
  $result = array();
138
  $parents = array();
139
 
140
- foreach( $sections as $key => $section ) {
141
- if( ! empty( $section['parent'] ) ) {
142
  $parents[$section['parent']][] = $section;
143
  unset( $sections[$key] );
144
  }
145
  }
146
 
147
- foreach( $sections as $key => $section ) {
148
- if( ! empty( $section['id'] ) && ! empty( $parents[$section['id']] ) ) {
149
  $section['subs'] = $parents[$section['id']];
150
  }
151
  $result[] = $section;
@@ -157,17 +157,17 @@ if( ! class_exists( 'CSF_Customize_Options' ) ) {
157
 
158
  public function add_customize_options( $wp_customize ) {
159
 
160
- if( ! class_exists( 'WP_Customize_Panel_CSF' ) ) {
161
  CSF::include_plugin_file( 'functions/customize.php' );
162
  }
163
 
164
- if( ! empty( $this->sections ) ) {
165
 
166
  $sections = $this->pre_tabs( $this->sections );
167
 
168
- foreach( $sections as $section ) {
169
 
170
- if( ! empty( $section['subs'] ) ) {
171
 
172
  $panel_id = ( isset( $section['id'] ) ) ? $section['id'] : $this->unique .'-panel-'. $this->priority;
173
 
@@ -179,7 +179,7 @@ if( ! class_exists( 'CSF_Customize_Options' ) ) {
179
 
180
  $this->priority++;
181
 
182
- foreach( $section['subs'] as $sub_section ) {
183
 
184
  $section_id = ( isset( $sub_section['id'] ) ) ? $sub_section['id'] : $this->unique .'-section-'. $this->priority;
185
 
@@ -208,41 +208,42 @@ if( ! class_exists( 'CSF_Customize_Options' ) ) {
208
  // add customize section
209
  public function add_section( $wp_customize, $section_id, $section_args, $panel_id ) {
210
 
211
- if( ! empty( $section_args['assign'] ) ) {
212
 
213
  $section_id = $section_args['assign'];
214
 
215
  } else {
216
 
217
  $wp_customize->add_section( new WP_Customize_Section_CSF( $wp_customize, $section_id, array(
218
- 'title' => ( isset( $section_args['title'] ) ) ? $section_args['title'] : null,
219
- 'description' => ( isset( $section_args['description'] ) ) ? $section_args['description'] : null,
220
- 'priority' => ( isset( $section_args['priority'] ) ) ? $section_args['priority'] : null,
221
- 'panel' => ( $panel_id ) ? $panel_id : null,
222
  ) ) );
223
 
224
  }
225
 
226
- if( ! empty( $section_args['fields'] ) ) {
227
 
228
  $field_key = 1;
229
 
230
- foreach( $section_args['fields'] as $field ) {
231
 
232
- if( isset( $field['id'] ) ) {
233
  $field['default'] = $this->get_default( $field );
234
  }
235
 
236
  $field_id = ( isset( $field['id'] ) ) ? $field['id'] : '_nonce-'. $section_id .'-'. $field_key;
237
- $setting_id = $this->unique .'['. $field_id .']';
238
  $setting_args = ( isset( $field['setting_args'] ) ) ? $field['setting_args'] : array();
239
  $control_args = ( isset( $field['control_args'] ) ) ? $field['control_args'] : array();
240
  $field_transport = ( isset( $field['transport'] ) ) ? $field['transport'] : $this->args['transport'];
241
- $field_sanitize = ( isset( $field['sanitize'] ) ) ? $field['sanitize'] : null;
242
- $field_validate = ( isset( $field['validate'] ) ) ? $field['validate'] : null;
243
- $field_default = ( isset( $field['default'] ) ) ? $field['default'] : null;
244
  $has_selective = ( isset( $field['selective_refresh'] ) && isset( $wp_customize->selective_refresh ) ) ? true : false;
245
 
 
 
246
  $wp_customize->add_setting( $setting_id,
247
  wp_parse_args( $setting_args, array(
248
  'default' => $field_default,
@@ -263,7 +264,7 @@ if( ! class_exists( 'CSF_Customize_Options' ) ) {
263
  ) )
264
  ) );
265
 
266
- if( $has_selective ) {
267
  $wp_customize->selective_refresh->add_partial( $setting_id, $field['selective_refresh'] );
268
  }
269
 
7
  * @version 1.0.0
8
  *
9
  */
10
+ if ( ! class_exists( 'CSF_Customize_Options' ) ) {
11
  class CSF_Customize_Options extends CSF_Abstract {
12
 
13
  // constans
44
  add_action( 'customize_save_after', array( &$this, 'add_customize_save_after' ) );
45
 
46
  // Get options for enqueue actions
47
+ if ( is_customize_preview() ) {
48
  add_action( 'wp_enqueue_scripts', array( &$this, 'get_options' ) );
49
  }
50
 
67
  // get default value
68
  public function get_default( $field ) {
69
 
70
+ $default = ( isset( $field['default'] ) ) ? $field['default'] : '';
71
+ $default = ( isset( $this->args['defaults'][$field['id']] ) ) ? $this->args['defaults'][$field['id']] : $default;
72
 
73
  return $default;
74
 
77
  // get option
78
  public function get_options() {
79
 
80
+ if ( $this->args['database'] === 'theme_mod' ) {
81
  $this->options = get_theme_mod( $this->unique, array() );
82
  } else {
83
  $this->options = get_option( $this->unique, array() );
84
  }
85
 
86
+ if ( empty( $this->options ) ) {
87
  $this->options = array();
88
  }
89
 
96
 
97
  $tmp_options = $this->options;
98
 
99
+ if ( ! empty( $this->pre_fields ) ) {
100
+ foreach ( $this->pre_fields as $field ) {
101
+ if ( ! empty( $field['id'] ) ) {
102
  $this->options[$field['id']] = ( isset( $this->options[$field['id']] ) ) ? $this->options[$field['id']] : $this->get_default( $field );
103
  }
104
  }
105
  }
106
 
107
+ if ( $this->args['save_defaults'] && empty( $this->args['show_in_customizer'] ) && empty( $tmp_options ) ) {
108
 
109
+ if ( $this->args['database'] === 'theme_mod' ) {
110
  set_theme_mod( $this->unique, $this->options );
111
  } else {
112
  update_option( $this->unique, $this->options );
120
 
121
  $result = array();
122
 
123
+ foreach ( $sections as $key => $section ) {
124
+ if ( ! empty( $section['fields'] ) ) {
125
+ foreach ( $section['fields'] as $field ) {
126
  $result[] = $field;
127
  }
128
  }
137
  $result = array();
138
  $parents = array();
139
 
140
+ foreach ( $sections as $key => $section ) {
141
+ if ( ! empty( $section['parent'] ) ) {
142
  $parents[$section['parent']][] = $section;
143
  unset( $sections[$key] );
144
  }
145
  }
146
 
147
+ foreach ( $sections as $key => $section ) {
148
+ if ( ! empty( $section['id'] ) && ! empty( $parents[$section['id']] ) ) {
149
  $section['subs'] = $parents[$section['id']];
150
  }
151
  $result[] = $section;
157
 
158
  public function add_customize_options( $wp_customize ) {
159
 
160
+ if ( ! class_exists( 'WP_Customize_Panel_CSF' ) ) {
161
  CSF::include_plugin_file( 'functions/customize.php' );
162
  }
163
 
164
+ if ( ! empty( $this->sections ) ) {
165
 
166
  $sections = $this->pre_tabs( $this->sections );
167
 
168
+ foreach ( $sections as $section ) {
169
 
170
+ if ( ! empty( $section['subs'] ) ) {
171
 
172
  $panel_id = ( isset( $section['id'] ) ) ? $section['id'] : $this->unique .'-panel-'. $this->priority;
173
 
179
 
180
  $this->priority++;
181
 
182
+ foreach ( $section['subs'] as $sub_section ) {
183
 
184
  $section_id = ( isset( $sub_section['id'] ) ) ? $sub_section['id'] : $this->unique .'-section-'. $this->priority;
185
 
208
  // add customize section
209
  public function add_section( $wp_customize, $section_id, $section_args, $panel_id ) {
210
 
211
+ if ( ! empty( $section_args['assign'] ) ) {
212
 
213
  $section_id = $section_args['assign'];
214
 
215
  } else {
216
 
217
  $wp_customize->add_section( new WP_Customize_Section_CSF( $wp_customize, $section_id, array(
218
+ 'title' => ( isset( $section_args['title'] ) ) ? $section_args['title'] : '',
219
+ 'description' => ( isset( $section_args['description'] ) ) ? $section_args['description'] : '',
220
+ 'priority' => ( isset( $section_args['priority'] ) ) ? $section_args['priority'] : '',
221
+ 'panel' => ( $panel_id ) ? $panel_id : '',
222
  ) ) );
223
 
224
  }
225
 
226
+ if ( ! empty( $section_args['fields'] ) ) {
227
 
228
  $field_key = 1;
229
 
230
+ foreach ( $section_args['fields'] as $field ) {
231
 
232
+ if ( isset( $field['id'] ) ) {
233
  $field['default'] = $this->get_default( $field );
234
  }
235
 
236
  $field_id = ( isset( $field['id'] ) ) ? $field['id'] : '_nonce-'. $section_id .'-'. $field_key;
 
237
  $setting_args = ( isset( $field['setting_args'] ) ) ? $field['setting_args'] : array();
238
  $control_args = ( isset( $field['control_args'] ) ) ? $field['control_args'] : array();
239
  $field_transport = ( isset( $field['transport'] ) ) ? $field['transport'] : $this->args['transport'];
240
+ $field_sanitize = ( isset( $field['sanitize'] ) ) ? $field['sanitize'] : '';
241
+ $field_validate = ( isset( $field['validate'] ) ) ? $field['validate'] : '';
242
+ $field_default = ( isset( $field['default'] ) ) ? $field['default'] : '';
243
  $has_selective = ( isset( $field['selective_refresh'] ) && isset( $wp_customize->selective_refresh ) ) ? true : false;
244
 
245
+ $setting_id = $this->unique .'['. $field_id .']';
246
+
247
  $wp_customize->add_setting( $setting_id,
248
  wp_parse_args( $setting_args, array(
249
  'default' => $field_default,
264
  ) )
265
  ) );
266
 
267
+ if ( $has_selective ) {
268
  $wp_customize->selective_refresh->add_partial( $setting_id, $field['selective_refresh'] );
269
  }
270
 
admin/settings/classes/fields.class.php CHANGED
@@ -7,7 +7,7 @@
7
  * @version 1.0.0
8
  *
9
  */
10
- if( ! class_exists( 'CSF_Fields' ) ) {
11
  abstract class CSF_Fields extends CSF_Abstract {
12
 
13
  public function __construct( $field = array(), $value = '', $unique = '', $where = '', $parent = '' ) {
@@ -25,7 +25,7 @@ if( ! class_exists( 'CSF_Fields' ) ) {
25
  $field_name = ( ! empty( $this->field['name'] ) ) ? $this->field['name'] : $unique_id;
26
  $tag_prefix = ( ! empty( $this->field['tag_prefix'] ) ) ? $this->field['tag_prefix'] : '';
27
 
28
- if( ! empty( $tag_prefix ) ) {
29
  $nested_name = str_replace( '[', '['. $tag_prefix, $nested_name );
30
  }
31
 
@@ -38,11 +38,11 @@ if( ! class_exists( 'CSF_Fields' ) ) {
38
  $field_id = ( ! empty( $this->field['id'] ) ) ? $this->field['id'] : '';
39
  $attributes = ( ! empty( $this->field['attributes'] ) ) ? $this->field['attributes'] : array();
40
 
41
- if( ! empty( $field_id ) && empty( $attributes['data-depend-id'] ) ) {
42
  $attributes['data-depend-id'] = $field_id;
43
  }
44
 
45
- if( ! empty( $this->field['placeholder'] ) ) {
46
  $attributes['placeholder'] = $this->field['placeholder'];
47
  }
48
 
@@ -50,12 +50,12 @@ if( ! class_exists( 'CSF_Fields' ) ) {
50
 
51
  $atts = '';
52
 
53
- if( ! empty( $attributes ) ) {
54
- foreach( $attributes as $key => $value ) {
55
- if( $value === 'only-key' ) {
56
- $atts .= ' '. $key;
57
  } else {
58
- $atts .= ' '. $key . '="'. $value .'"';
59
  }
60
  }
61
  }
@@ -65,15 +65,15 @@ if( ! class_exists( 'CSF_Fields' ) ) {
65
  }
66
 
67
  public function field_before() {
68
- return ( ! empty( $this->field['before'] ) ) ? $this->field['before'] : '';
69
  }
70
 
71
  public function field_after() {
72
 
73
- $output = ( ! empty( $this->field['after'] ) ) ? $this->field['after'] : '';
74
- $output .= ( ! empty( $this->field['desc'] ) ) ? '<p class="csf-text-desc">'. $this->field['desc'] .'</p>' : '';
75
- $output .= ( ! empty( $this->field['help'] ) ) ? '<span class="csf-help"><span class="csf-help-text">'. $this->field['help'] .'</span><span class="fa fa-question-circle"></span></span>' : '';
76
- $output .= ( ! empty( $this->field['_error'] ) ) ? '<p class="csf-text-error">'. $this->field['_error'] .'</p>' : '';
77
 
78
  return $output;
79
 
@@ -85,15 +85,15 @@ if( ! class_exists( 'CSF_Fields' ) ) {
85
  $array_search = false;
86
 
87
  // sanitize type name
88
- if( in_array( $type, array( 'page', 'pages' ) ) ) {
89
  $option = 'page';
90
- } else if( in_array( $type, array( 'post', 'posts' ) ) ) {
91
  $option = 'post';
92
- } else if( in_array( $type, array( 'category', 'categories' ) ) ) {
93
  $option = 'category';
94
- } else if( in_array( $type, array( 'tag', 'tags' ) ) ) {
95
  $option = 'post_tag';
96
- } else if( in_array( $type, array( 'menu', 'menus' ) ) ) {
97
  $option = 'nav_menu';
98
  } else {
99
  $option = '';
@@ -108,7 +108,7 @@ if( ! class_exists( 'CSF_Fields' ) ) {
108
  case 'posts':
109
 
110
  // term query required for ajax select
111
- if( ! empty( $term ) ) {
112
 
113
  $query = new WP_Query( wp_parse_args( $query_args, array(
114
  's' => $term,
@@ -126,8 +126,8 @@ if( ! class_exists( 'CSF_Fields' ) ) {
126
 
127
  }
128
 
129
- if( ! is_wp_error( $query ) && ! empty( $query->posts ) ) {
130
- foreach( $query->posts as $item ) {
131
  $options[$item->ID] = $item->post_title;
132
  }
133
  }
@@ -141,7 +141,7 @@ if( ! class_exists( 'CSF_Fields' ) ) {
141
  case 'menu':
142
  case 'menus':
143
 
144
- if( ! empty( $term ) ) {
145
 
146
  $query = new WP_Term_Query( wp_parse_args( $query_args, array(
147
  'search' => $term,
@@ -159,8 +159,8 @@ if( ! class_exists( 'CSF_Fields' ) ) {
159
 
160
  }
161
 
162
- if( ! is_wp_error( $query ) && ! empty( $query->terms ) ) {
163
- foreach( $query->terms as $item ) {
164
  $options[$item->term_id] = $item->name;
165
  }
166
  }
@@ -170,7 +170,7 @@ if( ! class_exists( 'CSF_Fields' ) ) {
170
  case 'user':
171
  case 'users':
172
 
173
- if( ! empty( $term ) ) {
174
 
175
  $query = new WP_User_Query( array(
176
  'search' => '*'. $term .'*',
@@ -186,8 +186,8 @@ if( ! class_exists( 'CSF_Fields' ) ) {
186
 
187
  }
188
 
189
- if( ! is_wp_error( $query ) && ! empty( $query->get_results() ) ) {
190
- foreach( $query->get_results() as $item ) {
191
  $options[$item->ID] = $item->display_name;
192
  }
193
  }
@@ -199,8 +199,8 @@ if( ! class_exists( 'CSF_Fields' ) ) {
199
 
200
  global $wp_registered_sidebars;
201
 
202
- if( ! empty( $wp_registered_sidebars ) ) {
203
- foreach( $wp_registered_sidebars as $sidebar ) {
204
  $options[$sidebar['id']] = $sidebar['name'];
205
  }
206
  }
@@ -214,9 +214,9 @@ if( ! class_exists( 'CSF_Fields' ) ) {
214
 
215
  global $wp_roles;
216
 
217
- if( ! empty( $wp_roles ) ) {
218
- if( ! empty( $wp_roles->roles ) ) {
219
- foreach( $wp_roles->roles as $role_key => $role_value ) {
220
  $options[$role_key] = $role_value['name'];
221
  }
222
  }
@@ -231,8 +231,8 @@ if( ! class_exists( 'CSF_Fields' ) ) {
231
 
232
  $post_types = get_post_types( array( 'show_in_nav_menus' => true ), 'objects' );
233
 
234
- if( ! is_wp_error( $post_types ) && ! empty( $post_types ) ) {
235
- foreach( $post_types as $post_type ) {
236
  $options[$post_type->name] = $post_type->labels->name;
237
  }
238
  }
@@ -243,8 +243,8 @@ if( ! class_exists( 'CSF_Fields' ) ) {
243
 
244
  default:
245
 
246
- if( function_exists( $type ) ) {
247
- if( ! empty( $term ) ) {
248
  $options = call_user_func( $type, $query_args );
249
  } else {
250
  $options = call_user_func( $type, $term, $query_args );
@@ -256,14 +256,14 @@ if( ! class_exists( 'CSF_Fields' ) ) {
256
  }
257
 
258
  // Array search by "term"
259
- if( ! empty( $term ) && ! empty( $options ) && ! empty( $array_search ) ) {
260
  $options = preg_grep( '/'. $term .'/i', $options );
261
  }
262
 
263
  // Make multidimensional array for ajax search
264
- if( ! empty( $term ) && ! empty( $options ) ) {
265
  $arr = array();
266
- foreach( $options as $option_key => $option_value ) {
267
  $arr[] = array( 'value' => $option_key, 'text' => $option_value );
268
  }
269
  $options = $arr;
@@ -277,9 +277,9 @@ if( ! class_exists( 'CSF_Fields' ) ) {
277
 
278
  $options = array();
279
 
280
- if( ! empty( $values ) && is_array( $values ) ) {
281
 
282
- foreach( $values as $value ) {
283
 
284
  switch( $type ) {
285
 
@@ -290,7 +290,7 @@ if( ! class_exists( 'CSF_Fields' ) ) {
290
 
291
  $title = get_the_title( $value );
292
 
293
- if( ! is_wp_error( $title ) && ! empty( $title ) ) {
294
  $options[$value] = $title;
295
  }
296
 
@@ -305,7 +305,7 @@ if( ! class_exists( 'CSF_Fields' ) ) {
305
 
306
  $term = get_term( $value );
307
 
308
- if( ! is_wp_error( $term ) && ! empty( $term ) ) {
309
  $options[$value] = $term->name;
310
  }
311
 
@@ -316,7 +316,7 @@ if( ! class_exists( 'CSF_Fields' ) ) {
316
 
317
  $user = get_user_by( 'id', $value );
318
 
319
- if( ! is_wp_error( $user ) && ! empty( $user ) ) {
320
  $options[$value] = $user->display_name;
321
  }
322
 
@@ -327,7 +327,7 @@ if( ! class_exists( 'CSF_Fields' ) ) {
327
 
328
  global $wp_registered_sidebars;
329
 
330
- if( ! empty( $wp_registered_sidebars[$value] ) ) {
331
  $options[$value] = $wp_registered_sidebars[$value]['name'];
332
  }
333
 
@@ -338,7 +338,7 @@ if( ! class_exists( 'CSF_Fields' ) ) {
338
 
339
  global $wp_roles;
340
 
341
- if( ! empty( $wp_roles ) && ! empty( $wp_roles->roles ) && ! empty( $wp_roles->roles[$value] ) ) {
342
  $options[$value] = $wp_roles->roles[$value]['name'];
343
  }
344
 
@@ -349,7 +349,7 @@ if( ! class_exists( 'CSF_Fields' ) ) {
349
 
350
  $post_types = get_post_types( array( 'show_in_nav_menus' => true ) );
351
 
352
- if( ! is_wp_error( $post_types ) && ! empty( $post_types ) && ! empty( $post_types[$value] ) ) {
353
  $options[$value] = ucfirst( $value );
354
  }
355
 
@@ -357,7 +357,7 @@ if( ! class_exists( 'CSF_Fields' ) ) {
357
 
358
  default:
359
 
360
- if( function_exists( $type .'_title' ) ) {
361
  $options[$value] = call_user_func( $type .'_title', $value );
362
  } else {
363
  $options[$value] = ucfirst( $value );
7
  * @version 1.0.0
8
  *
9
  */
10
+ if ( ! class_exists( 'CSF_Fields' ) ) {
11
  abstract class CSF_Fields extends CSF_Abstract {
12
 
13
  public function __construct( $field = array(), $value = '', $unique = '', $where = '', $parent = '' ) {
25
  $field_name = ( ! empty( $this->field['name'] ) ) ? $this->field['name'] : $unique_id;
26
  $tag_prefix = ( ! empty( $this->field['tag_prefix'] ) ) ? $this->field['tag_prefix'] : '';
27
 
28
+ if ( ! empty( $tag_prefix ) ) {
29
  $nested_name = str_replace( '[', '['. $tag_prefix, $nested_name );
30
  }
31
 
38
  $field_id = ( ! empty( $this->field['id'] ) ) ? $this->field['id'] : '';
39
  $attributes = ( ! empty( $this->field['attributes'] ) ) ? $this->field['attributes'] : array();
40
 
41
+ if ( ! empty( $field_id ) && empty( $attributes['data-depend-id'] ) ) {
42
  $attributes['data-depend-id'] = $field_id;
43
  }
44
 
45
+ if ( ! empty( $this->field['placeholder'] ) ) {
46
  $attributes['placeholder'] = $this->field['placeholder'];
47
  }
48
 
50
 
51
  $atts = '';
52
 
53
+ if ( ! empty( $attributes ) ) {
54
+ foreach ( $attributes as $key => $value ) {
55
+ if ( $value === 'only-key' ) {
56
+ $atts .= ' '. esc_attr( $key );
57
  } else {
58
+ $atts .= ' '. esc_attr( $key ) . '="'. esc_attr( $value ) .'"';
59
  }
60
  }
61
  }
65
  }
66
 
67
  public function field_before() {
68
+ return ( ! empty( $this->field['before'] ) ) ? wp_kses_post( $this->field['before'] ) : '';
69
  }
70
 
71
  public function field_after() {
72
 
73
+ $output = ( ! empty( $this->field['after'] ) ) ? wp_kses_post( $this->field['after'] ) : '';
74
+ $output .= ( ! empty( $this->field['desc'] ) ) ? '<div class="clear"></div><div class="csf-text-desc">'. wp_kses_post( $this->field['desc'] ) .'</div>' : '';
75
+ $output .= ( ! empty( $this->field['help'] ) ) ? '<div class="csf-help"><span class="csf-help-text">'. wp_kses_post( $this->field['help'] ) .'</span><i class="fas fa-question-circle"></i></div>' : '';
76
+ $output .= ( ! empty( $this->field['_error'] ) ) ? '<div class="csf-text-error">'. wp_kses_post( $this->field['_error'] ) .'</div>' : '';
77
 
78
  return $output;
79
 
85
  $array_search = false;
86
 
87
  // sanitize type name
88
+ if ( in_array( $type, array( 'page', 'pages' ) ) ) {
89
  $option = 'page';
90
+ } else if ( in_array( $type, array( 'post', 'posts' ) ) ) {
91
  $option = 'post';
92
+ } else if ( in_array( $type, array( 'category', 'categories' ) ) ) {
93
  $option = 'category';
94
+ } else if ( in_array( $type, array( 'tag', 'tags' ) ) ) {
95
  $option = 'post_tag';
96
+ } else if ( in_array( $type, array( 'menu', 'menus' ) ) ) {
97
  $option = 'nav_menu';
98
  } else {
99
  $option = '';
108
  case 'posts':
109
 
110
  // term query required for ajax select
111
+ if ( ! empty( $term ) ) {
112
 
113
  $query = new WP_Query( wp_parse_args( $query_args, array(
114
  's' => $term,
126
 
127
  }
128
 
129
+ if ( ! is_wp_error( $query ) && ! empty( $query->posts ) ) {
130
+ foreach ( $query->posts as $item ) {
131
  $options[$item->ID] = $item->post_title;
132
  }
133
  }
141
  case 'menu':
142
  case 'menus':
143
 
144
+ if ( ! empty( $term ) ) {
145
 
146
  $query = new WP_Term_Query( wp_parse_args( $query_args, array(
147
  'search' => $term,
159
 
160
  }
161
 
162
+ if ( ! is_wp_error( $query ) && ! empty( $query->terms ) ) {
163
+ foreach ( $query->terms as $item ) {
164
  $options[$item->term_id] = $item->name;
165
  }
166
  }
170
  case 'user':
171
  case 'users':
172
 
173
+ if ( ! empty( $term ) ) {
174
 
175
  $query = new WP_User_Query( array(
176
  'search' => '*'. $term .'*',
186
 
187
  }
188
 
189
+ if ( ! is_wp_error( $query ) && ! empty( $query->get_results() ) ) {
190
+ foreach ( $query->get_results() as $item ) {
191
  $options[$item->ID] = $item->display_name;
192
  }
193
  }
199
 
200
  global $wp_registered_sidebars;
201
 
202
+ if ( ! empty( $wp_registered_sidebars ) ) {
203
+ foreach ( $wp_registered_sidebars as $sidebar ) {
204
  $options[$sidebar['id']] = $sidebar['name'];
205
  }
206
  }
214
 
215
  global $wp_roles;
216
 
217
+ if ( ! empty( $wp_roles ) ) {
218
+ if ( ! empty( $wp_roles->roles ) ) {
219
+ foreach ( $wp_roles->roles as $role_key => $role_value ) {
220
  $options[$role_key] = $role_value['name'];
221
  }
222
  }
231
 
232
  $post_types = get_post_types( array( 'show_in_nav_menus' => true ), 'objects' );
233
 
234
+ if ( ! is_wp_error( $post_types ) && ! empty( $post_types ) ) {
235
+ foreach ( $post_types as $post_type ) {
236
  $options[$post_type->name] = $post_type->labels->name;
237
  }
238
  }
243
 
244
  default:
245
 
246
+ if ( function_exists( $type ) ) {
247
+ if ( ! empty( $term ) ) {
248
  $options = call_user_func( $type, $query_args );
249
  } else {
250
  $options = call_user_func( $type, $term, $query_args );
256
  }
257
 
258
  // Array search by "term"
259
+ if ( ! empty( $term ) && ! empty( $options ) && ! empty( $array_search ) ) {
260
  $options = preg_grep( '/'. $term .'/i', $options );
261
  }
262
 
263
  // Make multidimensional array for ajax search
264
+ if ( ! empty( $term ) && ! empty( $options ) ) {
265
  $arr = array();
266
+ foreach ( $options as $option_key => $option_value ) {
267
  $arr[] = array( 'value' => $option_key, 'text' => $option_value );
268
  }
269
  $options = $arr;
277
 
278
  $options = array();
279
 
280
+ if ( ! empty( $values ) && is_array( $values ) ) {
281
 
282
+ foreach ( $values as $value ) {
283
 
284
  switch( $type ) {
285
 
290
 
291
  $title = get_the_title( $value );
292
 
293
+ if ( ! is_wp_error( $title ) && ! empty( $title ) ) {
294
  $options[$value] = $title;
295
  }
296
 
305
 
306
  $term = get_term( $value );
307
 
308
+ if ( ! is_wp_error( $term ) && ! empty( $term ) ) {
309
  $options[$value] = $term->name;
310
  }
311
 
316
 
317
  $user = get_user_by( 'id', $value );
318
 
319
+ if ( ! is_wp_error( $user ) && ! empty( $user ) ) {
320
  $options[$value] = $user->display_name;
321
  }
322
 
327
 
328
  global $wp_registered_sidebars;
329
 
330
+ if ( ! empty( $wp_registered_sidebars[$value] ) ) {
331
  $options[$value] = $wp_registered_sidebars[$value]['name'];
332
  }
333
 
338
 
339
  global $wp_roles;
340
 
341
+ if ( ! empty( $wp_roles ) && ! empty( $wp_roles->roles ) && ! empty( $wp_roles->roles[$value] ) ) {
342
  $options[$value] = $wp_roles->roles[$value]['name'];
343
  }
344
 
349
 
350
  $post_types = get_post_types( array( 'show_in_nav_menus' => true ) );
351
 
352
+ if ( ! is_wp_error( $post_types ) && ! empty( $post_types ) && ! empty( $post_types[$value] ) ) {
353
  $options[$value] = ucfirst( $value );
354
  }
355
 
357
 
358
  default:
359
 
360
+ if ( function_exists( $type .'_title' ) ) {
361
  $options[$value] = call_user_func( $type .'_title', $value );
362
  } else {
363
  $options[$value] = ucfirst( $value );
admin/settings/classes/metabox.class.php CHANGED
@@ -7,7 +7,7 @@
7
  * @version 1.0.0
8
  *
9
  */
10
- if( ! class_exists( 'CSF_Metabox' ) ) {
11
  class CSF_Metabox extends CSF_Abstract{
12
 
13
  // constans
@@ -49,8 +49,8 @@ if( ! class_exists( 'CSF_Metabox' ) ) {
49
  add_action( 'save_post', array( &$this, 'save_meta_box' ) );
50
  add_action( 'edit_attachment', array( &$this, 'save_meta_box' ) );
51
 
52
- if( ! empty( $this->page_templates ) || ! empty( $this->post_formats ) || ! empty( $this->args['class'] ) ) {
53
- foreach( $this->post_type as $post_type ) {
54
  add_filter( 'postbox_classes_'. $post_type .'_'. $this->unique, array( &$this, 'add_metabox_classes' ) );
55
  }
56
  }
@@ -69,9 +69,9 @@ if( ! class_exists( 'CSF_Metabox' ) ) {
69
 
70
  $result = array();
71
 
72
- foreach( $sections as $key => $section ) {
73
- if( ! empty( $section['fields'] ) ) {
74
- foreach( $section['fields'] as $field ) {
75
  $result[] = $field;
76
  }
77
  }
@@ -84,7 +84,7 @@ if( ! class_exists( 'CSF_Metabox' ) ) {
84
 
85
  global $post;
86
 
87
- if( ! empty( $this->post_formats ) ) {
88
 
89
  $saved_post_format = ( is_object( $post ) ) ? get_post_format( $post ) : false;
90
  $saved_post_format = ( ! empty( $saved_post_format ) ) ? $saved_post_format : 'default';
@@ -92,15 +92,15 @@ if( ! class_exists( 'CSF_Metabox' ) ) {
92
  $classes[] = 'csf-post-formats';
93
 
94
  // Sanitize post format for standard to default
95
- if( ( $key = array_search( 'standard', $this->post_formats ) ) !== false ) {
96
  $this->post_formats[$key] = 'default';
97
  }
98
 
99
- foreach( $this->post_formats as $format ) {
100
  $classes[] = 'csf-post-format-'. $format;
101
  }
102
 
103
- if( ! in_array( $saved_post_format, $this->post_formats ) ) {
104
  $classes[] = 'csf-hide';
105
  } else {
106
  $classes[] = 'csf-show';
@@ -108,17 +108,17 @@ if( ! class_exists( 'CSF_Metabox' ) ) {
108
 
109
  }
110
 
111
- if( ! empty( $this->page_templates ) ) {
112
 
113
  $saved_template = ( is_object( $post ) && ! empty( $post->page_template ) ) ? $post->page_template : 'default';
114
 
115
  $classes[] = 'csf-page-templates';
116
 
117
- foreach( $this->page_templates as $template ) {
118
  $classes[] = 'csf-page-'. preg_replace( '/[^a-zA-Z0-9]+/', '-', strtolower( $template ) );
119
  }
120
 
121
- if( ! in_array( $saved_template, $this->page_templates ) ) {
122
  $classes[] = 'csf-hide';
123
  } else {
124
  $classes[] = 'csf-show';
@@ -126,7 +126,7 @@ if( ! class_exists( 'CSF_Metabox' ) ) {
126
 
127
  }
128
 
129
- if( ! empty( $this->args['class'] ) ) {
130
  $classes[] = $this->args['class'];
131
  }
132
 
@@ -137,8 +137,8 @@ if( ! class_exists( 'CSF_Metabox' ) ) {
137
  // add metabox
138
  public function add_meta_box( $post_type ) {
139
 
140
- if( ! in_array( $post_type, $this->args['exclude_post_types'] ) ) {
141
- add_meta_box( $this->unique, $this->args['title'], array( &$this, 'add_meta_box_content' ), $this->post_type, $this->args['context'], $this->args['priority'], $this->args );
142
  }
143
 
144
  }
@@ -146,8 +146,8 @@ if( ! class_exists( 'CSF_Metabox' ) ) {
146
  // get default value
147
  public function get_default( $field ) {
148
 
149
- $default = ( isset( $field['id'] ) && isset( $this->args['defaults'][$field['id']] ) ) ? $this->args['defaults'][$field['id']] : null;
150
- $default = ( isset( $field['default'] ) ) ? $field['default'] : $default;
151
 
152
  return $default;
153
 
@@ -160,9 +160,9 @@ if( ! class_exists( 'CSF_Metabox' ) ) {
160
 
161
  $value = null;
162
 
163
- if( is_object( $post ) && ! empty( $field['id'] ) ) {
164
 
165
- if( $this->args['data_type'] !== 'serialize' ) {
166
  $meta = get_post_meta( $post->ID, $field['id'] );
167
  $value = ( isset( $meta[0] ) ) ? $meta[0] : null;
168
  } else {
@@ -172,7 +172,7 @@ if( ! class_exists( 'CSF_Metabox' ) ) {
172
 
173
  }
174
 
175
- $default = $this->get_default( $field );
176
  $value = ( isset( $value ) ) ? $value : $default;
177
 
178
  return $value;
@@ -186,32 +186,32 @@ if( ! class_exists( 'CSF_Metabox' ) ) {
186
 
187
  $has_nav = ( count( $this->sections ) > 1 && $this->args['context'] !== 'side' ) ? true : false;
188
  $show_all = ( ! $has_nav ) ? ' csf-show-all' : '';
189
- $errors = ( is_object ( $post ) ) ? get_post_meta( $post->ID, '_csf_errors', true ) : array();
190
  $errors = ( ! empty( $errors ) ) ? $errors : array();
191
  $theme = ( $this->args['theme'] ) ? ' csf-theme-'. $this->args['theme'] : '';
192
 
193
- if( is_object ( $post ) && ! empty( $errors ) ) {
194
- delete_post_meta( $post->ID, '_csf_errors' );
195
  }
196
 
197
  wp_nonce_field( 'csf_metabox_nonce', 'csf_metabox_nonce'. $this->unique );
198
 
199
- echo '<div class="csf csf-metabox'. $theme .'">';
200
 
201
- echo '<div class="csf-wrapper'. $show_all .'">';
202
 
203
- if( $has_nav ) {
204
 
205
- echo '<div class="csf-nav csf-nav-metabox" data-unique="'. $this->unique .'">';
206
 
207
  echo '<ul>';
208
  $tab_key = 1;
209
- foreach( $this->sections as $section ) {
210
 
211
  $tab_error = ( ! empty( $errors['sections'][$tab_key] ) ) ? '<i class="csf-label-error csf-error">!</i>' : '';
212
- $tab_icon = ( ! empty( $section['icon'] ) ) ? '<i class="csf-icon '. $section['icon'] .'"></i>' : '';
213
 
214
- echo '<li><a href="#" data-section="'. $this->unique .'_'. $tab_key .'">'. $tab_icon . $section['title'] . $tab_error .'</a></li>';
215
 
216
  $tab_key++;
217
  }
@@ -225,27 +225,31 @@ if( ! class_exists( 'CSF_Metabox' ) ) {
225
 
226
  echo '<div class="csf-sections">';
227
 
228
- $section_key = 1;
229
 
230
- foreach( $this->sections as $section ) {
231
 
232
  $onload = ( ! $has_nav ) ? ' csf-onload' : '';
233
 
234
- echo '<div id="csf-section-'. $this->unique .'_'. $section_key .'" class="csf-section'. $onload .'">';
235
 
236
- $section_icon = ( ! empty( $section['icon'] ) ) ? '<i class="csf-icon '. $section['icon'] .'"></i>' : '';
237
  $section_title = ( ! empty( $section['title'] ) ) ? $section['title'] : '';
238
 
239
- echo ( $section_title || $section_icon ) ? '<div class="csf-section-title"><h3>'. $section_icon . $section_title .'</h3></div>' : '';
240
 
241
- if( ! empty( $section['fields'] ) ) {
242
 
243
  foreach ( $section['fields'] as $field ) {
244
 
245
- if( ! empty( $field['id'] ) && ! empty( $errors['fields'][$field['id']] ) ) {
246
  $field['_error'] = $errors['fields'][$field['id']];
247
  }
248
 
 
 
 
 
249
  CSF::field( $field, $this->get_meta_value( $field ), $this->unique, 'metabox' );
250
 
251
  }
@@ -258,18 +262,19 @@ if( ! class_exists( 'CSF_Metabox' ) ) {
258
 
259
  echo '</div>';
260
 
261
- $section_key++;
 
262
  }
263
 
264
  echo '</div>';
265
 
266
  echo '<div class="clear"></div>';
267
 
268
- if( ! empty( $this->args['show_restore'] ) ) {
269
 
270
  echo '<div class="csf-restore-wrapper">';
271
  echo '<label>';
272
- echo '<input type="checkbox" name="'. $this->unique .'[_restore]" />';
273
  echo '<span class="button csf-button-restore">'. esc_html__( 'Restore', 'csf' ) .'</span>';
274
  echo '<span class="button csf-button-cancel">'. sprintf( '<small>( %s )</small> %s', esc_html__( 'update post for restore ', 'csf' ), esc_html__( 'Cancel', 'csf' ) ) .'</span>';
275
  echo '</label>';
@@ -292,84 +297,87 @@ if( ! class_exists( 'CSF_Metabox' ) ) {
292
  // save metabox
293
  public function save_meta_box( $post_id ) {
294
 
295
- if( ! wp_verify_nonce( csf_get_var( 'csf_metabox_nonce'. $this->unique ), 'csf_metabox_nonce' ) ) {
296
- return $post_id;
297
- }
 
 
298
 
299
- if( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
300
  return $post_id;
301
  }
302
 
303
- $errors = array();
304
- $request = csf_get_var( $this->unique );
 
305
 
306
- if( ! empty( $request ) ) {
307
 
308
- // ignore _nonce
309
- if( isset( $request['_nonce'] ) ) {
310
- unset( $request['_nonce'] );
311
- }
312
 
313
- // sanitize and validate
314
- $section_key = 1;
315
- foreach( $this->sections as $section ) {
316
 
317
- if( ! empty( $section['fields'] ) ) {
318
 
319
- foreach( $section['fields'] as $field ) {
 
320
 
321
- if( ! empty( $field['id'] ) ) {
 
322
 
323
- // sanitize
324
- if( ! empty( $field['sanitize'] ) ) {
 
 
 
 
 
 
 
 
 
325
 
326
- $sanitize = $field['sanitize'];
327
- $value_sanitize = isset( $request[$field['id']] ) ? $request[$field['id']] : '';
328
- $request[$field['id']] = call_user_func( $sanitize, $value_sanitize );
329
 
330
  }
331
 
332
- // validate
333
- if( ! empty( $field['validate'] ) ) {
334
 
335
- $validate = $field['validate'];
336
- $value_validate = isset( $request[$field['id']] ) ? $request[$field['id']] : '';
337
- $has_validated = call_user_func( $validate, $value_validate );
338
 
339
- if( ! empty( $has_validated ) ) {
340
 
341
- $errors['sections'][$section_key] = true;
342
- $errors['fields'][$field['id']] = $has_validated;
343
- $request[$field['id']] = $this->get_meta_value( $field );
344
 
345
  }
346
 
347
  }
348
 
349
- // auto sanitize
350
- if( ! isset( $request[$field['id']] ) || is_null( $request[$field['id']] ) ) {
351
- $request[$field['id']] = '';
352
- }
353
-
354
  }
355
 
356
  }
357
 
358
  }
359
 
360
- $section_key++;
 
361
  }
362
 
363
  }
364
 
365
- $request = apply_filters( "csf_{$this->unique}_save", $request, $post_id, $this );
366
 
367
- do_action( "csf_{$this->unique}_save_before", $request, $post_id, $this );
368
 
369
- if( empty( $request ) || ! empty( $request['_restore'] ) ) {
370
 
371
- if( $this->args['data_type'] !== 'serialize' ) {
372
- foreach ( $request as $key => $value ) {
373
  delete_post_meta( $post_id, $key );
374
  }
375
  } else {
@@ -378,23 +386,23 @@ if( ! class_exists( 'CSF_Metabox' ) ) {
378
 
379
  } else {
380
 
381
- if( $this->args['data_type'] !== 'serialize' ) {
382
- foreach ( $request as $key => $value ) {
383
  update_post_meta( $post_id, $key, $value );
384
  }
385
  } else {
386
- update_post_meta( $post_id, $this->unique, $request );
387
  }
388
 
389
- if( ! empty( $errors ) ) {
390
- update_post_meta( $post_id, '_csf_errors', $errors );
391
  }
392
 
393
  }
394
 
395
- do_action( "csf_{$this->unique}_saved", $request, $post_id, $this );
396
 
397
- do_action( "csf_{$this->unique}_save_after", $request, $post_id, $this );
398
 
399
  }
400
  }
7
  * @version 1.0.0
8
  *
9
  */
10
+ if ( ! class_exists( 'CSF_Metabox' ) ) {
11
  class CSF_Metabox extends CSF_Abstract{
12
 
13
  // constans
49
  add_action( 'save_post', array( &$this, 'save_meta_box' ) );
50
  add_action( 'edit_attachment', array( &$this, 'save_meta_box' ) );
51
 
52
+ if ( ! empty( $this->page_templates ) || ! empty( $this->post_formats ) || ! empty( $this->args['class'] ) ) {
53
+ foreach ( $this->post_type as $post_type ) {
54
  add_filter( 'postbox_classes_'. $post_type .'_'. $this->unique, array( &$this, 'add_metabox_classes' ) );
55
  }
56
  }
69
 
70
  $result = array();
71
 
72
+ foreach ( $sections as $key => $section ) {
73
+ if ( ! empty( $section['fields'] ) ) {
74
+ foreach ( $section['fields'] as $field ) {
75
  $result[] = $field;
76
  }
77
  }
84
 
85
  global $post;
86
 
87
+ if ( ! empty( $this->post_formats ) ) {
88
 
89
  $saved_post_format = ( is_object( $post ) ) ? get_post_format( $post ) : false;
90
  $saved_post_format = ( ! empty( $saved_post_format ) ) ? $saved_post_format : 'default';
92
  $classes[] = 'csf-post-formats';
93
 
94
  // Sanitize post format for standard to default
95
+ if ( ( $key = array_search( 'standard', $this->post_formats ) ) !== false ) {
96
  $this->post_formats[$key] = 'default';
97
  }
98
 
99
+ foreach ( $this->post_formats as $format ) {
100
  $classes[] = 'csf-post-format-'. $format;
101
  }
102
 
103
+ if ( ! in_array( $saved_post_format, $this->post_formats ) ) {
104
  $classes[] = 'csf-hide';
105
  } else {
106
  $classes[] = 'csf-show';
108
 
109
  }
110
 
111
+ if ( ! empty( $this->page_templates ) ) {
112
 
113
  $saved_template = ( is_object( $post ) && ! empty( $post->page_template ) ) ? $post->page_template : 'default';
114
 
115
  $classes[] = 'csf-page-templates';
116
 
117
+ foreach ( $this->page_templates as $template ) {
118
  $classes[] = 'csf-page-'. preg_replace( '/[^a-zA-Z0-9]+/', '-', strtolower( $template ) );
119
  }
120
 
121
+ if ( ! in_array( $saved_template, $this->page_templates ) ) {
122
  $classes[] = 'csf-hide';
123
  } else {
124
  $classes[] = 'csf-show';
126
 
127
  }
128
 
129
+ if ( ! empty( $this->args['class'] ) ) {
130
  $classes[] = $this->args['class'];
131
  }
132
 
137
  // add metabox
138
  public function add_meta_box( $post_type ) {
139
 
140
+ if ( ! in_array( $post_type, $this->args['exclude_post_types'] ) ) {
141
+ add_meta_box( $this->unique, wp_kses_post( $this->args['title'] ), array( &$this, 'add_meta_box_content' ), $this->post_type, $this->args['context'], $this->args['priority'], $this->args );
142
  }
143
 
144
  }
146
  // get default value
147
  public function get_default( $field ) {
148
 
149
+ $default = ( isset( $field['default'] ) ) ? $field['default'] : '';
150
+ $default = ( isset( $this->args['defaults'][$field['id']] ) ) ? $this->args['defaults'][$field['id']] : $default;
151
 
152
  return $default;
153
 
160
 
161
  $value = null;
162
 
163
+ if ( is_object( $post ) && ! empty( $field['id'] ) ) {
164
 
165
+ if ( $this->args['data_type'] !== 'serialize' ) {
166
  $meta = get_post_meta( $post->ID, $field['id'] );
167
  $value = ( isset( $meta[0] ) ) ? $meta[0] : null;
168
  } else {
172
 
173
  }
174
 
175
+ $default = ( isset( $field['id'] ) ) ? $this->get_default( $field ) : '';
176
  $value = ( isset( $value ) ) ? $value : $default;
177
 
178
  return $value;
186
 
187
  $has_nav = ( count( $this->sections ) > 1 && $this->args['context'] !== 'side' ) ? true : false;
188
  $show_all = ( ! $has_nav ) ? ' csf-show-all' : '';
189
+ $errors = ( is_object ( $post ) ) ? get_post_meta( $post->ID, '_csf_errors_'. $this->unique, true ) : array();
190
  $errors = ( ! empty( $errors ) ) ? $errors : array();
191
  $theme = ( $this->args['theme'] ) ? ' csf-theme-'. $this->args['theme'] : '';
192
 
193
+ if ( is_object ( $post ) && ! empty( $errors ) ) {
194
+ delete_post_meta( $post->ID, '_csf_errors_'. $this->unique );
195
  }
196
 
197
  wp_nonce_field( 'csf_metabox_nonce', 'csf_metabox_nonce'. $this->unique );
198
 
199
+ echo '<div class="csf csf-metabox'. esc_attr( $theme ) .'">';
200
 
201
+ echo '<div class="csf-wrapper'. esc_attr( $show_all ) .'">';
202
 
203
+ if ( $has_nav ) {
204
 
205
+ echo '<div class="csf-nav csf-nav-metabox" data-unique="'. esc_attr( $this->unique ) .'">';
206
 
207
  echo '<ul>';
208
  $tab_key = 1;
209
+ foreach ( $this->sections as $section ) {
210
 
211
  $tab_error = ( ! empty( $errors['sections'][$tab_key] ) ) ? '<i class="csf-label-error csf-error">!</i>' : '';
212
+ $tab_icon = ( ! empty( $section['icon'] ) ) ? '<i class="csf-tab-icon '. esc_attr( $section['icon'] ) .'"></i>' : '';
213
 
214
+ echo '<li><a href="#" data-section="'. esc_attr( $this->unique .'_'. $tab_key ) .'">'. wp_kses_post( $tab_icon . $section['title'] . $tab_error ) .'</a></li>';
215
 
216
  $tab_key++;
217
  }
225
 
226
  echo '<div class="csf-sections">';
227
 
228
+ $count = 1;
229
 
230
+ foreach ( $this->sections as $section ) {
231
 
232
  $onload = ( ! $has_nav ) ? ' csf-onload' : '';
233
 
234
+ echo '<div id="csf-section-'. esc_attr( $this->unique .'_'. $count ) .'" class="csf-section'. esc_attr( $onload ) .'">';
235
 
236
+ $section_icon = ( ! empty( $section['icon'] ) ) ? '<i class="csf-section-icon '. esc_attr( $section['icon'] ) .'"></i>' : '';
237
  $section_title = ( ! empty( $section['title'] ) ) ? $section['title'] : '';
238
 
239
+ echo ( $section_title || $section_icon ) ? '<div class="csf-section-title"><h3>'. wp_kses_post( $section_icon . $section_title ) .'</h3></div>' : '';
240
 
241
+ if ( ! empty( $section['fields'] ) ) {
242
 
243
  foreach ( $section['fields'] as $field ) {
244
 
245
+ if ( ! empty( $field['id'] ) && ! empty( $errors['fields'][$field['id']] ) ) {
246
  $field['_error'] = $errors['fields'][$field['id']];
247
  }
248
 
249
+ if ( ! empty( $field['id'] ) ) {
250
+ $field['default'] = $this->get_default( $field );
251
+ }
252
+
253
  CSF::field( $field, $this->get_meta_value( $field ), $this->unique, 'metabox' );
254
 
255
  }
262
 
263
  echo '</div>';
264
 
265
+ $count++;
266
+
267
  }
268
 
269
  echo '</div>';
270
 
271
  echo '<div class="clear"></div>';
272
 
273
+ if ( ! empty( $this->args['show_restore'] ) ) {
274
 
275
  echo '<div class="csf-restore-wrapper">';
276
  echo '<label>';
277
+ echo '<input type="checkbox" name="'. esc_attr( $this->unique ) .'[_restore]" />';
278
  echo '<span class="button csf-button-restore">'. esc_html__( 'Restore', 'csf' ) .'</span>';
279
  echo '<span class="button csf-button-cancel">'. sprintf( '<small>( %s )</small> %s', esc_html__( 'update post for restore ', 'csf' ), esc_html__( 'Cancel', 'csf' ) ) .'</span>';
280
  echo '</label>';
297
  // save metabox
298
  public function save_meta_box( $post_id ) {
299
 
300
+ $count = 1;
301
+ $data = array();
302
+ $errors = array();
303
+ $noncekey = 'csf_metabox_nonce'. $this->unique;
304
+ $nonce = ( ! empty( $_POST[ $noncekey ] ) ) ? sanitize_text_field( wp_unslash( $_POST[ $noncekey ] ) ) : '';
305
 
306
+ if ( ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) || ! wp_verify_nonce( $nonce, 'csf_metabox_nonce' ) ) {
307
  return $post_id;
308
  }
309
 
310
+ // XSS ok.
311
+ // No worries, This "POST" requests is sanitizing in the below foreach.
312
+ $request = ( ! empty( $_POST[ $this->unique ] ) ) ? $_POST[ $this->unique ] : array();
313
 
314
+ if ( ! empty( $request ) ) {
315
 
316
+ foreach ( $this->sections as $section ) {
317
+
318
+ if ( ! empty( $section['fields'] ) ) {
 
319
 
320
+ foreach ( $section['fields'] as $field ) {
 
 
321
 
322
+ if ( ! empty( $field['id'] ) ) {
323
 
324
+ $field_id = $field['id'];
325
+ $field_value = isset( $request[$field_id] ) ? $request[$field_id] : '';
326
 
327
+ // Sanitize "post" request of field.
328
+ if ( ! isset( $field['sanitize'] ) ) {
329
 
330
+ if( is_array( $field_value ) ) {
331
+ $data[$field_id] = wp_kses_post_deep( $field_value );
332
+ } else {
333
+ $data[$field_id] = wp_kses_post( $field_value );
334
+ }
335
+
336
+ } else if( isset( $field['sanitize'] ) && function_exists( $field['sanitize'] ) ) {
337
+
338
+ $data[$field_id] = call_user_func( $field['sanitize'], $field_value );
339
+
340
+ } else {
341
 
342
+ $data[$field_id] = $field_value;
 
 
343
 
344
  }
345
 
346
+ // Validate "post" request of field.
347
+ if ( isset( $field['validate'] ) && function_exists( $field['validate'] ) ) {
348
 
349
+ $has_validated = call_user_func( $field['validate'], $field_value );
 
 
350
 
351
+ if ( ! empty( $has_validated ) ) {
352
 
353
+ $errors['sections'][$count] = true;
354
+ $errors['fields'][$field_id] = $has_validated;
355
+ $data[$field_id] = $this->get_meta_value( $field );
356
 
357
  }
358
 
359
  }
360
 
 
 
 
 
 
361
  }
362
 
363
  }
364
 
365
  }
366
 
367
+ $count++;
368
+
369
  }
370
 
371
  }
372
 
373
+ $data = apply_filters( "csf_{$this->unique}_save", $data, $post_id, $this );
374
 
375
+ do_action( "csf_{$this->unique}_save_before", $data, $post_id, $this );
376
 
377
+ if ( empty( $data ) || ! empty( $request['_restore'] ) ) {
378
 
379
+ if ( $this->args['data_type'] !== 'serialize' ) {
380
+ foreach ( $data as $key => $value ) {
381
  delete_post_meta( $post_id, $key );
382
  }
383
  } else {
386
 
387
  } else {
388
 
389
+ if ( $this->args['data_type'] !== 'serialize' ) {
390
+ foreach ( $data as $key => $value ) {
391
  update_post_meta( $post_id, $key, $value );
392
  }
393
  } else {
394
+ update_post_meta( $post_id, $this->unique, $data );
395
  }
396
 
397
+ if ( ! empty( $errors ) ) {
398
+ update_post_meta( $post_id, '_csf_errors_'. $this->unique, $errors );
399
  }
400
 
401
  }
402
 
403
+ do_action( "csf_{$this->unique}_saved", $data, $post_id, $this );
404
 
405
+ do_action( "csf_{$this->unique}_save_after", $data, $post_id, $this );
406
 
407
  }
408
  }
admin/settings/classes/options.class.php CHANGED
@@ -1,4 +1,4 @@
1
- <?php if( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
  /**
3
  *
4
  * Options Class
@@ -7,7 +7,7 @@
7
  * @version 1.0.0
8
  *
9
  */
10
- if( ! class_exists( 'CSF_Options' ) ) {
11
  class CSF_Options extends CSF_Abstract {
12
 
13
  // constans
@@ -106,7 +106,7 @@ if( ! class_exists( 'CSF_Options' ) ) {
106
  add_action( 'admin_bar_menu', array( &$this, 'add_admin_bar_menu' ), $this->args['admin_bar_menu_priority'] );
107
  add_action( 'wp_ajax_csf_'. $this->unique .'_ajax_save', array( &$this, 'ajax_save' ) );
108
 
109
- if( ! empty( $this->args['show_network_menu'] ) ) {
110
  add_action( 'network_admin_menu', array( &$this, 'add_admin_menu' ) );
111
  }
112
 
@@ -126,8 +126,8 @@ if( ! class_exists( 'CSF_Options' ) ) {
126
  $parents = array();
127
  $count = 100;
128
 
129
- foreach( $sections as $key => $section ) {
130
- if( ! empty( $section['parent'] ) ) {
131
  $section['priority'] = ( isset( $section['priority'] ) ) ? $section['priority'] : $count;
132
  $parents[$section['parent']][] = $section;
133
  unset( $sections[$key] );
@@ -135,9 +135,9 @@ if( ! class_exists( 'CSF_Options' ) ) {
135
  $count++;
136
  }
137
 
138
- foreach( $sections as $key => $section ) {
139
  $section['priority'] = ( isset( $section['priority'] ) ) ? $section['priority'] : $count;
140
- if( ! empty( $section['id'] ) && ! empty( $parents[$section['id']] ) ) {
141
  $section['subs'] = wp_list_sort( $parents[$section['id']], array( 'priority' => 'ASC' ), 'ASC', true );
142
  }
143
  $result[] = $section;
@@ -151,9 +151,9 @@ if( ! class_exists( 'CSF_Options' ) ) {
151
 
152
  $result = array();
153
 
154
- foreach( $sections as $key => $section ) {
155
- if( ! empty( $section['fields'] ) ) {
156
- foreach( $section['fields'] as $field ) {
157
  $result[] = $field;
158
  }
159
  }
@@ -166,13 +166,13 @@ if( ! class_exists( 'CSF_Options' ) ) {
166
 
167
  $result = array();
168
 
169
- foreach( $this->pre_tabs as $tab ) {
170
- if( ! empty( $tab['subs'] ) ) {
171
- foreach( $tab['subs'] as $sub ) {
172
  $result[] = $sub;
173
  }
174
  }
175
- if( empty( $tab['subs'] ) ) {
176
  $result[] = $tab;
177
  }
178
  }
@@ -183,36 +183,36 @@ if( ! class_exists( 'CSF_Options' ) ) {
183
  // add admin bar menu
184
  public function add_admin_bar_menu( $wp_admin_bar ) {
185
 
186
- if( ! empty( $this->args['show_bar_menu'] ) && empty( $this->args['menu_hidden'] ) ) {
187
 
188
  global $submenu;
189
 
190
  $menu_slug = $this->args['menu_slug'];
191
- $menu_icon = ( ! empty( $this->args['admin_bar_menu_icon'] ) ) ? '<span class="csf-ab-icon ab-icon '. $this->args['admin_bar_menu_icon'] .'"></span>' : '';
192
 
193
  $wp_admin_bar->add_node( array(
194
  'id' => $menu_slug,
195
- 'title' => $menu_icon . $this->args['menu_title'],
196
- 'href' => ( is_network_admin() ) ? network_admin_url( 'admin.php?page='. $menu_slug ) : admin_url( 'admin.php?page='. $menu_slug ),
197
  ) );
198
 
199
- if( ! empty( $submenu[$menu_slug] ) ) {
200
- foreach( $submenu[$menu_slug] as $key => $menu ) {
201
  $wp_admin_bar->add_node( array(
202
  'parent' => $menu_slug,
203
  'id' => $menu_slug .'-'. $key,
204
  'title' => $menu[0],
205
- 'href' => ( is_network_admin() ) ? network_admin_url( 'admin.php?page='. $menu[2] ) : admin_url( 'admin.php?page='. $menu[2] ),
206
  ) );
207
  }
208
  }
209
 
210
- if( ! empty( $this->args['show_network_menu'] ) ) {
211
  $wp_admin_bar->add_node( array(
212
  'parent' => 'network-admin',
213
  'id' => $menu_slug .'-network-admin',
214
- 'title' => $menu_icon . $this->args['menu_title'],
215
- 'href' => network_admin_url( 'admin.php?page='. $menu_slug ),
216
  ) );
217
  }
218
 
@@ -222,30 +222,21 @@ if( ! class_exists( 'CSF_Options' ) ) {
222
 
223
  public function ajax_save() {
224
 
225
- if( ! empty( $_POST['data'] ) ) {
226
-
227
- $_POST = json_decode( stripslashes( $_POST['data'] ), true );
228
-
229
- if( wp_verify_nonce( csf_get_var( 'csf_options_nonce'. $this->unique ), 'csf_options_nonce' ) ) {
230
-
231
- $this->set_options();
232
-
233
- wp_send_json_success( array( 'success' => true, 'notice' => $this->notice, 'errors' => $this->errors ) );
234
-
235
- }
236
 
 
 
 
 
237
  }
238
 
239
- wp_send_json_error( array( 'success' => false, 'error' => esc_html__( 'Error while saving.', 'csf' ) ) );
240
-
241
  }
242
 
243
  // get default value
244
- public function get_default( $field, $options = array() ) {
245
 
246
- $default = ( isset( $this->args['defaults'][$field['id']] ) ) ? $this->args['defaults'][$field['id']] : '';
247
- $default = ( isset( $field['default'] ) ) ? $field['default'] : $default;
248
- $default = ( isset( $options[$field['id']] ) ) ? $options[$field['id']] : $default;
249
 
250
  return $default;
251
 
@@ -256,91 +247,124 @@ if( ! class_exists( 'CSF_Options' ) ) {
256
 
257
  $tmp_options = $this->options;
258
 
259
- foreach( $this->pre_fields as $field ) {
260
- if( ! empty( $field['id'] ) ) {
261
- $this->options[$field['id']] = $this->get_default( $field, $this->options );
262
  }
263
  }
264
 
265
- if( $this->args['save_defaults'] && empty( $tmp_options ) ) {
266
  $this->save_options( $this->options );
267
  }
268
 
269
  }
270
 
271
  // set options
272
- public function set_options() {
273
 
274
- if( wp_verify_nonce( csf_get_var( 'csf_options_nonce'. $this->unique ), 'csf_options_nonce' ) ) {
 
 
275
 
276
- $request = csf_get_var( $this->unique, array() );
277
- $transient = csf_get_var( 'csf_transient' );
278
- $section_id = ( ! empty( $transient['section'] ) ) ? $transient['section'] : '';
 
 
 
 
 
279
 
280
- // import data
281
- if( ! empty( $transient['csf_import_data'] ) ) {
282
 
283
- $import_data = json_decode( stripslashes( trim( $transient['csf_import_data'] ) ), true );
284
- $request = ( is_array( $import_data ) ) ? $import_data : array();
285
 
 
 
 
 
 
286
  $this->notice = esc_html__( 'Success. Imported backup options.', 'csf' );
287
 
288
- } else if( ! empty( $transient['reset'] ) ) {
 
 
289
 
290
- foreach( $this->pre_fields as $field ) {
291
- if( ! empty( $field['id'] ) ) {
292
- $request[$field['id']] = $this->get_default( $field );
293
  }
294
  }
295
 
296
  $this->notice = esc_html__( 'Default options restored.', 'csf' );
297
 
298
- } else if( ! empty( $transient['reset_section'] ) && ! empty( $section_id ) ) {
299
 
300
- if( ! empty( $this->pre_sections[$section_id-1]['fields'] ) ) {
301
 
302
- foreach( $this->pre_sections[$section_id-1]['fields'] as $field ) {
303
- if( ! empty( $field['id'] ) ) {
304
- $request[$field['id']] = $this->get_default( $field );
305
  }
306
  }
307
 
308
  }
309
 
 
 
310
  $this->notice = esc_html__( 'Default options restored for only this section.', 'csf' );
311
 
312
  } else {
313
 
314
  // sanitize and validate
315
- foreach( $this->pre_fields as $field ) {
316
-
317
- if( ! empty( $field['id'] ) ) {
318
 
319
- // sanitize
320
- if( ! empty( $field['sanitize'] ) ) {
321
 
322
- $sanitize = $field['sanitize'];
323
- $value_sanitize = isset( $request[$field['id']] ) ? $request[$field['id']] : '';
324
- $request[$field['id']] = call_user_func( $sanitize, $value_sanitize );
325
 
 
 
 
326
  }
327
 
328
- // validate
329
- if( ! empty( $field['validate'] ) ) {
330
 
331
- $value_validate = isset( $request[$field['id']] ) ? $request[$field['id']] : '';
332
- $has_validated = call_user_func( $field['validate'], $value_validate );
 
 
 
 
 
333
 
334
- if( ! empty( $has_validated ) ) {
335
- $request[$field['id']] = ( isset( $this->options[$field['id']] ) ) ? $this->options[$field['id']] : '';
336
- $this->errors[$field['id']] = $has_validated;
337
  }
338
 
 
 
 
 
 
 
 
 
339
  }
340
 
341
- // auto sanitize
342
- if( ! isset( $request[$field['id']] ) || is_null( $request[$field['id']] ) ) {
343
- $request[$field['id']] = '';
 
 
 
 
 
 
 
 
 
344
  }
345
 
346
  }
@@ -349,62 +373,59 @@ if( ! class_exists( 'CSF_Options' ) ) {
349
 
350
  }
351
 
352
- // ignore nonce requests
353
- if( isset( $request['_nonce'] ) ) { unset( $request['_nonce'] ); }
354
 
355
- $request = wp_unslash( $request );
356
 
357
- $request = apply_filters( "csf_{$this->unique}_save", $request, $this );
358
 
359
- do_action( "csf_{$this->unique}_save_before", $request, $this );
360
 
361
- $this->options = $request;
362
 
363
- $this->save_options( $request );
364
-
365
- do_action( "csf_{$this->unique}_save_after", $request, $this );
366
-
367
- if( empty( $this->notice ) ) {
368
  $this->notice = esc_html__( 'Settings saved.', 'csf' );
369
  }
370
 
 
 
371
  }
372
 
373
- return true;
374
 
375
  }
376
 
377
  // save options database
378
- public function save_options( $request ) {
379
-
380
- if( $this->args['database'] === 'transient' ) {
381
- set_transient( $this->unique, $request, $this->args['transient_time'] );
382
- } else if( $this->args['database'] === 'theme_mod' ) {
383
- set_theme_mod( $this->unique, $request );
384
- } else if( $this->args['database'] === 'network' ) {
385
- update_site_option( $this->unique, $request );
386
  } else {
387
- update_option( $this->unique, $request );
388
  }
389
 
390
- do_action( "csf_{$this->unique}_saved", $request, $this );
391
 
392
  }
393
 
394
  // get options from database
395
  public function get_options() {
396
 
397
- if( $this->args['database'] === 'transient' ) {
398
  $this->options = get_transient( $this->unique );
399
- } else if( $this->args['database'] === 'theme_mod' ) {
400
  $this->options = get_theme_mod( $this->unique );
401
- } else if( $this->args['database'] === 'network' ) {
402
  $this->options = get_site_option( $this->unique );
403
  } else {
404
  $this->options = get_option( $this->unique );
405
  }
406
 
407
- if( empty( $this->options ) ) {
408
  $this->options = array();
409
  }
410
 
@@ -412,32 +433,32 @@ if( ! class_exists( 'CSF_Options' ) ) {
412
 
413
  }
414
 
415
- // wp api: admin menu
416
  public function add_admin_menu() {
417
 
418
  extract( $this->args );
419
 
420
- if( $menu_type === 'submenu' ) {
421
 
422
- $menu_page = call_user_func( 'add_submenu_page', $menu_parent, $menu_title, $menu_title, $menu_capability, $menu_slug, array( &$this, 'add_options_html' ) );
423
 
424
  } else {
425
 
426
- $menu_page = call_user_func( 'add_menu_page', $menu_title, $menu_title, $menu_capability, $menu_slug, array( &$this, 'add_options_html' ), $menu_icon, $menu_position );
427
 
428
  if ( ! empty( $sub_menu_title ) ) {
429
- call_user_func( 'add_submenu_page', $menu_slug, $sub_menu_title, $sub_menu_title, $menu_capability, $menu_slug, array( &$this, 'add_options_html' ) );
430
  }
431
 
432
- if( ! empty( $this->args['show_sub_menu'] ) && count( $this->pre_tabs ) > 1 ) {
433
 
434
  // create submenus
435
  $tab_key = 1;
436
  foreach ( $this->pre_tabs as $section ) {
437
 
438
- call_user_func( 'add_submenu_page', $menu_slug, $section['title'], $section['title'], $menu_capability, $menu_slug .'#tab='. $tab_key, '__return_null' );
439
 
440
- if( ! empty( $section['subs'] ) ) {
441
  $tab_key += ( count( $section['subs'] )-1 );
442
  }
443
 
@@ -449,7 +470,7 @@ if( ! class_exists( 'CSF_Options' ) ) {
449
 
450
  }
451
 
452
- if( ! empty( $menu_hidden ) ) {
453
  remove_menu_page( $menu_slug );
454
  }
455
 
@@ -461,15 +482,15 @@ if( ! class_exists( 'CSF_Options' ) ) {
461
 
462
  public function add_page_on_load() {
463
 
464
- if( ! empty( $this->args['contextual_help'] ) ) {
465
 
466
  $screen = get_current_screen();
467
 
468
- foreach( $this->args['contextual_help'] as $tab ) {
469
  $screen->add_help_tab( $tab );
470
  }
471
 
472
- if( ! empty( $this->args['contextual_help_sidebar'] ) ) {
473
  $screen->set_help_sidebar( $this->args['contextual_help_sidebar'] );
474
  }
475
 
@@ -481,30 +502,30 @@ if( ! class_exists( 'CSF_Options' ) ) {
481
 
482
  public function add_admin_footer_text() {
483
  $default = 'Thank you for creating with <a href="http://codestarframework.com/" target="_blank">Codestar Framework</a>';
484
- echo ( ! empty( $this->args['footer_credit'] ) ) ? $this->args['footer_credit'] : $default;
485
  }
486
 
487
  public function error_check( $sections, $err = '' ) {
488
 
489
- if( ! $this->args['ajax_save'] ) {
490
 
491
- if( ! empty( $sections['fields'] ) ) {
492
- foreach( $sections['fields'] as $field ) {
493
- if( ! empty( $field['id'] ) ) {
494
- if( array_key_exists( $field['id'], $this->errors ) ) {
495
  $err = '<span class="csf-label-error">!</span>';
496
  }
497
  }
498
  }
499
  }
500
 
501
- if( ! empty( $sections['subs'] ) ) {
502
- foreach( $sections['subs'] as $sub ) {
503
  $err = $this->error_check( $sub, $err );
504
  }
505
  }
506
 
507
- if( ! empty( $sections['id'] ) && array_key_exists( $sections['id'], $this->errors ) ) {
508
  $err = $this->errors[$sections['id']];
509
  }
510
 
@@ -526,7 +547,7 @@ if( ! class_exists( 'CSF_Options' ) ) {
526
 
527
  do_action( 'csf_options_before' );
528
 
529
- echo '<div class="csf csf-options'. $theme . $class . $wrapper_class .'" data-slug="'. $this->args['menu_slug'] .'" data-unique="'. $this->unique .'">';
530
 
531
  echo '<div class="csf-container">';
532
 
@@ -545,19 +566,19 @@ if( ! class_exists( 'CSF_Options' ) ) {
545
 
546
  echo '<div class="csf-header-right">';
547
 
548
- $notice_class = ( ! empty( $this->notice ) ) ? ' csf-form-show' : '';
549
  $notice_text = ( ! empty( $this->notice ) ) ? $this->notice : '';
550
 
551
- echo '<div class="csf-form-result csf-form-success'. $notice_class .'">'. $notice_text .'</div>';
552
 
553
  echo ( $this->args['show_form_warning'] ) ? '<div class="csf-form-result csf-form-warning">'. esc_html__( 'Settings have changed, you should save them!', 'csf' ) .'</div>' : '';
554
 
555
- echo ( $has_nav && $this->args['show_all_options'] ) ? '<div class="csf-expand-all" title="'. esc_html__( 'show all options', 'csf' ) .'"><i class="fa fa-outdent"></i></div>' : '';
556
 
557
  echo ( $this->args['show_search'] ) ? '<div class="csf-search"><input type="text" name="csf-search" placeholder="'. esc_html__( 'Search option(s)', 'csf' ) .'" autocomplete="off" /></div>' : '';
558
 
559
  echo '<div class="csf-buttons">';
560
- echo '<input type="submit" name="'. $this->unique .'[_nonce][save]" class="button button-primary csf-top-save csf-save'. $ajax_class .'" value="'. esc_html__( 'Save', 'csf' ) .'" data-save="'. esc_html__( 'Saving...', 'csf' ) .'">';
561
  echo ( $this->args['show_reset_section'] ) ? '<input type="submit" name="csf_transient[reset_section]" class="button button-secondary csf-reset-section csf-confirm" value="'. esc_html__( 'Reset Section', 'csf' ) .'" data-confirm="'. esc_html__( 'Are you sure to reset this section options?', 'csf' ) .'">' : '';
562
  echo ( $this->args['show_reset_all'] ) ? '<input type="submit" name="csf_transient[reset]" class="button csf-warning-primary csf-reset-all csf-confirm" value="'. esc_html__( 'Reset All', 'csf' ) .'" data-confirm="'. esc_html__( 'Are you sure to reset all options?', 'csf' ) .'">' : '';
563
  echo '</div>';
@@ -568,36 +589,38 @@ if( ! class_exists( 'CSF_Options' ) ) {
568
  echo '</div>';
569
  echo '</div>';
570
 
571
- echo '<div class="csf-wrapper'. $show_all .'">';
 
 
572
 
573
- if( $has_nav ) {
574
  echo '<div class="csf-nav csf-nav-options">';
575
 
576
  echo '<ul>';
577
 
578
  $tab_key = 1;
579
 
580
- foreach( $this->pre_tabs as $tab ) {
581
 
582
  $tab_error = $this->error_check( $tab );
583
- $tab_icon = ( ! empty( $tab['icon'] ) ) ? '<i class="'. $tab['icon'] .'"></i>' : '';
584
 
585
- if( ! empty( $tab['subs'] ) ) {
586
 
587
  echo '<li class="csf-tab-depth-0">';
588
 
589
- echo '<a href="#tab='. $tab_key .'" class="csf-arrow">'. $tab_icon . $tab['title'] . $tab_error .'</a>';
590
 
591
  echo '<ul>';
592
 
593
  foreach ( $tab['subs'] as $sub ) {
594
 
595
  $sub_error = $this->error_check( $sub );
596
- $sub_icon = ( ! empty( $sub['icon'] ) ) ? '<i class="'. $sub['icon'] .'"></i>' : '';
597
 
598
- echo '<li class="csf-tab-depth-1"><a id="csf-tab-link-'. $tab_key .'" href="#tab='. $tab_key .'">'. $sub_icon . $sub['title'] . $sub_error .'</a></li>';
599
 
600
  $tab_key++;
 
601
  }
602
 
603
  echo '</ul>';
@@ -606,9 +629,10 @@ if( ! class_exists( 'CSF_Options' ) ) {
606
 
607
  } else {
608
 
609
- echo '<li class="csf-tab-depth-0"><a id="csf-tab-link-'. $tab_key .'" href="#tab='. $tab_key .'">'. $tab_icon . $tab['title'] . $tab_error .'</a></li>';
610
 
611
  $tab_key++;
 
612
  }
613
 
614
  }
@@ -625,25 +649,29 @@ if( ! class_exists( 'CSF_Options' ) ) {
625
 
626
  $section_key = 1;
627
 
628
- foreach( $this->pre_sections as $section ) {
629
 
630
  $onload = ( ! $has_nav ) ? ' csf-onload' : '';
631
- $section_icon = ( ! empty( $section['icon'] ) ) ? '<i class="csf-icon '. $section['icon'] .'"></i>' : '';
632
 
633
- echo '<div id="csf-section-'. $section_key .'" class="csf-section'. $onload .'">';
634
- echo ( $has_nav ) ? '<div class="csf-section-title"><h3>'. $section_icon . $section['title'] .'</h3></div>' : '';
635
- echo ( ! empty( $section['description'] ) ) ? '<div class="csf-field csf-section-description">'. $section['description'] .'</div>' : '';
636
 
637
- if( ! empty( $section['fields'] ) ) {
638
 
639
- foreach( $section['fields'] as $field ) {
640
 
641
  $is_field_error = $this->error_check( $field );
642
 
643
- if( ! empty( $is_field_error ) ) {
644
  $field['_error'] = $is_field_error;
645
  }
646
 
 
 
 
 
647
  $value = ( ! empty( $field['id'] ) && isset( $this->options[$field['id']] ) ) ? $this->options[$field['id']] : '';
648
 
649
  CSF::field( $field, $value, $this->unique, 'options' );
@@ -659,6 +687,7 @@ if( ! class_exists( 'CSF_Options' ) ) {
659
  echo '</div>';
660
 
661
  $section_key++;
 
662
  }
663
 
664
  echo '</div>';
@@ -671,17 +700,17 @@ if( ! class_exists( 'CSF_Options' ) ) {
671
 
672
  echo '</div>';
673
 
674
- if( ! empty( $this->args['show_footer'] ) ) {
675
 
676
  echo '<div class="csf-footer">';
677
 
678
  echo '<div class="csf-buttons">';
679
- echo '<input type="submit" name="csf_transient[save]" class="button button-primary csf-save'. $ajax_class .'" value="'. esc_html__( 'Save', 'csf' ) .'" data-save="'. esc_html__( 'Saving...', 'csf' ) .'">';
680
  echo ( $this->args['show_reset_section'] ) ? '<input type="submit" name="csf_transient[reset_section]" class="button button-secondary csf-reset-section csf-confirm" value="'. esc_html__( 'Reset Section', 'csf' ) .'" data-confirm="'. esc_html__( 'Are you sure to reset this section options?', 'csf' ) .'">' : '';
681
  echo ( $this->args['show_reset_all'] ) ? '<input type="submit" name="csf_transient[reset]" class="button csf-warning-primary csf-reset-all csf-confirm" value="'. esc_html__( 'Reset All', 'csf' ) .'" data-confirm="'. esc_html__( 'Are you sure to reset all options?', 'csf' ) .'">' : '';
682
  echo '</div>';
683
 
684
- echo ( ! empty( $this->args['footer_text'] ) ) ? '<div class="csf-copyright">'. $this->args['footer_text'] .'</div>' : '';
685
 
686
  echo '<div class="clear"></div>';
687
  echo '</div>';
@@ -694,7 +723,7 @@ if( ! class_exists( 'CSF_Options' ) ) {
694
 
695
  echo '<div class="clear"></div>';
696
 
697
- echo ( ! empty( $this->args['footer_after'] ) ) ? $this->args['footer_after'] : '';
698
 
699
  echo '</div>';
700
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
  /**
3
  *
4
  * Options Class
7
  * @version 1.0.0
8
  *
9
  */
10
+ if ( ! class_exists( 'CSF_Options' ) ) {
11
  class CSF_Options extends CSF_Abstract {
12
 
13
  // constans
106
  add_action( 'admin_bar_menu', array( &$this, 'add_admin_bar_menu' ), $this->args['admin_bar_menu_priority'] );
107
  add_action( 'wp_ajax_csf_'. $this->unique .'_ajax_save', array( &$this, 'ajax_save' ) );
108
 
109
+ if ( ! empty( $this->args['show_network_menu'] ) ) {
110
  add_action( 'network_admin_menu', array( &$this, 'add_admin_menu' ) );
111
  }
112
 
126
  $parents = array();
127
  $count = 100;
128
 
129
+ foreach ( $sections as $key => $section ) {
130
+ if ( ! empty( $section['parent'] ) ) {
131
  $section['priority'] = ( isset( $section['priority'] ) ) ? $section['priority'] : $count;
132
  $parents[$section['parent']][] = $section;
133
  unset( $sections[$key] );
135
  $count++;
136
  }
137
 
138
+ foreach ( $sections as $key => $section ) {
139
  $section['priority'] = ( isset( $section['priority'] ) ) ? $section['priority'] : $count;
140
+ if ( ! empty( $section['id'] ) && ! empty( $parents[$section['id']] ) ) {
141
  $section['subs'] = wp_list_sort( $parents[$section['id']], array( 'priority' => 'ASC' ), 'ASC', true );
142
  }
143
  $result[] = $section;
151
 
152
  $result = array();
153
 
154
+ foreach ( $sections as $key => $section ) {
155
+ if ( ! empty( $section['fields'] ) ) {
156
+ foreach ( $section['fields'] as $field ) {
157
  $result[] = $field;
158
  }
159
  }
166
 
167
  $result = array();
168
 
169
+ foreach ( $this->pre_tabs as $tab ) {
170
+ if ( ! empty( $tab['subs'] ) ) {
171
+ foreach ( $tab['subs'] as $sub ) {
172
  $result[] = $sub;
173
  }
174
  }
175
+ if ( empty( $tab['subs'] ) ) {
176
  $result[] = $tab;
177
  }
178
  }
183
  // add admin bar menu
184
  public function add_admin_bar_menu( $wp_admin_bar ) {
185
 
186
+ if ( ! empty( $this->args['show_bar_menu'] ) && empty( $this->args['menu_hidden'] ) ) {
187
 
188
  global $submenu;
189
 
190
  $menu_slug = $this->args['menu_slug'];
191
+ $menu_icon = ( ! empty( $this->args['admin_bar_menu_icon'] ) ) ? '<span class="csf-ab-icon ab-icon '. esc_attr( $this->args['admin_bar_menu_icon'] ) .'"></span>' : '';
192
 
193
  $wp_admin_bar->add_node( array(
194
  'id' => $menu_slug,
195
+ 'title' => $menu_icon . esc_attr( $this->args['menu_title'] ),
196
+ 'href' => esc_url( ( is_network_admin() ) ? network_admin_url( 'admin.php?page='. $menu_slug ) : admin_url( 'admin.php?page='. $menu_slug ) ),
197
  ) );
198
 
199
+ if ( ! empty( $submenu[$menu_slug] ) ) {
200
+ foreach ( $submenu[$menu_slug] as $key => $menu ) {
201
  $wp_admin_bar->add_node( array(
202
  'parent' => $menu_slug,
203
  'id' => $menu_slug .'-'. $key,
204
  'title' => $menu[0],
205
+ 'href' => esc_url( ( is_network_admin() ) ? network_admin_url( 'admin.php?page='. $menu[2] ) : admin_url( 'admin.php?page='. $menu[2] ) ),
206
  ) );
207
  }
208
  }
209
 
210
+ if ( ! empty( $this->args['show_network_menu'] ) ) {
211
  $wp_admin_bar->add_node( array(
212
  'parent' => 'network-admin',
213
  'id' => $menu_slug .'-network-admin',
214
+ 'title' => $menu_icon . esc_attr( $this->args['menu_title'] ),
215
+ 'href' => esc_url( network_admin_url( 'admin.php?page='. $menu_slug ) ),
216
  ) );
217
  }
218
 
222
 
223
  public function ajax_save() {
224
 
225
+ $result = $this->set_options( true );
 
 
 
 
 
 
 
 
 
 
226
 
227
+ if ( ! $result ) {
228
+ wp_send_json_error( array( 'error' => esc_html__( 'Error while saving.', 'csf' ) ) );
229
+ } else {
230
+ wp_send_json_success( array( 'notice' => $this->notice, 'errors' => $this->errors ) );
231
  }
232
 
 
 
233
  }
234
 
235
  // get default value
236
+ public function get_default( $field ) {
237
 
238
+ $default = ( isset( $field['default'] ) ) ? $field['default'] : '';
239
+ $default = ( isset( $this->args['defaults'][$field['id']] ) ) ? $this->args['defaults'][$field['id']] : $default;
 
240
 
241
  return $default;
242
 
247
 
248
  $tmp_options = $this->options;
249
 
250
+ foreach ( $this->pre_fields as $field ) {
251
+ if ( ! empty( $field['id'] ) ) {
252
+ $this->options[$field['id']] = ( isset( $this->options[$field['id']] ) ) ? $this->options[$field['id']] : $this->get_default( $field );
253
  }
254
  }
255
 
256
+ if ( $this->args['save_defaults'] && empty( $tmp_options ) ) {
257
  $this->save_options( $this->options );
258
  }
259
 
260
  }
261
 
262
  // set options
263
+ public function set_options( $ajax = false ) {
264
 
265
+ // XSS ok.
266
+ // No worries, This "POST" requests is sanitizing in the below foreach. see #L337 - #L341
267
+ $response = ( $ajax && ! empty( $_POST['data'] ) ) ? json_decode( wp_unslash( trim( $_POST['data'] ) ), true ) : $_POST;
268
 
269
+ // Set variables.
270
+ $data = array();
271
+ $noncekey = 'csf_options_nonce'. $this->unique;
272
+ $nonce = ( ! empty( $response[$noncekey] ) ) ? $response[$noncekey] : '';
273
+ $options = ( ! empty( $response[$this->unique] ) ) ? $response[$this->unique] : array();
274
+ $transient = ( ! empty( $response['csf_transient'] ) ) ? $response['csf_transient'] : array();
275
+
276
+ if ( wp_verify_nonce( $nonce, 'csf_options_nonce' ) ) {
277
 
278
+ $importing = false;
279
+ $section_id = ( ! empty( $transient['section'] ) ) ? $transient['section'] : '';
280
 
281
+ if ( ! $ajax && ! empty( $response[ 'csf_import_data' ] ) ) {
 
282
 
283
+ // XSS ok.
284
+ // No worries, This "POST" requests is sanitizing in the below foreach. see #L337 - #L341
285
+ $import_data = json_decode( wp_unslash( trim( $response[ 'csf_import_data' ] ) ), true );
286
+ $options = ( is_array( $import_data ) && ! empty( $import_data ) ) ? $import_data : array();
287
+ $importing = true;
288
  $this->notice = esc_html__( 'Success. Imported backup options.', 'csf' );
289
 
290
+ }
291
+
292
+ if ( ! empty( $transient['reset'] ) ) {
293
 
294
+ foreach ( $this->pre_fields as $field ) {
295
+ if ( ! empty( $field['id'] ) ) {
296
+ $data[$field['id']] = $this->get_default( $field );
297
  }
298
  }
299
 
300
  $this->notice = esc_html__( 'Default options restored.', 'csf' );
301
 
302
+ } else if ( ! empty( $transient['reset_section'] ) && ! empty( $section_id ) ) {
303
 
304
+ if ( ! empty( $this->pre_sections[$section_id-1]['fields'] ) ) {
305
 
306
+ foreach ( $this->pre_sections[$section_id-1]['fields'] as $field ) {
307
+ if ( ! empty( $field['id'] ) ) {
308
+ $data[$field['id']] = $this->get_default( $field );
309
  }
310
  }
311
 
312
  }
313
 
314
+ $data = wp_parse_args( $data, $this->options );
315
+
316
  $this->notice = esc_html__( 'Default options restored for only this section.', 'csf' );
317
 
318
  } else {
319
 
320
  // sanitize and validate
321
+ foreach ( $this->pre_fields as $field ) {
 
 
322
 
323
+ if ( ! empty( $field['id'] ) ) {
 
324
 
325
+ $field_id = $field['id'];
326
+ $field_value = isset( $options[$field_id] ) ? $options[$field_id] : '';
 
327
 
328
+ // Ajax and Importing doing wp_unslash already.
329
+ if ( ! $ajax && ! $importing ) {
330
+ $field_value = wp_unslash( $field_value );
331
  }
332
 
333
+ // Sanitize "post" request of field.
334
+ if ( ! isset( $field['sanitize'] ) ) {
335
 
336
+ if( is_array( $field_value ) ) {
337
+
338
+ $data[$field_id] = wp_kses_post_deep( $field_value );
339
+
340
+ } else {
341
+
342
+ $data[$field_id] = wp_kses_post( $field_value );
343
 
 
 
 
344
  }
345
 
346
+ } else if( isset( $field['sanitize'] ) && function_exists( $field['sanitize'] ) ) {
347
+
348
+ $data[$field_id] = call_user_func( $field['sanitize'], $field_value );
349
+
350
+ } else {
351
+
352
+ $data[$field_id] = $field_value;
353
+
354
  }
355
 
356
+ // Validate "post" request of field.
357
+ if ( isset( $field['validate'] ) && function_exists( $field['validate'] ) ) {
358
+
359
+ $has_validated = call_user_func( $field['validate'], $field_value );
360
+
361
+ if ( ! empty( $has_validated ) ) {
362
+
363
+ $data[$field_id] = ( isset( $this->options[$field_id] ) ) ? $this->options[$field_id] : '';
364
+ $this->errors[$field_id] = $has_validated;
365
+
366
+ }
367
+
368
  }
369
 
370
  }
373
 
374
  }
375
 
376
+ $data = apply_filters( "csf_{$this->unique}_save", $data, $this );
 
377
 
378
+ do_action( "csf_{$this->unique}_save_before", $data, $this );
379
 
380
+ $this->options = $data;
381
 
382
+ $this->save_options( $data );
383
 
384
+ do_action( "csf_{$this->unique}_save_after", $data, $this );
385
 
386
+ if ( empty( $this->notice ) ) {
 
 
 
 
387
  $this->notice = esc_html__( 'Settings saved.', 'csf' );
388
  }
389
 
390
+ return true;
391
+
392
  }
393
 
394
+ return false;
395
 
396
  }
397
 
398
  // save options database
399
+ public function save_options( $data ) {
400
+
401
+ if ( $this->args['database'] === 'transient' ) {
402
+ set_transient( $this->unique, $data, $this->args['transient_time'] );
403
+ } else if ( $this->args['database'] === 'theme_mod' ) {
404
+ set_theme_mod( $this->unique, $data );
405
+ } else if ( $this->args['database'] === 'network' ) {
406
+ update_site_option( $this->unique, $data );
407
  } else {
408
+ update_option( $this->unique, $data );
409
  }
410
 
411
+ do_action( "csf_{$this->unique}_saved", $data, $this );
412
 
413
  }
414
 
415
  // get options from database
416
  public function get_options() {
417
 
418
+ if ( $this->args['database'] === 'transient' ) {
419
  $this->options = get_transient( $this->unique );
420
+ } else if ( $this->args['database'] === 'theme_mod' ) {
421
  $this->options = get_theme_mod( $this->unique );
422
+ } else if ( $this->args['database'] === 'network' ) {
423
  $this->options = get_site_option( $this->unique );
424
  } else {
425
  $this->options = get_option( $this->unique );
426
  }
427
 
428
+ if ( empty( $this->options ) ) {
429
  $this->options = array();
430
  }
431
 
433
 
434
  }
435
 
436
+ // admin menu
437
  public function add_admin_menu() {
438
 
439
  extract( $this->args );
440
 
441
+ if ( $menu_type === 'submenu' ) {
442
 
443
+ $menu_page = call_user_func( 'add_submenu_page', $menu_parent, esc_attr( $menu_title ), esc_attr( $menu_title ), $menu_capability, $menu_slug, array( &$this, 'add_options_html' ) );
444
 
445
  } else {
446
 
447
+ $menu_page = call_user_func( 'add_menu_page', esc_attr( $menu_title ), esc_attr( $menu_title ), $menu_capability, $menu_slug, array( &$this, 'add_options_html' ), $menu_icon, $menu_position );
448
 
449
  if ( ! empty( $sub_menu_title ) ) {
450
+ call_user_func( 'add_submenu_page', $menu_slug, esc_attr( $sub_menu_title ), esc_attr( $sub_menu_title ), $menu_capability, $menu_slug, array( &$this, 'add_options_html' ) );
451
  }
452
 
453
+ if ( ! empty( $this->args['show_sub_menu'] ) && count( $this->pre_tabs ) > 1 ) {
454
 
455
  // create submenus
456
  $tab_key = 1;
457
  foreach ( $this->pre_tabs as $section ) {
458
 
459
+ call_user_func( 'add_submenu_page', $menu_slug, esc_attr( $section['title'] ), esc_attr( $section['title'] ), $menu_capability, $menu_slug .'#tab='. $tab_key, '__return_null' );
460
 
461
+ if ( ! empty( $section['subs'] ) ) {
462
  $tab_key += ( count( $section['subs'] )-1 );
463
  }
464
 
470
 
471
  }
472
 
473
+ if ( ! empty( $menu_hidden ) ) {
474
  remove_menu_page( $menu_slug );
475
  }
476
 
482
 
483
  public function add_page_on_load() {
484
 
485
+ if ( ! empty( $this->args['contextual_help'] ) ) {
486
 
487
  $screen = get_current_screen();
488
 
489
+ foreach ( $this->args['contextual_help'] as $tab ) {
490
  $screen->add_help_tab( $tab );
491
  }
492
 
493
+ if ( ! empty( $this->args['contextual_help_sidebar'] ) ) {
494
  $screen->set_help_sidebar( $this->args['contextual_help_sidebar'] );
495
  }
496
 
502
 
503
  public function add_admin_footer_text() {
504
  $default = 'Thank you for creating with <a href="http://codestarframework.com/" target="_blank">Codestar Framework</a>';
505
+ echo ( ! empty( $this->args['footer_credit'] ) ) ? wp_kses_post( $this->args['footer_credit'] ) : $default;
506
  }
507
 
508
  public function error_check( $sections, $err = '' ) {
509
 
510
+ if ( ! $this->args['ajax_save'] ) {
511
 
512
+ if ( ! empty( $sections['fields'] ) ) {
513
+ foreach ( $sections['fields'] as $field ) {
514
+ if ( ! empty( $field['id'] ) ) {
515
+ if ( array_key_exists( $field['id'], $this->errors ) ) {
516
  $err = '<span class="csf-label-error">!</span>';
517
  }
518
  }
519
  }
520
  }
521
 
522
+ if ( ! empty( $sections['subs'] ) ) {
523
+ foreach ( $sections['subs'] as $sub ) {
524
  $err = $this->error_check( $sub, $err );
525
  }
526
  }
527
 
528
+ if ( ! empty( $sections['id'] ) && array_key_exists( $sections['id'], $this->errors ) ) {
529
  $err = $this->errors[$sections['id']];
530
  }
531
 
547
 
548
  do_action( 'csf_options_before' );
549
 
550
+ echo '<div class="csf csf-options'. esc_attr( $theme . $class . $wrapper_class ) .'" data-slug="'. esc_attr( $this->args['menu_slug'] ) .'" data-unique="'. esc_attr( $this->unique ) .'">';
551
 
552
  echo '<div class="csf-container">';
553
 
566
 
567
  echo '<div class="csf-header-right">';
568
 
569
+ $notice_class = ( ! empty( $this->notice ) ) ? 'csf-form-show' : '';
570
  $notice_text = ( ! empty( $this->notice ) ) ? $this->notice : '';
571
 
572
+ echo '<div class="csf-form-result csf-form-success '. esc_attr( $notice_class ) .'">'. wp_kses_post( $notice_text ) .'</div>';
573
 
574
  echo ( $this->args['show_form_warning'] ) ? '<div class="csf-form-result csf-form-warning">'. esc_html__( 'Settings have changed, you should save them!', 'csf' ) .'</div>' : '';
575
 
576
+ echo ( $has_nav && $this->args['show_all_options'] ) ? '<div class="csf-expand-all" title="'. esc_html__( 'show all options', 'csf' ) .'"><i class="fas fa-outdent"></i></div>' : '';
577
 
578
  echo ( $this->args['show_search'] ) ? '<div class="csf-search"><input type="text" name="csf-search" placeholder="'. esc_html__( 'Search option(s)', 'csf' ) .'" autocomplete="off" /></div>' : '';
579
 
580
  echo '<div class="csf-buttons">';
581
+ echo '<input type="submit" name="'. esc_attr( $this->unique ) .'[_nonce][save]" class="button button-primary csf-top-save csf-save'. esc_attr( $ajax_class ) .'" value="'. esc_html__( 'Save', 'csf' ) .'" data-save="'. esc_html__( 'Saving...', 'csf' ) .'">';
582
  echo ( $this->args['show_reset_section'] ) ? '<input type="submit" name="csf_transient[reset_section]" class="button button-secondary csf-reset-section csf-confirm" value="'. esc_html__( 'Reset Section', 'csf' ) .'" data-confirm="'. esc_html__( 'Are you sure to reset this section options?', 'csf' ) .'">' : '';
583
  echo ( $this->args['show_reset_all'] ) ? '<input type="submit" name="csf_transient[reset]" class="button csf-warning-primary csf-reset-all csf-confirm" value="'. esc_html__( 'Reset All', 'csf' ) .'" data-confirm="'. esc_html__( 'Are you sure to reset all options?', 'csf' ) .'">' : '';
584
  echo '</div>';
589
  echo '</div>';
590
  echo '</div>';
591
 
592
+ echo '<div class="csf-wrapper'. esc_attr( $show_all ) .'">';
593
+
594
+ if ( $has_nav ) {
595
 
 
596
  echo '<div class="csf-nav csf-nav-options">';
597
 
598
  echo '<ul>';
599
 
600
  $tab_key = 1;
601
 
602
+ foreach ( $this->pre_tabs as $tab ) {
603
 
604
  $tab_error = $this->error_check( $tab );
605
+ $tab_icon = ( ! empty( $tab['icon'] ) ) ? '<i class="csf-tab-icon '. esc_attr( $tab['icon'] ) .'"></i>' : '';
606
 
607
+ if ( ! empty( $tab['subs'] ) ) {
608
 
609
  echo '<li class="csf-tab-depth-0">';
610
 
611
+ echo '<a href="#tab='. $tab_key .'" class="csf-arrow">'. wp_kses_post( $tab_icon . $tab['title'] . $tab_error ) .'</a>';
612
 
613
  echo '<ul>';
614
 
615
  foreach ( $tab['subs'] as $sub ) {
616
 
617
  $sub_error = $this->error_check( $sub );
618
+ $sub_icon = ( ! empty( $sub['icon'] ) ) ? '<i class="csf-tab-icon '. esc_attr( $sub['icon'] ) .'"></i>' : '';
619
 
620
+ echo '<li class="csf-tab-depth-1"><a id="csf-tab-link-'. esc_attr( $tab_key ) .'" href="#tab='. esc_attr( $tab_key ) .'">'. wp_kses_post( $sub_icon . $sub['title'] . $sub_error ) .'</a></li>';
621
 
622
  $tab_key++;
623
+
624
  }
625
 
626
  echo '</ul>';
629
 
630
  } else {
631
 
632
+ echo '<li class="csf-tab-depth-0"><a id="csf-tab-link-'. esc_attr( $tab_key ) .'" href="#tab='. esc_attr( $tab_key ) .'">'. wp_kses_post( $tab_icon . $tab['title'] . $tab_error ) .'</a></li>';
633
 
634
  $tab_key++;
635
+
636
  }
637
 
638
  }
649
 
650
  $section_key = 1;
651
 
652
+ foreach ( $this->pre_sections as $section ) {
653
 
654
  $onload = ( ! $has_nav ) ? ' csf-onload' : '';
655
+ $section_icon = ( ! empty( $section['icon'] ) ) ? '<i class="csf-section-icon '. esc_attr( $section['icon'] ) .'"></i>' : '';
656
 
657
+ echo '<div id="csf-section-'. $section_key .'" class="csf-section'. esc_attr( $onload ) .'">';
658
+ echo ( $has_nav ) ? '<div class="csf-section-title"><h3>'. wp_kses_post( $section_icon . $section['title'] ) .'</h3></div>' : '';
659
+ echo ( ! empty( $section['description'] ) ) ? '<div class="csf-field csf-section-description">'. wp_kses_post( $section['description'] ) .'</div>' : '';
660
 
661
+ if ( ! empty( $section['fields'] ) ) {
662
 
663
+ foreach ( $section['fields'] as $field ) {
664
 
665
  $is_field_error = $this->error_check( $field );
666
 
667
+ if ( ! empty( $is_field_error ) ) {
668
  $field['_error'] = $is_field_error;
669
  }
670
 
671
+ if ( ! empty( $field['id'] ) ) {
672
+ $field['default'] = $this->get_default( $field );
673
+ }
674
+
675
  $value = ( ! empty( $field['id'] ) && isset( $this->options[$field['id']] ) ) ? $this->options[$field['id']] : '';
676
 
677
  CSF::field( $field, $value, $this->unique, 'options' );
687
  echo '</div>';
688
 
689
  $section_key++;
690
+
691
  }
692
 
693
  echo '</div>';
700
 
701
  echo '</div>';
702
 
703
+ if ( ! empty( $this->args['show_footer'] ) ) {
704
 
705
  echo '<div class="csf-footer">';
706
 
707
  echo '<div class="csf-buttons">';
708
+ echo '<input type="submit" name="csf_transient[save]" class="button button-primary csf-save'. esc_attr( $ajax_class ) .'" value="'. esc_html__( 'Save', 'csf' ) .'" data-save="'. esc_html__( 'Saving...', 'csf' ) .'">';
709
  echo ( $this->args['show_reset_section'] ) ? '<input type="submit" name="csf_transient[reset_section]" class="button button-secondary csf-reset-section csf-confirm" value="'. esc_html__( 'Reset Section', 'csf' ) .'" data-confirm="'. esc_html__( 'Are you sure to reset this section options?', 'csf' ) .'">' : '';
710
  echo ( $this->args['show_reset_all'] ) ? '<input type="submit" name="csf_transient[reset]" class="button csf-warning-primary csf-reset-all csf-confirm" value="'. esc_html__( 'Reset All', 'csf' ) .'" data-confirm="'. esc_html__( 'Are you sure to reset all options?', 'csf' ) .'">' : '';
711
  echo '</div>';
712
 
713
+ echo ( ! empty( $this->args['footer_text'] ) ) ? '<div class="csf-copyright">'. wp_kses_post( $this->args['footer_text'] ) .'</div>' : '';
714
 
715
  echo '<div class="clear"></div>';
716
  echo '</div>';
723
 
724
  echo '<div class="clear"></div>';
725
 
726
+ echo ( ! empty( $this->args['footer_after'] ) ) ? wp_kses_post( $this->args['footer_after'] ) : '';
727
 
728
  echo '</div>';
729
 
admin/settings/classes/profile-options.class.php CHANGED
@@ -7,7 +7,7 @@
7
  * @version 1.0.0
8
  *
9
  */
10
- if( ! class_exists( 'CSF_Profile_Options' ) ) {
11
  class CSF_Profile_Options extends CSF_Abstract{
12
 
13
  // constans
@@ -16,8 +16,8 @@ if( ! class_exists( 'CSF_Profile_Options' ) ) {
16
  public $sections = array();
17
  public $args = array(
18
  'data_type' => 'serialize',
19
- 'defaults' => array(),
20
  'class' => '',
 
21
  );
22
 
23
  // run profile construct
@@ -50,8 +50,8 @@ if( ! class_exists( 'CSF_Profile_Options' ) ) {
50
  // get default value
51
  public function get_default( $field ) {
52
 
53
- $default = ( isset( $field['id'] ) && isset( $this->args['defaults'][$field['id']] ) ) ? $this->args['defaults'][$field['id']] : null;
54
- $default = ( isset( $field['default'] ) ) ? $field['default'] : $default;
55
 
56
  return $default;
57
 
@@ -62,9 +62,9 @@ if( ! class_exists( 'CSF_Profile_Options' ) ) {
62
 
63
  $value = null;
64
 
65
- if( ! empty( $user_id ) && ! empty( $field['id'] ) ) {
66
 
67
- if( $this->args['data_type'] !== 'serialize' ) {
68
  $meta = get_user_meta( $user_id, $field['id'] );
69
  $value = ( isset( $meta[0] ) ) ? $meta[0] : null;
70
  } else {
@@ -74,7 +74,7 @@ if( ! class_exists( 'CSF_Profile_Options' ) ) {
74
 
75
  }
76
 
77
- $default = $this->get_default( $field );
78
  $value = ( isset( $value ) ) ? $value : $default;
79
 
80
  return $value;
@@ -86,31 +86,34 @@ if( ! class_exists( 'CSF_Profile_Options' ) ) {
86
 
87
  $is_profile = ( is_object( $profileuser ) && isset( $profileuser->ID ) ) ? true : false;
88
  $profile_id = ( $is_profile ) ? $profileuser->ID : 0;
89
- $errors = ( ! empty( $profile_id ) ) ? get_user_meta( $profile_id, '_csf_errors', true ) : array();
90
  $errors = ( ! empty( $errors ) ) ? $errors : array();
91
- $class = ( $this->args['class'] ) ? ' '. $this->args['class'] : '';
92
 
93
- // clear errors
94
- if( ! empty( $errors ) ) {
95
- delete_user_meta( $profile_id, '_csf_errors' );
96
  }
97
 
98
- echo '<div class="csf csf-profile csf-onload'. $class .'">';
99
 
100
  wp_nonce_field( 'csf_profile_nonce', 'csf_profile_nonce'. $this->unique );
101
 
102
- foreach( $this->sections as $section ) {
103
 
104
- $section_icon = ( ! empty( $section['icon'] ) ) ? '<i class="csf-icon '. $section['icon'] .'"></i>' : '';
105
  $section_title = ( ! empty( $section['title'] ) ) ? $section['title'] : '';
106
 
107
- echo ( $section_title || $section_icon ) ? '<h2>'. $section_icon . $section_title .'</h2>' : '';
108
 
109
- if( ! empty( $section['fields'] ) ) {
110
- foreach( $section['fields'] as $field ) {
 
 
 
 
111
 
112
- if( ! empty( $field['id'] ) && ! empty( $errors[$field['id']] ) ) {
113
- $field['_error'] = $errors[$field['id']];
114
  }
115
 
116
  CSF::field( $field, $this->get_meta_value( $profile_id, $field ), $this->unique, 'profile' );
@@ -127,101 +130,113 @@ if( ! class_exists( 'CSF_Profile_Options' ) ) {
127
  // save profile form fields
128
  public function save_profile( $user_id ) {
129
 
130
- if ( wp_verify_nonce( csf_get_var( 'csf_profile_nonce'. $this->unique ), 'csf_profile_nonce' ) ) {
 
 
 
 
131
 
132
- $errors = array();
 
 
 
 
 
 
 
 
133
 
134
  foreach ( $this->sections as $section ) {
135
 
136
- $request = csf_get_var( $this->unique, array() );
137
 
138
- // ignore _nonce
139
- if( isset( $request['_nonce'] ) ) {
140
- unset( $request['_nonce'] );
141
- }
142
 
143
- // sanitize and validate
144
- if( ! empty( $section['fields'] ) ) {
145
 
146
- foreach( $section['fields'] as $field ) {
 
147
 
148
- if( ! empty( $field['id'] ) ) {
 
149
 
150
- // sanitize
151
- if( ! empty( $field['sanitize'] ) ) {
 
 
 
 
 
 
 
 
 
152
 
153
- $sanitize = $field['sanitize'];
154
- $value_sanitize = csf_get_vars( $this->unique, $field['id'] );
155
- $request[$field['id']] = call_user_func( $sanitize, $value_sanitize );
156
 
157
  }
158
 
159
- // validate
160
- if( ! empty( $field['validate'] ) ) {
161
 
162
- $validate = $field['validate'];
163
- $value_validate = csf_get_vars( $this->unique, $field['id'] );
164
- $has_validated = call_user_func( $validate, $value_validate );
165
 
166
- if( ! empty( $has_validated ) ) {
167
 
168
- $errors[$field['id']] = $has_validated;
169
- $request[$field['id']] = $this->get_meta_value( $user_id, $field );
 
170
 
171
  }
172
 
173
  }
174
 
175
- // auto sanitize
176
- if( ! isset( $request[$field['id']] ) || is_null( $request[$field['id']] ) ) {
177
- $request[$field['id']] = '';
178
- }
179
-
180
  }
181
 
182
  }
183
 
184
  }
185
 
186
- $request = apply_filters( "csf_{$this->unique}_save", $request, $user_id, $this );
187
-
188
- do_action( "csf_{$this->unique}_save_before", $request, $user_id, $this );
189
 
190
- if( empty( $request ) ) {
191
 
192
- if( $this->args['data_type'] !== 'serialize' ) {
193
- foreach ( $request as $key => $value ) {
194
- delete_user_meta( $user_id, $key );
195
- }
196
- } else {
197
- delete_user_meta( $user_id, $this->unique );
198
- }
199
 
200
- } else {
201
 
202
- if( $this->args['data_type'] !== 'serialize' ) {
203
- foreach ( $request as $key => $value ) {
204
- update_user_meta( $user_id, $key, $value );
205
- }
206
- } else {
207
- update_user_meta( $user_id, $this->unique, $request );
208
- }
209
 
210
- if( ! empty( $errors ) ) {
211
- update_user_meta( $user_id, '_csf_errors', $errors );
212
- }
213
 
 
 
 
214
  }
 
 
 
215
 
216
- do_action( "csf_{$this->unique}_saved", $request, $user_id, $this );
217
 
218
- do_action( "csf_{$this->unique}_save_after", $request, $user_id, $this );
 
 
 
 
 
 
219
 
 
 
220
  }
221
 
222
  }
223
 
224
- }
 
 
225
 
 
226
  }
227
  }
7
  * @version 1.0.0
8
  *
9
  */
10
+ if ( ! class_exists( 'CSF_Profile_Options' ) ) {
11
  class CSF_Profile_Options extends CSF_Abstract{
12
 
13
  // constans
16
  public $sections = array();
17
  public $args = array(
18
  'data_type' => 'serialize',
 
19
  'class' => '',
20
+ 'defaults' => array(),
21
  );
22
 
23
  // run profile construct
50
  // get default value
51
  public function get_default( $field ) {
52
 
53
+ $default = ( isset( $field['default'] ) ) ? $field['default'] : '';
54
+ $default = ( isset( $this->args['defaults'][$field['id']] ) ) ? $this->args['defaults'][$field['id']] : $default;
55
 
56
  return $default;
57
 
62
 
63
  $value = null;
64
 
65
+ if ( ! empty( $user_id ) && ! empty( $field['id'] ) ) {
66
 
67
+ if ( $this->args['data_type'] !== 'serialize' ) {
68
  $meta = get_user_meta( $user_id, $field['id'] );
69
  $value = ( isset( $meta[0] ) ) ? $meta[0] : null;
70
  } else {
74
 
75
  }
76
 
77
+ $default = ( isset( $field['id'] ) ) ? $this->get_default( $field ) : '';
78
  $value = ( isset( $value ) ) ? $value : $default;
79
 
80
  return $value;
86
 
87
  $is_profile = ( is_object( $profileuser ) && isset( $profileuser->ID ) ) ? true : false;
88
  $profile_id = ( $is_profile ) ? $profileuser->ID : 0;
89
+ $errors = ( ! empty( $profile_id ) ) ? get_user_meta( $profile_id, '_csf_errors_'. $this->unique, true ) : array();
90
  $errors = ( ! empty( $errors ) ) ? $errors : array();
91
+ $class = ( $this->args['class'] ) ? ''. $this->args['class'] : '';
92
 
93
+ if ( ! empty( $errors ) ) {
94
+ delete_user_meta( $profile_id, '_csf_errors_'. $this->unique );
 
95
  }
96
 
97
+ echo '<div class="csf csf-profile csf-onload'. esc_attr( $class ) .'">';
98
 
99
  wp_nonce_field( 'csf_profile_nonce', 'csf_profile_nonce'. $this->unique );
100
 
101
+ foreach ( $this->sections as $section ) {
102
 
103
+ $section_icon = ( ! empty( $section['icon'] ) ) ? '<i class="csf-section-icon '. esc_attr( $section['icon'] ) .'"></i>' : '';
104
  $section_title = ( ! empty( $section['title'] ) ) ? $section['title'] : '';
105
 
106
+ echo ( $section_title || $section_icon ) ? '<h2>'. wp_kses_post( $section_icon . $section_title ) .'</h2>' : '';
107
 
108
+ if ( ! empty( $section['fields'] ) ) {
109
+ foreach ( $section['fields'] as $field ) {
110
+
111
+ if ( ! empty( $field['id'] ) && ! empty( $errors['fields'][$field['id']] ) ) {
112
+ $field['_error'] = $errors['fields'][$field['id']];
113
+ }
114
 
115
+ if ( ! empty( $field['id'] ) ) {
116
+ $field['default'] = $this->get_default( $field );
117
  }
118
 
119
  CSF::field( $field, $this->get_meta_value( $profile_id, $field ), $this->unique, 'profile' );
130
  // save profile form fields
131
  public function save_profile( $user_id ) {
132
 
133
+ $count = 1;
134
+ $data = array();
135
+ $errors = array();
136
+ $noncekey = 'csf_profile_nonce'. $this->unique;
137
+ $nonce = ( ! empty( $_POST[ $noncekey ] ) ) ? sanitize_text_field( wp_unslash( $_POST[ $noncekey ] ) ) : '';
138
 
139
+ if ( ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) || ! wp_verify_nonce( $nonce, 'csf_profile_nonce' ) ) {
140
+ return $user_id;
141
+ }
142
+
143
+ // XSS ok.
144
+ // No worries, This "POST" requests is sanitizing in the below foreach.
145
+ $request = ( ! empty( $_POST[ $this->unique ] ) ) ? $_POST[ $this->unique ] : array();
146
+
147
+ if ( ! empty( $request ) ) {
148
 
149
  foreach ( $this->sections as $section ) {
150
 
151
+ if ( ! empty( $section['fields'] ) ) {
152
 
153
+ foreach ( $section['fields'] as $field ) {
 
 
 
154
 
155
+ if ( ! empty( $field['id'] ) ) {
 
156
 
157
+ $field_id = $field['id'];
158
+ $field_value = isset( $request[$field_id] ) ? $request[$field_id] : '';
159
 
160
+ // Sanitize "post" request of field.
161
+ if ( ! isset( $field['sanitize'] ) ) {
162
 
163
+ if( is_array( $field_value ) ) {
164
+ $data[$field_id] = wp_kses_post_deep( $field_value );
165
+ } else {
166
+ $data[$field_id] = wp_kses_post( $field_value );
167
+ }
168
+
169
+ } else if( isset( $field['sanitize'] ) && function_exists( $field['sanitize'] ) ) {
170
+
171
+ $data[$field_id] = call_user_func( $field['sanitize'], $field_value );
172
+
173
+ } else {
174
 
175
+ $data[$field_id] = $field_value;
 
 
176
 
177
  }
178
 
179
+ // Validate "post" request of field.
180
+ if ( isset( $field['validate'] ) && function_exists( $field['validate'] ) ) {
181
 
182
+ $has_validated = call_user_func( $field['validate'], $field_value );
 
 
183
 
184
+ if ( ! empty( $has_validated ) ) {
185
 
186
+ $errors['sections'][$count] = true;
187
+ $errors['fields'][$field_id] = $has_validated;
188
+ $data[$field_id] = $this->get_meta_value( $user_id, $field );
189
 
190
  }
191
 
192
  }
193
 
 
 
 
 
 
194
  }
195
 
196
  }
197
 
198
  }
199
 
200
+ $count++;
 
 
201
 
202
+ }
203
 
204
+ }
 
 
 
 
 
 
205
 
206
+ $data = apply_filters( "csf_{$this->unique}_save", $data, $user_id, $this );
207
 
208
+ do_action( "csf_{$this->unique}_save_before", $data, $user_id, $this );
 
 
 
 
 
 
209
 
210
+ if ( empty( $data ) ) {
 
 
211
 
212
+ if ( $this->args['data_type'] !== 'serialize' ) {
213
+ foreach ( $data as $key => $value ) {
214
+ delete_user_meta( $user_id, $key );
215
  }
216
+ } else {
217
+ delete_user_meta( $user_id, $this->unique );
218
+ }
219
 
220
+ } else {
221
 
222
+ if ( $this->args['data_type'] !== 'serialize' ) {
223
+ foreach ( $data as $key => $value ) {
224
+ update_user_meta( $user_id, $key, $value );
225
+ }
226
+ } else {
227
+ update_user_meta( $user_id, $this->unique, $data );
228
+ }
229
 
230
+ if ( ! empty( $errors ) ) {
231
+ update_user_meta( $user_id, '_csf_errors_'. $this->unique, $errors );
232
  }
233
 
234
  }
235
 
236
+ do_action( "csf_{$this->unique}_saved", $data, $user_id, $this );
237
+
238
+ do_action( "csf_{$this->unique}_save_after", $data, $user_id, $this );
239
 
240
+ }
241
  }
242
  }
admin/settings/classes/setup.class.php CHANGED
@@ -7,11 +7,11 @@
7
  * @version 1.0.0
8
  *
9
  */
10
- if( ! class_exists( 'CSF' ) ) {
11
  class CSF {
12
 
13
  // constants
14
- public static $version = '2.1.3';
15
  public static $premium = true;
16
  public static $dir = null;
17
  public static $url = null;
@@ -59,13 +59,13 @@ if( ! class_exists( 'CSF' ) ) {
59
  public static function setup() {
60
 
61
  // welcome page
62
- self::include_plugin_file( 'views/welcome.php' );
63
 
64
  // setup options
65
  $params = array();
66
  if ( ! empty( self::$args['options'] ) ) {
67
- foreach( self::$args['options'] as $key => $value ) {
68
- if( ! empty( self::$args['sections'][$key] ) && ! isset( self::$inited[$key] ) ) {
69
 
70
  $params['args'] = $value;
71
  $params['sections'] = self::$args['sections'][$key];
@@ -73,7 +73,7 @@ if( ! class_exists( 'CSF' ) ) {
73
 
74
  CSF_Options::instance( $key, $params );
75
 
76
- if( ! empty( $value['show_in_customizer'] ) ) {
77
  $value['output_css'] = false;
78
  $value['enqueue_webfont'] = false;
79
  self::$args['customize_options'][$key] = $value;
@@ -87,8 +87,8 @@ if( ! class_exists( 'CSF' ) ) {
87
  // setup customize options
88
  $params = array();
89
  if ( ! empty( self::$args['customize_options'] ) ) {
90
- foreach( self::$args['customize_options'] as $key => $value ) {
91
- if( ! empty( self::$args['sections'][$key] ) && ! isset( self::$inited[$key] ) ) {
92
 
93
  $params['args'] = $value;
94
  $params['sections'] = self::$args['sections'][$key];
@@ -104,8 +104,8 @@ if( ! class_exists( 'CSF' ) ) {
104
  // setup metaboxes
105
  $params = array();
106
  if ( ! empty( self::$args['metaboxes'] ) ) {
107
- foreach( self::$args['metaboxes'] as $key => $value ) {
108
- if( ! empty( self::$args['sections'][$key] ) && ! isset( self::$inited[$key] ) ) {
109
 
110
  $params['args'] = $value;
111
  $params['sections'] = self::$args['sections'][$key];
@@ -120,8 +120,8 @@ if( ! class_exists( 'CSF' ) ) {
120
  // setup profile options
121
  $params = array();
122
  if ( ! empty( self::$args['profile_options'] ) ) {
123
- foreach( self::$args['profile_options'] as $key => $value ) {
124
- if( ! empty( self::$args['sections'][$key] ) && ! isset( self::$inited[$key] ) ) {
125
 
126
  $params['args'] = $value;
127
  $params['sections'] = self::$args['sections'][$key];
@@ -137,8 +137,8 @@ if( ! class_exists( 'CSF' ) ) {
137
  $params = array();
138
  if ( ! empty( self::$args['shortcoders'] ) ) {
139
 
140
- foreach( self::$args['shortcoders'] as $key => $value ) {
141
- if( ! empty( self::$args['sections'][$key] ) && ! isset( self::$inited[$key] ) ) {
142
 
143
  $params['args'] = $value;
144
  $params['sections'] = self::$args['sections'][$key];
@@ -150,7 +150,7 @@ if( ! class_exists( 'CSF' ) ) {
150
  }
151
 
152
  // Once editor setup for gutenberg and media buttons
153
- if( ! empty( CSF::$shortcode_instances ) ) {
154
  CSF_Shortcoder::once_editor_setup();
155
  }
156
 
@@ -159,8 +159,8 @@ if( ! class_exists( 'CSF' ) ) {
159
  // setup taxonomy options
160
  $params = array();
161
  if ( ! empty( self::$args['taxonomy_options'] ) ) {
162
- foreach( self::$args['taxonomy_options'] as $key => $value ) {
163
- if( ! empty( self::$args['sections'][$key] ) && ! isset( self::$inited[$key] ) ) {
164
 
165
  $params['args'] = $value;
166
  $params['sections'] = self::$args['sections'][$key];
@@ -177,8 +177,8 @@ if( ! class_exists( 'CSF' ) ) {
177
 
178
  $wp_widget_factory = new WP_Widget_Factory();
179
 
180
- foreach( self::$args['widgets'] as $key => $value ) {
181
- if( ! isset( self::$inited[$key] ) ) {
182
  self::$inited[$key] = true;
183
  $wp_widget_factory->register( CSF_Widget::instance( $key, $value ) );
184
  }
@@ -189,8 +189,8 @@ if( ! class_exists( 'CSF' ) ) {
189
  // setup comment metabox
190
  $params = array();
191
  if ( ! empty( self::$args['comment_metaboxes'] ) ) {
192
- foreach( self::$args['comment_metaboxes'] as $key => $value ) {
193
- if( ! empty( self::$args['sections'][$key] ) && ! isset( self::$inited[$key] ) ) {
194
 
195
  $params['args'] = $value;
196
  $params['sections'] = self::$args['sections'][$key];
@@ -278,7 +278,7 @@ if( ! class_exists( 'CSF' ) ) {
278
  $file = ltrim( $file, '/' );
279
  $override = apply_filters( 'csf_override', 'csf-override' );
280
 
281
- if( file_exists( get_parent_theme_file_path( $override .'/'. $file ) ) ) {
282
  $path = get_parent_theme_file_path( $override .'/'. $file );
283
  } elseif ( file_exists( get_theme_file_path( $override .'/'. $file ) ) ) {
284
  $path = get_theme_file_path( $override .'/'. $file );
@@ -288,11 +288,11 @@ if( ! class_exists( 'CSF' ) ) {
288
  $path = self::$dir .'/'. $file;
289
  }
290
 
291
- if( ! empty( $path ) && ! empty( $file ) && $load ) {
292
 
293
  global $wp_query;
294
 
295
- if( is_object( $wp_query ) && function_exists( 'load_template' ) ) {
296
 
297
  load_template( $path, true );
298
 
@@ -321,7 +321,7 @@ if( ! class_exists( 'CSF' ) ) {
321
 
322
  // Set plugin url
323
  public static function include_plugin_url( $file ) {
324
- return self::$url .'/'. ltrim( $file, '/' );
325
  }
326
 
327
  // General includes
@@ -340,7 +340,7 @@ if( ! class_exists( 'CSF' ) ) {
340
  self::include_plugin_file( 'classes/options.class.php' );
341
 
342
  // includes premium version classes
343
- if( self::$premium ) {
344
  self::include_plugin_file( 'classes/customize-options.class.php' );
345
  self::include_plugin_file( 'classes/metabox.class.php' );
346
  self::include_plugin_file( 'classes/profile-options.class.php' );
@@ -354,7 +354,7 @@ if( ! class_exists( 'CSF' ) ) {
354
 
355
  // Include field
356
  public static function maybe_include_field( $type = '' ) {
357
- if( ! class_exists( 'CSF_Field_'. $type ) && class_exists( 'CSF_Fields' ) ) {
358
  self::include_plugin_file( 'fields/'. $type .'/'. $type .'.php' );
359
  }
360
  }
@@ -367,23 +367,23 @@ if( ! class_exists( 'CSF' ) ) {
367
  // Get all of fields
368
  public static function set_used_fields( $sections ) {
369
 
370
- if( ! empty( $sections['fields'] ) ) {
371
 
372
- foreach( $sections['fields'] as $field ) {
373
 
374
- if( ! empty( $field['fields'] ) ) {
375
  self::set_used_fields( $field );
376
  }
377
 
378
- if( ! empty( $field['tabs'] ) ) {
379
  self::set_used_fields( array( 'fields' => $field['tabs'] ) );
380
  }
381
 
382
- if( ! empty( $field['accordions'] ) ) {
383
  self::set_used_fields( array( 'fields' => $field['accordions'] ) );
384
  }
385
 
386
- if( ! empty( $field['type'] ) ) {
387
  self::$fields[$field['type']] = $field;
388
  }
389
 
@@ -395,14 +395,7 @@ if( ! class_exists( 'CSF' ) ) {
395
 
396
  //
397
  // Enqueue admin and fields styles and scripts.
398
- public static function add_admin_enqueue_scripts( $hook ) {
399
-
400
- // Scripts is only can be load on ulike pages.
401
- if ( strpos( $hook, WP_ULIKE_SLUG ) === false ) {
402
- if( ! defined( 'WP_ULIKE_PRO_DOMAIN' ) || ! in_array( $hook, array( 'post.php', 'post-new.php' ) ) ){
403
- return;
404
- }
405
- }
406
 
407
  // check for developer mode
408
  $min = ( apply_filters( 'csf_dev_mode', false ) || WP_DEBUG ) ? '' : '.min';
@@ -414,20 +407,25 @@ if( ! class_exists( 'CSF' ) ) {
414
  wp_enqueue_style( 'wp-color-picker' );
415
  wp_enqueue_script( 'wp-color-picker' );
416
 
417
- // cdn styles
418
- wp_enqueue_style( 'csf-fa', 'https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css', array(), '4.7.1', 'all' );
 
 
 
 
 
419
 
420
  // framework core styles
421
- wp_enqueue_style( 'csf', CSF::include_plugin_url( 'assets/css/csf'. $min .'.css' ), array(), WP_ULIKE_VERSION, 'all' );
422
 
423
  // rtl styles
424
- if( is_rtl() ) {
425
- wp_enqueue_style( 'csf-rtl', CSF::include_plugin_url( 'assets/css/csf-rtl'. $min .'.css' ), array(), WP_ULIKE_VERSION, 'all' );
426
  }
427
 
428
  // framework core scripts
429
- wp_enqueue_script( 'csf-plugins', CSF::include_plugin_url( 'assets/js/csf-plugins'. $min .'.js' ), array(), WP_ULIKE_VERSION, true );
430
- wp_enqueue_script( 'csf', CSF::include_plugin_url( 'assets/js/csf'. $min .'.js' ), array( 'csf-plugins' ), WP_ULIKE_VERSION, true );
431
 
432
  wp_localize_script( 'csf', 'csf_vars', array(
433
  'color_palette' => apply_filters( 'csf_color_palette', array() ),
@@ -447,14 +445,14 @@ if( ! class_exists( 'CSF' ) ) {
447
  // load admin enqueue scripts and styles
448
  $enqueued = array();
449
 
450
- if( ! empty( self::$fields ) ) {
451
- foreach( self::$fields as $field ) {
452
- if( ! empty( $field['type'] ) ) {
453
  $classname = 'CSF_Field_' . $field['type'];
454
  self::maybe_include_field( $field['type'] );
455
- if( class_exists( $classname ) && method_exists( $classname, 'enqueue' ) ) {
456
  $instance = new $classname( $field );
457
- if( method_exists( $classname, 'enqueue' ) ) {
458
  $instance->enqueue();
459
  }
460
  unset( $instance );
@@ -479,7 +477,7 @@ if( ! class_exists( 'CSF' ) ) {
479
 
480
  $current_branch = implode( '.', array_slice( preg_split( '/[.-]/', $wp_version ), 0, 2 ) );
481
 
482
- if( version_compare( $current_branch, '5.3', '<' ) ) {
483
 
484
  echo '<style type="text/css">
485
  .csf-field-slider .csf--unit,
@@ -506,7 +504,7 @@ if( ! class_exists( 'CSF' ) ) {
506
  public static function field( $field = array(), $value = '', $unique = '', $where = '', $parent = '' ) {
507
 
508
  // Check for unallow fields
509
- if( ! empty( $field['_notice'] ) ) {
510
 
511
  $field_type = $field['type'];
512
 
@@ -520,9 +518,9 @@ if( ! class_exists( 'CSF' ) ) {
520
  $depend = '';
521
  $hidden = '';
522
  $unique = ( ! empty( $unique ) ) ? $unique : '';
523
- $class = ( ! empty( $field['class'] ) ) ? ' ' . $field['class'] : '';
524
  $is_pseudo = ( ! empty( $field['pseudo'] ) ) ? ' csf-pseudo-field' : '';
525
- $field_type = ( ! empty( $field['type'] ) ) ? $field['type'] : '';
526
 
527
  if ( ! empty( $field['dependency'] ) ) {
528
 
@@ -533,7 +531,7 @@ if( ! class_exists( 'CSF' ) ) {
533
  $data_value = '';
534
  $data_global = '';
535
 
536
- if( is_array( $dependency[0] ) ) {
537
  $data_controller = implode( '|', array_column( $dependency, 0 ) );
538
  $data_condition = implode( '|', array_column( $dependency, 1 ) );
539
  $data_value = implode( '|', array_column( $dependency, 2 ) );
@@ -545,23 +543,30 @@ if( ! class_exists( 'CSF' ) ) {
545
  $data_global = ( ! empty( $dependency[3] ) ) ? $dependency[3] : '';
546
  }
547
 
548
- $depend .= ' data-controller="'. $data_controller .'"';
549
- $depend .= ' data-condition="'. $data_condition .'"';
550
- $depend .= ' data-value="'. $data_value .'"';
551
  $depend .= ( ! empty( $data_global ) ) ? ' data-depend-global="true"' : '';
552
 
553
  }
554
 
555
- if( ! empty( $field_type ) ) {
556
 
 
557
  echo '<div class="csf-field csf-field-'. $field_type . $is_pseudo . $class . $hidden .'"'. $depend .'>';
558
 
559
- if( ! empty( $field['title'] ) ) {
560
- $subtitle = ( ! empty( $field['subtitle'] ) ) ? '<p class="csf-text-subtitle">'. $field['subtitle'] .'</p>' : '';
561
- echo '<div class="csf-title"><h4>' . $field['title'] . '</h4>'. $subtitle .'</div>';
 
 
 
 
 
 
562
  }
563
 
564
- echo ( ! empty( $field['title'] ) ) ? '<div class="csf-fieldset">' : '';
565
 
566
  $value = ( ! isset( $value ) && isset( $field['default'] ) ) ? $field['default'] : $value;
567
  $value = ( isset( $field['value'] ) ) ? $field['value'] : $value;
@@ -570,7 +575,7 @@ if( ! class_exists( 'CSF' ) ) {
570
 
571
  $classname = 'CSF_Field_'. $field_type;
572
 
573
- if( class_exists( $classname ) ) {
574
  $instance = new $classname( $field, $value, $unique, $where, $parent );
575
  $instance->render();
576
  } else {
@@ -581,7 +586,7 @@ if( ! class_exists( 'CSF' ) ) {
581
  echo '<p>'. esc_html__( 'This type is not found!', 'csf' ) .'</p>';
582
  }
583
 
584
- echo ( ! empty( $field['title'] ) ) ? '</div>' : '';
585
  echo '<div class="clear"></div>';
586
  echo '</div>';
587
 
7
  * @version 1.0.0
8
  *
9
  */
10
+ if ( ! class_exists( 'CSF' ) ) {
11
  class CSF {
12
 
13
  // constants
14
+ public static $version = '2.1.5';
15
  public static $premium = true;
16
  public static $dir = null;
17
  public static $url = null;
59
  public static function setup() {
60
 
61
  // welcome page
62
+ // self::include_plugin_file( 'views/welcome.php' );
63
 
64
  // setup options
65
  $params = array();
66
  if ( ! empty( self::$args['options'] ) ) {
67
+ foreach ( self::$args['options'] as $key => $value ) {
68
+ if ( ! empty( self::$args['sections'][$key] ) && ! isset( self::$inited[$key] ) ) {
69
 
70
  $params['args'] = $value;
71
  $params['sections'] = self::$args['sections'][$key];
73
 
74
  CSF_Options::instance( $key, $params );
75
 
76
+ if ( ! empty( $value['show_in_customizer'] ) ) {
77
  $value['output_css'] = false;
78
  $value['enqueue_webfont'] = false;
79
  self::$args['customize_options'][$key] = $value;
87
  // setup customize options
88
  $params = array();
89
  if ( ! empty( self::$args['customize_options'] ) ) {
90
+ foreach ( self::$args['customize_options'] as $key => $value ) {
91
+ if ( ! empty( self::$args['sections'][$key] ) && ! isset( self::$inited[$key] ) ) {
92
 
93
  $params['args'] = $value;
94
  $params['sections'] = self::$args['sections'][$key];
104
  // setup metaboxes
105
  $params = array();
106
  if ( ! empty( self::$args['metaboxes'] ) ) {
107
+ foreach ( self::$args['metaboxes'] as $key => $value ) {
108
+ if ( ! empty( self::$args['sections'][$key] ) && ! isset( self::$inited[$key] ) ) {
109
 
110
  $params['args'] = $value;
111
  $params['sections'] = self::$args['sections'][$key];
120
  // setup profile options
121
  $params = array();
122
  if ( ! empty( self::$args['profile_options'] ) ) {
123
+ foreach ( self::$args['profile_options'] as $key => $value ) {
124
+ if ( ! empty( self::$args['sections'][$key] ) && ! isset( self::$inited[$key] ) ) {
125
 
126
  $params['args'] = $value;
127
  $params['sections'] = self::$args['sections'][$key];
137
  $params = array();
138
  if ( ! empty( self::$args['shortcoders'] ) ) {
139
 
140
+ foreach ( self::$args['shortcoders'] as $key => $value ) {
141
+ if ( ! empty( self::$args['sections'][$key] ) && ! isset( self::$inited[$key] ) ) {
142
 
143
  $params['args'] = $value;
144
  $params['sections'] = self::$args['sections'][$key];
150
  }
151
 
152
  // Once editor setup for gutenberg and media buttons
153
+ if ( ! empty( CSF::$shortcode_instances ) ) {
154
  CSF_Shortcoder::once_editor_setup();
155
  }
156
 
159
  // setup taxonomy options
160
  $params = array();
161
  if ( ! empty( self::$args['taxonomy_options'] ) ) {
162
+ foreach ( self::$args['taxonomy_options'] as $key => $value ) {
163
+ if ( ! empty( self::$args['sections'][$key] ) && ! isset( self::$inited[$key] ) ) {
164
 
165
  $params['args'] = $value;
166
  $params['sections'] = self::$args['sections'][$key];
177
 
178
  $wp_widget_factory = new WP_Widget_Factory();
179
 
180
+ foreach ( self::$args['widgets'] as $key => $value ) {
181
+ if ( ! isset( self::$inited[$key] ) ) {
182
  self::$inited[$key] = true;
183
  $wp_widget_factory->register( CSF_Widget::instance( $key, $value ) );
184
  }
189
  // setup comment metabox
190
  $params = array();
191
  if ( ! empty( self::$args['comment_metaboxes'] ) ) {
192
+ foreach ( self::$args['comment_metaboxes'] as $key => $value ) {
193
+ if ( ! empty( self::$args['sections'][$key] ) && ! isset( self::$inited[$key] ) ) {
194
 
195
  $params['args'] = $value;
196
  $params['sections'] = self::$args['sections'][$key];
278
  $file = ltrim( $file, '/' );
279
  $override = apply_filters( 'csf_override', 'csf-override' );
280
 
281
+ if ( file_exists( get_parent_theme_file_path( $override .'/'. $file ) ) ) {
282
  $path = get_parent_theme_file_path( $override .'/'. $file );
283
  } elseif ( file_exists( get_theme_file_path( $override .'/'. $file ) ) ) {
284
  $path = get_theme_file_path( $override .'/'. $file );
288
  $path = self::$dir .'/'. $file;
289
  }
290
 
291
+ if ( ! empty( $path ) && ! empty( $file ) && $load ) {
292
 
293
  global $wp_query;
294
 
295
+ if ( is_object( $wp_query ) && function_exists( 'load_template' ) ) {
296
 
297
  load_template( $path, true );
298
 
321
 
322
  // Set plugin url
323
  public static function include_plugin_url( $file ) {
324
+ return esc_url( self::$url ) .'/'. ltrim( $file, '/' );
325
  }
326
 
327
  // General includes
340
  self::include_plugin_file( 'classes/options.class.php' );
341
 
342
  // includes premium version classes
343
+ if ( self::$premium ) {
344
  self::include_plugin_file( 'classes/customize-options.class.php' );
345
  self::include_plugin_file( 'classes/metabox.class.php' );
346
  self::include_plugin_file( 'classes/profile-options.class.php' );
354
 
355
  // Include field
356
  public static function maybe_include_field( $type = '' ) {
357
+ if ( ! class_exists( 'CSF_Field_'. $type ) && class_exists( 'CSF_Fields' ) ) {
358
  self::include_plugin_file( 'fields/'. $type .'/'. $type .'.php' );
359
  }
360
  }
367
  // Get all of fields
368
  public static function set_used_fields( $sections ) {
369
 
370
+ if ( ! empty( $sections['fields'] ) ) {
371
 
372
+ foreach ( $sections['fields'] as $field ) {
373
 
374
+ if ( ! empty( $field['fields'] ) ) {
375
  self::set_used_fields( $field );
376
  }
377
 
378
+ if ( ! empty( $field['tabs'] ) ) {
379
  self::set_used_fields( array( 'fields' => $field['tabs'] ) );
380
  }
381
 
382
+ if ( ! empty( $field['accordions'] ) ) {
383
  self::set_used_fields( array( 'fields' => $field['accordions'] ) );
384
  }
385
 
386
+ if ( ! empty( $field['type'] ) ) {
387
  self::$fields[$field['type']] = $field;
388
  }
389
 
395
 
396
  //
397
  // Enqueue admin and fields styles and scripts.
398
+ public static function add_admin_enqueue_scripts() {
 
 
 
 
 
 
 
399
 
400
  // check for developer mode
401
  $min = ( apply_filters( 'csf_dev_mode', false ) || WP_DEBUG ) ? '' : '.min';
407
  wp_enqueue_style( 'wp-color-picker' );
408
  wp_enqueue_script( 'wp-color-picker' );
409
 
410
+ // font awesome 4 and 5
411
+ if ( apply_filters( 'csf_fa4', false ) ) {
412
+ wp_enqueue_style( 'csf-fa', 'https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome'. $min .'.css', array(), '4.7.0', 'all' );
413
+ } else {
414
+ wp_enqueue_style( 'csf-fa5', 'https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.13.0/css/all'. $min .'.css', array(), '5.13.0', 'all' );
415
+ wp_enqueue_style( 'csf-fa5-v4-shims', 'https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.13.0/css/v4-shims'. $min .'.css', array(), '5.13.0', 'all' );
416
+ }
417
 
418
  // framework core styles
419
+ wp_enqueue_style( 'csf', CSF::include_plugin_url( 'assets/css/csf'. $min .'.css' ), array(), '1.0.0', 'all' );
420
 
421
  // rtl styles
422
+ if ( is_rtl() ) {
423
+ wp_enqueue_style( 'csf-rtl', CSF::include_plugin_url( 'assets/css/csf-rtl'. $min .'.css' ), array(), '1.0.0', 'all' );
424
  }
425
 
426
  // framework core scripts
427
+ wp_enqueue_script( 'csf-plugins', CSF::include_plugin_url( 'assets/js/csf-plugins'. $min .'.js' ), array(), '1.0.0', true );
428
+ wp_enqueue_script( 'csf', CSF::include_plugin_url( 'assets/js/csf'. $min .'.js' ), array( 'csf-plugins' ), '1.0.0', true );
429
 
430
  wp_localize_script( 'csf', 'csf_vars', array(
431
  'color_palette' => apply_filters( 'csf_color_palette', array() ),
445
  // load admin enqueue scripts and styles
446
  $enqueued = array();
447
 
448
+ if ( ! empty( self::$fields ) ) {
449
+ foreach ( self::$fields as $field ) {
450
+ if ( ! empty( $field['type'] ) ) {
451
  $classname = 'CSF_Field_' . $field['type'];
452
  self::maybe_include_field( $field['type'] );
453
+ if ( class_exists( $classname ) && method_exists( $classname, 'enqueue' ) ) {
454
  $instance = new $classname( $field );
455
+ if ( method_exists( $classname, 'enqueue' ) ) {
456
  $instance->enqueue();
457
  }
458
  unset( $instance );
477
 
478
  $current_branch = implode( '.', array_slice( preg_split( '/[.-]/', $wp_version ), 0, 2 ) );
479
 
480
+ if ( version_compare( $current_branch, '5.3', '<' ) ) {
481
 
482
  echo '<style type="text/css">
483
  .csf-field-slider .csf--unit,
504
  public static function field( $field = array(), $value = '', $unique = '', $where = '', $parent = '' ) {
505
 
506
  // Check for unallow fields
507
+ if ( ! empty( $field['_notice'] ) ) {
508
 
509
  $field_type = $field['type'];
510
 
518
  $depend = '';
519
  $hidden = '';
520
  $unique = ( ! empty( $unique ) ) ? $unique : '';
521
+ $class = ( ! empty( $field['class'] ) ) ? ' ' . esc_attr( $field['class'] ) : '';
522
  $is_pseudo = ( ! empty( $field['pseudo'] ) ) ? ' csf-pseudo-field' : '';
523
+ $field_type = ( ! empty( $field['type'] ) ) ? esc_attr( $field['type'] ) : '';
524
 
525
  if ( ! empty( $field['dependency'] ) ) {
526
 
531
  $data_value = '';
532
  $data_global = '';
533
 
534
+ if ( is_array( $dependency[0] ) ) {
535
  $data_controller = implode( '|', array_column( $dependency, 0 ) );
536
  $data_condition = implode( '|', array_column( $dependency, 1 ) );
537
  $data_value = implode( '|', array_column( $dependency, 2 ) );
543
  $data_global = ( ! empty( $dependency[3] ) ) ? $dependency[3] : '';
544
  }
545
 
546
+ $depend .= ' data-controller="'. esc_attr( $data_controller ) .'"';
547
+ $depend .= ' data-condition="'. esc_attr( $data_condition ) .'"';
548
+ $depend .= ' data-value="'. esc_attr( $data_value ) .'"';
549
  $depend .= ( ! empty( $data_global ) ) ? ' data-depend-global="true"' : '';
550
 
551
  }
552
 
553
+ if ( ! empty( $field_type ) ) {
554
 
555
+ // These attributes has been sanitized above.
556
  echo '<div class="csf-field csf-field-'. $field_type . $is_pseudo . $class . $hidden .'"'. $depend .'>';
557
 
558
+ if ( ! empty( $field['fancy_title'] ) ) {
559
+ echo '<div class="csf-fancy-title">' . wp_kses_post( $field['fancy_title'] ) .'</div>';
560
+ }
561
+
562
+ if ( ! empty( $field['title'] ) ) {
563
+ echo '<div class="csf-title">';
564
+ echo '<h4>'. wp_kses_post( $field['title'] ) .'</h4>';
565
+ echo ( ! empty( $field['subtitle'] ) ) ? '<div class="csf-text-subtitle">'. wp_kses_post( $field['subtitle'] ) .'</div>' : '';
566
+ echo '</div>';
567
  }
568
 
569
+ echo ( ! empty( $field['title'] ) || ! empty( $field['fancy_title'] ) ) ? '<div class="csf-fieldset">' : '';
570
 
571
  $value = ( ! isset( $value ) && isset( $field['default'] ) ) ? $field['default'] : $value;
572
  $value = ( isset( $field['value'] ) ) ? $field['value'] : $value;
575
 
576
  $classname = 'CSF_Field_'. $field_type;
577
 
578
+ if ( class_exists( $classname ) ) {
579
  $instance = new $classname( $field, $value, $unique, $where, $parent );
580
  $instance->render();
581
  } else {
586
  echo '<p>'. esc_html__( 'This type is not found!', 'csf' ) .'</p>';
587
  }
588
 
589
+ echo ( ! empty( $field['title'] ) || ! empty( $field['fancy_title'] ) ) ? '</div>' : '';
590
  echo '<div class="clear"></div>';
591
  echo '</div>';
592
 
admin/settings/classes/shortcoder.class.php CHANGED
@@ -7,7 +7,7 @@
7
  * @version 1.0.0
8
  *
9
  */
10
- if( ! class_exists( 'CSF_Shortcoder' ) ) {
11
  class CSF_Shortcoder extends CSF_Abstract{
12
 
13
  // constans
@@ -47,12 +47,12 @@ if( ! class_exists( 'CSF_Shortcoder' ) ) {
47
  add_action( 'customize_controls_print_footer_scripts', array( &$this, 'add_shortcode_modal' ) );
48
  add_action( 'wp_ajax_csf-get-shortcode-'. $this->unique, array( &$this, 'get_shortcode' ) );
49
 
50
- if( ! empty( $this->args['show_in_editor'] ) ) {
51
 
52
  CSF::$shortcode_instances[] = wp_parse_args( array( 'hash' => md5( $key ), 'modal_id' => $this->unique ), $this->args );
53
 
54
  // elementor editor support
55
- if( CSF::is_active_plugin( 'elementor/elementor.php' ) ) {
56
  add_action( 'elementor/editor/before_enqueue_scripts', array( 'CSF', 'add_admin_enqueue_scripts' ), 20 );
57
  add_action( 'elementor/editor/footer', array( &$this, 'add_shortcode_modal' ) );
58
  add_action( 'elementor/editor/footer', 'csf_set_icons' );
@@ -73,8 +73,8 @@ if( ! class_exists( 'CSF_Shortcoder' ) ) {
73
  $parents = array();
74
  $count = 100;
75
 
76
- foreach( $sections as $key => $section ) {
77
- if( ! empty( $section['parent'] ) ) {
78
  $section['priority'] = ( isset( $section['priority'] ) ) ? $section['priority'] : $count;
79
  $parents[$section['parent']][] = $section;
80
  unset( $sections[$key] );
@@ -82,9 +82,9 @@ if( ! class_exists( 'CSF_Shortcoder' ) ) {
82
  $count++;
83
  }
84
 
85
- foreach( $sections as $key => $section ) {
86
  $section['priority'] = ( isset( $section['priority'] ) ) ? $section['priority'] : $count;
87
- if( ! empty( $section['id'] ) && ! empty( $parents[$section['id']] ) ) {
88
  $section['subs'] = wp_list_sort( $parents[$section['id']], array( 'priority' => 'ASC' ), 'ASC', true );
89
  }
90
  $result[] = $section;
@@ -98,13 +98,13 @@ if( ! class_exists( 'CSF_Shortcoder' ) ) {
98
 
99
  $result = array();
100
 
101
- foreach( $this->pre_tabs as $tab ) {
102
- if( ! empty( $tab['subs'] ) ) {
103
- foreach( $tab['subs'] as $sub ) {
104
  $result[] = $sub;
105
  }
106
  }
107
- if( empty( $tab['subs'] ) ) {
108
  $result[] = $tab;
109
  }
110
  }
@@ -115,8 +115,8 @@ if( ! class_exists( 'CSF_Shortcoder' ) ) {
115
  // get default value
116
  public function get_default( $field ) {
117
 
118
- $default = ( isset( $field['id'] ) && isset( $this->args['defaults'][$field['id']] ) ) ? $this->args['defaults'][$field['id']] : null;
119
- $default = ( isset( $field['default'] ) ) ? $field['default'] : $default;
120
 
121
  return $default;
122
 
@@ -124,56 +124,59 @@ if( ! class_exists( 'CSF_Shortcoder' ) ) {
124
 
125
  public function add_shortcode_modal() {
126
 
127
- $class = ( $this->args['class'] ) ? ' '. $this->args['class'] : '';
128
  $has_select = ( count( $this->pre_tabs ) > 1 ) ? true : false;
129
  $single_usage = ( ! $has_select ) ? ' csf-shortcode-single' : '';
130
  $hide_header = ( ! $has_select ) ? ' hidden' : '';
131
 
132
  ?>
133
- <div id="csf-modal-<?php echo $this->unique; ?>" class="wp-core-ui csf-modal csf-shortcode<?php echo $single_usage . $class; ?>" data-modal-id="<?php echo $this->unique; ?>" data-nonce="<?php echo wp_create_nonce( 'csf_shortcode_nonce' ); ?>">
134
  <div class="csf-modal-table">
135
  <div class="csf-modal-table-cell">
136
  <div class="csf-modal-overlay"></div>
137
  <div class="csf-modal-inner">
138
  <div class="csf-modal-title">
139
- <?php echo $this->args['button_title']; ?>
140
  <div class="csf-modal-close"></div>
141
  </div>
142
  <?php
143
 
144
- echo '<div class="csf-modal-header'. $hide_header .'">';
145
  echo '<select>';
146
- echo ( $has_select ) ? '<option value="">'. $this->args['select_title'] .'</option>' : '';
147
 
148
  $tab_key = 1;
 
149
  foreach ( $this->pre_tabs as $tab ) {
150
 
151
- if( ! empty( $tab['subs'] ) ) {
152
 
153
- echo '<optgroup label="'. $tab['title'] .'">';
154
 
155
  foreach ( $tab['subs'] as $sub ) {
156
 
157
- $view = ( ! empty( $sub['view'] ) ) ? ' data-view="'. $sub['view'] .'"' : '';
158
- $shortcode = ( ! empty( $sub['shortcode'] ) ) ? ' data-shortcode="'. $sub['shortcode'] .'"' : '';
159
- $group = ( ! empty( $sub['group_shortcode'] ) ) ? ' data-group="'. $sub['group_shortcode'] .'"' : '';
160
 
161
- echo '<option value="'. $tab_key .'"'. $view . $shortcode . $group .'>'. $sub['title'] .'</option>';
162
 
163
  $tab_key++;
 
164
  }
165
 
166
  echo '</optgroup>' ;
167
 
168
  } else {
169
 
170
- $view = ( ! empty( $tab['view'] ) ) ? ' data-view="'. $tab['view'] .'"' : '';
171
- $shortcode = ( ! empty( $tab['shortcode'] ) ) ? ' data-shortcode="'. $tab['shortcode'] .'"' : '';
172
- $group = ( ! empty( $tab['group_shortcode'] ) ) ? ' data-group="'. $tab['group_shortcode'] .'"' : '';
173
 
174
- echo '<option value="'. $tab_key .'"'. $view . $shortcode . $group .'>'. $tab['title'] .'</option>';
175
 
176
  $tab_key++;
 
177
  }
178
 
179
  }
@@ -186,7 +189,7 @@ if( ! class_exists( 'CSF_Shortcoder' ) ) {
186
  <div class="csf-modal-loading"><div class="csf-loading"></div></div>
187
  <div class="csf-modal-load"></div>
188
  </div>
189
- <div class="csf-modal-insert-wrapper hidden"><a href="#" class="button button-primary csf-modal-insert"><?php echo $this->args['insert_title']; ?></a></div>
190
  </div>
191
  </div>
192
  </div>
@@ -198,31 +201,32 @@ if( ! class_exists( 'CSF_Shortcoder' ) ) {
198
 
199
  ob_start();
200
 
201
- $shortcode_key = csf_get_var( 'shortcode_key' );
 
202
 
203
- if( ! empty( $shortcode_key ) && wp_verify_nonce( csf_get_var( 'nonce' ), 'csf_shortcode_nonce' ) ) {
204
 
205
  $unallows = array( 'group', 'repeater', 'sorter' );
206
  $section = $this->pre_sections[$shortcode_key-1];
207
  $shortcode = ( ! empty( $section['shortcode'] ) ) ? $section['shortcode'] : '';
208
  $view = ( ! empty( $section['view'] ) ) ? $section['view'] : 'normal';
209
 
210
- if( ! empty( $section ) ) {
211
 
212
  //
213
  // View: normal
214
- if( ! empty( $section['fields'] ) && $view !== 'repeater' ) {
215
 
216
  echo '<div class="csf-fields">';
217
 
218
  foreach ( $section['fields'] as $field ) {
219
 
220
- if( in_array( $field['type'], $unallows ) ) { $field['_notice'] = true; }
221
 
222
  // Extra tag improves for spesific fields (border, spacing, dimensions etc...)
223
  $field['tag_prefix'] = ( ! empty( $field['tag_prefix'] ) ) ? $field['tag_prefix'] .'_' : '';
224
 
225
- $field_default = $this->get_default( $field );
226
 
227
  CSF::field( $field, $field_default, $shortcode, 'shortcode' );
228
 
@@ -237,7 +241,7 @@ if( ! class_exists( 'CSF_Shortcoder' ) ) {
237
  $repeatable_fields = ( $view === 'repeater' && ! empty( $section['fields'] ) ) ? $section['fields'] : array();
238
  $repeatable_fields = ( $view === 'group' && ! empty( $section['group_fields'] ) ) ? $section['group_fields'] : $repeatable_fields;
239
 
240
- if( ! empty( $repeatable_fields ) ) {
241
 
242
  $button_title = ( ! empty( $section['button_title'] ) ) ? ' '. $section['button_title'] : esc_html__( 'Add one more', 'csf' );
243
  $inner_shortcode = ( ! empty( $section['group_shortcode'] ) ) ? $section['group_shortcode'] : $shortcode;
@@ -246,18 +250,18 @@ if( ! class_exists( 'CSF_Shortcoder' ) ) {
246
 
247
  echo '<div class="csf--repeat-shortcode">';
248
 
249
- echo '<div class="csf-repeat-remove fa fa-times"></div>';
250
 
251
  echo '<div class="csf-fields">';
252
 
253
  foreach ( $repeatable_fields as $field ) {
254
 
255
- if( in_array( $field['type'], $unallows ) ) { $field['_notice'] = true; }
256
 
257
  // Extra tag improves for spesific fields (border, spacing, dimensions etc...)
258
  $field['tag_prefix'] = ( ! empty( $field['tag_prefix'] ) ) ? $field['tag_prefix'] .'_' : '';
259
 
260
- $field_default = $this->get_default( $field );
261
 
262
  CSF::field( $field, $field_default, $inner_shortcode.'[0]', 'shortcode' );
263
 
@@ -269,7 +273,7 @@ if( ! class_exists( 'CSF_Shortcoder' ) ) {
269
 
270
  echo '</div>';
271
 
272
- echo '<div class="csf--repeat-button-block"><a class="button csf--repeat-button" href="#"><i class="fa fa-plus-circle"></i> '. $button_title .'</a></div>';
273
 
274
  }
275
 
@@ -303,7 +307,7 @@ if( ! class_exists( 'CSF_Shortcoder' ) ) {
303
 
304
  wp_localize_script( 'csf-gutenberg-block', 'csf_gutenberg_blocks', CSF::$shortcode_instances );
305
 
306
- foreach( CSF::$shortcode_instances as $hash => $value ) {
307
 
308
  register_block_type( 'csf-gutenberg-block/block-'. $hash, array(
309
  'editor_script' => 'csf-gutenberg-block',
@@ -316,8 +320,8 @@ if( ! class_exists( 'CSF_Shortcoder' ) ) {
316
  // Add media buttons
317
  public static function add_media_buttons( $editor_id ) {
318
 
319
- foreach( CSF::$shortcode_instances as $hash => $value ) {
320
- echo '<a href="#" class="button button-primary csf-shortcode-button" data-editor-id="'. $editor_id .'" data-modal-id="'. $value['modal_id'] .'">'. $value['button_title'] .'</a>';
321
  }
322
 
323
  }
7
  * @version 1.0.0
8
  *
9
  */
10
+ if ( ! class_exists( 'CSF_Shortcoder' ) ) {
11
  class CSF_Shortcoder extends CSF_Abstract{
12
 
13
  // constans
47
  add_action( 'customize_controls_print_footer_scripts', array( &$this, 'add_shortcode_modal' ) );
48
  add_action( 'wp_ajax_csf-get-shortcode-'. $this->unique, array( &$this, 'get_shortcode' ) );
49
 
50
+ if ( ! empty( $this->args['show_in_editor'] ) ) {
51
 
52
  CSF::$shortcode_instances[] = wp_parse_args( array( 'hash' => md5( $key ), 'modal_id' => $this->unique ), $this->args );
53
 
54
  // elementor editor support
55
+ if ( CSF::is_active_plugin( 'elementor/elementor.php' ) ) {
56
  add_action( 'elementor/editor/before_enqueue_scripts', array( 'CSF', 'add_admin_enqueue_scripts' ), 20 );
57
  add_action( 'elementor/editor/footer', array( &$this, 'add_shortcode_modal' ) );
58
  add_action( 'elementor/editor/footer', 'csf_set_icons' );
73
  $parents = array();
74
  $count = 100;
75
 
76
+ foreach ( $sections as $key => $section ) {
77
+ if ( ! empty( $section['parent'] ) ) {
78
  $section['priority'] = ( isset( $section['priority'] ) ) ? $section['priority'] : $count;
79
  $parents[$section['parent']][] = $section;
80
  unset( $sections[$key] );
82
  $count++;
83
  }
84
 
85
+ foreach ( $sections as $key => $section ) {
86
  $section['priority'] = ( isset( $section['priority'] ) ) ? $section['priority'] : $count;
87
+ if ( ! empty( $section['id'] ) && ! empty( $parents[$section['id']] ) ) {
88
  $section['subs'] = wp_list_sort( $parents[$section['id']], array( 'priority' => 'ASC' ), 'ASC', true );
89
  }
90
  $result[] = $section;
98
 
99
  $result = array();
100
 
101
+ foreach ( $this->pre_tabs as $tab ) {
102
+ if ( ! empty( $tab['subs'] ) ) {
103
+ foreach ( $tab['subs'] as $sub ) {
104
  $result[] = $sub;
105
  }
106
  }
107
+ if ( empty( $tab['subs'] ) ) {
108
  $result[] = $tab;
109
  }
110
  }
115
  // get default value
116
  public function get_default( $field ) {
117
 
118
+ $default = ( isset( $field['default'] ) ) ? $field['default'] : '';
119
+ $default = ( isset( $this->args['defaults'][$field['id']] ) ) ? $this->args['defaults'][$field['id']] : $default;
120
 
121
  return $default;
122
 
124
 
125
  public function add_shortcode_modal() {
126
 
127
+ $class = ( $this->args['class'] ) ? ' '. esc_attr( $this->args['class'] ) : '';
128
  $has_select = ( count( $this->pre_tabs ) > 1 ) ? true : false;
129
  $single_usage = ( ! $has_select ) ? ' csf-shortcode-single' : '';
130
  $hide_header = ( ! $has_select ) ? ' hidden' : '';
131
 
132
  ?>
133
+ <div id="csf-modal-<?php echo esc_attr( $this->unique ); ?>" class="wp-core-ui csf-modal csf-shortcode<?php echo esc_attr( $single_usage . $class ); ?>" data-modal-id="<?php echo esc_attr( $this->unique ); ?>" data-nonce="<?php echo esc_attr( wp_create_nonce( 'csf_shortcode_nonce' ) ); ?>">
134
  <div class="csf-modal-table">
135
  <div class="csf-modal-table-cell">
136
  <div class="csf-modal-overlay"></div>
137
  <div class="csf-modal-inner">
138
  <div class="csf-modal-title">
139
+ <?php echo wp_kses_post( $this->args['button_title'] ); ?>
140
  <div class="csf-modal-close"></div>
141
  </div>
142
  <?php
143
 
144
+ echo '<div class="csf-modal-header'. esc_attr( $hide_header ) .'">';
145
  echo '<select>';
146
+ echo ( $has_select ) ? '<option value="">'. esc_attr( $this->args['select_title'] ) .'</option>' : '';
147
 
148
  $tab_key = 1;
149
+
150
  foreach ( $this->pre_tabs as $tab ) {
151
 
152
+ if ( ! empty( $tab['subs'] ) ) {
153
 
154
+ echo '<optgroup label="'. esc_attr( $tab['title'] ) .'">';
155
 
156
  foreach ( $tab['subs'] as $sub ) {
157
 
158
+ $view = ( ! empty( $sub['view'] ) ) ? ' data-view="'. esc_attr( $sub['view'] ) .'"' : '';
159
+ $shortcode = ( ! empty( $sub['shortcode'] ) ) ? ' data-shortcode="'. esc_attr( $sub['shortcode'] ) .'"' : '';
160
+ $group = ( ! empty( $sub['group_shortcode'] ) ) ? ' data-group="'. esc_attr( $sub['group_shortcode'] ) .'"' : '';
161
 
162
+ echo '<option value="'. esc_attr( $tab_key ) .'"'. $view . $shortcode . $group .'>'. esc_attr( $sub['title'] ) .'</option>';
163
 
164
  $tab_key++;
165
+
166
  }
167
 
168
  echo '</optgroup>' ;
169
 
170
  } else {
171
 
172
+ $view = ( ! empty( $tab['view'] ) ) ? ' data-view="'. esc_attr( $tab['view'] ) .'"' : '';
173
+ $shortcode = ( ! empty( $tab['shortcode'] ) ) ? ' data-shortcode="'. esc_attr( $tab['shortcode'] ) .'"' : '';
174
+ $group = ( ! empty( $tab['group_shortcode'] ) ) ? ' data-group="'. esc_attr( $tab['group_shortcode'] ) .'"' : '';
175
 
176
+ echo '<option value="'. esc_attr( $tab_key ) .'"'. $view . $shortcode . $group .'>'. esc_attr( $tab['title'] ) .'</option>';
177
 
178
  $tab_key++;
179
+
180
  }
181
 
182
  }
189
  <div class="csf-modal-loading"><div class="csf-loading"></div></div>
190
  <div class="csf-modal-load"></div>
191
  </div>
192
+ <div class="csf-modal-insert-wrapper hidden"><a href="#" class="button button-primary csf-modal-insert"><?php echo wp_kses_post( $this->args['insert_title'] ); ?></a></div>
193
  </div>
194
  </div>
195
  </div>
201
 
202
  ob_start();
203
 
204
+ $nonce = ( ! empty( $_POST[ 'nonce' ] ) ) ? sanitize_text_field( wp_unslash( $_POST[ 'nonce' ] ) ) : '';
205
+ $shortcode_key = ( ! empty( $_POST[ 'shortcode_key' ] ) ) ? sanitize_text_field( wp_unslash( $_POST[ 'shortcode_key' ] ) ) : '';
206
 
207
+ if ( ! empty( $shortcode_key ) && wp_verify_nonce( $nonce, 'csf_shortcode_nonce' ) ) {
208
 
209
  $unallows = array( 'group', 'repeater', 'sorter' );
210
  $section = $this->pre_sections[$shortcode_key-1];
211
  $shortcode = ( ! empty( $section['shortcode'] ) ) ? $section['shortcode'] : '';
212
  $view = ( ! empty( $section['view'] ) ) ? $section['view'] : 'normal';
213
 
214
+ if ( ! empty( $section ) ) {
215
 
216
  //
217
  // View: normal
218
+ if ( ! empty( $section['fields'] ) && $view !== 'repeater' ) {
219
 
220
  echo '<div class="csf-fields">';
221
 
222
  foreach ( $section['fields'] as $field ) {
223
 
224
+ if ( in_array( $field['type'], $unallows ) ) { $field['_notice'] = true; }
225
 
226
  // Extra tag improves for spesific fields (border, spacing, dimensions etc...)
227
  $field['tag_prefix'] = ( ! empty( $field['tag_prefix'] ) ) ? $field['tag_prefix'] .'_' : '';
228
 
229
+ $field_default = ( isset( $field['id'] ) ) ? $this->get_default( $field ) : '';
230
 
231
  CSF::field( $field, $field_default, $shortcode, 'shortcode' );
232
 
241
  $repeatable_fields = ( $view === 'repeater' && ! empty( $section['fields'] ) ) ? $section['fields'] : array();
242
  $repeatable_fields = ( $view === 'group' && ! empty( $section['group_fields'] ) ) ? $section['group_fields'] : $repeatable_fields;
243
 
244
+ if ( ! empty( $repeatable_fields ) ) {
245
 
246
  $button_title = ( ! empty( $section['button_title'] ) ) ? ' '. $section['button_title'] : esc_html__( 'Add one more', 'csf' );
247
  $inner_shortcode = ( ! empty( $section['group_shortcode'] ) ) ? $section['group_shortcode'] : $shortcode;
250
 
251
  echo '<div class="csf--repeat-shortcode">';
252
 
253
+ echo '<div class="csf-repeat-remove fas fa-times"></div>';
254
 
255
  echo '<div class="csf-fields">';
256
 
257
  foreach ( $repeatable_fields as $field ) {
258
 
259
+ if ( in_array( $field['type'], $unallows ) ) { $field['_notice'] = true; }
260
 
261
  // Extra tag improves for spesific fields (border, spacing, dimensions etc...)
262
  $field['tag_prefix'] = ( ! empty( $field['tag_prefix'] ) ) ? $field['tag_prefix'] .'_' : '';
263
 
264
+ $field_default = ( isset( $field['id'] ) ) ? $this->get_default( $field ) : '';
265
 
266
  CSF::field( $field, $field_default, $inner_shortcode.'[0]', 'shortcode' );
267
 
273
 
274
  echo '</div>';
275
 
276
+ echo '<div class="csf--repeat-button-block"><a class="button csf--repeat-button" href="#"><i class="fas fa-plus-circle"></i> '. wp_kses_post( $button_title ) .'</a></div>';
277
 
278
  }
279
 
307
 
308
  wp_localize_script( 'csf-gutenberg-block', 'csf_gutenberg_blocks', CSF::$shortcode_instances );
309
 
310
+ foreach ( CSF::$shortcode_instances as $hash => $value ) {
311
 
312
  register_block_type( 'csf-gutenberg-block/block-'. $hash, array(
313
  'editor_script' => 'csf-gutenberg-block',
320
  // Add media buttons
321
  public static function add_media_buttons( $editor_id ) {
322
 
323
+ foreach ( CSF::$shortcode_instances as $hash => $value ) {
324
+ echo '<a href="#" class="button button-primary csf-shortcode-button" data-editor-id="'. esc_attr( $editor_id ) .'" data-modal-id="'. esc_attr( $value['modal_id'] ) .'">'. wp_kses_post( $value['button_title'] ) .'</a>';
325
  }
326
 
327
  }
admin/settings/classes/taxonomy-options.class.php CHANGED
@@ -7,7 +7,7 @@
7
  * @version 1.0.0
8
  *
9
  */
10
- if( ! class_exists( 'CSF_Taxonomy_Options' ) ) {
11
  class CSF_Taxonomy_Options extends CSF_Abstract{
12
 
13
  // constans
@@ -19,8 +19,8 @@ if( ! class_exists( 'CSF_Taxonomy_Options' ) ) {
19
  public $args = array(
20
  'taxonomy' => '',
21
  'data_type' => 'serialize',
22
- 'defaults' => array(),
23
  'class' => '',
 
24
  );
25
 
26
  // run taxonomy construct
@@ -30,9 +30,9 @@ if( ! class_exists( 'CSF_Taxonomy_Options' ) ) {
30
  $this->args = apply_filters( "csf_{$this->unique}_args", wp_parse_args( $params['args'], $this->args ), $this );
31
  $this->sections = apply_filters( "csf_{$this->unique}_sections", $params['sections'], $this );
32
  $this->taxonomies = ( is_array( $this->args['taxonomy'] ) ) ? $this->args['taxonomy'] : array_filter( (array) $this->args['taxonomy'] );
33
- $this->taxonomy = csf_get_var( 'taxonomy' );
34
 
35
- if( ! empty( $this->taxonomies ) && in_array( $this->taxonomy, $this->taxonomies ) ) {
36
  add_action( 'admin_init', array( &$this, 'add_taxonomy_options' ) );
37
  }
38
 
@@ -57,8 +57,8 @@ if( ! class_exists( 'CSF_Taxonomy_Options' ) ) {
57
  // get default value
58
  public function get_default( $field ) {
59
 
60
- $default = ( isset( $field['id'] ) && isset( $this->args['defaults'][$field['id']] ) ) ? $this->args['defaults'][$field['id']] : null;
61
- $default = ( isset( $field['default'] ) ) ? $field['default'] : $default;
62
 
63
  return $default;
64
 
@@ -69,9 +69,9 @@ if( ! class_exists( 'CSF_Taxonomy_Options' ) ) {
69
 
70
  $value = null;
71
 
72
- if( ! empty( $term_id ) && ! empty( $field['id'] ) ) {
73
 
74
- if( $this->args['data_type'] !== 'serialize' ) {
75
  $meta = get_term_meta( $term_id, $field['id'] );
76
  $value = ( isset( $meta[0] ) ) ? $meta[0] : null;
77
  } else {
@@ -81,7 +81,7 @@ if( ! class_exists( 'CSF_Taxonomy_Options' ) ) {
81
 
82
  }
83
 
84
- $default = $this->get_default( $field );
85
  $value = ( isset( $value ) ) ? $value : $default;
86
 
87
  return $value;
@@ -95,33 +95,36 @@ if( ! class_exists( 'CSF_Taxonomy_Options' ) ) {
95
  $term_id = ( $is_term ) ? $term->term_id : 0;
96
  $taxonomy = ( $is_term ) ? $term->taxonomy : $term;
97
  $classname = ( $is_term ) ? 'edit' : 'add';
98
- $errors = ( ! empty( $term_id ) ) ? get_term_meta( $term_id, '_csf_errors', true ) : array();
99
  $errors = ( ! empty( $errors ) ) ? $errors : array();
100
  $class = ( $this->args['class'] ) ? ' '. $this->args['class'] : '';
101
 
102
- // clear errors
103
- if( ! empty( $errors ) ) {
104
- delete_term_meta( $term_id, '_csf_errors' );
105
  }
106
 
107
  wp_nonce_field( 'csf_taxonomy_nonce', 'csf_taxonomy_nonce'. $this->unique );
108
 
109
- echo '<div class="csf csf-taxonomy csf-show-all csf-onload csf-taxonomy-'. $classname .'-fields'. $class .'">';
110
 
111
- foreach( $this->sections as $section ) {
112
 
113
- if( $taxonomy === $this->taxonomy ) {
114
 
115
- $section_icon = ( ! empty( $section['icon'] ) ) ? '<i class="csf-icon '. $section['icon'] .'"></i>' : '';
116
  $section_title = ( ! empty( $section['title'] ) ) ? $section['title'] : '';
117
 
118
- echo ( $section_title || $section_icon ) ? '<div class="csf-section-title"><h3>'. $section_icon . $section_title .'</h3></div>' : '';
119
 
120
- if( ! empty( $section['fields'] ) ) {
121
- foreach( $section['fields'] as $field ) {
 
 
 
 
122
 
123
- if( ! empty( $field['id'] ) && ! empty( $errors[$field['id']] ) ) {
124
- $field['_error'] = $errors[$field['id']];
125
  }
126
 
127
  CSF::field( $field, $this->get_meta_value( $term_id, $field ), $this->unique, 'taxonomy' );
@@ -139,57 +142,64 @@ if( ! class_exists( 'CSF_Taxonomy_Options' ) ) {
139
  // save taxonomy form fields
140
  public function save_taxonomy( $term_id ) {
141
 
142
- if ( wp_verify_nonce( csf_get_var( 'csf_taxonomy_nonce'. $this->unique ), 'csf_taxonomy_nonce' ) ) {
 
 
 
 
 
143
 
144
- $errors = array();
145
- $taxonomy = csf_get_var( 'taxonomy' );
 
 
 
 
 
 
 
146
 
147
  foreach ( $this->sections as $section ) {
148
 
149
- if( $taxonomy == $this->taxonomy ) {
150
 
151
- $request = csf_get_var( $this->unique, array() );
152
 
153
- // ignore _nonce
154
- if( isset( $request['_nonce'] ) ) {
155
- unset( $request['_nonce'] );
156
- }
157
 
158
- // sanitize and validate
159
- if( ! empty( $section['fields'] ) ) {
160
 
161
- foreach( $section['fields'] as $field ) {
 
162
 
163
- if( ! empty( $field['id'] ) ) {
 
 
 
 
164
 
165
- // sanitize
166
- if( ! empty( $field['sanitize'] ) ) {
167
 
168
- $sanitize = $field['sanitize'];
169
- $value_sanitize = csf_get_vars( $this->unique, $field['id'] );
170
- $request[$field['id']] = call_user_func( $sanitize, $value_sanitize );
171
 
172
- }
173
 
174
- // validate
175
- if( ! empty( $field['validate'] ) ) {
176
 
177
- $validate = $field['validate'];
178
- $value_validate = csf_get_vars( $this->unique, $field['id'] );
179
- $has_validated = call_user_func( $validate, $value_validate );
180
 
181
- if( ! empty( $has_validated ) ) {
 
182
 
183
- $errors[$field['id']] = $has_validated;
184
- $request[$field['id']] = $this->get_meta_value( $term_id, $field );
185
 
186
- }
187
 
188
- }
 
 
189
 
190
- // auto sanitize
191
- if( ! isset( $request[$field['id']] ) || is_null( $request[$field['id']] ) ) {
192
- $request[$field['id']] = '';
193
  }
194
 
195
  }
@@ -198,47 +208,48 @@ if( ! class_exists( 'CSF_Taxonomy_Options' ) ) {
198
 
199
  }
200
 
201
- $request = apply_filters( "csf_{$this->unique}_save", $request, $term_id, $this );
202
-
203
- do_action( "csf_{$this->unique}_save_before", $request, $term_id, $this );
204
 
205
- if( empty( $request ) ) {
206
 
207
- if( $this->args['data_type'] !== 'serialize' ) {
208
- foreach ( $request as $key => $value ) {
209
- delete_term_meta( $term_id, $key );
210
- }
211
- } else {
212
- delete_term_meta( $term_id, $this->unique );
213
- }
214
 
215
- } else {
216
 
217
- if( $this->args['data_type'] !== 'serialize' ) {
218
- foreach ( $request as $key => $value ) {
219
- update_term_meta( $term_id, $key, $value );
220
- }
221
- } else {
222
- update_term_meta( $term_id, $this->unique, $request );
223
- }
224
 
225
- if( ! empty( $errors ) ) {
226
- update_term_meta( $term_id, '_csf_errors', $errors );
227
- }
228
 
229
- }
230
 
231
- do_action( "csf_{$this->unique}_saved", $request, $term_id, $this );
 
 
 
 
 
 
232
 
233
- do_action( "csf_{$this->unique}_save_after", $request, $term_id, $this );
234
 
 
 
 
235
  }
 
 
 
236
 
 
 
237
  }
238
 
239
  }
240
 
241
- }
 
 
242
 
 
243
  }
244
  }
7
  * @version 1.0.0
8
  *
9
  */
10
+ if ( ! class_exists( 'CSF_Taxonomy_Options' ) ) {
11
  class CSF_Taxonomy_Options extends CSF_Abstract{
12
 
13
  // constans
19
  public $args = array(
20
  'taxonomy' => '',
21
  'data_type' => 'serialize',
 
22
  'class' => '',
23
+ 'defaults' => array(),
24
  );
25
 
26
  // run taxonomy construct
30
  $this->args = apply_filters( "csf_{$this->unique}_args", wp_parse_args( $params['args'], $this->args ), $this );
31
  $this->sections = apply_filters( "csf_{$this->unique}_sections", $params['sections'], $this );
32
  $this->taxonomies = ( is_array( $this->args['taxonomy'] ) ) ? $this->args['taxonomy'] : array_filter( (array) $this->args['taxonomy'] );
33
+ $this->taxonomy = ( ! empty( $_REQUEST[ 'taxonomy' ] ) ) ? sanitize_text_field( wp_unslash( $_REQUEST[ 'taxonomy' ] ) ) : '';
34
 
35
+ if ( ! empty( $this->taxonomies ) && in_array( $this->taxonomy, $this->taxonomies ) ) {
36
  add_action( 'admin_init', array( &$this, 'add_taxonomy_options' ) );
37
  }
38
 
57
  // get default value
58
  public function get_default( $field ) {
59
 
60
+ $default = ( isset( $field['default'] ) ) ? $field['default'] : '';
61
+ $default = ( isset( $this->args['defaults'][$field['id']] ) ) ? $this->args['defaults'][$field['id']] : $default;
62
 
63
  return $default;
64
 
69
 
70
  $value = null;
71
 
72
+ if ( ! empty( $term_id ) && ! empty( $field['id'] ) ) {
73
 
74
+ if ( $this->args['data_type'] !== 'serialize' ) {
75
  $meta = get_term_meta( $term_id, $field['id'] );
76
  $value = ( isset( $meta[0] ) ) ? $meta[0] : null;
77
  } else {
81
 
82
  }
83
 
84
+ $default = ( isset( $field['id'] ) ) ? $this->get_default( $field ) : '';
85
  $value = ( isset( $value ) ) ? $value : $default;
86
 
87
  return $value;
95
  $term_id = ( $is_term ) ? $term->term_id : 0;
96
  $taxonomy = ( $is_term ) ? $term->taxonomy : $term;
97
  $classname = ( $is_term ) ? 'edit' : 'add';
98
+ $errors = ( ! empty( $term_id ) ) ? get_term_meta( $term_id, '_csf_errors_'. $this->unique, true ) : array();
99
  $errors = ( ! empty( $errors ) ) ? $errors : array();
100
  $class = ( $this->args['class'] ) ? ' '. $this->args['class'] : '';
101
 
102
+ if ( ! empty( $errors ) ) {
103
+ delete_term_meta( $term_id, '_csf_errors_'. $this->unique );
 
104
  }
105
 
106
  wp_nonce_field( 'csf_taxonomy_nonce', 'csf_taxonomy_nonce'. $this->unique );
107
 
108
+ echo '<div class="csf csf-taxonomy csf-show-all csf-onload csf-taxonomy-'. esc_attr( $classname ) .'-fields '. esc_attr( $class ) .'">';
109
 
110
+ foreach ( $this->sections as $section ) {
111
 
112
+ if ( $taxonomy === $this->taxonomy ) {
113
 
114
+ $section_icon = ( ! empty( $section['icon'] ) ) ? '<i class="csf-section-icon '. esc_attr( $section['icon'] ) .'"></i>' : '';
115
  $section_title = ( ! empty( $section['title'] ) ) ? $section['title'] : '';
116
 
117
+ echo ( $section_title || $section_icon ) ? '<div class="csf-section-title"><h3>'. wp_kses_post( $section_icon . $section_title ) .'</h3></div>' : '';
118
 
119
+ if ( ! empty( $section['fields'] ) ) {
120
+ foreach ( $section['fields'] as $field ) {
121
+
122
+ if ( ! empty( $field['id'] ) && ! empty( $errors['fields'][$field['id']] ) ) {
123
+ $field['_error'] = $errors['fields'][$field['id']];
124
+ }
125
 
126
+ if ( ! empty( $field['id'] ) ) {
127
+ $field['default'] = $this->get_default( $field );
128
  }
129
 
130
  CSF::field( $field, $this->get_meta_value( $term_id, $field ), $this->unique, 'taxonomy' );
142
  // save taxonomy form fields
143
  public function save_taxonomy( $term_id ) {
144
 
145
+ $count = 1;
146
+ $data = array();
147
+ $errors = array();
148
+ $noncekey = 'csf_taxonomy_nonce'. $this->unique;
149
+ $nonce = ( ! empty( $_POST[ $noncekey ] ) ) ? sanitize_text_field( wp_unslash( $_POST[ $noncekey ] ) ) : '';
150
+ $taxonomy = ( ! empty( $_POST[ 'taxonomy' ] ) ) ? sanitize_text_field( wp_unslash( $_POST[ 'taxonomy' ] ) ) : '';
151
 
152
+ if ( ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) || ! wp_verify_nonce( $nonce, 'csf_taxonomy_nonce' ) ) {
153
+ return $term_id;
154
+ }
155
+
156
+ // XSS ok.
157
+ // No worries, This "POST" requests is sanitizing in the below foreach.
158
+ $request = ( ! empty( $_POST[ $this->unique ] ) ) ? $_POST[ $this->unique ] : array();
159
+
160
+ if ( ! empty( $request ) ) {
161
 
162
  foreach ( $this->sections as $section ) {
163
 
164
+ if ( ! empty( $section['fields'] ) ) {
165
 
166
+ foreach ( $section['fields'] as $field ) {
167
 
168
+ if ( ! empty( $field['id'] ) ) {
 
 
 
169
 
170
+ $field_id = $field['id'];
171
+ $field_value = isset( $request[$field_id] ) ? $request[$field_id] : '';
172
 
173
+ // Sanitize "post" request of field.
174
+ if ( ! isset( $field['sanitize'] ) ) {
175
 
176
+ if( is_array( $field_value ) ) {
177
+ $data[$field_id] = wp_kses_post_deep( $field_value );
178
+ } else {
179
+ $data[$field_id] = wp_kses_post( $field_value );
180
+ }
181
 
182
+ } else if( isset( $field['sanitize'] ) && function_exists( $field['sanitize'] ) ) {
 
183
 
184
+ $data[$field_id] = call_user_func( $field['sanitize'], $field_value );
 
 
185
 
186
+ } else {
187
 
188
+ $data[$field_id] = $field_value;
 
189
 
190
+ }
 
 
191
 
192
+ // Validate "post" request of field.
193
+ if ( isset( $field['validate'] ) && function_exists( $field['validate'] ) ) {
194
 
195
+ $has_validated = call_user_func( $field['validate'], $field_value );
 
196
 
197
+ if ( ! empty( $has_validated ) ) {
198
 
199
+ $errors['sections'][$count] = true;
200
+ $errors['fields'][$field_id] = $has_validated;
201
+ $data[$field_id] = $this->get_meta_value( $term_id, $field );
202
 
 
 
 
203
  }
204
 
205
  }
208
 
209
  }
210
 
211
+ }
 
 
212
 
213
+ $count++;
214
 
215
+ }
 
 
 
 
 
 
216
 
217
+ }
218
 
219
+ $data = apply_filters( "csf_{$this->unique}_save", $data, $term_id, $this );
 
 
 
 
 
 
220
 
221
+ do_action( "csf_{$this->unique}_save_before", $data, $term_id, $this );
 
 
222
 
223
+ if ( empty( $data ) ) {
224
 
225
+ if ( $this->args['data_type'] !== 'serialize' ) {
226
+ foreach ( $data as $key => $value ) {
227
+ delete_term_meta( $term_id, $key );
228
+ }
229
+ } else {
230
+ delete_term_meta( $term_id, $this->unique );
231
+ }
232
 
233
+ } else {
234
 
235
+ if ( $this->args['data_type'] !== 'serialize' ) {
236
+ foreach ( $data as $key => $value ) {
237
+ update_term_meta( $term_id, $key, $value );
238
  }
239
+ } else {
240
+ update_term_meta( $term_id, $this->unique, $data );
241
+ }
242
 
243
+ if ( ! empty( $errors ) ) {
244
+ update_term_meta( $term_id, '_csf_errors_'. $this->unique, $errors );
245
  }
246
 
247
  }
248
 
249
+ do_action( "csf_{$this->unique}_saved", $data, $term_id, $this );
250
+
251
+ do_action( "csf_{$this->unique}_save_after", $data, $term_id, $this );
252
 
253
+ }
254
  }
255
  }
admin/settings/classes/widgets.class.php CHANGED
@@ -7,7 +7,7 @@
7
  * @version 1.0.0
8
  *
9
  */
10
- if( ! class_exists( 'CSF_Widget' ) ) {
11
  class CSF_Widget extends WP_Widget {
12
 
13
  // constans
@@ -17,9 +17,9 @@ if( ! class_exists( 'CSF_Widget' ) ) {
17
  'classname' => '',
18
  'description' => '',
19
  'width' => '',
20
- 'defaults' => array(),
21
- 'fields' => array(),
22
  'class' => '',
 
 
23
  );
24
 
25
  public function __construct( $key, $params ) {
@@ -31,24 +31,24 @@ if( ! class_exists( 'CSF_Widget' ) ) {
31
  $this->args = apply_filters( "csf_{$this->unique}_args", wp_parse_args( $params, $this->args ), $this );
32
 
33
  // Set control options
34
- if( ! empty( $this->args['width'] ) ) {
35
- $control_ops['width'] = $this->args['width'];
36
  }
37
 
38
  // Set widget options
39
- if( ! empty( $this->args['description'] ) ) {
40
- $widget_ops['description'] = $this->args['description'];
41
  }
42
 
43
- if( ! empty( $this->args['classname'] ) ) {
44
- $widget_ops['classname'] = $this->args['classname'];
45
  }
46
 
47
  // Set filters
48
  $widget_ops = apply_filters( "csf_{$this->unique}_widget_ops", $widget_ops, $this );
49
  $control_ops = apply_filters( "csf_{$this->unique}_control_ops", $control_ops, $this );
50
 
51
- parent::__construct( $this->unique, $this->args['title'], $widget_ops, $control_ops );
52
 
53
  }
54
 
@@ -63,42 +63,51 @@ if( ! class_exists( 'CSF_Widget' ) ) {
63
  }
64
 
65
  // get default value
66
- public function get_default( $field, $options = array() ) {
67
 
68
- $default = ( isset( $this->args['defaults'][$field['id']] ) ) ? $this->args['defaults'][$field['id']] : null;
69
- $default = ( isset( $field['default'] ) ) ? $field['default'] : $default;
70
- $default = ( isset( $options[$field['id']] ) ) ? $options[$field['id']] : $default;
71
 
72
  return $default;
73
 
74
  }
75
 
 
 
 
 
 
 
 
 
 
 
76
  // Back-end widget form.
77
  public function form( $instance ) {
78
 
79
- if( ! empty( $this->args['fields'] ) ) {
80
 
81
  $class = ( $this->args['class'] ) ? ' '. $this->args['class'] : '';
82
 
83
  echo '<div class="csf csf-widgets csf-fields'. $class .'">';
84
 
85
- foreach( $this->args['fields'] as $field ) {
86
 
87
- $field_value = '';
88
  $field_unique = '';
89
 
90
- if( ! empty( $field['id'] ) ) {
91
 
92
- $field_value = $this->get_default( $field, $instance );
93
  $field_unique = 'widget-' . $this->unique . '[' . $this->number . ']';
94
 
95
- if( $field['id'] === 'title' ) {
96
  $field['attributes']['id'] = 'widget-'. $this->unique .'-'. $this->number .'-title';
97
  }
98
 
 
 
99
  }
100
 
101
- CSF::field( $field, $field_value, $field_unique );
102
 
103
  }
104
 
@@ -112,8 +121,8 @@ if( ! class_exists( 'CSF_Widget' ) ) {
112
  public function update( $new_instance, $old_instance ) {
113
 
114
  // auto sanitize
115
- foreach( $this->args['fields'] as $field ) {
116
- if( ! empty( $field['id'] ) && ( ! isset( $new_instance[$field['id']] ) || is_null( $new_instance[$field['id']] ) ) ) {
117
  $new_instance[$field['id']] = '';
118
  }
119
  }
7
  * @version 1.0.0
8
  *
9
  */
10
+ if ( ! class_exists( 'CSF_Widget' ) ) {
11
  class CSF_Widget extends WP_Widget {
12
 
13
  // constans
17
  'classname' => '',
18
  'description' => '',
19
  'width' => '',
 
 
20
  'class' => '',
21
+ 'fields' => array(),
22
+ 'defaults' => array(),
23
  );
24
 
25
  public function __construct( $key, $params ) {
31
  $this->args = apply_filters( "csf_{$this->unique}_args", wp_parse_args( $params, $this->args ), $this );
32
 
33
  // Set control options
34
+ if ( ! empty( $this->args['width'] ) ) {
35
+ $control_ops['width'] = esc_attr( $this->args['width'] );
36
  }
37
 
38
  // Set widget options
39
+ if ( ! empty( $this->args['description'] ) ) {
40
+ $widget_ops['description'] = esc_attr( $this->args['description'] );
41
  }
42
 
43
+ if ( ! empty( $this->args['classname'] ) ) {
44
+ $widget_ops['classname'] = esc_attr( $this->args['classname'] );
45
  }
46
 
47
  // Set filters
48
  $widget_ops = apply_filters( "csf_{$this->unique}_widget_ops", $widget_ops, $this );
49
  $control_ops = apply_filters( "csf_{$this->unique}_control_ops", $control_ops, $this );
50
 
51
+ parent::__construct( $this->unique, esc_attr( $this->args['title'] ), $widget_ops, $control_ops );
52
 
53
  }
54
 
63
  }
64
 
65
  // get default value
66
+ public function get_default( $field ) {
67
 
68
+ $default = ( isset( $field['default'] ) ) ? $field['default'] : '';
69
+ $default = ( isset( $this->args['defaults'][$field['id']] ) ) ? $this->args['defaults'][$field['id']] : $default;
 
70
 
71
  return $default;
72
 
73
  }
74
 
75
+ // get widget value
76
+ public function get_widget_value( $instance, $field ) {
77
+
78
+ $default = ( isset( $field['id'] ) ) ? $this->get_default( $field ) : '';
79
+ $value = ( isset( $field['id'] ) && isset( $instance[$field['id']] ) ) ? $instance[$field['id']] : $default;
80
+
81
+ return $value;
82
+
83
+ }
84
+
85
  // Back-end widget form.
86
  public function form( $instance ) {
87
 
88
+ if ( ! empty( $this->args['fields'] ) ) {
89
 
90
  $class = ( $this->args['class'] ) ? ' '. $this->args['class'] : '';
91
 
92
  echo '<div class="csf csf-widgets csf-fields'. $class .'">';
93
 
94
+ foreach ( $this->args['fields'] as $field ) {
95
 
 
96
  $field_unique = '';
97
 
98
+ if ( ! empty( $field['id'] ) ) {
99
 
 
100
  $field_unique = 'widget-' . $this->unique . '[' . $this->number . ']';
101
 
102
+ if ( $field['id'] === 'title' ) {
103
  $field['attributes']['id'] = 'widget-'. $this->unique .'-'. $this->number .'-title';
104
  }
105
 
106
+ $field['default'] = $this->get_default( $field );
107
+
108
  }
109
 
110
+ CSF::field( $field, $this->get_widget_value( $instance, $field ), $field_unique );
111
 
112
  }
113
 
121
  public function update( $new_instance, $old_instance ) {
122
 
123
  // auto sanitize
124
+ foreach ( $this->args['fields'] as $field ) {
125
+ if ( ! empty( $field['id'] ) && ( ! isset( $new_instance[$field['id']] ) || is_null( $new_instance[$field['id']] ) ) ) {
126
  $new_instance[$field['id']] = '';
127
  }
128
  }
admin/settings/fields/accordion/accordion.php CHANGED
@@ -7,7 +7,7 @@
7
  * @version 1.0.0
8
  *
9
  */
10
- if( ! class_exists( 'CSF_Field_accordion' ) ) {
11
  class CSF_Field_accordion extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
@@ -26,18 +26,18 @@ if( ! class_exists( 'CSF_Field_accordion' ) ) {
26
 
27
  echo '<div class="csf-accordion-item">';
28
 
29
- $icon = ( ! empty( $accordion['icon'] ) ) ? 'csf--icon '. $accordion['icon'] : 'csf-accordion-icon fa fa-angle-right';
30
 
31
  echo '<h4 class="csf-accordion-title">';
32
- echo '<i class="'. $icon .'"></i>';
33
- echo $accordion['title'];
34
  echo '</h4>';
35
 
36
  echo '<div class="csf-accordion-content">';
37
 
38
  foreach ( $accordion['fields'] as $field ) {
39
 
40
- if( in_array( $field['type'], $unallows ) ) { $field['_notice'] = true; }
41
 
42
  $field_id = ( isset( $field['id'] ) ) ? $field['id'] : '';
43
  $field_default = ( isset( $field['default'] ) ) ? $field['default'] : '';
7
  * @version 1.0.0
8
  *
9
  */
10
+ if ( ! class_exists( 'CSF_Field_accordion' ) ) {
11
  class CSF_Field_accordion extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
26
 
27
  echo '<div class="csf-accordion-item">';
28
 
29
+ $icon = ( ! empty( $accordion['icon'] ) ) ? 'csf--icon '. $accordion['icon'] : 'csf-accordion-icon fas fa-angle-right';
30
 
31
  echo '<h4 class="csf-accordion-title">';
32
+ echo '<i class="'. esc_attr( $icon ) .'"></i>';
33
+ echo esc_attr( $accordion['title'] );
34
  echo '</h4>';
35
 
36
  echo '<div class="csf-accordion-content">';
37
 
38
  foreach ( $accordion['fields'] as $field ) {
39
 
40
+ if ( in_array( $field['type'], $unallows ) ) { $field['_notice'] = true; }
41
 
42
  $field_id = ( isset( $field['id'] ) ) ? $field['id'] : '';
43
  $field_default = ( isset( $field['default'] ) ) ? $field['default'] : '';
admin/settings/fields/background/background.php CHANGED
@@ -7,7 +7,7 @@
7
  * @version 1.0.0
8
  *
9
  */
10
- if( ! class_exists( 'CSF_Field_background' ) ) {
11
  class CSF_Field_background extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
@@ -59,7 +59,7 @@ if( ! class_exists( 'CSF_Field_background' ) ) {
59
 
60
  //
61
  // Background Color
62
- if( ! empty( $args['background_color'] ) ) {
63
 
64
  echo '<div class="csf--color">';
65
 
@@ -77,7 +77,7 @@ if( ! class_exists( 'CSF_Field_background' ) ) {
77
 
78
  //
79
  // Background Gradient Color
80
- if( ! empty( $args['background_gradient_color'] ) && ! empty( $args['background_gradient'] ) ) {
81
 
82
  echo '<div class="csf--color">';
83
 
@@ -95,7 +95,7 @@ if( ! class_exists( 'CSF_Field_background' ) ) {
95
 
96
  //
97
  // Background Gradient Direction
98
- if( ! empty( $args['background_gradient_direction'] ) && ! empty( $args['background_gradient'] ) ) {
99
 
100
  echo '<div class="csf--color">';
101
 
@@ -121,7 +121,7 @@ if( ! class_exists( 'CSF_Field_background' ) ) {
121
 
122
  //
123
  // Background Image
124
- if( ! empty( $args['background_image'] ) ) {
125
 
126
  echo '<div class="csf--background-image">';
127
 
@@ -142,11 +142,11 @@ if( ! class_exists( 'CSF_Field_background' ) ) {
142
  $auto_class = ( ! empty( $args['background_auto_attributes'] ) ) ? ' csf--auto-attributes' : '';
143
  $hidden_class = ( ! empty( $args['background_auto_attributes'] ) && empty( $this->value['background-image']['url'] ) ) ? ' csf--attributes-hidden' : '';
144
 
145
- echo '<div class="csf--background-attributes'. $auto_class . $hidden_class .'">';
146
 
147
  //
148
  // Background Position
149
- if( ! empty( $args['background_position'] ) ) {
150
 
151
  CSF::field( array(
152
  'id' => 'background-position',
@@ -169,7 +169,7 @@ if( ! class_exists( 'CSF_Field_background' ) ) {
169
 
170
  //
171
  // Background Repeat
172
- if( ! empty( $args['background_repeat'] ) ) {
173
 
174
  CSF::field( array(
175
  'id' => 'background-repeat',
@@ -187,7 +187,7 @@ if( ! class_exists( 'CSF_Field_background' ) ) {
187
 
188
  //
189
  // Background Attachment
190
- if( ! empty( $args['background_attachment'] ) ) {
191
 
192
  CSF::field( array(
193
  'id' => 'background-attachment',
@@ -203,7 +203,7 @@ if( ! class_exists( 'CSF_Field_background' ) ) {
203
 
204
  //
205
  // Background Size
206
- if( ! empty( $args['background_size'] ) ) {
207
 
208
  CSF::field( array(
209
  'id' => 'background-size',
@@ -219,7 +219,7 @@ if( ! class_exists( 'CSF_Field_background' ) ) {
219
 
220
  //
221
  // Background Origin
222
- if( ! empty( $args['background_origin'] ) ) {
223
 
224
  CSF::field( array(
225
  'id' => 'background-origin',
@@ -236,7 +236,7 @@ if( ! class_exists( 'CSF_Field_background' ) ) {
236
 
237
  //
238
  // Background Clip
239
- if( ! empty( $args['background_clip'] ) ) {
240
 
241
  CSF::field( array(
242
  'id' => 'background-clip',
@@ -253,7 +253,7 @@ if( ! class_exists( 'CSF_Field_background' ) ) {
253
 
254
  //
255
  // Background Blend Mode
256
- if( ! empty( $args['background_blend_mode'] ) ) {
257
 
258
  CSF::field( array(
259
  'id' => 'background-blend-mode',
@@ -295,30 +295,30 @@ if( ! class_exists( 'CSF_Field_background' ) ) {
295
  $background_image = ( ! empty( $this->value['background-image']['url'] ) ) ? $this->value['background-image']['url'] : '';
296
 
297
 
298
- if( $background_color && $background_gd_color ) {
299
  $gd_direction = ( $background_gd_direction ) ? $background_gd_direction .',' : '';
300
  $bg_image[] = 'linear-gradient('. $gd_direction . $background_color .','. $background_gd_color .')';
301
  }
302
 
303
- if( $background_image ) {
304
  $bg_image[] = 'url('. $background_image .')';
305
  }
306
 
307
- if( ! empty( $bg_image ) ) {
308
  $output .= 'background-image:'. implode( ',', $bg_image ) . $important .';';
309
  }
310
 
311
  // Common background properties
312
  $properties = array( 'color', 'position', 'repeat', 'attachment', 'size', 'origin', 'clip', 'blend-mode' );
313
 
314
- foreach( $properties as $property ) {
315
  $property = 'background-'. $property;
316
- if( ! empty( $this->value[$property] ) ) {
317
  $output .= $property .':'. $this->value[$property] . $important .';';
318
  }
319
  }
320
 
321
- if( $output ) {
322
  $output = $element .'{'. $output .'}';
323
  }
324
 
7
  * @version 1.0.0
8
  *
9
  */
10
+ if ( ! class_exists( 'CSF_Field_background' ) ) {
11
  class CSF_Field_background extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
59
 
60
  //
61
  // Background Color
62
+ if ( ! empty( $args['background_color'] ) ) {
63
 
64
  echo '<div class="csf--color">';
65
 
77
 
78
  //
79
  // Background Gradient Color
80
+ if ( ! empty( $args['background_gradient_color'] ) && ! empty( $args['background_gradient'] ) ) {
81
 
82
  echo '<div class="csf--color">';
83
 
95
 
96
  //
97
  // Background Gradient Direction
98
+ if ( ! empty( $args['background_gradient_direction'] ) && ! empty( $args['background_gradient'] ) ) {
99
 
100
  echo '<div class="csf--color">';
101
 
121
 
122
  //
123
  // Background Image
124
+ if ( ! empty( $args['background_image'] ) ) {
125
 
126
  echo '<div class="csf--background-image">';
127
 
142
  $auto_class = ( ! empty( $args['background_auto_attributes'] ) ) ? ' csf--auto-attributes' : '';
143
  $hidden_class = ( ! empty( $args['background_auto_attributes'] ) && empty( $this->value['background-image']['url'] ) ) ? ' csf--attributes-hidden' : '';
144
 
145
+ echo '<div class="csf--background-attributes'. esc_attr( $auto_class . $hidden_class ) .'">';
146
 
147
  //
148
  // Background Position
149
+ if ( ! empty( $args['background_position'] ) ) {
150
 
151
  CSF::field( array(
152
  'id' => 'background-position',
169
 
170
  //
171
  // Background Repeat
172
+ if ( ! empty( $args['background_repeat'] ) ) {
173
 
174
  CSF::field( array(
175
  'id' => 'background-repeat',
187
 
188
  //
189
  // Background Attachment
190
+ if ( ! empty( $args['background_attachment'] ) ) {
191
 
192
  CSF::field( array(
193
  'id' => 'background-attachment',
203
 
204
  //
205
  // Background Size
206
+ if ( ! empty( $args['background_size'] ) ) {
207
 
208
  CSF::field( array(
209
  'id' => 'background-size',
219
 
220
  //
221
  // Background Origin
222
+ if ( ! empty( $args['background_origin'] ) ) {
223
 
224
  CSF::field( array(
225
  'id' => 'background-origin',
236
 
237
  //
238
  // Background Clip
239
+ if ( ! empty( $args['background_clip'] ) ) {
240
 
241
  CSF::field( array(
242
  'id' => 'background-clip',
253
 
254
  //
255
  // Background Blend Mode
256
+ if ( ! empty( $args['background_blend_mode'] ) ) {
257
 
258
  CSF::field( array(
259
  'id' => 'background-blend-mode',
295
  $background_image = ( ! empty( $this->value['background-image']['url'] ) ) ? $this->value['background-image']['url'] : '';
296
 
297
 
298
+ if ( $background_color && $background_gd_color ) {
299
  $gd_direction = ( $background_gd_direction ) ? $background_gd_direction .',' : '';
300
  $bg_image[] = 'linear-gradient('. $gd_direction . $background_color .','. $background_gd_color .')';
301
  }
302
 
303
+ if ( $background_image ) {
304
  $bg_image[] = 'url('. $background_image .')';
305
  }
306
 
307
+ if ( ! empty( $bg_image ) ) {
308
  $output .= 'background-image:'. implode( ',', $bg_image ) . $important .';';
309
  }
310
 
311
  // Common background properties
312
  $properties = array( 'color', 'position', 'repeat', 'attachment', 'size', 'origin', 'clip', 'blend-mode' );
313
 
314
+ foreach ( $properties as $property ) {
315
  $property = 'background-'. $property;
316
+ if ( ! empty( $this->value[$property] ) ) {
317
  $output .= $property .':'. $this->value[$property] . $important .';';
318
  }
319
  }
320
 
321
+ if ( $output ) {
322
  $output = $element .'{'. $output .'}';
323
  }
324
 
admin/settings/fields/backup/backup.php CHANGED
@@ -7,7 +7,7 @@
7
  * @version 1.0.0
8
  *
9
  */
10
- if( ! class_exists( 'CSF_Field_backup' ) ) {
11
  class CSF_Field_backup extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
@@ -18,20 +18,20 @@ if( ! class_exists( 'CSF_Field_backup' ) ) {
18
 
19
  $unique = $this->unique;
20
  $nonce = wp_create_nonce( 'csf_backup_nonce' );
21
- $export = add_query_arg( array( 'action' => 'csf-export', 'export' => $unique, 'nonce' => $nonce ), admin_url( 'admin-ajax.php' ) );
22
 
23
  echo $this->field_before();
24
 
25
- echo '<textarea name="csf_transient[csf_import_data]" class="csf-import-data"></textarea>';
26
- echo '<button type="submit" class="button button-primary csf-confirm csf-import" data-unique="'. $unique .'" data-nonce="'. $nonce .'">'. esc_html__( 'Import', 'csf' ) .'</button>';
27
  echo '<small>( '. esc_html__( 'copy-paste your backup string here', 'csf' ).' )</small>';
28
 
29
  echo '<hr />';
30
- echo '<textarea readonly="readonly" class="csf-export-data">'. json_encode( get_option( $unique ) ) .'</textarea>';
31
  echo '<a href="'. esc_url( $export ) .'" class="button button-primary csf-export" target="_blank">'. esc_html__( 'Export and Download Backup', 'csf' ) .'</a>';
32
 
33
  echo '<hr />';
34
- echo '<button type="submit" name="csf_transient[csf_reset_all]" value="csf_reset_all" class="button csf-warning-primary csf-confirm csf-reset" data-unique="'. $unique .'" data-nonce="'. $nonce .'">'. esc_html__( 'Reset All', 'csf' ) .'</button>';
35
  echo '<small class="csf-text-error">'. esc_html__( 'Please be sure for reset all of options.', 'csf' ) .'</small>';
36
 
37
  echo $this->field_after();
7
  * @version 1.0.0
8
  *
9
  */
10
+ if ( ! class_exists( 'CSF_Field_backup' ) ) {
11
  class CSF_Field_backup extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
18
 
19
  $unique = $this->unique;
20
  $nonce = wp_create_nonce( 'csf_backup_nonce' );
21
+ $export = add_query_arg( array( 'action' => 'csf-export', 'unique' => $unique, 'nonce' => $nonce ), admin_url( 'admin-ajax.php' ) );
22
 
23
  echo $this->field_before();
24
 
25
+ echo '<textarea name="csf_import_data" class="csf-import-data"></textarea>';
26
+ echo '<button type="submit" class="button button-primary csf-confirm csf-import" data-unique="'. esc_attr( $unique ) .'" data-nonce="'. esc_attr( $nonce ) .'">'. esc_html__( 'Import', 'csf' ) .'</button>';
27
  echo '<small>( '. esc_html__( 'copy-paste your backup string here', 'csf' ).' )</small>';
28
 
29
  echo '<hr />';
30
+ echo '<textarea readonly="readonly" class="csf-export-data">'. esc_attr( json_encode( get_option( $unique ) ) ) .'</textarea>';
31
  echo '<a href="'. esc_url( $export ) .'" class="button button-primary csf-export" target="_blank">'. esc_html__( 'Export and Download Backup', 'csf' ) .'</a>';
32
 
33
  echo '<hr />';
34
+ echo '<button type="submit" name="csf_transient[reset]" value="reset" class="button csf-warning-primary csf-confirm csf-reset" data-unique="'. esc_attr( $unique ) .'" data-nonce="'. esc_attr( $nonce ) .'">'. esc_html__( 'Reset All', 'csf' ) .'</button>';
35
  echo '<small class="csf-text-error">'. esc_html__( 'Please be sure for reset all of options.', 'csf' ) .'</small>';
36
 
37
  echo $this->field_after();
admin/settings/fields/border/border.php CHANGED
@@ -7,7 +7,7 @@
7
  * @version 1.0.0
8
  *
9
  */
10
- if( ! class_exists( 'CSF_Field_border' ) ) {
11
  class CSF_Field_border extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
@@ -17,11 +17,11 @@ if( ! class_exists( 'CSF_Field_border' ) ) {
17
  public function render() {
18
 
19
  $args = wp_parse_args( $this->field, array(
20
- 'top_icon' => '<i class="fa fa-long-arrow-up"></i>',
21
- 'left_icon' => '<i class="fa fa-long-arrow-left"></i>',
22
- 'bottom_icon' => '<i class="fa fa-long-arrow-down"></i>',
23
- 'right_icon' => '<i class="fa fa-long-arrow-right"></i>',
24
- 'all_icon' => '<i class="fa fa-arrows"></i>',
25
  'top_placeholder' => esc_html__( 'top', 'csf' ),
26
  'right_placeholder' => esc_html__( 'right', 'csf' ),
27
  'bottom_placeholder' => esc_html__( 'bottom', 'csf' ),
@@ -67,14 +67,14 @@ if( ! class_exists( 'CSF_Field_border' ) ) {
67
 
68
  echo '<div class="csf--inputs">';
69
 
70
- if( ! empty( $args['all'] ) ) {
71
 
72
- $placeholder = ( ! empty( $args['all_placeholder'] ) ) ? ' placeholder="'. $args['all_placeholder'] .'"' : '';
73
 
74
  echo '<div class="csf--input">';
75
- echo ( ! empty( $args['all_icon'] ) ) ? '<span class="csf--label csf--icon">'. $args['all_icon'] .'</span>' : '';
76
- echo '<input type="number" name="'. $this->field_name('[all]') .'" value="'. $value['all'] .'"'. $placeholder .' class="csf-input-number csf--is-unit" />';
77
- echo ( ! empty( $args['unit'] ) ) ? '<span class="csf--label csf--unit">'. $args['unit'] .'</span>' : '';
78
  echo '</div>';
79
 
80
  } else {
@@ -82,33 +82,33 @@ if( ! class_exists( 'CSF_Field_border' ) ) {
82
  $properties = array();
83
 
84
  foreach ( array( 'top', 'right', 'bottom', 'left' ) as $prop ) {
85
- if( ! empty( $args[$prop] ) ) {
86
  $properties[] = $prop;
87
  }
88
  }
89
 
90
  $properties = ( $properties === array( 'right', 'left' ) ) ? array_reverse( $properties ) : $properties;
91
 
92
- foreach( $properties as $property ) {
93
 
94
- $placeholder = ( ! empty( $args[$property.'_placeholder'] ) ) ? ' placeholder="'. $args[$property.'_placeholder'] .'"' : '';
95
 
96
  echo '<div class="csf--input">';
97
- echo ( ! empty( $args[$property.'_icon'] ) ) ? '<span class="csf--label csf--icon">'. $args[$property.'_icon'] .'</span>' : '';
98
- echo '<input type="number" name="'. $this->field_name('['. $property .']') .'" value="'. $value[$property] .'"'. $placeholder .' class="csf-input-number csf--is-unit" />';
99
- echo ( ! empty( $args['unit'] ) ) ? '<span class="csf--label csf--unit">'. $args['unit'] .'</span>' : '';
100
  echo '</div>';
101
 
102
  }
103
 
104
  }
105
 
106
- if( ! empty( $args['style'] ) ) {
107
  echo '<div class="csf--input">';
108
- echo '<select name="'. $this->field_name('[style]') .'">';
109
- foreach( $border_props as $border_prop_key => $border_prop_value ) {
110
  $selected = ( $value['style'] === $border_prop_key ) ? ' selected' : '';
111
- echo '<option value="'. $border_prop_key .'"'. $selected .'>'. $border_prop_value .'</option>';
112
  }
113
  echo '</select>';
114
  echo '</div>';
@@ -116,17 +116,15 @@ if( ! class_exists( 'CSF_Field_border' ) ) {
116
 
117
  echo '</div>';
118
 
119
- if( ! empty( $args['color'] ) ) {
120
- $default_color_attr = ( ! empty( $default_value['color'] ) ) ? ' data-default-color="'. $default_value['color'] .'"' : '';
121
  echo '<div class="csf--color">';
122
  echo '<div class="csf-field-color">';
123
- echo '<input type="text" name="'. $this->field_name('[color]') .'" value="'. $value['color'] .'" class="csf-color"'. $default_color_attr .' />';
124
  echo '</div>';
125
  echo '</div>';
126
  }
127
 
128
- echo '<div class="clear"></div>';
129
-
130
  echo $this->field_after();
131
 
132
  }
@@ -147,7 +145,7 @@ if( ! class_exists( 'CSF_Field_border' ) ) {
147
  $color = ( isset( $this->value['color'] ) && $this->value['color'] !== '' ) ? $this->value['color'] : '';
148
  $all = ( isset( $this->value['all'] ) && $this->value['all'] !== '' ) ? $this->value['all'] : '';
149
 
150
- if( ! empty( $this->field['all'] ) && ( $all !== '' || $color !== '' ) ) {
151
 
152
  $output = $element .'{';
153
  $output .= ( $all !== '' ) ? 'border-width:'. $all . $unit . $important .';' : '';
@@ -155,7 +153,7 @@ if( ! class_exists( 'CSF_Field_border' ) ) {
155
  $output .= ( $style !== '' ) ? 'border-style:'. $style . $important .';' : '';
156
  $output .= '}';
157
 
158
- } else if( $top !== '' || $right !== '' || $bottom !== '' || $left !== '' || $color !== '' ) {
159
 
160
  $output = $element .'{';
161
  $output .= ( $top !== '' ) ? 'border-top-width:'. $top . $unit . $important .';' : '';
7
  * @version 1.0.0
8
  *
9
  */
10
+ if ( ! class_exists( 'CSF_Field_border' ) ) {
11
  class CSF_Field_border extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
17
  public function render() {
18
 
19
  $args = wp_parse_args( $this->field, array(
20
+ 'top_icon' => '<i class="fas fa-long-arrow-alt-up"></i>',
21
+ 'left_icon' => '<i class="fas fa-long-arrow-alt-left"></i>',
22
+ 'bottom_icon' => '<i class="fas fa-long-arrow-alt-down"></i>',
23
+ 'right_icon' => '<i class="fas fa-long-arrow-alt-right"></i>',
24
+ 'all_icon' => '<i class="fas fa-arrows-alt"></i>',
25
  'top_placeholder' => esc_html__( 'top', 'csf' ),
26
  'right_placeholder' => esc_html__( 'right', 'csf' ),
27
  'bottom_placeholder' => esc_html__( 'bottom', 'csf' ),
67
 
68
  echo '<div class="csf--inputs">';
69
 
70
+ if ( ! empty( $args['all'] ) ) {
71
 
72
+ $placeholder = ( ! empty( $args['all_placeholder'] ) ) ? ' placeholder="'. esc_attr( $args['all_placeholder'] ) .'"' : '';
73
 
74
  echo '<div class="csf--input">';
75
+ echo ( ! empty( $args['all_icon'] ) ) ? '<span class="csf--label csf--icon">'. wp_kses_post( $args['all_icon'] ) .'</span>' : '';
76
+ echo '<input type="number" name="'. esc_attr( $this->field_name( '[all]' ) ) .'" value="'. esc_attr( $value['all'] ) .'"'. $placeholder .' class="csf-input-number csf--is-unit" />';
77
+ echo ( ! empty( $args['unit'] ) ) ? '<span class="csf--label csf--unit">'. esc_attr( $args['unit'] ) .'</span>' : '';
78
  echo '</div>';
79
 
80
  } else {
82
  $properties = array();
83
 
84
  foreach ( array( 'top', 'right', 'bottom', 'left' ) as $prop ) {
85
+ if ( ! empty( $args[$prop] ) ) {
86
  $properties[] = $prop;
87
  }
88
  }
89
 
90
  $properties = ( $properties === array( 'right', 'left' ) ) ? array_reverse( $properties ) : $properties;
91
 
92
+ foreach ( $properties as $property ) {
93
 
94
+ $placeholder = ( ! empty( $args[$property.'_placeholder'] ) ) ? ' placeholder="'. esc_attr( $args[$property.'_placeholder'] ) .'"' : '';
95
 
96
  echo '<div class="csf--input">';
97
+ echo ( ! empty( $args[$property.'_icon'] ) ) ? '<span class="csf--label csf--icon">'. wp_kses_post( $args[$property.'_icon'] ) .'</span>' : '';
98
+ echo '<input type="number" name="'. esc_attr( $this->field_name( '['. $property .']' ) ) .'" value="'. esc_attr( $value[$property] ) .'"'. $placeholder .' class="csf-input-number csf--is-unit" />';
99
+ echo ( ! empty( $args['unit'] ) ) ? '<span class="csf--label csf--unit">'. esc_attr( $args['unit'] ) .'</span>' : '';
100
  echo '</div>';
101
 
102
  }
103
 
104
  }
105
 
106
+ if ( ! empty( $args['style'] ) ) {
107
  echo '<div class="csf--input">';
108
+ echo '<select name="'. esc_attr( $this->field_name( '[style]' ) ) .'">';
109
+ foreach ( $border_props as $border_prop_key => $border_prop_value ) {
110
  $selected = ( $value['style'] === $border_prop_key ) ? ' selected' : '';
111
+ echo '<option value="'. esc_attr( $border_prop_key ) .'"'. esc_attr( $selected ) .'>'. esc_attr( $border_prop_value ) .'</option>';
112
  }
113
  echo '</select>';
114
  echo '</div>';
116
 
117
  echo '</div>';
118
 
119
+ if ( ! empty( $args['color'] ) ) {
120
+ $default_color_attr = ( ! empty( $default_value['color'] ) ) ? ' data-default-color="'. esc_attr( $default_value['color'] ) .'"' : '';
121
  echo '<div class="csf--color">';
122
  echo '<div class="csf-field-color">';
123
+ echo '<input type="text" name="'. esc_attr( $this->field_name( '[color]' ) ) .'" value="'. esc_attr( $value['color'] ) .'" class="csf-color"'. $default_color_attr .' />';
124
  echo '</div>';
125
  echo '</div>';
126
  }
127
 
 
 
128
  echo $this->field_after();
129
 
130
  }
145
  $color = ( isset( $this->value['color'] ) && $this->value['color'] !== '' ) ? $this->value['color'] : '';
146
  $all = ( isset( $this->value['all'] ) && $this->value['all'] !== '' ) ? $this->value['all'] : '';
147
 
148
+ if ( ! empty( $this->field['all'] ) && ( $all !== '' || $color !== '' ) ) {
149
 
150
  $output = $element .'{';
151
  $output .= ( $all !== '' ) ? 'border-width:'. $all . $unit . $important .';' : '';
153
  $output .= ( $style !== '' ) ? 'border-style:'. $style . $important .';' : '';
154
  $output .= '}';
155
 
156
+ } else if ( $top !== '' || $right !== '' || $bottom !== '' || $left !== '' || $color !== '' ) {
157
 
158
  $output = $element .'{';
159
  $output .= ( $top !== '' ) ? 'border-top-width:'. $top . $unit . $important .';' : '';
admin/settings/fields/button_set/button_set.php CHANGED
@@ -7,7 +7,7 @@
7
  * @version 1.0.0
8
  *
9
  */
10
- if( ! class_exists( 'CSF_Field_button_set' ) ) {
11
  class CSF_Field_button_set extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
@@ -17,37 +17,47 @@ if( ! class_exists( 'CSF_Field_button_set' ) ) {
17
  public function render() {
18
 
19
  $args = wp_parse_args( $this->field, array(
20
- 'multiple' => false,
21
- 'options' => array(),
 
22
  ) );
23
 
24
  $value = ( is_array( $this->value ) ) ? $this->value : array_filter( (array) $this->value );
25
 
26
  echo $this->field_before();
27
 
28
- if( ! empty( $args['options'] ) ) {
29
 
30
- echo '<div class="csf-siblings csf--button-group" data-multiple="'. $args['multiple'] .'">';
 
31
 
32
- foreach( $args['options'] as $key => $option ) {
33
 
34
- $type = ( $args['multiple'] ) ? 'checkbox' : 'radio';
35
- $extra = ( $args['multiple'] ) ? '[]' : '';
36
- $active = ( in_array( $key, $value ) || ( empty( $value ) && empty( $key ) ) ) ? ' csf--active' : '';
37
- $checked = ( in_array( $key, $value ) || ( empty( $value ) && empty( $key ) ) ) ? ' checked' : '';
 
 
 
 
 
 
 
 
 
 
 
38
 
39
- echo '<div class="csf--sibling csf--button'. $active .'">';
40
- echo '<input type="'. $type .'" name="'. $this->field_name( $extra ) .'" value="'. $key .'"'. $this->field_attributes() . $checked .'/>';
41
- echo $option;
42
  echo '</div>';
43
 
44
- }
45
 
46
- echo '</div>';
47
 
48
- }
49
 
50
- echo '<div class="clear"></div>';
51
 
52
  echo $this->field_after();
53
 
7
  * @version 1.0.0
8
  *
9
  */
10
+ if ( ! class_exists( 'CSF_Field_button_set' ) ) {
11
  class CSF_Field_button_set extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
17
  public function render() {
18
 
19
  $args = wp_parse_args( $this->field, array(
20
+ 'multiple' => false,
21
+ 'options' => array(),
22
+ 'query_args' => array(),
23
  ) );
24
 
25
  $value = ( is_array( $this->value ) ) ? $this->value : array_filter( (array) $this->value );
26
 
27
  echo $this->field_before();
28
 
29
+ if ( isset( $this->field['options'] ) ) {
30
 
31
+ $options = $this->field['options'];
32
+ $options = ( is_array( $options ) ) ? $options : array_filter( $this->field_data( $options, false, $args['query_args'] ) );
33
 
34
+ if ( is_array( $options ) && ! empty( $options ) ) {
35
 
36
+ echo '<div class="csf-siblings csf--button-group" data-multiple="'. esc_attr( $args['multiple'] ) .'">';
37
+
38
+ foreach ( $options as $key => $option ) {
39
+
40
+ $type = ( $args['multiple'] ) ? 'checkbox' : 'radio';
41
+ $extra = ( $args['multiple'] ) ? '[]' : '';
42
+ $active = ( in_array( $key, $value ) || ( empty( $value ) && empty( $key ) ) ) ? ' csf--active' : '';
43
+ $checked = ( in_array( $key, $value ) || ( empty( $value ) && empty( $key ) ) ) ? ' checked' : '';
44
+
45
+ echo '<div class="csf--sibling csf--button'. esc_attr( $active ) .'">';
46
+ echo '<input type="'. esc_attr( $type ) .'" name="'. esc_attr( $this->field_name( $extra ) ) .'" value="'. esc_attr( $key ) .'"'. $this->field_attributes() . esc_attr( $checked ) .'/>';
47
+ echo wp_kses_post( $option );
48
+ echo '</div>';
49
+
50
+ }
51
 
 
 
 
52
  echo '</div>';
53
 
54
+ } else {
55
 
56
+ echo ( ! empty( $this->field['empty_message'] ) ) ? esc_attr( $this->field['empty_message'] ) : esc_html__( 'No data provided for this option type.', 'csf' );
57
 
58
+ }
59
 
60
+ }
61
 
62
  echo $this->field_after();
63
 
admin/settings/fields/callback/callback.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Field: callback
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if ( ! class_exists( 'CSF_Field_callback' ) ) {
11
+ class CSF_Field_callback extends CSF_Fields {
12
+
13
+ public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
14
+ parent::__construct( $field, $value, $unique, $where, $parent );
15
+ }
16
+
17
+ public function render() {
18
+
19
+ if ( isset( $this->field['function'] ) && function_exists( $this->field['function'] ) ) {
20
+
21
+ $args = ( isset( $this->field['args'] ) ) ? $this->field['args'] : null;
22
+
23
+ call_user_func( $this->field['function'], $args );
24
+
25
+ }
26
+
27
+ }
28
+
29
+ }
30
+ }
admin/settings/fields/checkbox/checkbox.php CHANGED
@@ -7,7 +7,7 @@
7
  * @version 1.0.0
8
  *
9
  */
10
- if( ! class_exists( 'CSF_Field_checkbox' ) ) {
11
  class CSF_Field_checkbox extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
@@ -25,25 +25,25 @@ if( ! class_exists( 'CSF_Field_checkbox' ) ) {
25
 
26
  echo $this->field_before();
27
 
28
- if( isset( $this->field['options'] ) ) {
29
 
30
  $value = ( is_array( $this->value ) ) ? $this->value : array_filter( (array) $this->value );
31
  $options = $this->field['options'];
32
  $options = ( is_array( $options ) ) ? $options : array_filter( $this->field_data( $options, false, $args['query_args'] ) );
33
 
34
- if( is_array( $options ) && ! empty( $options ) ) {
35
 
36
  echo '<ul'. $inline_class .'>';
37
  foreach ( $options as $option_key => $option_value ) {
38
 
39
- if( is_array( $option_value ) && ! empty( $option_value ) ) {
40
 
41
  echo '<li>';
42
  echo '<ul>';
43
- echo '<li><strong>'. $option_key .'</strong></li>';
44
- foreach( $option_value as $sub_key => $sub_value ) {
45
  $checked = ( in_array( $sub_key, $value ) ) ? ' checked' : '';
46
- echo '<li><label><input type="checkbox" name="'. $this->field_name( '[]' ) .'" value="'. $sub_key .'"'. $this->field_attributes() . $checked .'/> '. $sub_value .'</label></li>';
47
  }
48
  echo '</ul>';
49
  echo '</li>';
@@ -51,7 +51,7 @@ if( ! class_exists( 'CSF_Field_checkbox' ) ) {
51
  } else {
52
 
53
  $checked = ( in_array( $option_key, $value ) ) ? ' checked' : '';
54
- echo '<li><label><input type="checkbox" name="'. $this->field_name( '[]' ) .'" value="'. $option_key .'"'. $this->field_attributes() . $checked .'/> '. $option_value .'</label></li>';
55
 
56
  }
57
 
@@ -60,16 +60,16 @@ if( ! class_exists( 'CSF_Field_checkbox' ) ) {
60
 
61
  } else {
62
 
63
- echo ( ! empty( $this->field['empty_message'] ) ) ? $this->field['empty_message'] : esc_html__( 'No data provided for this option type.', 'csf' );
64
 
65
  }
66
 
67
  } else {
68
 
69
  echo '<label class="csf-checkbox">';
70
- echo '<input type="hidden" name="'. $this->field_name() .'" value="'. $this->value .'" class="csf--input"'. $this->field_attributes() .'/>';
71
- echo '<input type="checkbox" name="_pseudo" class="csf--checkbox"'. checked( $this->value, 1, false ) .'/>';
72
- echo ( ! empty( $this->field['label'] ) ) ? ' '. $this->field['label'] : '';
73
  echo '</label>';
74
 
75
  }
7
  * @version 1.0.0
8
  *
9
  */
10
+ if ( ! class_exists( 'CSF_Field_checkbox' ) ) {
11
  class CSF_Field_checkbox extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
25
 
26
  echo $this->field_before();
27
 
28
+ if ( isset( $this->field['options'] ) ) {
29
 
30
  $value = ( is_array( $this->value ) ) ? $this->value : array_filter( (array) $this->value );
31
  $options = $this->field['options'];
32
  $options = ( is_array( $options ) ) ? $options : array_filter( $this->field_data( $options, false, $args['query_args'] ) );
33
 
34
+ if ( is_array( $options ) && ! empty( $options ) ) {
35
 
36
  echo '<ul'. $inline_class .'>';
37
  foreach ( $options as $option_key => $option_value ) {
38
 
39
+ if ( is_array( $option_value ) && ! empty( $option_value ) ) {
40
 
41
  echo '<li>';
42
  echo '<ul>';
43
+ echo '<li><strong>'. esc_attr( $option_key ) .'</strong></li>';
44
+ foreach ( $option_value as $sub_key => $sub_value ) {
45
  $checked = ( in_array( $sub_key, $value ) ) ? ' checked' : '';
46
+ echo '<li><label><input type="checkbox" name="'. esc_attr( $this->field_name( '[]' ) ) .'" value="'. esc_attr( $sub_key ) .'"'. $this->field_attributes() . esc_attr( $checked ) .'/> '. esc_attr( $sub_value ) .'</label></li>';
47
  }
48
  echo '</ul>';
49
  echo '</li>';
51
  } else {
52
 
53
  $checked = ( in_array( $option_key, $value ) ) ? ' checked' : '';
54
+ echo '<li><label><input type="checkbox" name="'. esc_attr( $this->field_name( '[]' ) ) .'" value="'. esc_attr( $option_key ) .'"'. $this->field_attributes() . $checked .'/> '. esc_attr( $option_value ) .'</label></li>';
55
 
56
  }
57
 
60
 
61
  } else {
62
 
63
+ echo ( ! empty( $this->field['empty_message'] ) ) ? esc_attr( $this->field['empty_message'] ) : esc_html__( 'No data provided for this option type.', 'csf' );
64
 
65
  }
66
 
67
  } else {
68
 
69
  echo '<label class="csf-checkbox">';
70
+ echo '<input type="hidden" name="'. esc_attr( $this->field_name() ) .'" value="'. $this->value .'" class="csf--input"'. $this->field_attributes() .'/>';
71
+ echo '<input type="checkbox" name="_pseudo" class="csf--checkbox"'. esc_attr( checked( $this->value, 1, false ) ) .'/>';
72
+ echo ( ! empty( $this->field['label'] ) ) ? ' '. esc_attr( $this->field['label'] ) : '';
73
  echo '</label>';
74
 
75
  }
admin/settings/fields/code_editor/code_editor.php CHANGED
@@ -7,7 +7,7 @@
7
  * @version 1.0.0
8
  *
9
  */
10
- if( ! class_exists( 'CSF_Field_code_editor' ) ) {
11
  class CSF_Field_code_editor extends CSF_Fields {
12
 
13
  public $version = '5.41.0';
@@ -29,26 +29,27 @@ if( ! class_exists( 'CSF_Field_code_editor' ) ) {
29
 
30
  $settings = ( ! empty( $this->field['settings'] ) ) ? $this->field['settings'] : array();
31
  $settings = wp_parse_args( $settings, $default_settings );
32
- $encoded = htmlspecialchars( json_encode( $settings ) );
33
 
34
  echo $this->field_before();
35
- echo '<textarea name="'. $this->field_name() .'"'. $this->field_attributes() .' data-editor="'. $encoded .'">'. $this->value .'</textarea>';
36
  echo $this->field_after();
37
 
38
  }
39
 
40
  public function enqueue() {
41
 
 
 
42
  // Do not loads CodeMirror in revslider page.
43
- if( in_array( csf_get_var( 'page' ), array( 'revslider' ) ) ) { return; }
44
 
45
- if( ! wp_script_is( 'csf-codemirror' ) ) {
46
- wp_enqueue_script( 'csf-codemirror', $this->cdn_url . $this->version .'/lib/codemirror.min.js', array( 'csf' ), $this->version, true );
47
- wp_enqueue_script( 'csf-codemirror-loadmode', $this->cdn_url . $this->version .'/addon/mode/loadmode.min.js', array( 'csf-codemirror' ), $this->version, true );
48
  }
49
 
50
- if( ! wp_style_is( 'csf-codemirror' ) ) {
51
- wp_enqueue_style( 'csf-codemirror', $this->cdn_url . $this->version .'/lib/codemirror.min.css', array(), $this->version );
52
  }
53
 
54
  }
7
  * @version 1.0.0
8
  *
9
  */
10
+ if ( ! class_exists( 'CSF_Field_code_editor' ) ) {
11
  class CSF_Field_code_editor extends CSF_Fields {
12
 
13
  public $version = '5.41.0';
29
 
30
  $settings = ( ! empty( $this->field['settings'] ) ) ? $this->field['settings'] : array();
31
  $settings = wp_parse_args( $settings, $default_settings );
 
32
 
33
  echo $this->field_before();
34
+ echo '<textarea name="'. esc_attr( $this->field_name() ) .'"'. $this->field_attributes() .' data-editor="'. esc_attr( json_encode( $settings ) ) .'">'. $this->value .'</textarea>';
35
  echo $this->field_after();
36
 
37
  }
38
 
39
  public function enqueue() {
40
 
41
+ $page = ( ! empty( $_GET[ 'page' ] ) ) ? sanitize_text_field( wp_unslash( $_GET[ 'page' ] ) ) : '';
42
+
43
  // Do not loads CodeMirror in revslider page.
44
+ if ( in_array( $page, array( 'revslider' ) ) ) { return; }
45
 
46
+ if ( ! wp_script_is( 'csf-codemirror' ) ) {
47
+ wp_enqueue_script( 'csf-codemirror', esc_url( $this->cdn_url . $this->version .'/lib/codemirror.min.js' ), array( 'csf' ), $this->version, true );
48
+ wp_enqueue_script( 'csf-codemirror-loadmode', esc_url( $this->cdn_url . $this->version .'/addon/mode/loadmode.min.js' ), array( 'csf-codemirror' ), $this->version, true );
49
  }
50
 
51
+ if ( ! wp_style_is( 'csf-codemirror' ) ) {
52
+ wp_enqueue_style( 'csf-codemirror', esc_url( $this->cdn_url . $this->version .'/lib/codemirror.min.css' ), array(), $this->version );
53
  }
54
 
55
  }
admin/settings/fields/color/color.php CHANGED
@@ -7,7 +7,7 @@
7
  * @version 1.0.0
8
  *
9
  */
10
- if( ! class_exists( 'CSF_Field_color' ) ) {
11
  class CSF_Field_color extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
@@ -16,10 +16,10 @@ if( ! class_exists( 'CSF_Field_color' ) ) {
16
 
17
  public function render() {
18
 
19
- $default_attr = ( ! empty( $this->field['default'] ) ) ? ' data-default-color="'. $this->field['default'] .'"' : '';
20
 
21
  echo $this->field_before();
22
- echo '<input type="text" name="'. $this->field_name() .'" value="'. $this->value .'" class="csf-color"'. $default_attr . $this->field_attributes() .'/>';
23
  echo $this->field_after();
24
 
25
  }
@@ -31,9 +31,9 @@ if( ! class_exists( 'CSF_Field_color' ) ) {
31
  $important = ( ! empty( $this->field['output_important'] ) ) ? '!important' : '';
32
  $mode = ( ! empty( $this->field['output_mode'] ) ) ? $this->field['output_mode'] : 'color';
33
 
34
- if( ! empty( $elements ) && isset( $this->value ) && $this->value !== '' ) {
35
- foreach( $elements as $key_property => $element ) {
36
- if( is_numeric( $key_property ) ) {
37
  $output = implode( ',', $elements ) .'{'. $mode .':'. $this->value . $important .';}';
38
  break;
39
  } else {
7
  * @version 1.0.0
8
  *
9
  */
10
+ if ( ! class_exists( 'CSF_Field_color' ) ) {
11
  class CSF_Field_color extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
16
 
17
  public function render() {
18
 
19
+ $default_attr = ( ! empty( $this->field['default'] ) ) ? ' data-default-color="'. esc_attr( $this->field['default'] ) .'"' : '';
20
 
21
  echo $this->field_before();
22
+ echo '<input type="text" name="'. esc_attr( $this->field_name() ) .'" value="'. esc_attr( $this->value ) .'" class="csf-color"'. $default_attr . $this->field_attributes() .'/>';
23
  echo $this->field_after();
24
 
25
  }
31
  $important = ( ! empty( $this->field['output_important'] ) ) ? '!important' : '';
32
  $mode = ( ! empty( $this->field['output_mode'] ) ) ? $this->field['output_mode'] : 'color';
33
 
34
+ if ( ! empty( $elements ) && isset( $this->value ) && $this->value !== '' ) {
35
+ foreach ( $elements as $key_property => $element ) {
36
+ if ( is_numeric( $key_property ) ) {
37
  $output = implode( ',', $elements ) .'{'. $mode .':'. $this->value . $important .';}';
38
  break;
39
  } else {
admin/settings/fields/color_group/color_group.php CHANGED
@@ -7,7 +7,7 @@
7
  * @version 1.0.0
8
  *
9
  */
10
- if( ! class_exists( 'CSF_Field_color_group' ) ) {
11
  class CSF_Field_color_group extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
@@ -20,22 +20,20 @@ if( ! class_exists( 'CSF_Field_color_group' ) ) {
20
 
21
  echo $this->field_before();
22
 
23
- if( ! empty( $options ) ) {
24
- foreach( $options as $key => $option ) {
25
 
26
  $color_value = ( ! empty( $this->value[$key] ) ) ? $this->value[$key] : '';
27
- $default_attr = ( ! empty( $this->field['default'][$key] ) ) ? ' data-default-color="'. $this->field['default'][$key] .'"' : '';
28
 
29
  echo '<div class="csf--left csf-field-color">';
30
  echo '<div class="csf--title">'. $option .'</div>';
31
- echo '<input type="text" name="'. $this->field_name('['. $key .']') .'" value="'. $color_value .'" class="csf-color"'. $default_attr . $this->field_attributes() .'/>';
32
  echo '</div>';
33
 
34
  }
35
  }
36
 
37
- echo '<div class="clear"></div>';
38
-
39
  echo $this->field_after();
40
 
41
  }
7
  * @version 1.0.0
8
  *
9
  */
10
+ if ( ! class_exists( 'CSF_Field_color_group' ) ) {
11
  class CSF_Field_color_group extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
20
 
21
  echo $this->field_before();
22
 
23
+ if ( ! empty( $options ) ) {
24
+ foreach ( $options as $key => $option ) {
25
 
26
  $color_value = ( ! empty( $this->value[$key] ) ) ? $this->value[$key] : '';
27
+ $default_attr = ( ! empty( $this->field['default'][$key] ) ) ? ' data-default-color="'. esc_attr( $this->field['default'][$key] ) .'"' : '';
28
 
29
  echo '<div class="csf--left csf-field-color">';
30
  echo '<div class="csf--title">'. $option .'</div>';
31
+ echo '<input type="text" name="'. esc_attr( $this->field_name( '['. $key .']' ) ) .'" value="'. esc_attr( $color_value ) .'" class="csf-color"'. $default_attr . $this->field_attributes() .'/>';
32
  echo '</div>';
33
 
34
  }
35
  }
36
 
 
 
37
  echo $this->field_after();
38
 
39
  }
admin/settings/fields/content/content.php CHANGED
@@ -7,7 +7,7 @@
7
  * @version 1.0.0
8
  *
9
  */
10
- if( ! class_exists( 'CSF_Field_content' ) ) {
11
  class CSF_Field_content extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
@@ -15,7 +15,13 @@ if( ! class_exists( 'CSF_Field_content' ) ) {
15
  }
16
 
17
  public function render() {
18
- echo $this->field['content'];
 
 
 
 
 
 
19
  }
20
 
21
  }
7
  * @version 1.0.0
8
  *
9
  */
10
+ if ( ! class_exists( 'CSF_Field_content' ) ) {
11
  class CSF_Field_content extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
15
  }
16
 
17
  public function render() {
18
+
19
+ if ( ! empty( $this->field['content'] ) ) {
20
+
21
+ echo wp_kses_post( $this->field['content'] );
22
+
23
+ }
24
+
25
  }
26
 
27
  }
admin/settings/fields/date/date.php CHANGED
@@ -7,7 +7,7 @@
7
  * @version 1.0.0
8
  *
9
  */
10
- if( ! class_exists( 'CSF_Field_date' ) ) {
11
  class CSF_Field_date extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
@@ -25,7 +25,7 @@ if( ! class_exists( 'CSF_Field_date' ) ) {
25
 
26
  echo $this->field_before();
27
 
28
- if( ! empty( $this->field['from_to'] ) ) {
29
 
30
  $args = wp_parse_args( $this->field, array(
31
  'text_from' => esc_html__( 'From', 'csf' ),
@@ -37,12 +37,12 @@ if( ! class_exists( 'CSF_Field_date' ) ) {
37
  'to' => '',
38
  ) );
39
 
40
- echo '<label class="csf--from">'. $args['text_from'] .' <input type="text" name="'. $this->field_name('[from]') .'" value="'. $value['from'] .'"'. $this->field_attributes() .'/></label>';
41
- echo '<label class="csf--to">'. $args['text_to'] .' <input type="text" name="'. $this->field_name('[to]') .'" value="'. $value['to'] .'"'. $this->field_attributes() .'/></label>';
42
 
43
  } else {
44
 
45
- echo '<input type="text" name="'. $this->field_name() .'" value="'. $this->value .'"'. $this->field_attributes() .'/>';
46
 
47
  }
48
 
@@ -54,7 +54,7 @@ if( ! class_exists( 'CSF_Field_date' ) ) {
54
 
55
  public function enqueue() {
56
 
57
- if( ! wp_script_is( 'jquery-ui-datepicker' ) ) {
58
  wp_enqueue_script( 'jquery-ui-datepicker' );
59
  }
60
 
7
  * @version 1.0.0
8
  *
9
  */
10
+ if ( ! class_exists( 'CSF_Field_date' ) ) {
11
  class CSF_Field_date extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
25
 
26
  echo $this->field_before();
27
 
28
+ if ( ! empty( $this->field['from_to'] ) ) {
29
 
30
  $args = wp_parse_args( $this->field, array(
31
  'text_from' => esc_html__( 'From', 'csf' ),
37
  'to' => '',
38
  ) );
39
 
40
+ echo '<label class="csf--from">'. esc_attr( $args['text_from'] ) .' <input type="text" name="'. esc_attr( $this->field_name( '[from]' ) ) .'" value="'. esc_attr( $value['from'] ) .'"'. $this->field_attributes() .'/></label>';
41
+ echo '<label class="csf--to">'. esc_attr( $args['text_to'] ) .' <input type="text" name="'. esc_attr( $this->field_name( '[to]' ) ) .'" value="'. esc_attr( $value['to'] ) .'"'. $this->field_attributes() .'/></label>';
42
 
43
  } else {
44
 
45
+ echo '<input type="text" name="'. esc_attr( $this->field_name() ) .'" value="'. esc_attr( $this->value ) .'"'. $this->field_attributes() .'/>';
46
 
47
  }
48
 
54
 
55
  public function enqueue() {
56
 
57
+ if ( ! wp_script_is( 'jquery-ui-datepicker' ) ) {
58
  wp_enqueue_script( 'jquery-ui-datepicker' );
59
  }
60
 
admin/settings/fields/dimensions/dimensions.php CHANGED
@@ -7,7 +7,7 @@
7
  * @version 1.0.0
8
  *
9
  */
10
- if( ! class_exists( 'CSF_Field_dimensions' ) ) {
11
  class CSF_Field_dimensions extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
@@ -17,8 +17,8 @@ if( ! class_exists( 'CSF_Field_dimensions' ) ) {
17
  public function render() {
18
 
19
  $args = wp_parse_args( $this->field, array(
20
- 'width_icon' => '<i class="fa fa-arrows-h"></i>',
21
- 'height_icon' => '<i class="fa fa-arrows-v"></i>',
22
  'width_placeholder' => esc_html__( 'width', 'csf' ),
23
  'height_placeholder' => esc_html__( 'height', 'csf' ),
24
  'width' => true,
@@ -42,30 +42,30 @@ if( ! class_exists( 'CSF_Field_dimensions' ) ) {
42
 
43
  echo '<div class="csf--inputs">';
44
 
45
- if( ! empty( $args['width'] ) ) {
46
- $placeholder = ( ! empty( $args['width_placeholder'] ) ) ? ' placeholder="'. $args['width_placeholder'] .'"' : '';
47
  echo '<div class="csf--input">';
48
- echo ( ! empty( $args['width_icon'] ) ) ? '<span class="csf--label csf--icon">'. $args['width_icon'] .'</span>' : '';
49
- echo '<input type="number" name="'. $this->field_name('[width]') .'" value="'. $value['width'] .'"'. $placeholder .' class="csf-input-number'. $is_unit .'" />';
50
- echo ( ! empty( $unit ) ) ? '<span class="csf--label csf--unit">'. $args['units'][0] .'</span>' : '';
51
  echo '</div>';
52
  }
53
 
54
- if( ! empty( $args['height'] ) ) {
55
- $placeholder = ( ! empty( $args['height_placeholder'] ) ) ? ' placeholder="'. $args['height_placeholder'] .'"' : '';
56
  echo '<div class="csf--input">';
57
- echo ( ! empty( $args['height_icon'] ) ) ? '<span class="csf--label csf--icon">'. $args['height_icon'] .'</span>' : '';
58
- echo '<input type="number" name="'. $this->field_name('[height]') .'" value="'. $value['height'] .'"'. $placeholder .' class="csf-input-number'. $is_unit .'" />';
59
- echo ( ! empty( $unit ) ) ? '<span class="csf--label csf--unit">'. $args['units'][0] .'</span>' : '';
60
  echo '</div>';
61
  }
62
 
63
- if( ! empty( $args['unit'] ) && ! empty( $args['show_units'] ) && count( $args['units'] ) > 1 ) {
64
  echo '<div class="csf--input">';
65
- echo '<select name="'. $this->field_name('[unit]') .'">';
66
- foreach( $args['units'] as $unit ) {
67
  $selected = ( $value['unit'] === $unit ) ? ' selected' : '';
68
- echo '<option value="'. $unit .'"'. $selected .'>'. $unit .'</option>';
69
  }
70
  echo '</select>';
71
  echo '</div>';
@@ -85,9 +85,9 @@ if( ! class_exists( 'CSF_Field_dimensions' ) ) {
85
  $important = ( ! empty( $this->field['output_important'] ) ) ? '!important' : '';
86
  $unit = ( ! empty( $this->value['unit'] ) ) ? $this->value['unit'] : 'px';
87
  $width = ( isset( $this->value['width'] ) && $this->value['width'] !== '' ) ? $prefix .'width:'. $this->value['width'] . $unit . $important .';' : '';
88
- $height = ( isset( $this->value['height'] ) && $this->value['width'] !== '' ) ? $prefix .'height:'. $this->value['height'] . $unit . $important .';' : '';
89
 
90
- if( $width !== '' || $height !== '' ) {
91
  $output = $element .'{'. $width . $height .'}';
92
  }
93
 
7
  * @version 1.0.0
8
  *
9
  */
10
+ if ( ! class_exists( 'CSF_Field_dimensions' ) ) {
11
  class CSF_Field_dimensions extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
17
  public function render() {
18
 
19
  $args = wp_parse_args( $this->field, array(
20
+ 'width_icon' => '<i class="fas fa-arrows-alt-h"></i>',
21
+ 'height_icon' => '<i class="fas fa-arrows-alt-v"></i>',
22
  'width_placeholder' => esc_html__( 'width', 'csf' ),
23
  'height_placeholder' => esc_html__( 'height', 'csf' ),
24
  'width' => true,
42
 
43
  echo '<div class="csf--inputs">';
44
 
45
+ if ( ! empty( $args['width'] ) ) {
46
+ $placeholder = ( ! empty( $args['width_placeholder'] ) ) ? ' placeholder="'. esc_attr( $args['width_placeholder'] ) .'"' : '';
47
  echo '<div class="csf--input">';
48
+ echo ( ! empty( $args['width_icon'] ) ) ? '<span class="csf--label csf--icon">'. wp_kses_post( $args['width_icon'] ) .'</span>' : '';
49
+ echo '<input type="number" name="'. esc_attr( $this->field_name( '[width]' ) ) .'" value="'. esc_attr( $value['width'] ) .'"'. $placeholder .' class="csf-input-number'. esc_attr( $is_unit ) .'" />';
50
+ echo ( ! empty( $unit ) ) ? '<span class="csf--label csf--unit">'. esc_attr( $args['units'][0] ) .'</span>' : '';
51
  echo '</div>';
52
  }
53
 
54
+ if ( ! empty( $args['height'] ) ) {
55
+ $placeholder = ( ! empty( $args['height_placeholder'] ) ) ? ' placeholder="'. esc_attr( $args['height_placeholder'] ) .'"' : '';
56
  echo '<div class="csf--input">';
57
+ echo ( ! empty( $args['height_icon'] ) ) ? '<span class="csf--label csf--icon">'. wp_kses_post( $args['height_icon'] ) .'</span>' : '';
58
+ echo '<input type="number" name="'. esc_attr( $this->field_name( '[height]' ) ) .'" value="'. esc_attr( $value['height'] ) .'"'. $placeholder .' class="csf-input-number'. esc_attr( $is_unit ) .'" />';
59
+ echo ( ! empty( $unit ) ) ? '<span class="csf--label csf--unit">'. esc_attr( $args['units'][0] ) .'</span>' : '';
60
  echo '</div>';
61
  }
62
 
63
+ if ( ! empty( $args['unit'] ) && ! empty( $args['show_units'] ) && count( $args['units'] ) > 1 ) {
64
  echo '<div class="csf--input">';
65
+ echo '<select name="'. esc_attr( $this->field_name( '[unit]' ) ) .'">';
66
+ foreach ( $args['units'] as $unit ) {
67
  $selected = ( $value['unit'] === $unit ) ? ' selected' : '';
68
+ echo '<option value="'. esc_attr( $unit ) .'"'. esc_attr( $selected ) .'>'. esc_attr( $unit ) .'</option>';
69
  }
70
  echo '</select>';
71
  echo '</div>';
85
  $important = ( ! empty( $this->field['output_important'] ) ) ? '!important' : '';
86
  $unit = ( ! empty( $this->value['unit'] ) ) ? $this->value['unit'] : 'px';
87
  $width = ( isset( $this->value['width'] ) && $this->value['width'] !== '' ) ? $prefix .'width:'. $this->value['width'] . $unit . $important .';' : '';
88
+ $height = ( isset( $this->value['height'] ) && $this->value['height'] !== '' ) ? $prefix .'height:'. $this->value['height'] . $unit . $important .';' : '';
89
 
90
+ if ( $width !== '' || $height !== '' ) {
91
  $output = $element .'{'. $width . $height .'}';
92
  }
93
 
admin/settings/fields/fieldset/fieldset.php CHANGED
@@ -7,7 +7,7 @@
7
  * @version 1.0.0
8
  *
9
  */
10
- if( ! class_exists( 'CSF_Field_fieldset' ) ) {
11
  class CSF_Field_fieldset extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
7
  * @version 1.0.0
8
  *
9
  */
10
+ if ( ! class_exists( 'CSF_Field_fieldset' ) ) {
11
  class CSF_Field_fieldset extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
admin/settings/fields/gallery/gallery.php CHANGED
@@ -7,7 +7,7 @@
7
  * @version 1.0.0
8
  *
9
  */
10
- if( ! class_exists( 'CSF_Field_gallery' ) ) {
11
  class CSF_Field_gallery extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
@@ -27,23 +27,22 @@ if( ! class_exists( 'CSF_Field_gallery' ) ) {
27
  echo $this->field_before();
28
 
29
  echo '<ul>';
30
-
31
- if( ! empty( $this->value ) ) {
32
 
33
  $values = explode( ',', $this->value );
34
 
35
  foreach ( $values as $id ) {
36
  $attachment = wp_get_attachment_image_src( $id, 'thumbnail' );
37
- echo '<li><img src="'. $attachment[0] .'" /></li>';
38
  }
39
 
40
  }
41
-
42
  echo '</ul>';
43
- echo '<a href="#" class="button button-primary csf-button">'. $args['add_title'] .'</a>';
44
- echo '<a href="#" class="button csf-edit-gallery'. $hidden .'">'. $args['edit_title'] .'</a>';
45
- echo '<a href="#" class="button csf-warning-primary csf-clear-gallery'. $hidden .'">'. $args['clear_title'] .'</a>';
46
- echo '<input type="text" name="'. $this->field_name() .'" value="'. $this->value .'"'. $this->field_attributes() .'/>';
 
47
 
48
  echo $this->field_after();
49
 
7
  * @version 1.0.0
8
  *
9
  */
10
+ if ( ! class_exists( 'CSF_Field_gallery' ) ) {
11
  class CSF_Field_gallery extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
27
  echo $this->field_before();
28
 
29
  echo '<ul>';
30
+ if ( ! empty( $this->value ) ) {
 
31
 
32
  $values = explode( ',', $this->value );
33
 
34
  foreach ( $values as $id ) {
35
  $attachment = wp_get_attachment_image_src( $id, 'thumbnail' );
36
+ echo '<li><img src="'. esc_url( $attachment[0] ) .'" /></li>';
37
  }
38
 
39
  }
 
40
  echo '</ul>';
41
+
42
+ echo '<a href="#" class="button button-primary csf-button">'. esc_attr( $args['add_title'] ) .'</a>';
43
+ echo '<a href="#" class="button csf-edit-gallery'. esc_attr( $hidden ) .'">'. esc_attr( $args['edit_title'] ) .'</a>';
44
+ echo '<a href="#" class="button csf-warning-primary csf-clear-gallery'. esc_attr( $hidden ) .'">'. esc_attr( $args['clear_title'] ) .'</a>';
45
+ echo '<input type="text" name="'. esc_attr( $this->field_name() ) .'" value="'. esc_attr( $this->value ) .'"'. $this->field_attributes() .'/>';
46
 
47
  echo $this->field_after();
48
 
admin/settings/fields/group/group.php CHANGED
@@ -7,7 +7,7 @@
7
  * @version 1.0.0
8
  *
9
  */
10
- if( ! class_exists( 'CSF_Field_group' ) ) {
11
  class CSF_Field_group extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
@@ -30,7 +30,7 @@ if( ! class_exists( 'CSF_Field_group' ) ) {
30
  $title_number = ( ! empty( $args['accordion_title_number'] ) ) ? true : false;
31
  $title_auto = ( ! empty( $args['accordion_title_auto'] ) ) ? true : false;
32
 
33
- if( ! empty( $this->parent ) && preg_match( '/'. preg_quote( '['. $this->field['id'] .']' ) .'/', $this->parent ) ) {
34
 
35
  echo '<div class="csf-notice csf-notice-danger">'. esc_html__( 'Error: Nested field id can not be same with another nested field id.', 'csf' ) .'</div>';
36
 
@@ -41,15 +41,15 @@ if( ! class_exists( 'CSF_Field_group' ) ) {
41
  echo '<div class="csf-cloneable-item csf-cloneable-hidden">';
42
 
43
  echo '<div class="csf-cloneable-helper">';
44
- echo '<i class="csf-cloneable-sort fa fa-arrows"></i>';
45
- echo '<i class="csf-cloneable-clone fa fa-clone"></i>';
46
- echo '<i class="csf-cloneable-remove csf-confirm fa fa-times" data-confirm="'. esc_html__( 'Are you sure to delete this item?', 'csf' ) .'"></i>';
47
  echo '</div>';
48
 
49
  echo '<h4 class="csf-cloneable-title">';
50
  echo '<span class="csf-cloneable-text">';
51
  echo ( $title_number ) ? '<span class="csf-cloneable-title-number"></span>' : '';
52
- echo ( $title_prefix ) ? '<span class="csf-cloneable-title-prefix">'. $title_prefix .'</span>' : '';
53
  echo ( $title_auto ) ? '<span class="csf-cloneable-value"><span class="csf-cloneable-placeholder"></span></span>' : '';
54
  echo '</span>';
55
  echo '</h4>';
@@ -67,9 +67,9 @@ if( ! class_exists( 'CSF_Field_group' ) ) {
67
 
68
  echo '</div>';
69
 
70
- echo '<div class="csf-cloneable-wrapper csf-data-wrapper" data-title-number="'. $title_number .'" data-unique-id="'. $this->unique .'" data-field-id="['. $this->field['id'] .']" data-max="'. $args['max'] .'" data-min="'. $args['min'] .'">';
71
 
72
- if( ! empty( $this->value ) ) {
73
 
74
  $num = 0;
75
 
@@ -77,20 +77,21 @@ if( ! class_exists( 'CSF_Field_group' ) ) {
77
 
78
  $first_id = ( isset( $this->field['fields'][0]['id'] ) ) ? $this->field['fields'][0]['id'] : '';
79
  $first_value = ( isset( $value[$first_id] ) ) ? $value[$first_id] : '';
 
80
 
81
  echo '<div class="csf-cloneable-item">';
82
 
83
  echo '<div class="csf-cloneable-helper">';
84
- echo '<i class="csf-cloneable-sort fa fa-arrows"></i>';
85
- echo '<i class="csf-cloneable-clone fa fa-clone"></i>';
86
- echo '<i class="csf-cloneable-remove csf-confirm fa fa-times" data-confirm="'. esc_html__( 'Are you sure to delete this item?', 'csf' ) .'"></i>';
87
  echo '</div>';
88
 
89
  echo '<h4 class="csf-cloneable-title">';
90
  echo '<span class="csf-cloneable-text">';
91
- echo ( $title_number ) ? '<span class="csf-cloneable-title-number">'. ( $num+1 ) .'.</span>' : '';
92
- echo ( $title_prefix ) ? '<span class="csf-cloneable-title-prefix">'. $title_prefix .'</span>' : '';
93
- echo ( $title_auto ) ? '<span class="csf-cloneable-value">' . $first_value .'</span>' : '';
94
  echo '</span>';
95
  echo '</h4>';
96
 
@@ -118,10 +119,10 @@ if( ! class_exists( 'CSF_Field_group' ) ) {
118
 
119
  echo '</div>';
120
 
121
- echo '<div class="csf-cloneable-alert csf-cloneable-max">'. esc_html__( 'You can not add more than', 'csf' ) .' '. $args['max'] .'</div>';
122
- echo '<div class="csf-cloneable-alert csf-cloneable-min">'. esc_html__( 'You can not remove less than', 'csf' ) .' '. $args['min'] .'</div>';
123
 
124
- echo '<a href="#" class="button button-primary csf-cloneable-add">'. $args['button_title'] .'</a>';
125
 
126
  echo $this->field_after();
127
 
@@ -131,11 +132,11 @@ if( ! class_exists( 'CSF_Field_group' ) ) {
131
 
132
  public function enqueue() {
133
 
134
- if( ! wp_script_is( 'jquery-ui-accordion' ) ) {
135
  wp_enqueue_script( 'jquery-ui-accordion' );
136
  }
137
 
138
- if( ! wp_script_is( 'jquery-ui-sortable' ) ) {
139
  wp_enqueue_script( 'jquery-ui-sortable' );
140
  }
141
 
7
  * @version 1.0.0
8
  *
9
  */
10
+ if ( ! class_exists( 'CSF_Field_group' ) ) {
11
  class CSF_Field_group extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
30
  $title_number = ( ! empty( $args['accordion_title_number'] ) ) ? true : false;
31
  $title_auto = ( ! empty( $args['accordion_title_auto'] ) ) ? true : false;
32
 
33
+ if ( ! empty( $this->parent ) && preg_match( '/'. preg_quote( '['. $this->field['id'] .']' ) .'/', $this->parent ) ) {
34
 
35
  echo '<div class="csf-notice csf-notice-danger">'. esc_html__( 'Error: Nested field id can not be same with another nested field id.', 'csf' ) .'</div>';
36
 
41
  echo '<div class="csf-cloneable-item csf-cloneable-hidden">';
42
 
43
  echo '<div class="csf-cloneable-helper">';
44
+ echo '<i class="csf-cloneable-sort fas fa-arrows-alt"></i>';
45
+ echo '<i class="csf-cloneable-clone far fa-clone"></i>';
46
+ echo '<i class="csf-cloneable-remove csf-confirm fas fa-times" data-confirm="'. esc_html__( 'Are you sure to delete this item?', 'csf' ) .'"></i>';
47
  echo '</div>';
48
 
49
  echo '<h4 class="csf-cloneable-title">';
50
  echo '<span class="csf-cloneable-text">';
51
  echo ( $title_number ) ? '<span class="csf-cloneable-title-number"></span>' : '';
52
+ echo ( $title_prefix ) ? '<span class="csf-cloneable-title-prefix">'. esc_attr( $title_prefix ) .'</span>' : '';
53
  echo ( $title_auto ) ? '<span class="csf-cloneable-value"><span class="csf-cloneable-placeholder"></span></span>' : '';
54
  echo '</span>';
55
  echo '</h4>';
67
 
68
  echo '</div>';
69
 
70
+ echo '<div class="csf-cloneable-wrapper csf-data-wrapper" data-title-number="'. esc_attr( $title_number ) .'" data-unique-id="'. esc_attr( $this->unique ) .'" data-field-id="['. esc_attr( $this->field['id'] ) .']" data-max="'. esc_attr( $args['max'] ) .'" data-min="'. esc_attr( $args['min'] ) .'">';
71
 
72
+ if ( ! empty( $this->value ) ) {
73
 
74
  $num = 0;
75
 
77
 
78
  $first_id = ( isset( $this->field['fields'][0]['id'] ) ) ? $this->field['fields'][0]['id'] : '';
79
  $first_value = ( isset( $value[$first_id] ) ) ? $value[$first_id] : '';
80
+ $first_value = ( is_array( $first_value ) ) ? reset( $first_value ) : $first_value;
81
 
82
  echo '<div class="csf-cloneable-item">';
83
 
84
  echo '<div class="csf-cloneable-helper">';
85
+ echo '<i class="csf-cloneable-sort fas fa-arrows-alt"></i>';
86
+ echo '<i class="csf-cloneable-clone far fa-clone"></i>';
87
+ echo '<i class="csf-cloneable-remove csf-confirm fas fa-times" data-confirm="'. esc_html__( 'Are you sure to delete this item?', 'csf' ) .'"></i>';
88
  echo '</div>';
89
 
90
  echo '<h4 class="csf-cloneable-title">';
91
  echo '<span class="csf-cloneable-text">';
92
+ echo ( $title_number ) ? '<span class="csf-cloneable-title-number">'. esc_attr( $num+1 ) .'.</span>' : '';
93
+ echo ( $title_prefix ) ? '<span class="csf-cloneable-title-prefix">'. esc_attr( $title_prefix ) .'</span>' : '';
94
+ echo ( $title_auto ) ? '<span class="csf-cloneable-value">' . esc_attr( $first_value ) .'</span>' : '';
95
  echo '</span>';
96
  echo '</h4>';
97
 
119
 
120
  echo '</div>';
121
 
122
+ echo '<div class="csf-cloneable-alert csf-cloneable-max">'. esc_html__( 'You can not add more than', 'csf' ) .' '. esc_attr( $args['max'] ) .'</div>';
123
+ echo '<div class="csf-cloneable-alert csf-cloneable-min">'. esc_html__( 'You can not remove less than', 'csf' ) .' '. esc_attr( $args['min'] ) .'</div>';
124
 
125
+ echo '<a href="#" class="button button-primary csf-cloneable-add">'. wp_kses_post( $args['button_title'] ) .'</a>';
126
 
127
  echo $this->field_after();
128
 
132
 
133
  public function enqueue() {
134
 
135
+ if ( ! wp_script_is( 'jquery-ui-accordion' ) ) {
136
  wp_enqueue_script( 'jquery-ui-accordion' );
137
  }
138
 
139
+ if ( ! wp_script_is( 'jquery-ui-sortable' ) ) {
140
  wp_enqueue_script( 'jquery-ui-sortable' );
141
  }
142
 
admin/settings/fields/heading/heading.php CHANGED
@@ -7,7 +7,7 @@
7
  * @version 1.0.0
8
  *
9
  */
10
- if( ! class_exists( 'CSF_Field_heading' ) ) {
11
  class CSF_Field_heading extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
@@ -16,7 +16,7 @@ if( ! class_exists( 'CSF_Field_heading' ) ) {
16
 
17
  public function render() {
18
 
19
- echo ( ! empty( $this->field['content'] ) ) ? $this->field['content'] : '';
20
 
21
  }
22
 
7
  * @version 1.0.0
8
  *
9
  */
10
+ if ( ! class_exists( 'CSF_Field_heading' ) ) {
11
  class CSF_Field_heading extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
16
 
17
  public function render() {
18
 
19
+ echo ( ! empty( $this->field['content'] ) ) ? wp_kses_post( $this->field['content'] ) : '';
20
 
21
  }
22
 
admin/settings/fields/icon/{default-icons.php → fa4-icons.php} RENAMED
@@ -1,9 +1,6 @@
1
- <?php
2
- //
3
- //
4
- // Default Icons
5
- // We are using Font-awesome icons as default
6
  //
 
7
  //
8
  function csf_get_default_icons() {
9
  return array( array(
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
 
 
 
 
2
  //
3
+ // Font Awesome 4 Icons
4
  //
5
  function csf_get_default_icons() {
6
  return array( array(
admin/settings/fields/icon/fa5-icons.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ //
3
+ // Font Awesome 5 Free Icons
4
+ //
5
+ function csf_get_default_icons() {
6
+ return array( array(
7
+ 'title' => 'Font Awesome 5 Free',
8
+ 'icons' => array('fab fa-500px','fab fa-accessible-icon','fab fa-accusoft','fab fa-acquisitions-incorporated','fas fa-ad','fas fa-address-book','far fa-address-book','fas fa-address-card','far fa-address-card','fas fa-adjust','fab fa-adn','fab fa-adobe','fab fa-adversal','fab fa-affiliatetheme','fas fa-air-freshener','fab fa-airbnb','fab fa-algolia','fas fa-align-center','fas fa-align-justify','fas fa-align-left','fas fa-align-right','fab fa-alipay','fas fa-allergies','fab fa-amazon','fab fa-amazon-pay','fas fa-ambulance','fas fa-american-sign-language-interpreting','fab fa-amilia','fas fa-anchor','fab fa-android','fab fa-angellist','fas fa-angle-double-down','fas fa-angle-double-left','fas fa-angle-double-right','fas fa-angle-double-up','fas fa-angle-down','fas fa-angle-left','fas fa-angle-right','fas fa-angle-up','fas fa-angry','far fa-angry','fab fa-angrycreative','fab fa-angular','fas fa-ankh','fab fa-app-store','fab fa-app-store-ios','fab fa-apper','fab fa-apple','fas fa-apple-alt','fab fa-apple-pay','fas fa-archive','fas fa-archway','fas fa-arrow-alt-circle-down','far fa-arrow-alt-circle-down','fas fa-arrow-alt-circle-left','far fa-arrow-alt-circle-left','fas fa-arrow-alt-circle-right','far fa-arrow-alt-circle-right','fas fa-arrow-alt-circle-up','far fa-arrow-alt-circle-up','fas fa-arrow-circle-down','fas fa-arrow-circle-left','fas fa-arrow-circle-right','fas fa-arrow-circle-up','fas fa-arrow-down','fas fa-arrow-left','fas fa-arrow-right','fas fa-arrow-up','fas fa-arrows-alt','fas fa-arrows-alt-h','fas fa-arrows-alt-v','fab fa-artstation','fas fa-assistive-listening-systems','fas fa-asterisk','fab fa-asymmetrik','fas fa-at','fas fa-atlas','fab fa-atlassian','fas fa-atom','fab fa-audible','fas fa-audio-description','fab fa-autoprefixer','fab fa-avianex','fab fa-aviato','fas fa-award','fab fa-aws','fas fa-baby','fas fa-baby-carriage','fas fa-backspace','fas fa-backward','fas fa-bacon','fas fa-bahai','fas fa-balance-scale','fas fa-balance-scale-left','fas fa-balance-scale-right','fas fa-ban','fas fa-band-aid','fab fa-bandcamp','fas fa-barcode','fas fa-bars','fas fa-baseball-ball','fas fa-basketball-ball','fas fa-bath','fas fa-battery-empty','fas fa-battery-full','fas fa-battery-half','fas fa-battery-quarter','fas fa-battery-three-quarters','fab fa-battle-net','fas fa-bed','fas fa-beer','fab fa-behance','fab fa-behance-square','fas fa-bell','far fa-bell','fas fa-bell-slash','far fa-bell-slash','fas fa-bezier-curve','fas fa-bible','fas fa-bicycle','fas fa-biking','fab fa-bimobject','fas fa-binoculars','fas fa-biohazard','fas fa-birthday-cake','fab fa-bitbucket','fab fa-bitcoin','fab fa-bity','fab fa-black-tie','fab fa-blackberry','fas fa-blender','fas fa-blender-phone','fas fa-blind','fas fa-blog','fab fa-blogger','fab fa-blogger-b','fab fa-bluetooth','fab fa-bluetooth-b','fas fa-bold','fas fa-bolt','fas fa-bomb','fas fa-bone','fas fa-bong','fas fa-book','fas fa-book-dead','fas fa-book-medical','fas fa-book-open','fas fa-book-reader','fas fa-bookmark','far fa-bookmark','fab fa-bootstrap','fas fa-border-all','fas fa-border-none','fas fa-border-style','fas fa-bowling-ball','fas fa-box','fas fa-box-open','fas fa-box-tissue','fas fa-boxes','fas fa-braille','fas fa-brain','fas fa-bread-slice','fas fa-briefcase','fas fa-briefcase-medical','fas fa-broadcast-tower','fas fa-broom','fas fa-brush','fab fa-btc','fab fa-buffer','fas fa-bug','fas fa-building','far fa-building','fas fa-bullhorn','fas fa-bullseye','fas fa-burn','fab fa-buromobelexperte','fas fa-bus','fas fa-bus-alt','fas fa-business-time','fab fa-buy-n-large','fab fa-buysellads','fas fa-calculator','fas fa-calendar','far fa-calendar','fas fa-calendar-alt','far fa-calendar-alt','fas fa-calendar-check','far fa-calendar-check','fas fa-calendar-day','fas fa-calendar-minus','far fa-calendar-minus','fas fa-calendar-plus','far fa-calendar-plus','fas fa-calendar-times','far fa-calendar-times','fas fa-calendar-week','fas fa-camera','fas fa-camera-retro','fas fa-campground','fab fa-canadian-maple-leaf','fas fa-candy-cane','fas fa-cannabis','fas fa-capsules','fas fa-car','fas fa-car-alt','fas fa-car-battery','fas fa-car-crash','fas fa-car-side','fas fa-caravan','fas fa-caret-down','fas fa-caret-left','fas fa-caret-right','fas fa-caret-square-down','far fa-caret-square-down','fas fa-caret-square-left','far fa-caret-square-left','fas fa-caret-square-right','far fa-caret-square-right','fas fa-caret-square-up','far fa-caret-square-up','fas fa-caret-up','fas fa-carrot','fas fa-cart-arrow-down','fas fa-cart-plus','fas fa-cash-register','fas fa-cat','fab fa-cc-amazon-pay','fab fa-cc-amex','fab fa-cc-apple-pay','fab fa-cc-diners-club','fab fa-cc-discover','fab fa-cc-jcb','fab fa-cc-mastercard','fab fa-cc-paypal','fab fa-cc-stripe','fab fa-cc-visa','fab fa-centercode','fab fa-centos','fas fa-certificate','fas fa-chair','fas fa-chalkboard','fas fa-chalkboard-teacher','fas fa-charging-station','fas fa-chart-area','fas fa-chart-bar','far fa-chart-bar','fas fa-chart-line','fas fa-chart-pie','fas fa-check','fas fa-check-circle','far fa-check-circle','fas fa-check-double','fas fa-check-square','far fa-check-square','fas fa-cheese','fas fa-chess','fas fa-chess-bishop','fas fa-chess-board','fas fa-chess-king','fas fa-chess-knight','fas fa-chess-pawn','fas fa-chess-queen','fas fa-chess-rook','fas fa-chevron-circle-down','fas fa-chevron-circle-left','fas fa-chevron-circle-right','fas fa-chevron-circle-up','fas fa-chevron-down','fas fa-chevron-left','fas fa-chevron-right','fas fa-chevron-up','fas fa-child','fab fa-chrome','fab fa-chromecast','fas fa-church','fas fa-circle','far fa-circle','fas fa-circle-notch','fas fa-city','fas fa-clinic-medical','fas fa-clipboard','far fa-clipboard','fas fa-clipboard-check','fas fa-clipboard-list','fas fa-clock','far fa-clock','fas fa-clone','far fa-clone','fas fa-closed-captioning','far fa-closed-captioning','fas fa-cloud','fas fa-cloud-download-alt','fas fa-cloud-meatball','fas fa-cloud-moon','fas fa-cloud-moon-rain','fas fa-cloud-rain','fas fa-cloud-showers-heavy','fas fa-cloud-sun','fas fa-cloud-sun-rain','fas fa-cloud-upload-alt','fab fa-cloudscale','fab fa-cloudsmith','fab fa-cloudversify','fas fa-cocktail','fas fa-code','fas fa-code-branch','fab fa-codepen','fab fa-codiepie','fas fa-coffee','fas fa-cog','fas fa-cogs','fas fa-coins','fas fa-columns','fas fa-comment','far fa-comment','fas fa-comment-alt','far fa-comment-alt','fas fa-comment-dollar','fas fa-comment-dots','far fa-comment-dots','fas fa-comment-medical','fas fa-comment-slash','fas fa-comments','far fa-comments','fas fa-comments-dollar','fas fa-compact-disc','fas fa-compass','far fa-compass','fas fa-compress','fas fa-compress-alt','fas fa-compress-arrows-alt','fas fa-concierge-bell','fab fa-confluence','fab fa-connectdevelop','fab fa-contao','fas fa-cookie','fas fa-cookie-bite','fas fa-copy','far fa-copy','fas fa-copyright','far fa-copyright','fab fa-cotton-bureau','fas fa-couch','fab fa-cpanel','fab fa-creative-commons','fab fa-creative-commons-by','fab fa-creative-commons-nc','fab fa-creative-commons-nc-eu','fab fa-creative-commons-nc-jp','fab fa-creative-commons-nd','fab fa-creative-commons-pd','fab fa-creative-commons-pd-alt','fab fa-creative-commons-remix','fab fa-creative-commons-sa','fab fa-creative-commons-sampling','fab fa-creative-commons-sampling-plus','fab fa-creative-commons-share','fab fa-creative-commons-zero','fas fa-credit-card','far fa-credit-card','fab fa-critical-role','fas fa-crop','fas fa-crop-alt','fas fa-cross','fas fa-crosshairs','fas fa-crow','fas fa-crown','fas fa-crutch','fab fa-css3','fab fa-css3-alt','fas fa-cube','fas fa-cubes','fas fa-cut','fab fa-cuttlefish','fab fa-d-and-d','fab fa-d-and-d-beyond','fab fa-dailymotion','fab fa-dashcube','fas fa-database','fas fa-deaf','fab fa-delicious','fas fa-democrat','fab fa-deploydog','fab fa-deskpro','fas fa-desktop','fab fa-dev','fab fa-deviantart','fas fa-dharmachakra','fab fa-dhl','fas fa-diagnoses','fab fa-diaspora','fas fa-dice','fas fa-dice-d20','fas fa-dice-d6','fas fa-dice-five','fas fa-dice-four','fas fa-dice-one','fas fa-dice-six','fas fa-dice-three','fas fa-dice-two','fab fa-digg','fab fa-digital-ocean','fas fa-digital-tachograph','fas fa-directions','fab fa-discord','fab fa-discourse','fas fa-disease','fas fa-divide','fas fa-dizzy','far fa-dizzy','fas fa-dna','fab fa-dochub','fab fa-docker','fas fa-dog','fas fa-dollar-sign','fas fa-dolly','fas fa-dolly-flatbed','fas fa-donate','fas fa-door-closed','fas fa-door-open','fas fa-dot-circle','far fa-dot-circle','fas fa-dove','fas fa-download','fab fa-draft2digital','fas fa-drafting-compass','fas fa-dragon','fas fa-draw-polygon','fab fa-dribbble','fab fa-dribbble-square','fab fa-dropbox','fas fa-drum','fas fa-drum-steelpan','fas fa-drumstick-bite','fab fa-drupal','fas fa-dumbbell','fas fa-dumpster','fas fa-dumpster-fire','fas fa-dungeon','fab fa-dyalog','fab fa-earlybirds','fab fa-ebay','fab fa-edge','fas fa-edit','far fa-edit','fas fa-egg','fas fa-eject','fab fa-elementor','fas fa-ellipsis-h','fas fa-ellipsis-v','fab fa-ello','fab fa-ember','fab fa-empire','fas fa-envelope','far fa-envelope','fas fa-envelope-open','far fa-envelope-open','fas fa-envelope-open-text','fas fa-envelope-square','fab fa-envira','fas fa-equals','fas fa-eraser','fab fa-erlang','fab fa-ethereum','fas fa-ethernet','fab fa-etsy','fas fa-euro-sign','fab fa-evernote','fas fa-exchange-alt','fas fa-exclamation','fas fa-exclamation-circle','fas fa-exclamation-triangle','fas fa-expand','fas fa-expand-alt','fas fa-expand-arrows-alt','fab fa-expeditedssl','fas fa-external-link-alt','fas fa-external-link-square-alt','fas fa-eye','far fa-eye','fas fa-eye-dropper','fas fa-eye-slash','far fa-eye-slash','fab fa-facebook','fab fa-facebook-f','fab fa-facebook-messenger','fab fa-facebook-square','fas fa-fan','fab fa-fantasy-flight-games','fas fa-fast-backward','fas fa-fast-forward','fas fa-faucet','fas fa-fax','fas fa-feather','fas fa-feather-alt','fab fa-fedex','fab fa-fedora','fas fa-female','fas fa-fighter-jet','fab fa-figma','fas fa-file','far fa-file','fas fa-file-alt','far fa-file-alt','fas fa-file-archive','far fa-file-archive','fas fa-file-audio','far fa-file-audio','fas fa-file-code','far fa-file-code','fas fa-file-contract','fas fa-file-csv','fas fa-file-download','fas fa-file-excel','far fa-file-excel','fas fa-file-export','fas fa-file-image','far fa-file-image','fas fa-file-import','fas fa-file-invoice','fas fa-file-invoice-dollar','fas fa-file-medical','fas fa-file-medical-alt','fas fa-file-pdf','far fa-file-pdf','fas fa-file-powerpoint','far fa-file-powerpoint','fas fa-file-prescription','fas fa-file-signature','fas fa-file-upload','fas fa-file-video','far fa-file-video','fas fa-file-word','far fa-file-word','fas fa-fill','fas fa-fill-drip','fas fa-film','fas fa-filter','fas fa-fingerprint','fas fa-fire','fas fa-fire-alt','fas fa-fire-extinguisher','fab fa-firefox','fab fa-firefox-browser','fas fa-first-aid','fab fa-first-order','fab fa-first-order-alt','fab fa-firstdraft','fas fa-fish','fas fa-fist-raised','fas fa-flag','far fa-flag','fas fa-flag-checkered','fas fa-flag-usa','fas fa-flask','fab fa-flickr','fab fa-flipboard','fas fa-flushed','far fa-flushed','fab fa-fly','fas fa-folder','far fa-folder','fas fa-folder-minus','fas fa-folder-open','far fa-folder-open','fas fa-folder-plus','fas fa-font','fab fa-font-awesome','fab fa-font-awesome-alt','fab fa-font-awesome-flag','far fa-font-awesome-logo-full','fas fa-font-awesome-logo-full','fab fa-font-awesome-logo-full','fab fa-fonticons','fab fa-fonticons-fi','fas fa-football-ball','fab fa-fort-awesome','fab fa-fort-awesome-alt','fab fa-forumbee','fas fa-forward','fab fa-foursquare','fab fa-free-code-camp','fab fa-freebsd','fas fa-frog','fas fa-frown','far fa-frown','fas fa-frown-open','far fa-frown-open','fab fa-fulcrum','fas fa-funnel-dollar','fas fa-futbol','far fa-futbol','fab fa-galactic-republic','fab fa-galactic-senate','fas fa-gamepad','fas fa-gas-pump','fas fa-gavel','fas fa-gem','far fa-gem','fas fa-genderless','fab fa-get-pocket','fab fa-gg','fab fa-gg-circle','fas fa-ghost','fas fa-gift','fas fa-gifts','fab fa-git','fab fa-git-alt','fab fa-git-square','fab fa-github','fab fa-github-alt','fab fa-github-square','fab fa-gitkraken','fab fa-gitlab','fab fa-gitter','fas fa-glass-cheers','fas fa-glass-martini','fas fa-glass-martini-alt','fas fa-glass-whiskey','fas fa-glasses','fab fa-glide','fab fa-glide-g','fas fa-globe','fas fa-globe-africa','fas fa-globe-americas','fas fa-globe-asia','fas fa-globe-europe','fab fa-gofore','fas fa-golf-ball','fab fa-goodreads','fab fa-goodreads-g','fab fa-google','fab fa-google-drive','fab fa-google-play','fab fa-google-plus','fab fa-google-plus-g','fab fa-google-plus-square','fab fa-google-wallet','fas fa-gopuram','fas fa-graduation-cap','fab fa-gratipay','fab fa-grav','fas fa-greater-than','fas fa-greater-than-equal','fas fa-grimace','far fa-grimace','fas fa-grin','far fa-grin','fas fa-grin-alt','far fa-grin-alt','fas fa-grin-beam','far fa-grin-beam','fas fa-grin-beam-sweat','far fa-grin-beam-sweat','fas fa-grin-hearts','far fa-grin-hearts','fas fa-grin-squint','far fa-grin-squint','fas fa-grin-squint-tears','far fa-grin-squint-tears','fas fa-grin-stars','far fa-grin-stars','fas fa-grin-tears','far fa-grin-tears','fas fa-grin-tongue','far fa-grin-tongue','fas fa-grin-tongue-squint','far fa-grin-tongue-squint','fas fa-grin-tongue-wink','far fa-grin-tongue-wink','fas fa-grin-wink','far fa-grin-wink','fas fa-grip-horizontal','fas fa-grip-lines','fas fa-grip-lines-vertical','fas fa-grip-vertical','fab fa-gripfire','fab fa-grunt','fas fa-guitar','fab fa-gulp','fas fa-h-square','fab fa-hacker-news','fab fa-hacker-news-square','fab fa-hackerrank','fas fa-hamburger','fas fa-hammer','fas fa-hamsa','fas fa-hand-holding','fas fa-hand-holding-heart','fas fa-hand-holding-medical','fas fa-hand-holding-usd','fas fa-hand-holding-water','fas fa-hand-lizard','far fa-hand-lizard','fas fa-hand-middle-finger','fas fa-hand-paper','far fa-hand-paper','fas fa-hand-peace','far fa-hand-peace','fas fa-hand-point-down','far fa-hand-point-down','fas fa-hand-point-left','far fa-hand-point-left','fas fa-hand-point-right','far fa-hand-point-right','fas fa-hand-point-up','far fa-hand-point-up','fas fa-hand-pointer','far fa-hand-pointer','fas fa-hand-rock','far fa-hand-rock','fas fa-hand-scissors','far fa-hand-scissors','fas fa-hand-sparkles','fas fa-hand-spock','far fa-hand-spock','fas fa-hands','fas fa-hands-helping','fas fa-hands-wash','fas fa-handshake','far fa-handshake','fas fa-handshake-alt-slash','fas fa-handshake-slash','fas fa-hanukiah','fas fa-hard-hat','fas fa-hashtag','fas fa-hat-cowboy','fas fa-hat-cowboy-side','fas fa-hat-wizard','fas fa-hdd','far fa-hdd','fas fa-head-side-cough','fas fa-head-side-cough-slash','fas fa-head-side-mask','fas fa-head-side-virus','fas fa-heading','fas fa-headphones','fas fa-headphones-alt','fas fa-headset','fas fa-heart','far fa-heart','fas fa-heart-broken','fas fa-heartbeat','fas fa-helicopter','fas fa-highlighter','fas fa-hiking','fas fa-hippo','fab fa-hips','fab fa-hire-a-helper','fas fa-history','fas fa-hockey-puck','fas fa-holly-berry','fas fa-home','fab fa-hooli','fab fa-hornbill','fas fa-horse','fas fa-horse-head','fas fa-hospital','far fa-hospital','fas fa-hospital-alt','fas fa-hospital-symbol','fas fa-hospital-user','fas fa-hot-tub','fas fa-hotdog','fas fa-hotel','fab fa-hotjar','fas fa-hourglass','far fa-hourglass','fas fa-hourglass-end','fas fa-hourglass-half','fas fa-hourglass-start','fas fa-house-damage','fas fa-house-user','fab fa-houzz','fas fa-hryvnia','fab fa-html5','fab fa-hubspot','fas fa-i-cursor','fas fa-ice-cream','fas fa-icicles','fas fa-icons','fas fa-id-badge','far fa-id-badge','fas fa-id-card','far fa-id-card','fas fa-id-card-alt','fab fa-ideal','fas fa-igloo','fas fa-image','far fa-image','fas fa-images','far fa-images','fab fa-imdb','fas fa-inbox','fas fa-indent','fas fa-industry','fas fa-infinity','fas fa-info','fas fa-info-circle','fab fa-instagram','fab fa-instagram-square','fab fa-intercom','fab fa-internet-explorer','fab fa-invision','fab fa-ioxhost','fas fa-italic','fab fa-itch-io','fab fa-itunes','fab fa-itunes-note','fab fa-java','fas fa-jedi','fab fa-jedi-order','fab fa-jenkins','fab fa-jira','fab fa-joget','fas fa-joint','fab fa-joomla','fas fa-journal-whills','fab fa-js','fab fa-js-square','fab fa-jsfiddle','fas fa-kaaba','fab fa-kaggle','fas fa-key','fab fa-keybase','fas fa-keyboard','far fa-keyboard','fab fa-keycdn','fas fa-khanda','fab fa-kickstarter','fab fa-kickstarter-k','fas fa-kiss','far fa-kiss','fas fa-kiss-beam','far fa-kiss-beam','fas fa-kiss-wink-heart','far fa-kiss-wink-heart','fas fa-kiwi-bird','fab fa-korvue','fas fa-landmark','fas fa-language','fas fa-laptop','fas fa-laptop-code','fas fa-laptop-house','fas fa-laptop-medical','fab fa-laravel','fab fa-lastfm','fab fa-lastfm-square','fas fa-laugh','far fa-laugh','fas fa-laugh-beam','far fa-laugh-beam','fas fa-laugh-squint','far fa-laugh-squint','fas fa-laugh-wink','far fa-laugh-wink','fas fa-layer-group','fas fa-leaf','fab fa-leanpub','fas fa-lemon','far fa-lemon','fab fa-less','fas fa-less-than','fas fa-less-than-equal','fas fa-level-down-alt','fas fa-level-up-alt','fas fa-life-ring','far fa-life-ring','fas fa-lightbulb','far fa-lightbulb','fab fa-line','fas fa-link','fab fa-linkedin','fab fa-linkedin-in','fab fa-linode','fab fa-linux','fas fa-lira-sign','fas fa-list','fas fa-list-alt','far fa-list-alt','fas fa-list-ol','fas fa-list-ul','fas fa-location-arrow','fas fa-lock','fas fa-lock-open','fas fa-long-arrow-alt-down','fas fa-long-arrow-alt-left','fas fa-long-arrow-alt-right','fas fa-long-arrow-alt-up','fas fa-low-vision','fas fa-luggage-cart','fas fa-lungs','fas fa-lungs-virus','fab fa-lyft','fab fa-magento','fas fa-magic','fas fa-magnet','fas fa-mail-bulk','fab fa-mailchimp','fas fa-male','fab fa-mandalorian','fas fa-map','far fa-map','fas fa-map-marked','fas fa-map-marked-alt','fas fa-map-marker','fas fa-map-marker-alt','fas fa-map-pin','fas fa-map-signs','fab fa-markdown','fas fa-marker','fas fa-mars','fas fa-mars-double','fas fa-mars-stroke','fas fa-mars-stroke-h','fas fa-mars-stroke-v','fas fa-mask','fab fa-mastodon','fab fa-maxcdn','fab fa-mdb','fas fa-medal','fab fa-medapps','fab fa-medium','fab fa-medium-m','fas fa-medkit','fab fa-medrt','fab fa-meetup','fab fa-megaport','fas fa-meh','far fa-meh','fas fa-meh-blank','far fa-meh-blank','fas fa-meh-rolling-eyes','far fa-meh-rolling-eyes','fas fa-memory','fab fa-mendeley','fas fa-menorah','fas fa-mercury','fas fa-meteor','fab fa-microblog','fas fa-microchip','fas fa-microphone','fas fa-microphone-alt','fas fa-microphone-alt-slash','fas fa-microphone-slash','fas fa-microscope','fab fa-microsoft','fas fa-minus','fas fa-minus-circle','fas fa-minus-square','far fa-minus-square','fas fa-mitten','fab fa-mix','fab fa-mixcloud','fab fa-mixer','fab fa-mizuni','fas fa-mobile','fas fa-mobile-alt','fab fa-modx','fab fa-monero','fas fa-money-bill','fas fa-money-bill-alt','far fa-money-bill-alt','fas fa-money-bill-wave','fas fa-money-bill-wave-alt','fas fa-money-check','fas fa-money-check-alt','fas fa-monument','fas fa-moon','far fa-moon','fas fa-mortar-pestle','fas fa-mosque','fas fa-motorcycle','fas fa-mountain','fas fa-mouse','fas fa-mouse-pointer','fas fa-mug-hot','fas fa-music','fab fa-napster','fab fa-neos','fas fa-network-wired','fas fa-neuter','fas fa-newspaper','far fa-newspaper','fab fa-nimblr','fab fa-node','fab fa-node-js','fas fa-not-equal','fas fa-notes-medical','fab fa-npm','fab fa-ns8','fab fa-nutritionix','fas fa-object-group','far fa-object-group','fas fa-object-ungroup','far fa-object-ungroup','fab fa-odnoklassniki','fab fa-odnoklassniki-square','fas fa-oil-can','fab fa-old-republic','fas fa-om','fab fa-opencart','fab fa-openid','fab fa-opera','fab fa-optin-monster','fab fa-orcid','fab fa-osi','fas fa-otter','fas fa-outdent','fab fa-page4','fab fa-pagelines','fas fa-pager','fas fa-paint-brush','fas fa-paint-roller','fas fa-palette','fab fa-palfed','fas fa-pallet','fas fa-paper-plane','far fa-paper-plane','fas fa-paperclip','fas fa-parachute-box','fas fa-paragraph','fas fa-parking','fas fa-passport','fas fa-pastafarianism','fas fa-paste','fab fa-patreon','fas fa-pause','fas fa-pause-circle','far fa-pause-circle','fas fa-paw','fab fa-paypal','fas fa-peace','fas fa-pen','fas fa-pen-alt','fas fa-pen-fancy','fas fa-pen-nib','fas fa-pen-square','fas fa-pencil-alt','fas fa-pencil-ruler','fab fa-penny-arcade','fas fa-people-arrows','fas fa-people-carry','fas fa-pepper-hot','fas fa-percent','fas fa-percentage','fab fa-periscope','fas fa-person-booth','fab fa-phabricator','fab fa-phoenix-framework','fab fa-phoenix-squadron','fas fa-phone','fas fa-phone-alt','fas fa-phone-slash','fas fa-phone-square','fas fa-phone-square-alt','fas fa-phone-volume','fas fa-photo-video','fab fa-php','fab fa-pied-piper','fab fa-pied-piper-alt','fab fa-pied-piper-hat','fab fa-pied-piper-pp','fab fa-pied-piper-square','fas fa-piggy-bank','fas fa-pills','fab fa-pinterest','fab fa-pinterest-p','fab fa-pinterest-square','fas fa-pizza-slice','fas fa-place-of-worship','fas fa-plane','fas fa-plane-arrival','fas fa-plane-departure','fas fa-plane-slash','fas fa-play','fas fa-play-circle','far fa-play-circle','fab fa-playstation','fas fa-plug','fas fa-plus','fas fa-plus-circle','fas fa-plus-square','far fa-plus-square','fas fa-podcast','fas fa-poll','fas fa-poll-h','fas fa-poo','fas fa-poo-storm','fas fa-poop','fas fa-portrait','fas fa-pound-sign','fas fa-power-off','fas fa-pray','fas fa-praying-hands','fas fa-prescription','fas fa-prescription-bottle','fas fa-prescription-bottle-alt','fas fa-print','fas fa-procedures','fab fa-product-hunt','fas fa-project-diagram','fas fa-pump-medical','fas fa-pump-soap','fab fa-pushed','fas fa-puzzle-piece','fab fa-python','fab fa-qq','fas fa-qrcode','fas fa-question','fas fa-question-circle','far fa-question-circle','fas fa-quidditch','fab fa-quinscape','fab fa-quora','fas fa-quote-left','fas fa-quote-right','fas fa-quran','fab fa-r-project','fas fa-radiation','fas fa-radiation-alt','fas fa-rainbow','fas fa-random','fab fa-raspberry-pi','fab fa-ravelry','fab fa-react','fab fa-reacteurope','fab fa-readme','fab fa-rebel','fas fa-receipt','fas fa-record-vinyl','fas fa-recycle','fab fa-red-river','fab fa-reddit','fab fa-reddit-alien','fab fa-reddit-square','fab fa-redhat','fas fa-redo','fas fa-redo-alt','fas fa-registered','far fa-registered','fas fa-remove-format','fab fa-renren','fas fa-reply','fas fa-reply-all','fab fa-replyd','fas fa-republican','fab fa-researchgate','fab fa-resolving','fas fa-restroom','fas fa-retweet','fab fa-rev','fas fa-ribbon','fas fa-ring','fas fa-road','fas fa-robot','fas fa-rocket','fab fa-rocketchat','fab fa-rockrms','fas fa-route','fas fa-rss','fas fa-rss-square','fas fa-ruble-sign','fas fa-ruler','fas fa-ruler-combined','fas fa-ruler-horizontal','fas fa-ruler-vertical','fas fa-running','fas fa-rupee-sign','fas fa-sad-cry','far fa-sad-cry','fas fa-sad-tear','far fa-sad-tear','fab fa-safari','fab fa-salesforce','fab fa-sass','fas fa-satellite','fas fa-satellite-dish','fas fa-save','far fa-save','fab fa-schlix','fas fa-school','fas fa-screwdriver','fab fa-scribd','fas fa-scroll','fas fa-sd-card','fas fa-search','fas fa-search-dollar','fas fa-search-location','fas fa-search-minus','fas fa-search-plus','fab fa-searchengin','fas fa-seedling','fab fa-sellcast','fab fa-sellsy','fas fa-server','fab fa-servicestack','fas fa-shapes','fas fa-share','fas fa-share-alt','fas fa-share-alt-square','fas fa-share-square','far fa-share-square','fas fa-shekel-sign','fas fa-shield-alt','fas fa-shield-virus','fas fa-ship','fas fa-shipping-fast','fab fa-shirtsinbulk','fas fa-shoe-prints','fab fa-shopify','fas fa-shopping-bag','fas fa-shopping-basket','fas fa-shopping-cart','fab fa-shopware','fas fa-shower','fas fa-shuttle-van','fas fa-sign','fas fa-sign-in-alt','fas fa-sign-language','fas fa-sign-out-alt','fas fa-signal','fas fa-signature','fas fa-sim-card','fab fa-simplybuilt','fab fa-sistrix','fas fa-sitemap','fab fa-sith','fas fa-skating','fab fa-sketch','fas fa-skiing','fas fa-skiing-nordic','fas fa-skull','fas fa-skull-crossbones','fab fa-skyatlas','fab fa-skype','fab fa-slack','fab fa-slack-hash','fas fa-slash','fas fa-sleigh','fas fa-sliders-h','fab fa-slideshare','fas fa-smile','far fa-smile','fas fa-smile-beam','far fa-smile-beam','fas fa-smile-wink','far fa-smile-wink','fas fa-smog','fas fa-smoking','fas fa-smoking-ban','fas fa-sms','fab fa-snapchat','fab fa-snapchat-ghost','fab fa-snapchat-square','fas fa-snowboarding','fas fa-snowflake','far fa-snowflake','fas fa-snowman','fas fa-snowplow','fas fa-soap','fas fa-socks','fas fa-solar-panel','fas fa-sort','fas fa-sort-alpha-down','fas fa-sort-alpha-down-alt','fas fa-sort-alpha-up','fas fa-sort-alpha-up-alt','fas fa-sort-amount-down','fas fa-sort-amount-down-alt','fas fa-sort-amount-up','fas fa-sort-amount-up-alt','fas fa-sort-down','fas fa-sort-numeric-down','fas fa-sort-numeric-down-alt','fas fa-sort-numeric-up','fas fa-sort-numeric-up-alt','fas fa-sort-up','fab fa-soundcloud','fab fa-sourcetree','fas fa-spa','fas fa-space-shuttle','fab fa-speakap','fab fa-speaker-deck','fas fa-spell-check','fas fa-spider','fas fa-spinner','fas fa-splotch','fab fa-spotify','fas fa-spray-can','fas fa-square','far fa-square','fas fa-square-full','fas fa-square-root-alt','fab fa-squarespace','fab fa-stack-exchange','fab fa-stack-overflow','fab fa-stackpath','fas fa-stamp','fas fa-star','far fa-star','fas fa-star-and-crescent','fas fa-star-half','far fa-star-half','fas fa-star-half-alt','fas fa-star-of-david','fas fa-star-of-life','fab fa-staylinked','fab fa-steam','fab fa-steam-square','fab fa-steam-symbol','fas fa-step-backward','fas fa-step-forward','fas fa-stethoscope','fab fa-sticker-mule','fas fa-sticky-note','far fa-sticky-note','fas fa-stop','fas fa-stop-circle','far fa-stop-circle','fas fa-stopwatch','fas fa-stopwatch-20','fas fa-store','fas fa-store-alt','fas fa-store-alt-slash','fas fa-store-slash','fab fa-strava','fas fa-stream','fas fa-street-view','fas fa-strikethrough','fab fa-stripe','fab fa-stripe-s','fas fa-stroopwafel','fab fa-studiovinari','fab fa-stumbleupon','fab fa-stumbleupon-circle','fas fa-subscript','fas fa-subway','fas fa-suitcase','fas fa-suitcase-rolling','fas fa-sun','far fa-sun','fab fa-superpowers','fas fa-superscript','fab fa-supple','fas fa-surprise','far fa-surprise','fab fa-suse','fas fa-swatchbook','fab fa-swift','fas fa-swimmer','fas fa-swimming-pool','fab fa-symfony','fas fa-synagogue','fas fa-sync','fas fa-sync-alt','fas fa-syringe','fas fa-table','fas fa-table-tennis','fas fa-tablet','fas fa-tablet-alt','fas fa-tablets','fas fa-tachometer-alt','fas fa-tag','fas fa-tags','fas fa-tape','fas fa-tasks','fas fa-taxi','fab fa-teamspeak','fas fa-teeth','fas fa-teeth-open','fab fa-telegram','fab fa-telegram-plane','fas fa-temperature-high','fas fa-temperature-low','fab fa-tencent-weibo','fas fa-tenge','fas fa-terminal','fas fa-text-height','fas fa-text-width','fas fa-th','fas fa-th-large','fas fa-th-list','fab fa-the-red-yeti','fas fa-theater-masks','fab fa-themeco','fab fa-themeisle','fas fa-thermometer','fas fa-thermometer-empty','fas fa-thermometer-full','fas fa-thermometer-half','fas fa-thermometer-quarter','fas fa-thermometer-three-quarters','fab fa-think-peaks','fas fa-thumbs-down','far fa-thumbs-down','fas fa-thumbs-up','far fa-thumbs-up','fas fa-thumbtack','fas fa-ticket-alt','fas fa-times','fas fa-times-circle','far fa-times-circle','fas fa-tint','fas fa-tint-slash','fas fa-tired','far fa-tired','fas fa-toggle-off','fas fa-toggle-on','fas fa-toilet','fas fa-toilet-paper','fas fa-toilet-paper-slash','fas fa-toolbox','fas fa-tools','fas fa-tooth','fas fa-torah','fas fa-torii-gate','fas fa-tractor','fab fa-trade-federation','fas fa-trademark','fas fa-traffic-light','fas fa-trailer','fas fa-train','fas fa-tram','fas fa-transgender','fas fa-transgender-alt','fas fa-trash','fas fa-trash-alt','far fa-trash-alt','fas fa-trash-restore','fas fa-trash-restore-alt','fas fa-tree','fab fa-trello','fab fa-tripadvisor','fas fa-trophy','fas fa-truck','fas fa-truck-loading','fas fa-truck-monster','fas fa-truck-moving','fas fa-truck-pickup','fas fa-tshirt','fas fa-tty','fab fa-tumblr','fab fa-tumblr-square','fas fa-tv','fab fa-twitch','fab fa-twitter','fab fa-twitter-square','fab fa-typo3','fab fa-uber','fab fa-ubuntu','fab fa-uikit','fab fa-umbraco','fas fa-umbrella','fas fa-umbrella-beach','fas fa-underline','fas fa-undo','fas fa-undo-alt','fab fa-uniregistry','fab fa-unity','fas fa-universal-access','fas fa-university','fas fa-unlink','fas fa-unlock','fas fa-unlock-alt','fab fa-untappd','fas fa-upload','fab fa-ups','fab fa-usb','fas fa-user','far fa-user','fas fa-user-alt','fas fa-user-alt-slash','fas fa-user-astronaut','fas fa-user-check','fas fa-user-circle','far fa-user-circle','fas fa-user-clock','fas fa-user-cog','fas fa-user-edit','fas fa-user-friends','fas fa-user-graduate','fas fa-user-injured','fas fa-user-lock','fas fa-user-md','fas fa-user-minus','fas fa-user-ninja','fas fa-user-nurse','fas fa-user-plus','fas fa-user-secret','fas fa-user-shield','fas fa-user-slash','fas fa-user-tag','fas fa-user-tie','fas fa-user-times','fas fa-users','fas fa-users-cog','fab fa-usps','fab fa-ussunnah','fas fa-utensil-spoon','fas fa-utensils','fab fa-vaadin','fas fa-vector-square','fas fa-venus','fas fa-venus-double','fas fa-venus-mars','fab fa-viacoin','fab fa-viadeo','fab fa-viadeo-square','fas fa-vial','fas fa-vials','fab fa-viber','fas fa-video','fas fa-video-slash','fas fa-vihara','fab fa-vimeo','fab fa-vimeo-square','fab fa-vimeo-v','fab fa-vine','fas fa-virus','fas fa-virus-slash','fas fa-viruses','fab fa-vk','fab fa-vnv','fas fa-voicemail','fas fa-volleyball-ball','fas fa-volume-down','fas fa-volume-mute','fas fa-volume-off','fas fa-volume-up','fas fa-vote-yea','fas fa-vr-cardboard','fab fa-vuejs','fas fa-walking','fas fa-wallet','fas fa-warehouse','fas fa-water','fas fa-wave-square','fab fa-waze','fab fa-weebly','fab fa-weibo','fas fa-weight','fas fa-weight-hanging','fab fa-weixin','fab fa-whatsapp','fab fa-whatsapp-square','fas fa-wheelchair','fab fa-whmcs','fas fa-wifi','fab fa-wikipedia-w','fas fa-wind','fas fa-window-close','far fa-window-close','fas fa-window-maximize','far fa-window-maximize','fas fa-window-minimize','far fa-window-minimize','fas fa-window-restore','far fa-window-restore','fab fa-windows','fas fa-wine-bottle','fas fa-wine-glass','fas fa-wine-glass-alt','fab fa-wix','fab fa-wizards-of-the-coast','fab fa-wolf-pack-battalion','fas fa-won-sign','fab fa-wordpress','fab fa-wordpress-simple','fab fa-wpbeginner','fab fa-wpexplorer','fab fa-wpforms','fab fa-wpressr','fas fa-wrench','fas fa-x-ray','fab fa-xbox','fab fa-xing','fab fa-xing-square','fab fa-y-combinator','fab fa-yahoo','fab fa-yammer','fab fa-yandex','fab fa-yandex-international','fab fa-yarn','fab fa-yelp','fas fa-yen-sign','fas fa-yin-yang','fab fa-yoast','fab fa-youtube','fab fa-youtube-square','fab fa-zhihu')
9
+ ) );
10
+ }
admin/settings/fields/icon/icon.php CHANGED
@@ -7,7 +7,7 @@
7
  * @version 1.0.0
8
  *
9
  */
10
- if( ! class_exists( 'CSF_Field_icon' ) ) {
11
  class CSF_Field_icon extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
@@ -27,10 +27,10 @@ if( ! class_exists( 'CSF_Field_icon' ) ) {
27
  $hidden = ( empty( $this->value ) ) ? ' hidden' : '';
28
 
29
  echo '<div class="csf-icon-select">';
30
- echo '<span class="csf-icon-preview'. $hidden .'"><i class="'. $this->value .'"></i></span>';
31
- echo '<a href="#" class="button button-primary csf-icon-add" data-nonce="'. $nonce .'">'. $args['button_title'] .'</a>';
32
- echo '<a href="#" class="button csf-warning-primary csf-icon-remove'. $hidden .'">'. $args['remove_title'] .'</a>';
33
- echo '<input type="text" name="'. $this->field_name() .'" value="'. $this->value .'" class="csf-icon-value"'. $this->field_attributes() .' />';
34
  echo '</div>';
35
 
36
  echo $this->field_after();
7
  * @version 1.0.0
8
  *
9
  */
10
+ if ( ! class_exists( 'CSF_Field_icon' ) ) {
11
  class CSF_Field_icon extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
27
  $hidden = ( empty( $this->value ) ) ? ' hidden' : '';
28
 
29
  echo '<div class="csf-icon-select">';
30
+ echo '<span class="csf-icon-preview'. esc_attr( $hidden ) .'"><i class="'. esc_attr( $this->value ) .'"></i></span>';
31
+ echo '<a href="#" class="button button-primary csf-icon-add" data-nonce="'. esc_attr( $nonce ) .'">'. wp_kses_post( $args['button_title'] ) .'</a>';
32
+ echo '<a href="#" class="button csf-warning-primary csf-icon-remove'. esc_attr( $hidden ) .'">'. wp_kses_post( $args['remove_title'] ) .'</a>';
33
+ echo '<input type="text" name="'. esc_attr( $this->field_name() ) .'" value="'. esc_attr( $this->value ) .'" class="csf-icon-value"'. $this->field_attributes() .' />';
34
  echo '</div>';
35
 
36
  echo $this->field_after();
admin/settings/fields/image_select/image_select.php CHANGED
@@ -7,7 +7,7 @@
7
  * @version 1.0.0
8
  *
9
  */
10
- if( ! class_exists( 'CSF_Field_image_select' ) ) {
11
  class CSF_Field_image_select extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
@@ -25,22 +25,22 @@ if( ! class_exists( 'CSF_Field_image_select' ) ) {
25
 
26
  echo $this->field_before();
27
 
28
- if( ! empty( $args['options'] ) ) {
29
 
30
- echo '<div class="csf-siblings csf--image-group" data-multiple="'. $args['multiple'] .'">';
31
 
32
  $num = 1;
33
 
34
- foreach( $args['options'] as $key => $option ) {
35
 
36
  $type = ( $args['multiple'] ) ? 'checkbox' : 'radio';
37
  $extra = ( $args['multiple'] ) ? '[]' : '';
38
  $active = ( in_array( $key, $value ) ) ? ' csf--active' : '';
39
  $checked = ( in_array( $key, $value ) ) ? ' checked' : '';
40
 
41
- echo '<div class="csf--sibling csf--image'. $active .'">';
42
- echo '<img src="'. $option .'" alt="img-'. $num++ .'" />';
43
- echo '<input type="'. $type .'" name="'. $this->field_name( $extra ) .'" value="'. $key .'"'. $this->field_attributes() . $checked .'/>';
44
  echo '</div>';
45
 
46
  }
@@ -49,8 +49,6 @@ if( ! class_exists( 'CSF_Field_image_select' ) ) {
49
 
50
  }
51
 
52
- echo '<div class="clear"></div>';
53
-
54
  echo $this->field_after();
55
 
56
  }
@@ -62,7 +60,7 @@ if( ! class_exists( 'CSF_Field_image_select' ) ) {
62
  $important = ( ! empty( $this->field['output_important'] ) ) ? '!important' : '';
63
  $elements = ( is_array( $this->field['output'] ) ) ? join( ',', $this->field['output'] ) : $this->field['output'];
64
 
65
- if( ! empty( $elements ) && isset( $this->value ) && $this->value !== '' ) {
66
  $output = $elements .'{background-image:url('. $this->value .')'. $important .';}';
67
  }
68
 
7
  * @version 1.0.0
8
  *
9
  */
10
+ if ( ! class_exists( 'CSF_Field_image_select' ) ) {
11
  class CSF_Field_image_select extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
25
 
26
  echo $this->field_before();
27
 
28
+ if ( ! empty( $args['options'] ) ) {
29
 
30
+ echo '<div class="csf-siblings csf--image-group" data-multiple="'. esc_attr( $args['multiple'] ) .'">';
31
 
32
  $num = 1;
33
 
34
+ foreach ( $args['options'] as $key => $option ) {
35
 
36
  $type = ( $args['multiple'] ) ? 'checkbox' : 'radio';
37
  $extra = ( $args['multiple'] ) ? '[]' : '';
38
  $active = ( in_array( $key, $value ) ) ? ' csf--active' : '';
39
  $checked = ( in_array( $key, $value ) ) ? ' checked' : '';
40
 
41
+ echo '<div class="csf--sibling csf--image'. esc_attr( $active ) .'">';
42
+ echo '<img src="'. esc_url( $option ) .'" alt="img-'. esc_attr( $num++ ) .'" />';
43
+ echo '<input type="'. esc_attr( $type ) .'" name="'. esc_attr( $this->field_name( $extra ) ) .'" value="'. esc_attr( $key ) .'"'. $this->field_attributes() . esc_attr( $checked ) .'/>';
44
  echo '</div>';
45
 
46
  }
49
 
50
  }
51
 
 
 
52
  echo $this->field_after();
53
 
54
  }
60
  $important = ( ! empty( $this->field['output_important'] ) ) ? '!important' : '';
61
  $elements = ( is_array( $this->field['output'] ) ) ? join( ',', $this->field['output'] ) : $this->field['output'];
62
 
63
+ if ( ! empty( $elements ) && isset( $this->value ) && $this->value !== '' ) {
64
  $output = $elements .'{background-image:url('. $this->value .')'. $important .';}';
65
  }
66
 
admin/settings/fields/link_color/link_color.php CHANGED
@@ -7,7 +7,7 @@
7
  * @version 1.0.0
8
  *
9
  */
10
- if( ! class_exists( 'CSF_Field_link_color' ) ) {
11
  class CSF_Field_link_color extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
@@ -46,13 +46,13 @@ if( ! class_exists( 'CSF_Field_link_color' ) ) {
46
 
47
  foreach ( $color_props as $color_prop_key => $color_prop_value ) {
48
 
49
- if( ! empty( $args[$color_prop_key] ) ) {
50
 
51
- $default_attr = ( ! empty( $this->field['default'][$color_prop_key] ) ) ? ' data-default-color="'. $this->field['default'][$color_prop_key] .'"' : '';
52
 
53
  echo '<div class="csf--left csf-field-color">';
54
- echo '<div class="csf--title">'. $color_prop_value .'</div>';
55
- echo '<input type="text" name="'. $this->field_name('['. $color_prop_key .']') .'" value="'. $value[$color_prop_key] .'" class="csf-color"'. $default_attr . $this->field_attributes() .'/>';
56
  echo '</div>';
57
 
58
  }
@@ -69,14 +69,14 @@ if( ! class_exists( 'CSF_Field_link_color' ) ) {
69
  $elements = ( is_array( $this->field['output'] ) ) ? $this->field['output'] : array_filter( (array) $this->field['output'] );
70
  $important = ( ! empty( $this->field['output_important'] ) ) ? '!important' : '';
71
 
72
- if( ! empty( $elements ) && isset( $this->value ) && $this->value !== '' ) {
73
- foreach( $elements as $element ) {
74
 
75
- if( isset( $this->value['color'] ) && $this->value['color'] !== '' ) { $output .= $element .'{color:'. $this->value['color'] . $important .';}'; }
76
- if( isset( $this->value['hover'] ) && $this->value['hover'] !== '' ) { $output .= $element .':hover{color:'. $this->value['hover'] . $important .';}'; }
77
- if( isset( $this->value['active'] ) && $this->value['active'] !== '' ) { $output .= $element .':active{color:'. $this->value['active'] . $important .';}'; }
78
- if( isset( $this->value['visited'] ) && $this->value['visited'] !== '' ) { $output .= $element .':visited{color:'. $this->value['visited'] . $important .';}'; }
79
- if( isset( $this->value['focus'] ) && $this->value['focus'] !== '' ) { $output .= $element .':focus{color:'. $this->value['focus'] . $important .';}'; }
80
 
81
  }
82
  }
7
  * @version 1.0.0
8
  *
9
  */
10
+ if ( ! class_exists( 'CSF_Field_link_color' ) ) {
11
  class CSF_Field_link_color extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
46
 
47
  foreach ( $color_props as $color_prop_key => $color_prop_value ) {
48
 
49
+ if ( ! empty( $args[$color_prop_key] ) ) {
50
 
51
+ $default_attr = ( ! empty( $this->field['default'][$color_prop_key] ) ) ? ' data-default-color="'. esc_attr( $this->field['default'][$color_prop_key] ) .'"' : '';
52
 
53
  echo '<div class="csf--left csf-field-color">';
54
+ echo '<div class="csf--title">'. esc_attr( $color_prop_value ) .'</div>';
55
+ echo '<input type="text" name="'. esc_attr( $this->field_name( '['. $color_prop_key .']' ) ) .'" value="'. esc_attr( $value[$color_prop_key] ) .'" class="csf-color"'. $default_attr . $this->field_attributes() .'/>';
56
  echo '</div>';
57
 
58
  }
69
  $elements = ( is_array( $this->field['output'] ) ) ? $this->field['output'] : array_filter( (array) $this->field['output'] );
70
  $important = ( ! empty( $this->field['output_important'] ) ) ? '!important' : '';
71
 
72
+ if ( ! empty( $elements ) && isset( $this->value ) && $this->value !== '' ) {
73
+ foreach ( $elements as $element ) {
74
 
75
+ if ( isset( $this->value['color'] ) && $this->value['color'] !== '' ) { $output .= $element .'{color:'. $this->value['color'] . $important .';}'; }
76
+ if ( isset( $this->value['hover'] ) && $this->value['hover'] !== '' ) { $output .= $element .':hover{color:'. $this->value['hover'] . $important .';}'; }
77
+ if ( isset( $this->value['active'] ) && $this->value['active'] !== '' ) { $output .= $element .':active{color:'. $this->value['active'] . $important .';}'; }
78
+ if ( isset( $this->value['visited'] ) && $this->value['visited'] !== '' ) { $output .= $element .':visited{color:'. $this->value['visited'] . $important .';}'; }
79
+ if ( isset( $this->value['focus'] ) && $this->value['focus'] !== '' ) { $output .= $element .':focus{color:'. $this->value['focus'] . $important .';}'; }
80
 
81
  }
82
  }
admin/settings/fields/map/map.php CHANGED
@@ -7,7 +7,7 @@
7
  * @version 1.0.0
8
  *
9
  */
10
- if( ! class_exists( 'CSF_Field_map' ) ) {
11
  class CSF_Field_map extends CSF_Fields {
12
 
13
  public $version = '1.5.1';
@@ -42,38 +42,37 @@ if( ! class_exists( 'CSF_Field_map' ) ) {
42
 
43
  $settings = ( ! empty( $this->field['settings'] ) ) ? $this->field['settings'] : array();
44
  $settings = wp_parse_args( $settings, $default_settings );
45
- $encoded = htmlspecialchars( json_encode( $settings ) );
46
 
47
- $style_attr = ( ! empty( $args['height'] ) ) ? ' style="min-height:'. $args['height'] .';"' : '';
48
  $placeholder = ( ! empty( $args['placeholder'] ) ) ? array( 'placeholder' => $args['placeholder'] ) : '';
49
 
50
  echo $this->field_before();
51
 
52
- if( empty( $args['address_field'] ) ) {
53
  echo '<div class="csf--map-search">';
54
- echo '<input type="text" name="'. $this->field_name('[address]') .'" value="'. $value['address'] .'"'. $this->field_attributes( $placeholder ) .' />';
55
  echo '</div>';
56
  } else {
57
- echo '<div class="csf--address-field" data-address-field="'. $args['address_field'] .'"></div>';
58
  }
59
 
60
- echo '<div class="csf--map-osm-wrap"><div class="csf--map-osm" data-map="'. $encoded .'"'. $style_attr .'></div></div>';
61
 
62
  echo '<div class="csf--map-inputs">';
63
 
64
  echo '<div class="csf--map-input">';
65
- echo '<label>'. $args['latitude_text'] .'</label>';
66
- echo '<input type="text" name="'. $this->field_name('[latitude]') .'" value="'. $value['latitude'] .'" class="csf--latitude" />';
67
  echo '</div>';
68
 
69
  echo '<div class="csf--map-input">';
70
- echo '<label>'. $args['longitude_text'] .'</label>';
71
- echo '<input type="text" name="'. $this->field_name('[longitude]') .'" value="'. $value['longitude'] .'" class="csf--longitude" />';
72
  echo '</div>';
73
 
74
  echo '</div>';
75
 
76
- echo '<input type="hidden" name="'. $this->field_name('[zoom]') .'" value="'. $value['zoom'] .'" class="csf--zoom" />';
77
 
78
  echo $this->field_after();
79
 
@@ -81,15 +80,15 @@ if( ! class_exists( 'CSF_Field_map' ) ) {
81
 
82
  public function enqueue() {
83
 
84
- if( ! wp_script_is( 'csf-leaflet' ) ) {
85
- wp_enqueue_script( 'csf-leaflet', $this->cdn_url . $this->version .'/dist/leaflet.js', array( 'csf' ), $this->version, true );
86
  }
87
 
88
- if( ! wp_style_is( 'csf-leaflet' ) ) {
89
- wp_enqueue_style( 'csf-leaflet', $this->cdn_url . $this->version .'/dist/leaflet.css', array(), $this->version );
90
  }
91
 
92
- if( ! wp_script_is( 'jquery-ui-autocomplete' ) ) {
93
  wp_enqueue_script( 'jquery-ui-autocomplete' );
94
  }
95
 
7
  * @version 1.0.0
8
  *
9
  */
10
+ if ( ! class_exists( 'CSF_Field_map' ) ) {
11
  class CSF_Field_map extends CSF_Fields {
12
 
13
  public $version = '1.5.1';
42
 
43
  $settings = ( ! empty( $this->field['settings'] ) ) ? $this->field['settings'] : array();
44
  $settings = wp_parse_args( $settings, $default_settings );
 
45
 
46
+ $style_attr = ( ! empty( $args['height'] ) ) ? ' style="min-height:'. esc_attr( $args['height'] ) .';"' : '';
47
  $placeholder = ( ! empty( $args['placeholder'] ) ) ? array( 'placeholder' => $args['placeholder'] ) : '';
48
 
49
  echo $this->field_before();
50
 
51
+ if ( empty( $args['address_field'] ) ) {
52
  echo '<div class="csf--map-search">';
53
+ echo '<input type="text" name="'. esc_attr( $this->field_name( '[address]' ) ) .'" value="'. esc_attr( $value['address'] ) .'"'. $this->field_attributes( $placeholder ) .' />';
54
  echo '</div>';
55
  } else {
56
+ echo '<div class="csf--address-field" data-address-field="'. esc_attr( $args['address_field'] ) .'"></div>';
57
  }
58
 
59
+ echo '<div class="csf--map-osm-wrap"><div class="csf--map-osm" data-map="'. esc_attr( json_encode( $settings ) ) .'"'. $style_attr .'></div></div>';
60
 
61
  echo '<div class="csf--map-inputs">';
62
 
63
  echo '<div class="csf--map-input">';
64
+ echo '<label>'. esc_attr( $args['latitude_text'] ) .'</label>';
65
+ echo '<input type="text" name="'. esc_attr( $this->field_name( '[latitude]' ) ) .'" value="'. esc_attr( $value['latitude'] ) .'" class="csf--latitude" />';
66
  echo '</div>';
67
 
68
  echo '<div class="csf--map-input">';
69
+ echo '<label>'. esc_attr( $args['longitude_text'] ) .'</label>';
70
+ echo '<input type="text" name="'. esc_attr( $this->field_name( '[longitude]' ) ) .'" value="'. esc_attr( $value['longitude'] ) .'" class="csf--longitude" />';
71
  echo '</div>';
72
 
73
  echo '</div>';
74
 
75
+ echo '<input type="hidden" name="'. esc_attr( $this->field_name( '[zoom]' ) ) .'" value="'. esc_attr( $value['zoom'] ) .'" class="csf--zoom" />';
76
 
77
  echo $this->field_after();
78
 
80
 
81
  public function enqueue() {
82
 
83
+ if ( ! wp_script_is( 'csf-leaflet' ) ) {
84
+ wp_enqueue_script( 'csf-leaflet', esc_url( $this->cdn_url . $this->version .'/dist/leaflet.js' ), array( 'csf' ), $this->version, true );
85
  }
86
 
87
+ if ( ! wp_style_is( 'csf-leaflet' ) ) {
88
+ wp_enqueue_style( 'csf-leaflet', esc_url( $this->cdn_url . $this->version .'/dist/leaflet.css' ), array(), $this->version );
89
  }
90
 
91
+ if ( ! wp_script_is( 'jquery-ui-autocomplete' ) ) {
92
  wp_enqueue_script( 'jquery-ui-autocomplete' );
93
  }
94
 
admin/settings/fields/media/media.php CHANGED
@@ -7,7 +7,7 @@
7
  * @version 1.0.0
8
  *
9
  */
10
- if( ! class_exists( 'CSF_Field_media' ) ) {
11
  class CSF_Field_media extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
@@ -37,7 +37,7 @@ if( ! class_exists( 'CSF_Field_media' ) ) {
37
  );
38
 
39
  // fallback
40
- if( is_numeric( $this->value ) ) {
41
 
42
  $this->value = array(
43
  'id' => $this->value,
@@ -58,25 +58,25 @@ if( ! class_exists( 'CSF_Field_media' ) ) {
58
 
59
  echo $this->field_before();
60
 
61
- if( ! empty( $args['preview'] ) ) {
62
- echo '<div class="csf--preview'. $hidden_auto .'">';
63
- echo '<div class="csf-image-preview"><a href="#" class="csf--remove fa fa-times"></a><img src="'. $preview_src .'" class="csf--src" /></div>';
64
  echo '</div>';
65
  }
66
 
67
  echo '<div class="csf--placeholder">';
68
- echo '<input type="text" name="'. $this->field_name('[url]') .'" value="'. $this->value['url'] .'" class="csf--url'. $hidden_url .'" readonly="readonly"'. $this->field_attributes() . $placeholder .' />';
69
- echo '<a href="#" class="button button-primary csf--button" data-library="'. esc_attr( $library ) .'" data-preview-size="'. esc_attr( $args['preview_size'] ) .'">'. $args['button_title'] .'</a>';
70
- echo ( empty( $args['preview'] ) ) ? '<a href="#" class="button button-secondary csf-warning-primary csf--remove'. $hidden_auto .'">'. $args['remove_title'] .'</a>' : '';
71
  echo '</div>';
72
 
73
- echo '<input type="hidden" name="'. $this->field_name('[id]') .'" value="'. $this->value['id'] .'" class="csf--id"/>';
74
- echo '<input type="hidden" name="'. $this->field_name('[width]') .'" value="'. $this->value['width'] .'" class="csf--width"/>';
75
- echo '<input type="hidden" name="'. $this->field_name('[height]') .'" value="'. $this->value['height'] .'" class="csf--height"/>';
76
- echo '<input type="hidden" name="'. $this->field_name('[thumbnail]') .'" value="'. $this->value['thumbnail'] .'" class="csf--thumbnail"/>';
77
- echo '<input type="hidden" name="'. $this->field_name('[alt]') .'" value="'. $this->value['alt'] .'" class="csf--alt"/>';
78
- echo '<input type="hidden" name="'. $this->field_name('[title]') .'" value="'. $this->value['title'] .'" class="csf--title"/>';
79
- echo '<input type="hidden" name="'. $this->field_name('[description]') .'" value="'. $this->value['description'] .'" class="csf--description"/>';
80
 
81
  echo $this->field_after();
82
 
7
  * @version 1.0.0
8
  *
9
  */
10
+ if ( ! class_exists( 'CSF_Field_media' ) ) {
11
  class CSF_Field_media extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
37
  );
38
 
39
  // fallback
40
+ if ( is_numeric( $this->value ) ) {
41
 
42
  $this->value = array(
43
  'id' => $this->value,
58
 
59
  echo $this->field_before();
60
 
61
+ if ( ! empty( $args['preview'] ) ) {
62
+ echo '<div class="csf--preview'. esc_attr( $hidden_auto ) .'">';
63
+ echo '<div class="csf-image-preview"><a href="#" class="csf--remove fas fa-times"></a><img src="'. esc_url( $preview_src ) .'" class="csf--src" /></div>';
64
  echo '</div>';
65
  }
66
 
67
  echo '<div class="csf--placeholder">';
68
+ echo '<input type="text" name="'. esc_attr( $this->field_name( '[url]' ) ) .'" value="'. esc_attr( $this->value['url'] ) .'" class="csf--url'. esc_attr( $hidden_url ) .'" readonly="readonly"'. $this->field_attributes() . $placeholder .' />';
69
+ echo '<a href="#" class="button button-primary csf--button" data-library="'. esc_attr( $library ) .'" data-preview-size="'. esc_attr( $args['preview_size'] ) .'">'. wp_kses_post( $args['button_title'] ) .'</a>';
70
+ echo ( empty( $args['preview'] ) ) ? '<a href="#" class="button button-secondary csf-warning-primary csf--remove'. esc_attr( $hidden_auto ) .'">'. wp_kses_post( $args['remove_title'] ) .'</a>' : '';
71
  echo '</div>';
72
 
73
+ echo '<input type="hidden" name="'. esc_attr( $this->field_name( '[id]' ) ) .'" value="'. esc_attr( $this->value['id'] ) .'" class="csf--id"/>';
74
+ echo '<input type="hidden" name="'. esc_attr( $this->field_name( '[width]' ) ) .'" value="'. esc_attr( $this->value['width'] ) .'" class="csf--width"/>';
75
+ echo '<input type="hidden" name="'. esc_attr( $this->field_name( '[height]' ) ) .'" value="'. esc_attr( $this->value['height'] ) .'" class="csf--height"/>';
76
+ echo '<input type="hidden" name="'. esc_attr( $this->field_name( '[thumbnail]' ) ) .'" value="'. esc_attr( $this->value['thumbnail'] ) .'" class="csf--thumbnail"/>';
77
+ echo '<input type="hidden" name="'. esc_attr( $this->field_name( '[alt]' ) ) .'" value="'. esc_attr( $this->value['alt'] ) .'" class="csf--alt"/>';
78
+ echo '<input type="hidden" name="'. esc_attr( $this->field_name( '[title]' ) ) .'" value="'. esc_attr( $this->value['title'] ) .'" class="csf--title"/>';
79
+ echo '<input type="hidden" name="'. esc_attr( $this->field_name( '[description]' ) ) .'" value="'. esc_attr( $this->value['description'] ) .'" class="csf--description"/>';
80
 
81
  echo $this->field_after();
82
 
admin/settings/fields/notice/notice.php CHANGED
@@ -7,7 +7,7 @@
7
  * @version 1.0.0
8
  *
9
  */
10
- if( ! class_exists( 'CSF_Field_notice' ) ) {
11
  class CSF_Field_notice extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
@@ -18,7 +18,7 @@ if( ! class_exists( 'CSF_Field_notice' ) ) {
18
 
19
  $style = ( ! empty( $this->field['style'] ) ) ? $this->field['style'] : 'normal';
20
 
21
- echo ( ! empty( $this->field['content'] ) ) ? '<div class="csf-notice csf-notice-'. $style .'">'. $this->field['content'] .'</div>' : '';
22
 
23
  }
24
 
7
  * @version 1.0.0
8
  *
9
  */
10
+ if ( ! class_exists( 'CSF_Field_notice' ) ) {
11
  class CSF_Field_notice extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
18
 
19
  $style = ( ! empty( $this->field['style'] ) ) ? $this->field['style'] : 'normal';
20
 
21
+ echo ( ! empty( $this->field['content'] ) ) ? '<div class="csf-notice csf-notice-'. esc_attr( $style ) .'">'. wp_kses_post( $this->field['content'] ) .'</div>' : '';
22
 
23
  }
24
 
admin/settings/fields/number/number.php CHANGED
@@ -7,7 +7,7 @@
7
  * @version 1.0.0
8
  *
9
  */
10
- if( ! class_exists( 'CSF_Field_number' ) ) {
11
  class CSF_Field_number extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
@@ -22,10 +22,9 @@ if( ! class_exists( 'CSF_Field_number' ) ) {
22
 
23
  echo $this->field_before();
24
  echo '<div class="csf--wrap">';
25
- echo '<input type="number" name="'. $this->field_name() .'" value="'. $this->value .'"'. $this->field_attributes( array( 'class' => 'csf-input-number' ) ) .'/>';
26
- echo ( ! empty( $args['unit'] ) ) ? '<span class="csf--unit">'. $args['unit'] .'</span>' : '';
27
  echo '</div>';
28
- echo '<div class="clear"></div>';
29
  echo $this->field_after();
30
 
31
  }
@@ -38,10 +37,10 @@ if( ! class_exists( 'CSF_Field_number' ) ) {
38
  $mode = ( ! empty( $this->field['output_mode'] ) ) ? $this->field['output_mode'] : 'width';
39
  $unit = ( ! empty( $this->field['unit'] ) ) ? $this->field['unit'] : 'px';
40
 
41
- if( ! empty( $elements ) && isset( $this->value ) && $this->value !== '' ) {
42
- foreach( $elements as $key_property => $element ) {
43
- if( is_numeric( $key_property ) ) {
44
- if( $mode ) {
45
  $output = implode( ',', $elements ) .'{'. $mode .':'. $this->value . $unit . $important .';}';
46
  }
47
  break;
7
  * @version 1.0.0
8
  *
9
  */
10
+ if ( ! class_exists( 'CSF_Field_number' ) ) {
11
  class CSF_Field_number extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
22
 
23
  echo $this->field_before();
24
  echo '<div class="csf--wrap">';
25
+ echo '<input type="number" name="'. esc_attr( $this->field_name() ) .'" value="'. esc_attr( $this->value ) .'"'. $this->field_attributes( array( 'class' => 'csf-input-number' ) ) .'/>';
26
+ echo ( ! empty( $args['unit'] ) ) ? '<span class="csf--unit">'. esc_attr( $args['unit'] ) .'</span>' : '';
27
  echo '</div>';
 
28
  echo $this->field_after();
29
 
30
  }
37
  $mode = ( ! empty( $this->field['output_mode'] ) ) ? $this->field['output_mode'] : 'width';
38
  $unit = ( ! empty( $this->field['unit'] ) ) ? $this->field['unit'] : 'px';
39
 
40
+ if ( ! empty( $elements ) && isset( $this->value ) && $this->value !== '' ) {
41
+ foreach ( $elements as $key_property => $element ) {
42
+ if ( is_numeric( $key_property ) ) {
43
+ if ( $mode ) {
44
  $output = implode( ',', $elements ) .'{'. $mode .':'. $this->value . $unit . $important .';}';
45
  }
46
  break;
admin/settings/fields/palette/palette.php CHANGED
@@ -7,7 +7,7 @@
7
  * @version 1.0.0
8
  *
9
  */
10
- if( ! class_exists( 'CSF_Field_palette' ) ) {
11
  class CSF_Field_palette extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
@@ -20,7 +20,7 @@ if( ! class_exists( 'CSF_Field_palette' ) ) {
20
 
21
  echo $this->field_before();
22
 
23
- if( ! empty( $palette ) ) {
24
 
25
  echo '<div class="csf-siblings csf--palettes">';
26
 
@@ -29,19 +29,19 @@ if( ! class_exists( 'CSF_Field_palette' ) ) {
29
  $active = ( $key === $this->value ) ? ' csf--active' : '';
30
  $checked = ( $key === $this->value ) ? ' checked' : '';
31
 
32
- echo '<div class="csf--sibling csf--palette'. $active .'">';
33
 
34
- if( ! empty( $colors ) ) {
35
 
36
- foreach( $colors as $color ) {
37
 
38
- echo '<span style="background-color: '. $color .';"></span>';
39
 
40
  }
41
 
42
  }
43
 
44
- echo '<input type="radio" name="'. $this->field_name() .'" value="'. $key .'"'. $this->field_attributes() . $checked .'/>';
45
  echo '</div>';
46
 
47
  }
@@ -50,8 +50,6 @@ if( ! class_exists( 'CSF_Field_palette' ) ) {
50
 
51
  }
52
 
53
- echo '<div class="clear"></div>';
54
-
55
  echo $this->field_after();
56
 
57
  }
7
  * @version 1.0.0
8
  *
9
  */
10
+ if ( ! class_exists( 'CSF_Field_palette' ) ) {
11
  class CSF_Field_palette extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
20
 
21
  echo $this->field_before();
22
 
23
+ if ( ! empty( $palette ) ) {
24
 
25
  echo '<div class="csf-siblings csf--palettes">';
26
 
29
  $active = ( $key === $this->value ) ? ' csf--active' : '';
30
  $checked = ( $key === $this->value ) ? ' checked' : '';
31
 
32
+ echo '<div class="csf--sibling csf--palette'. esc_attr( $active ) .'">';
33
 
34
+ if ( ! empty( $colors ) ) {
35
 
36
+ foreach ( $colors as $color ) {
37
 
38
+ echo '<span style="background-color: '. esc_attr( $color ) .';"></span>';
39
 
40
  }
41
 
42
  }
43
 
44
+ echo '<input type="radio" name="'. esc_attr( $this->field_name() ) .'" value="'. esc_attr( $key ) .'"'. $this->field_attributes() . esc_attr( $checked ) .'/>';
45
  echo '</div>';
46
 
47
  }
50
 
51
  }
52
 
 
 
53
  echo $this->field_after();
54
 
55
  }
admin/settings/fields/radio/radio.php CHANGED
@@ -7,7 +7,7 @@
7
  * @version 1.0.0
8
  *
9
  */
10
- if( ! class_exists( 'CSF_Field_radio' ) ) {
11
  class CSF_Field_radio extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
@@ -25,24 +25,24 @@ if( ! class_exists( 'CSF_Field_radio' ) ) {
25
 
26
  echo $this->field_before();
27
 
28
- if( isset( $this->field['options'] ) ) {
29
 
30
  $options = $this->field['options'];
31
  $options = ( is_array( $options ) ) ? $options : array_filter( $this->field_data( $options, false, $args['query_args'] ) );
32
 
33
- if( is_array( $options ) && ! empty( $options ) ) {
34
 
35
  echo '<ul'. $inline_class .'>';
36
  foreach ( $options as $option_key => $option_value ) {
37
 
38
- if( is_array( $option_value ) && ! empty( $option_value ) ) {
39
 
40
  echo '<li>';
41
  echo '<ul>';
42
- echo '<li><strong>'. $option_key .'</strong></li>';
43
- foreach( $option_value as $sub_key => $sub_value ) {
44
  $checked = ( $sub_key == $this->value ) ? ' checked' : '';
45
- echo '<li><label><input type="radio" name="'. $this->field_name() .'" value="'. $sub_key .'"'. $this->field_attributes() . $checked .'/> '. $sub_value .'</label></li>';
46
  }
47
  echo '</ul>';
48
  echo '</li>';
@@ -50,7 +50,7 @@ if( ! class_exists( 'CSF_Field_radio' ) ) {
50
  } else {
51
 
52
  $checked = ( $option_key == $this->value ) ? ' checked' : '';
53
- echo '<li><label><input type="radio" name="'. $this->field_name() .'" value="'. $option_key .'"'. $this->field_attributes() . $checked .'/> '. $option_value .'</label></li>';
54
 
55
  }
56
 
@@ -59,13 +59,13 @@ if( ! class_exists( 'CSF_Field_radio' ) ) {
59
 
60
  } else {
61
 
62
- echo ( ! empty( $this->field['empty_message'] ) ) ? $this->field['empty_message'] : esc_html__( 'No data provided for this option type.', 'csf' );
63
 
64
  }
65
 
66
  } else {
67
  $label = ( isset( $this->field['label'] ) ) ? $this->field['label'] : '';
68
- echo '<label><input type="radio" name="'. $this->field_name() .'" value="1"'. $this->field_attributes() . checked( $this->value, 1, false ) .'/> '. $label .'</label>';
69
  }
70
 
71
  echo $this->field_after();
7
  * @version 1.0.0
8
  *
9
  */
10
+ if ( ! class_exists( 'CSF_Field_radio' ) ) {
11
  class CSF_Field_radio extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
25
 
26
  echo $this->field_before();
27
 
28
+ if ( isset( $this->field['options'] ) ) {
29
 
30
  $options = $this->field['options'];
31
  $options = ( is_array( $options ) ) ? $options : array_filter( $this->field_data( $options, false, $args['query_args'] ) );
32
 
33
+ if ( is_array( $options ) && ! empty( $options ) ) {
34
 
35
  echo '<ul'. $inline_class .'>';
36
  foreach ( $options as $option_key => $option_value ) {
37
 
38
+ if ( is_array( $option_value ) && ! empty( $option_value ) ) {
39
 
40
  echo '<li>';
41
  echo '<ul>';
42
+ echo '<li><strong>'. esc_attr( $option_key ) .'</strong></li>';
43
+ foreach ( $option_value as $sub_key => $sub_value ) {
44
  $checked = ( $sub_key == $this->value ) ? ' checked' : '';
45
+ echo '<li><label><input type="radio" name="'. esc_attr( $this->field_name() ) .'" value="'. esc_attr( $sub_key ) .'"'. $this->field_attributes() . esc_attr( $checked ) .'/> '. $sub_value .'</label></li>';
46
  }
47
  echo '</ul>';
48
  echo '</li>';
50
  } else {
51
 
52
  $checked = ( $option_key == $this->value ) ? ' checked' : '';
53
+ echo '<li><label><input type="radio" name="'. esc_attr( $this->field_name() ) .'" value="'. esc_attr( $option_key ) .'"'. $this->field_attributes() . esc_attr( $checked ) .'/> '. esc_attr( $option_value ) .'</label></li>';
54
 
55
  }
56
 
59
 
60
  } else {
61
 
62
+ echo ( ! empty( $this->field['empty_message'] ) ) ? esc_attr( $this->field['empty_message'] ) : esc_html__( 'No data provided for this option type.', 'csf' );
63
 
64
  }
65
 
66
  } else {
67
  $label = ( isset( $this->field['label'] ) ) ? $this->field['label'] : '';
68
+ echo '<label><input type="radio" name="'. esc_attr( $this->field_name() ) .'" value="1"'. $this->field_attributes() . esc_attr( checked( $this->value, 1, false ) ) .'/> '. esc_attr( $label ) .'</label>';
69
  }
70
 
71
  echo $this->field_after();
admin/settings/fields/repeater/repeater.php CHANGED
@@ -7,7 +7,7 @@
7
  * @version 1.0.0
8
  *
9
  */
10
- if( ! class_exists( 'CSF_Field_repeater' ) ) {
11
  class CSF_Field_repeater extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
@@ -19,13 +19,13 @@ if( ! class_exists( 'CSF_Field_repeater' ) ) {
19
  $args = wp_parse_args( $this->field, array(
20
  'max' => 0,
21
  'min' => 0,
22
- 'button_title' => '<i class="fa fa-plus-circle"></i>',
23
  ) );
24
 
25
  $fields = $this->field['fields'];
26
  $unique_id = ( ! empty( $this->unique ) ) ? $this->unique : $this->field['id'];
27
 
28
- if( $this->parent && preg_match( '/'. preg_quote( '['. $this->field['id'] .']' ) .'/', $this->parent ) ) {
29
 
30
  echo '<div class="csf-notice csf-notice-danger">'. esc_html__( 'Error: Nested field id can not be same with another nested field id.', 'csf' ) .'</div>';
31
 
@@ -46,16 +46,16 @@ if( ! class_exists( 'CSF_Field_repeater' ) ) {
46
  echo '</div>';
47
  echo '<div class="csf-repeater-helper">';
48
  echo '<div class="csf-repeater-helper-inner">';
49
- echo '<i class="csf-repeater-sort fa fa-arrows"></i>';
50
- echo '<i class="csf-repeater-clone fa fa-clone"></i>';
51
- echo '<i class="csf-repeater-remove csf-confirm fa fa-times" data-confirm="'. esc_html__( 'Are you sure to delete this item?', 'csf' ) .'"></i>';
52
  echo '</div>';
53
  echo '</div>';
54
  echo '</div>';
55
 
56
- echo '<div class="csf-repeater-wrapper csf-data-wrapper" data-unique-id="'. $this->unique .'" data-field-id="['. $this->field['id'] .']" data-max="'. $args['max'] .'" data-min="'. $args['min'] .'">';
57
 
58
- if( ! empty( $this->value ) ) {
59
 
60
  $num = 0;
61
 
@@ -77,9 +77,9 @@ if( ! class_exists( 'CSF_Field_repeater' ) ) {
77
 
78
  echo '<div class="csf-repeater-helper">';
79
  echo '<div class="csf-repeater-helper-inner">';
80
- echo '<i class="csf-repeater-sort fa fa-arrows"></i>';
81
- echo '<i class="csf-repeater-clone fa fa-clone"></i>';
82
- echo '<i class="csf-repeater-remove csf-confirm fa fa-times" data-confirm="'. esc_html__( 'Are you sure to delete this item?', 'csf' ) .'"></i>';
83
  echo '</div>';
84
  echo '</div>';
85
 
@@ -93,10 +93,10 @@ if( ! class_exists( 'CSF_Field_repeater' ) ) {
93
 
94
  echo '</div>';
95
 
96
- echo '<div class="csf-repeater-alert csf-repeater-max">'. esc_html__( 'You can not add more than', 'csf' ) .' '. $args['max'] .'</div>';
97
- echo '<div class="csf-repeater-alert csf-repeater-min">'. esc_html__( 'You can not remove less than', 'csf' ) .' '. $args['min'] .'</div>';
98
 
99
- echo '<a href="#" class="button button-primary csf-repeater-add">'. $args['button_title'] .'</a>';
100
 
101
  echo $this->field_after();
102
 
@@ -106,7 +106,7 @@ if( ! class_exists( 'CSF_Field_repeater' ) ) {
106
 
107
  public function enqueue() {
108
 
109
- if( ! wp_script_is( 'jquery-ui-sortable' ) ) {
110
  wp_enqueue_script( 'jquery-ui-sortable' );
111
  }
112
 
7
  * @version 1.0.0
8
  *
9
  */
10
+ if ( ! class_exists( 'CSF_Field_repeater' ) ) {
11
  class CSF_Field_repeater extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
19
  $args = wp_parse_args( $this->field, array(
20
  'max' => 0,
21
  'min' => 0,
22
+ 'button_title' => '<i class="fas fa-plus-circle"></i>',
23
  ) );
24
 
25
  $fields = $this->field['fields'];
26
  $unique_id = ( ! empty( $this->unique ) ) ? $this->unique : $this->field['id'];
27
 
28
+ if ( $this->parent && preg_match( '/'. preg_quote( '['. $this->field['id'] .']' ) .'/', $this->parent ) ) {
29
 
30
  echo '<div class="csf-notice csf-notice-danger">'. esc_html__( 'Error: Nested field id can not be same with another nested field id.', 'csf' ) .'</div>';
31
 
46
  echo '</div>';
47
  echo '<div class="csf-repeater-helper">';
48
  echo '<div class="csf-repeater-helper-inner">';
49
+ echo '<i class="csf-repeater-sort fas fa-arrows-alt"></i>';
50
+ echo '<i class="csf-repeater-clone far fa-clone"></i>';
51
+ echo '<i class="csf-repeater-remove csf-confirm fas fa-times" data-confirm="'. esc_html__( 'Are you sure to delete this item?', 'csf' ) .'"></i>';
52
  echo '</div>';
53
  echo '</div>';
54
  echo '</div>';
55
 
56
+ echo '<div class="csf-repeater-wrapper csf-data-wrapper" data-unique-id="'. esc_attr( $this->unique ) .'" data-field-id="['. esc_attr( $this->field['id'] ) .']" data-max="'. esc_attr( $args['max'] ) .'" data-min="'. esc_attr( $args['min'] ) .'">';
57
 
58
+ if ( ! empty( $this->value ) && is_array( $this->value ) ) {
59
 
60
  $num = 0;
61
 
77
 
78
  echo '<div class="csf-repeater-helper">';
79
  echo '<div class="csf-repeater-helper-inner">';
80
+ echo '<i class="csf-repeater-sort fas fa-arrows-alt"></i>';
81
+ echo '<i class="csf-repeater-clone far fa-clone"></i>';
82
+ echo '<i class="csf-repeater-remove csf-confirm fas fa-times" data-confirm="'. esc_html__( 'Are you sure to delete this item?', 'csf' ) .'"></i>';
83
  echo '</div>';
84
  echo '</div>';
85
 
93
 
94
  echo '</div>';
95
 
96
+ echo '<div class="csf-repeater-alert csf-repeater-max">'. esc_html__( 'You can not add more than', 'csf' ) .' '. esc_attr( $args['max'] ) .'</div>';
97
+ echo '<div class="csf-repeater-alert csf-repeater-min">'. esc_html__( 'You can not remove less than', 'csf' ) .' '. esc_attr( $args['min'] ) .'</div>';
98
 
99
+ echo '<a href="#" class="button button-primary csf-repeater-add">'. wp_kses_post( $args['button_title'] ) .'</a>';
100
 
101
  echo $this->field_after();
102
 
106
 
107
  public function enqueue() {
108
 
109
+ if ( ! wp_script_is( 'jquery-ui-sortable' ) ) {
110
  wp_enqueue_script( 'jquery-ui-sortable' );
111
  }
112
 
admin/settings/fields/select/select.php CHANGED
@@ -7,7 +7,7 @@
7
  * @version 1.0.0
8
  *
9
  */
10
- if( ! class_exists( 'CSF_Field_select' ) ) {
11
  class CSF_Field_select extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
@@ -30,12 +30,12 @@ if( ! class_exists( 'CSF_Field_select' ) ) {
30
 
31
  echo $this->field_before();
32
 
33
- if( isset( $this->field['options'] ) ) {
34
 
35
- if( ! empty( $args['ajax'] ) ) {
36
  $args['settings']['data']['type'] = $args['options'];
37
  $args['settings']['data']['nonce'] = wp_create_nonce( 'csf_chosen_ajax_nonce' );
38
- if( ! empty( $args['query_args'] ) ) {
39
  $args['settings']['data']['query_args'] = $args['query_args'];
40
  }
41
  }
@@ -45,28 +45,28 @@ if( ! class_exists( 'CSF_Field_select' ) ) {
45
  $multiple_attr = ( $args['multiple'] ) ? ' multiple="multiple"' : '';
46
  $chosen_sortable = ( $args['chosen'] && $args['sortable'] ) ? ' csf-chosen-sortable' : '';
47
  $chosen_ajax = ( $args['chosen'] && $args['ajax'] ) ? ' csf-chosen-ajax' : '';
48
- $placeholder_attr = ( $args['chosen'] && $args['placeholder'] ) ? ' data-placeholder="'. $args['placeholder'] .'"' : '';
49
- $field_class = ( $args['chosen'] ) ? ' class="csf-chosen'. $chosen_rtl . $chosen_sortable . $chosen_ajax .'"' : '';
50
  $field_name = $this->field_name( $multiple_name );
51
  $field_attr = $this->field_attributes();
52
  $maybe_options = $this->field['options'];
53
  $chosen_data_attr = ( $args['chosen'] && ! empty( $args['settings'] ) ) ? ' data-chosen-settings="'. esc_attr( json_encode( $args['settings'] ) ) .'"' : '';
54
 
55
- if( is_string( $maybe_options ) && ! empty( $args['chosen'] ) && ! empty( $args['ajax'] ) ) {
56
  $options = $this->field_wp_query_data_title( $maybe_options, $this->value );
57
- } else if( is_string( $maybe_options ) ) {
58
  $options = $this->field_data( $maybe_options, false, $args['query_args'] );
59
  } else {
60
  $options = $maybe_options;
61
  }
62
 
63
- if( ( is_array( $options ) && ! empty( $options ) ) || ( ! empty( $args['chosen'] ) && ! empty( $args['ajax'] ) ) ) {
64
 
65
- if( ! empty( $args['chosen'] ) && ! empty( $args['multiple'] ) ) {
66
 
67
  echo '<select name="'. $field_name .'" class="csf-hidden-select csf-hidden"'. $multiple_attr . $field_attr .'>';
68
- foreach( $this->value as $option_key ) {
69
- echo '<option value="'. $option_key .'" selected>'. $option_key .'</option>';
70
  }
71
  echo '</select>';
72
 
@@ -75,32 +75,33 @@ if( ! class_exists( 'CSF_Field_select' ) ) {
75
 
76
  }
77
 
78
- echo '<select name="'. $field_name .'"'. $field_class . $multiple_attr . $placeholder_attr . $field_attr . $chosen_data_attr .'>';
 
79
 
80
- if( $args['placeholder'] && empty( $args['multiple'] ) ) {
81
- if( ! empty( $args['chosen'] ) ) {
82
  echo '<option value=""></option>';
83
  } else {
84
- echo '<option value="">'. $args['placeholder'] .'</option>';
85
  }
86
  }
87
 
88
- foreach( $options as $option_key => $option ) {
89
 
90
- if( is_array( $option ) && ! empty( $option ) ) {
91
 
92
- echo '<optgroup label="'. $option_key .'">';
93
 
94
- foreach( $option as $sub_key => $sub_value ) {
95
  $selected = ( in_array( $sub_key, $this->value ) ) ? ' selected' : '';
96
- echo '<option value="'. $sub_key .'" '. $selected .'>'. $sub_value .'</option>';
97
  }
98
 
99
  echo '</optgroup>';
100
 
101
  } else {
102
  $selected = ( in_array( $option_key, $this->value ) ) ? ' selected' : '';
103
- echo '<option value="'. $option_key .'" '. $selected .'>'. $option .'</option>';
104
  }
105
 
106
  }
@@ -109,7 +110,7 @@ if( ! class_exists( 'CSF_Field_select' ) ) {
109
 
110
  } else {
111
 
112
- echo ( ! empty( $this->field['empty_message'] ) ) ? $this->field['empty_message'] : esc_html__( 'No data provided for this option type.', 'csf' );
113
 
114
  }
115
 
@@ -121,7 +122,7 @@ if( ! class_exists( 'CSF_Field_select' ) ) {
121
 
122
  public function enqueue() {
123
 
124
- if( ! wp_script_is( 'jquery-ui-sortable' ) ) {
125
  wp_enqueue_script( 'jquery-ui-sortable' );
126
  }
127
 
7
  * @version 1.0.0
8
  *
9
  */
10
+ if ( ! class_exists( 'CSF_Field_select' ) ) {
11
  class CSF_Field_select extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
30
 
31
  echo $this->field_before();
32
 
33
+ if ( isset( $this->field['options'] ) ) {
34
 
35
+ if ( ! empty( $args['ajax'] ) ) {
36
  $args['settings']['data']['type'] = $args['options'];
37
  $args['settings']['data']['nonce'] = wp_create_nonce( 'csf_chosen_ajax_nonce' );
38
+ if ( ! empty( $args['query_args'] ) ) {
39
  $args['settings']['data']['query_args'] = $args['query_args'];
40
  }
41
  }
45
  $multiple_attr = ( $args['multiple'] ) ? ' multiple="multiple"' : '';
46
  $chosen_sortable = ( $args['chosen'] && $args['sortable'] ) ? ' csf-chosen-sortable' : '';
47
  $chosen_ajax = ( $args['chosen'] && $args['ajax'] ) ? ' csf-chosen-ajax' : '';
48
+ $placeholder_attr = ( $args['chosen'] && $args['placeholder'] ) ? ' data-placeholder="'. esc_attr( $args['placeholder'] ) .'"' : '';
49
+ $field_class = ( $args['chosen'] ) ? ' class="csf-chosen'. esc_attr( $chosen_rtl . $chosen_sortable . $chosen_ajax ) .'"' : '';
50
  $field_name = $this->field_name( $multiple_name );
51
  $field_attr = $this->field_attributes();
52
  $maybe_options = $this->field['options'];
53
  $chosen_data_attr = ( $args['chosen'] && ! empty( $args['settings'] ) ) ? ' data-chosen-settings="'. esc_attr( json_encode( $args['settings'] ) ) .'"' : '';
54
 
55
+ if ( is_string( $maybe_options ) && ! empty( $args['chosen'] ) && ! empty( $args['ajax'] ) ) {
56
  $options = $this->field_wp_query_data_title( $maybe_options, $this->value );
57
+ } else if ( is_string( $maybe_options ) ) {
58
  $options = $this->field_data( $maybe_options, false, $args['query_args'] );
59
  } else {
60
  $options = $maybe_options;
61
  }
62
 
63
+ if ( ( is_array( $options ) && ! empty( $options ) ) || ( ! empty( $args['chosen'] ) && ! empty( $args['ajax'] ) ) ) {
64
 
65
+ if ( ! empty( $args['chosen'] ) && ! empty( $args['multiple'] ) ) {
66
 
67
  echo '<select name="'. $field_name .'" class="csf-hidden-select csf-hidden"'. $multiple_attr . $field_attr .'>';
68
+ foreach ( $this->value as $option_key ) {
69
+ echo '<option value="'. esc_attr( $option_key ) .'" selected>'. esc_attr( $option_key ) .'</option>';
70
  }
71
  echo '</select>';
72
 
75
 
76
  }
77
 
78
+ // These attributes has been serialized above.
79
+ echo '<select name="'. esc_attr( $field_name ) .'"'. $field_class . $multiple_attr . $placeholder_attr . $field_attr . $chosen_data_attr .'>';
80
 
81
+ if ( $args['placeholder'] && empty( $args['multiple'] ) ) {
82
+ if ( ! empty( $args['chosen'] ) ) {
83
  echo '<option value=""></option>';
84
  } else {
85
+ echo '<option value="">'. esc_attr( $args['placeholder'] ) .'</option>';
86
  }
87
  }
88
 
89
+ foreach ( $options as $option_key => $option ) {
90
 
91
+ if ( is_array( $option ) && ! empty( $option ) ) {
92
 
93
+ echo '<optgroup label="'. esc_attr( $option_key ) .'">';
94
 
95
+ foreach ( $option as $sub_key => $sub_value ) {
96
  $selected = ( in_array( $sub_key, $this->value ) ) ? ' selected' : '';
97
+ echo '<option value="'. esc_attr( $sub_key ) .'" '. esc_attr( $selected ) .'>'. esc_attr( $sub_value ) .'</option>';
98
  }
99
 
100
  echo '</optgroup>';
101
 
102
  } else {
103
  $selected = ( in_array( $option_key, $this->value ) ) ? ' selected' : '';
104
+ echo '<option value="'. esc_attr( $option_key ) .'" '. esc_attr( $selected ) .'>'. esc_attr( $option ) .'</option>';
105
  }
106
 
107
  }
110
 
111
  } else {
112
 
113
+ echo ( ! empty( $this->field['empty_message'] ) ) ? esc_attr( $this->field['empty_message'] ) : esc_html__( 'No data provided for this option type.', 'csf' );
114
 
115
  }
116
 
122
 
123
  public function enqueue() {
124
 
125
+ if ( ! wp_script_is( 'jquery-ui-sortable' ) ) {
126
  wp_enqueue_script( 'jquery-ui-sortable' );
127
  }
128
 
admin/settings/fields/slider/slider.php CHANGED
@@ -7,7 +7,7 @@
7
  * @version 1.0.0
8
  *
9
  */
10
- if( ! class_exists( 'CSF_Field_slider' ) ) {
11
  class CSF_Field_slider extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
@@ -30,8 +30,8 @@ if( ! class_exists( 'CSF_Field_slider' ) ) {
30
  echo '<div class="csf--wrap">';
31
  echo '<div class="csf-slider-ui"></div>';
32
  echo '<div class="csf--input">';
33
- echo '<input type="number" name="'. $this->field_name() .'" value="'. $this->value .'"'. $this->field_attributes( array( 'class' => 'csf-input-number'. $is_unit ) ) .' data-max="'. $args['max'] .'" data-min="'. $args['min'] .'" data-step="'. $args['step'] .'" />';
34
- echo ( ! empty( $args['unit'] ) ) ? '<span class="csf--unit">'. $args['unit'] .'</span>' : '';
35
  echo '</div>';
36
  echo '</div>';
37
 
@@ -41,7 +41,7 @@ if( ! class_exists( 'CSF_Field_slider' ) ) {
41
 
42
  public function enqueue() {
43
 
44
- if( ! wp_script_is( 'jquery-ui-slider' ) ) {
45
  wp_enqueue_script( 'jquery-ui-slider' );
46
  }
47
 
@@ -55,10 +55,10 @@ if( ! class_exists( 'CSF_Field_slider' ) ) {
55
  $mode = ( ! empty( $this->field['output_mode'] ) ) ? $this->field['output_mode'] : 'width';
56
  $unit = ( ! empty( $this->field['unit'] ) ) ? $this->field['unit'] : 'px';
57
 
58
- if( ! empty( $elements ) && isset( $this->value ) && $this->value !== '' ) {
59
- foreach( $elements as $key_property => $element ) {
60
- if( is_numeric( $key_property ) ) {
61
- if( $mode ) {
62
  $output = implode( ',', $elements ) .'{'. $mode .':'. $this->value . $unit . $important .';}';
63
  }
64
  break;
7
  * @version 1.0.0
8
  *
9
  */
10
+ if ( ! class_exists( 'CSF_Field_slider' ) ) {
11
  class CSF_Field_slider extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
30
  echo '<div class="csf--wrap">';
31
  echo '<div class="csf-slider-ui"></div>';
32
  echo '<div class="csf--input">';
33
+ echo '<input type="number" name="'. esc_attr( $this->field_name() ) .'" value="'. esc_attr( $this->value ) .'"'. $this->field_attributes( array( 'class' => 'csf-input-number'. esc_attr( $is_unit ) ) ) .' data-max="'. esc_attr( $args['max'] ) .'" data-min="'. esc_attr( $args['min'] ) .'" data-step="'. esc_attr( $args['step'] ) .'" />';
34
+ echo ( ! empty( $args['unit'] ) ) ? '<span class="csf--unit">'. esc_attr( $args['unit'] ) .'</span>' : '';
35
  echo '</div>';
36
  echo '</div>';
37
 
41
 
42
  public function enqueue() {
43
 
44
+ if ( ! wp_script_is( 'jquery-ui-slider' ) ) {
45
  wp_enqueue_script( 'jquery-ui-slider' );
46
  }
47
 
55
  $mode = ( ! empty( $this->field['output_mode'] ) ) ? $this->field['output_mode'] : 'width';
56
  $unit = ( ! empty( $this->field['unit'] ) ) ? $this->field['unit'] : 'px';
57
 
58
+ if ( ! empty( $elements ) && isset( $this->value ) && $this->value !== '' ) {
59
+ foreach ( $elements as $key_property => $element ) {
60
+ if ( is_numeric( $key_property ) ) {
61
+ if ( $mode ) {
62
  $output = implode( ',', $elements ) .'{'. $mode .':'. $this->value . $unit . $important .';}';
63
  }
64
  break;
admin/settings/fields/sortable/sortable.php CHANGED
@@ -7,7 +7,7 @@
7
  * @version 1.0.0
8
  *
9
  */
10
- if( ! class_exists( 'CSF_Field_sortable' ) ) {
11
  class CSF_Field_sortable extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
@@ -24,26 +24,26 @@ if( ! class_exists( 'CSF_Field_sortable' ) ) {
24
  $pre_fields = array();
25
 
26
  // Add array-keys to defined fields for sort by
27
- foreach( $this->field['fields'] as $key => $field ) {
28
  $pre_fields[$field['id']] = $field;
29
  }
30
 
31
  // Set sort by by saved-value or default-value
32
- if( ! empty( $this->value ) ) {
33
 
34
- foreach( $this->value as $key => $value ) {
35
  $pre_sortby[$key] = $pre_fields[$key];
36
  }
37
 
38
  } else {
39
 
40
- foreach( $pre_fields as $key => $value ) {
41
  $pre_sortby[$key] = $value;
42
  }
43
 
44
  }
45
 
46
- foreach( $pre_sortby as $key => $field ) {
47
 
48
  echo '<div class="csf--sortable-item">';
49
 
@@ -57,7 +57,7 @@ if( ! class_exists( 'CSF_Field_sortable' ) ) {
57
 
58
  echo '</div>';
59
 
60
- echo '<div class="csf--sortable-helper"><i class="fa fa-arrows"></i></div>';
61
 
62
  echo '</div>';
63
 
@@ -71,7 +71,7 @@ if( ! class_exists( 'CSF_Field_sortable' ) ) {
71
 
72
  public function enqueue() {
73
 
74
- if( ! wp_script_is( 'jquery-ui-sortable' ) ) {
75
  wp_enqueue_script( 'jquery-ui-sortable' );
76
  }
77
 
7
  * @version 1.0.0
8
  *
9
  */
10
+ if ( ! class_exists( 'CSF_Field_sortable' ) ) {
11
  class CSF_Field_sortable extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
24
  $pre_fields = array();
25
 
26
  // Add array-keys to defined fields for sort by
27
+ foreach ( $this->field['fields'] as $key => $field ) {
28
  $pre_fields[$field['id']] = $field;
29
  }
30
 
31
  // Set sort by by saved-value or default-value
32
+ if ( ! empty( $this->value ) ) {
33
 
34
+ foreach ( $this->value as $key => $value ) {
35
  $pre_sortby[$key] = $pre_fields[$key];
36
  }
37
 
38
  } else {
39
 
40
+ foreach ( $pre_fields as $key => $value ) {
41
  $pre_sortby[$key] = $value;
42
  }
43
 
44
  }
45
 
46
+ foreach ( $pre_sortby as $key => $field ) {
47
 
48
  echo '<div class="csf--sortable-item">';
49
 
57
 
58
  echo '</div>';
59
 
60
+ echo '<div class="csf--sortable-helper"><i class="fas fa-arrows-alt"></i></div>';
61
 
62
  echo '</div>';
63
 
71
 
72
  public function enqueue() {
73
 
74
+ if ( ! wp_script_is( 'jquery-ui-sortable' ) ) {
75
  wp_enqueue_script( 'jquery-ui-sortable' );
76
  }
77
 
admin/settings/fields/sorter/sorter.php CHANGED
@@ -7,7 +7,7 @@
7
  * @version 1.0.0
8
  *
9
  */
10
- if( ! class_exists( 'CSF_Field_sorter' ) ) {
11
  class CSF_Field_sorter extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
@@ -30,26 +30,26 @@ if( ! class_exists( 'CSF_Field_sorter' ) ) {
30
 
31
  echo ( $args['disabled'] ) ? '<div class="csf-modules">' : '';
32
 
33
- echo ( ! empty( $args['enabled_title'] ) ) ? '<div class="csf-sorter-title">'. $args['enabled_title'] .'</div>' : '';
34
  echo '<ul class="csf-enabled">';
35
- if( ! empty( $enabled_options ) ) {
36
- foreach( $enabled_options as $key => $value ) {
37
- echo '<li><input type="hidden" name="'. $this->field_name( '[enabled]['. $key .']' ) .'" value="'. $value .'"/><label>'. $value .'</label></li>';
38
  }
39
  }
40
  echo '</ul>';
41
 
42
  // Check for hide/show disabled section
43
- if( $args['disabled'] ) {
44
 
45
  echo '</div>';
46
 
47
  echo '<div class="csf-modules">';
48
- echo ( ! empty( $args['disabled_title'] ) ) ? '<div class="csf-sorter-title">'. $args['disabled_title'] .'</div>' : '';
49
  echo '<ul class="csf-disabled">';
50
- if( ! empty( $disabled_options ) ) {
51
- foreach( $disabled_options as $key => $value ) {
52
- echo '<li><input type="hidden" name="'. $this->field_name( '[disabled]['. $key .']' ) .'" value="'. $value .'"/><label>'. $value .'</label></li>';
53
  }
54
  }
55
  echo '</ul>';
@@ -57,15 +57,13 @@ if( ! class_exists( 'CSF_Field_sorter' ) ) {
57
 
58
  }
59
 
60
- echo '<div class="clear"></div>';
61
-
62
  echo $this->field_after();
63
 
64
  }
65
 
66
  public function enqueue() {
67
 
68
- if( ! wp_script_is( 'jquery-ui-sortable' ) ) {
69
  wp_enqueue_script( 'jquery-ui-sortable' );
70
  }
71
 
7
  * @version 1.0.0
8
  *
9
  */
10
+ if ( ! class_exists( 'CSF_Field_sorter' ) ) {
11
  class CSF_Field_sorter extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
30
 
31
  echo ( $args['disabled'] ) ? '<div class="csf-modules">' : '';
32
 
33
+ echo ( ! empty( $args['enabled_title'] ) ) ? '<div class="csf-sorter-title">'. esc_attr( $args['enabled_title'] ) .'</div>' : '';
34
  echo '<ul class="csf-enabled">';
35
+ if ( ! empty( $enabled_options ) ) {
36
+ foreach ( $enabled_options as $key => $value ) {
37
+ echo '<li><input type="hidden" name="'. esc_attr( $this->field_name( '[enabled]['. $key .']' ) ) .'" value="'. esc_attr( $value ) .'"/><label>'. esc_attr( $value ) .'</label></li>';
38
  }
39
  }
40
  echo '</ul>';
41
 
42
  // Check for hide/show disabled section
43
+ if ( $args['disabled'] ) {
44
 
45
  echo '</div>';
46
 
47
  echo '<div class="csf-modules">';
48
+ echo ( ! empty( $args['disabled_title'] ) ) ? '<div class="csf-sorter-title">'. esc_attr( $args['disabled_title'] ) .'</div>' : '';
49
  echo '<ul class="csf-disabled">';
50
+ if ( ! empty( $disabled_options ) ) {
51
+ foreach ( $disabled_options as $key => $value ) {
52
+ echo '<li><input type="hidden" name="'. esc_attr( $this->field_name( '[disabled]['. $key .']' ) ) .'" value="'. esc_attr( $value ) .'"/><label>'. esc_attr( $value ) .'</label></li>';
53
  }
54
  }
55
  echo '</ul>';
57
 
58
  }
59
 
 
 
60
  echo $this->field_after();
61
 
62
  }
63
 
64
  public function enqueue() {
65
 
66
+ if ( ! wp_script_is( 'jquery-ui-sortable' ) ) {
67
  wp_enqueue_script( 'jquery-ui-sortable' );
68
  }
69
 
admin/settings/fields/spacing/spacing.php CHANGED
@@ -7,7 +7,7 @@
7
  * @version 1.0.0
8
  *
9
  */
10
- if( ! class_exists( 'CSF_Field_spacing' ) ) {
11
  class CSF_Field_spacing extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
@@ -17,11 +17,11 @@ if( ! class_exists( 'CSF_Field_spacing' ) ) {
17
  public function render() {
18
 
19
  $args = wp_parse_args( $this->field, array(
20
- 'top_icon' => '<i class="fa fa-long-arrow-up"></i>',
21
- 'right_icon' => '<i class="fa fa-long-arrow-right"></i>',
22
- 'bottom_icon' => '<i class="fa fa-long-arrow-down"></i>',
23
- 'left_icon' => '<i class="fa fa-long-arrow-left"></i>',
24
- 'all_icon' => '<i class="fa fa-arrows"></i>',
25
  'top_placeholder' => esc_html__( 'top', 'csf' ),
26
  'right_placeholder' => esc_html__( 'right', 'csf' ),
27
  'bottom_placeholder' => esc_html__( 'bottom', 'csf' ),
@@ -54,14 +54,14 @@ if( ! class_exists( 'CSF_Field_spacing' ) ) {
54
 
55
  echo '<div class="csf--inputs">';
56
 
57
- if( ! empty( $args['all'] ) ) {
58
 
59
- $placeholder = ( ! empty( $args['all_placeholder'] ) ) ? ' placeholder="'. $args['all_placeholder'] .'"' : '';
60
 
61
  echo '<div class="csf--input">';
62
- echo ( ! empty( $args['all_icon'] ) ) ? '<span class="csf--label csf--icon">'. $args['all_icon'] .'</span>' : '';
63
- echo '<input type="number" name="'. $this->field_name('[all]') .'" value="'. $value['all'] .'"'. $placeholder .' class="csf-input-number'. $is_unit .'" />';
64
- echo ( $unit ) ? '<span class="csf--label csf--unit">'. $args['units'][0] .'</span>' : '';
65
  echo '</div>';
66
 
67
  } else {
@@ -69,33 +69,33 @@ if( ! class_exists( 'CSF_Field_spacing' ) ) {
69
  $properties = array();
70
 
71
  foreach ( array( 'top', 'right', 'bottom', 'left' ) as $prop ) {
72
- if( ! empty( $args[$prop] ) ) {
73
  $properties[] = $prop;
74
  }
75
  }
76
 
77
  $properties = ( $properties === array( 'right', 'left' ) ) ? array_reverse( $properties ) : $properties;
78
 
79
- foreach( $properties as $property ) {
80
 
81
- $placeholder = ( ! empty( $args[$property.'_placeholder'] ) ) ? ' placeholder="'. $args[$property.'_placeholder'] .'"' : '';
82
 
83
  echo '<div class="csf--input">';
84
- echo ( ! empty( $args[$property.'_icon'] ) ) ? '<span class="csf--label csf--icon">'. $args[$property.'_icon'] .'</span>' : '';
85
- echo '<input type="number" name="'. $this->field_name('['. $property .']') .'" value="'. $value[$property] .'"'. $placeholder .' class="csf-input-number'. $is_unit .'" />';
86
- echo ( $unit ) ? '<span class="csf--label csf--unit">'. $args['units'][0] .'</span>' : '';
87
  echo '</div>';
88
 
89
  }
90
 
91
  }
92
 
93
- if( ! empty( $args['unit'] ) && ! empty( $args['show_units'] ) && count( $args['units'] ) > 1 ) {
94
  echo '<div class="csf--input">';
95
- echo '<select name="'. $this->field_name('[unit]') .'">';
96
- foreach( $args['units'] as $unit ) {
97
  $selected = ( $value['unit'] === $unit ) ? ' selected' : '';
98
- echo '<option value="'. $unit .'"'. $selected .'>'. $unit .'</option>';
99
  }
100
  echo '</select>';
101
  echo '</div>';
@@ -118,7 +118,7 @@ if( ! class_exists( 'CSF_Field_spacing' ) ) {
118
  $mode = ( $mode === 'relative' || $mode === 'absolute' || $mode === 'none' ) ? '' : $mode;
119
  $mode = ( ! empty( $mode ) ) ? $mode .'-' : '';
120
 
121
- if( ! empty( $this->field['all'] ) && isset( $this->value['all'] ) && $this->value['all'] !== '' ) {
122
 
123
  $output = $element .'{';
124
  $output .= $mode .'top:'. $this->value['all'] . $unit . $important .';';
@@ -134,7 +134,7 @@ if( ! class_exists( 'CSF_Field_spacing' ) ) {
134
  $bottom = ( isset( $this->value['bottom'] ) && $this->value['bottom'] !== '' ) ? $mode .'bottom:'. $this->value['bottom'] . $unit . $important .';' : '';
135
  $left = ( isset( $this->value['left'] ) && $this->value['left'] !== '' ) ? $mode .'left:'. $this->value['left'] . $unit . $important .';' : '';
136
 
137
- if( $top !== '' || $right !== '' || $bottom !== '' || $left !== '' ) {
138
  $output = $element .'{'. $top . $right . $bottom . $left .'}';
139
  }
140
 
7
  * @version 1.0.0
8
  *
9
  */
10
+ if ( ! class_exists( 'CSF_Field_spacing' ) ) {
11
  class CSF_Field_spacing extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
17
  public function render() {
18
 
19
  $args = wp_parse_args( $this->field, array(
20
+ 'top_icon' => '<i class="fas fa-long-arrow-alt-up"></i>',
21
+ 'right_icon' => '<i class="fas fa-long-arrow-alt-right"></i>',
22
+ 'bottom_icon' => '<i class="fas fa-long-arrow-alt-down"></i>',
23
+ 'left_icon' => '<i class="fas fa-long-arrow-alt-left"></i>',
24
+ 'all_icon' => '<i class="fas fa-arrows-alt"></i>',
25
  'top_placeholder' => esc_html__( 'top', 'csf' ),
26
  'right_placeholder' => esc_html__( 'right', 'csf' ),
27
  'bottom_placeholder' => esc_html__( 'bottom', 'csf' ),
54
 
55
  echo '<div class="csf--inputs">';
56
 
57
+ if ( ! empty( $args['all'] ) ) {
58
 
59
+ $placeholder = ( ! empty( $args['all_placeholder'] ) ) ? ' placeholder="'. esc_attr( $args['all_placeholder'] ) .'"' : '';
60
 
61
  echo '<div class="csf--input">';
62
+ echo ( ! empty( $args['all_icon'] ) ) ? '<span class="csf--label csf--icon">'. wp_kses_post( $args['all_icon'] ) .'</span>' : '';
63
+ echo '<input type="number" name="'. esc_attr( $this->field_name( '[all]' ) ) .'" value="'. esc_attr( $value['all'] ) .'"'. $placeholder .' class="csf-input-number'. esc_attr( $is_unit ) .'" />';
64
+ echo ( $unit ) ? '<span class="csf--label csf--unit">'. esc_attr( $args['units'][0] ) .'</span>' : '';
65
  echo '</div>';
66
 
67
  } else {
69
  $properties = array();
70
 
71
  foreach ( array( 'top', 'right', 'bottom', 'left' ) as $prop ) {
72
+ if ( ! empty( $args[$prop] ) ) {
73
  $properties[] = $prop;
74
  }
75
  }
76
 
77
  $properties = ( $properties === array( 'right', 'left' ) ) ? array_reverse( $properties ) : $properties;
78
 
79
+ foreach ( $properties as $property ) {
80
 
81
+ $placeholder = ( ! empty( $args[$property.'_placeholder'] ) ) ? ' placeholder="'. esc_attr( $args[$property.'_placeholder'] ) .'"' : '';
82
 
83
  echo '<div class="csf--input">';
84
+ echo ( ! empty( $args[$property.'_icon'] ) ) ? '<span class="csf--label csf--icon">'. wp_kses_post( $args[$property.'_icon'] ) .'</span>' : '';
85
+ echo '<input type="number" name="'. esc_attr( $this->field_name( '['. $property .']' ) ) .'" value="'. esc_attr( $value[$property] ) .'"'. $placeholder .' class="csf-input-number'. esc_attr( $is_unit ) .'" />';
86
+ echo ( $unit ) ? '<span class="csf--label csf--unit">'. esc_attr( $args['units'][0] ) .'</span>' : '';
87
  echo '</div>';
88
 
89
  }
90
 
91
  }
92
 
93
+ if ( ! empty( $args['unit'] ) && ! empty( $args['show_units'] ) && count( $args['units'] ) > 1 ) {
94
  echo '<div class="csf--input">';
95
+ echo '<select name="'. esc_attr( $this->field_name( '[unit]' ) ) .'">';
96
+ foreach ( $args['units'] as $unit ) {
97
  $selected = ( $value['unit'] === $unit ) ? ' selected' : '';
98
+ echo '<option value="'. esc_attr( $unit ) .'"'. esc_attr( $selected ) .'>'. esc_attr( $unit ) .'</option>';
99
  }
100
  echo '</select>';
101
  echo '</div>';
118
  $mode = ( $mode === 'relative' || $mode === 'absolute' || $mode === 'none' ) ? '' : $mode;
119
  $mode = ( ! empty( $mode ) ) ? $mode .'-' : '';
120
 
121
+ if ( ! empty( $this->field['all'] ) && isset( $this->value['all'] ) && $this->value['all'] !== '' ) {
122
 
123
  $output = $element .'{';
124
  $output .= $mode .'top:'. $this->value['all'] . $unit . $important .';';
134
  $bottom = ( isset( $this->value['bottom'] ) && $this->value['bottom'] !== '' ) ? $mode .'bottom:'. $this->value['bottom'] . $unit . $important .';' : '';
135
  $left = ( isset( $this->value['left'] ) && $this->value['left'] !== '' ) ? $mode .'left:'. $this->value['left'] . $unit . $important .';' : '';
136
 
137
+ if ( $top !== '' || $right !== '' || $bottom !== '' || $left !== '' ) {
138
  $output = $element .'{'. $top . $right . $bottom . $left .'}';
139
  }
140
 
admin/settings/fields/spinner/spinner.php CHANGED
@@ -7,7 +7,7 @@
7
  * @version 1.0.0
8
  *
9
  */
10
- if( ! class_exists( 'CSF_Field_spinner' ) ) {
11
  class CSF_Field_spinner extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
@@ -24,14 +24,16 @@ if( ! class_exists( 'CSF_Field_spinner' ) ) {
24
  ) );
25
 
26
  echo $this->field_before();
27
- echo '<div class="csf--spin"><input type="number" name="'. $this->field_name() .'" value="'. $this->value .'"'. $this->field_attributes( array( 'class' => 'csf-input-number' ) ) .' data-max="'. $args['max'] .'" data-min="'. $args['min'] .'" data-step="'. $args['step'] .'" data-unit="'. $args['unit'] .'"/></div>';
 
 
28
  echo $this->field_after();
29
 
30
  }
31
 
32
  public function enqueue() {
33
 
34
- if( ! wp_script_is( 'jquery-ui-spinner' ) ) {
35
  wp_enqueue_script( 'jquery-ui-spinner' );
36
  }
37
 
@@ -45,10 +47,10 @@ if( ! class_exists( 'CSF_Field_spinner' ) ) {
45
  $mode = ( ! empty( $this->field['output_mode'] ) ) ? $this->field['output_mode'] : 'width';
46
  $unit = ( ! empty( $this->field['unit'] ) ) ? $this->field['unit'] : 'px';
47
 
48
- if( ! empty( $elements ) && isset( $this->value ) && $this->value !== '' ) {
49
- foreach( $elements as $key_property => $element ) {
50
- if( is_numeric( $key_property ) ) {
51
- if( $mode ) {
52
  $output = implode( ',', $elements ) .'{'. $mode .':'. $this->value . $unit . $important .';}';
53
  }
54
  break;
7
  * @version 1.0.0
8
  *
9
  */
10
+ if ( ! class_exists( 'CSF_Field_spinner' ) ) {
11
  class CSF_Field_spinner extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
24
  ) );
25
 
26
  echo $this->field_before();
27
+
28
+ echo '<div class="csf--spin"><input type="number" name="'. esc_attr( $this->field_name() ) .'" value="'. esc_attr( $this->value ) .'"'. $this->field_attributes( array( 'class' => 'csf-input-number' ) ) .' data-max="'. esc_attr( $args['max'] ) .'" data-min="'. esc_attr( $args['min'] ) .'" data-step="'. esc_attr( $args['step'] ) .'" data-unit="'. esc_attr( $args['unit'] ) .'"/></div>';
29
+
30
  echo $this->field_after();
31
 
32
  }
33
 
34
  public function enqueue() {
35
 
36
+ if ( ! wp_script_is( 'jquery-ui-spinner' ) ) {
37
  wp_enqueue_script( 'jquery-ui-spinner' );
38
  }
39
 
47
  $mode = ( ! empty( $this->field['output_mode'] ) ) ? $this->field['output_mode'] : 'width';
48
  $unit = ( ! empty( $this->field['unit'] ) ) ? $this->field['unit'] : 'px';
49
 
50
+ if ( ! empty( $elements ) && isset( $this->value ) && $this->value !== '' ) {
51
+ foreach ( $elements as $key_property => $element ) {
52
+ if ( is_numeric( $key_property ) ) {
53
+ if ( $mode ) {
54
  $output = implode( ',', $elements ) .'{'. $mode .':'. $this->value . $unit . $important .';}';
55
  }
56
  break;
admin/settings/fields/subheading/subheading.php CHANGED
@@ -7,7 +7,7 @@
7
  * @version 1.0.0
8
  *
9
  */
10
- if( ! class_exists( 'CSF_Field_subheading' ) ) {
11
  class CSF_Field_subheading extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
@@ -16,7 +16,7 @@ if( ! class_exists( 'CSF_Field_subheading' ) ) {
16
 
17
  public function render() {
18
 
19
- echo ( ! empty( $this->field['content'] ) ) ? $this->field['content'] : '';
20
 
21
  }
22
 
7
  * @version 1.0.0
8
  *
9
  */
10
+ if ( ! class_exists( 'CSF_Field_subheading' ) ) {
11
  class CSF_Field_subheading extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
16
 
17
  public function render() {
18
 
19
+ echo ( ! empty( $this->field['content'] ) ) ? wp_kses_post( $this->field['content'] ) : '';
20
 
21
  }
22
 
admin/settings/fields/submessage/submessage.php CHANGED
@@ -7,7 +7,7 @@
7
  * @version 1.0.0
8
  *
9
  */
10
- if( ! class_exists( 'CSF_Field_submessage' ) ) {
11
  class CSF_Field_submessage extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
@@ -18,7 +18,7 @@ if( ! class_exists( 'CSF_Field_submessage' ) ) {
18
 
19
  $style = ( ! empty( $this->field['style'] ) ) ? $this->field['style'] : 'normal';
20
 
21
- echo '<div class="csf-submessage csf-submessage-'. $style .'">'. $this->field['content'] .'</div>';
22
 
23
  }
24
 
7
  * @version 1.0.0
8
  *
9
  */
10
+ if ( ! class_exists( 'CSF_Field_submessage' ) ) {
11
  class CSF_Field_submessage extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
18
 
19
  $style = ( ! empty( $this->field['style'] ) ) ? $this->field['style'] : 'normal';
20
 
21
+ echo '<div class="csf-submessage csf-submessage-'. esc_attr( $style ) .'">'. wp_kses_post( $this->field['content'] ) .'</div>';
22
 
23
  }
24
 
admin/settings/fields/switcher/switcher.php CHANGED
@@ -7,7 +7,7 @@
7
  * @version 1.0.0
8
  *
9
  */
10
- if( ! class_exists( 'CSF_Field_switcher' ) ) {
11
  class CSF_Field_switcher extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
@@ -19,20 +19,18 @@ if( ! class_exists( 'CSF_Field_switcher' ) ) {
19
  $active = ( ! empty( $this->value ) ) ? ' csf--active' : '';
20
  $text_on = ( ! empty( $this->field['text_on'] ) ) ? $this->field['text_on'] : esc_html__( 'On', 'csf' );
21
  $text_off = ( ! empty( $this->field['text_off'] ) ) ? $this->field['text_off'] : esc_html__( 'Off', 'csf' );
22
- $text_width = ( ! empty( $this->field['text_width'] ) ) ? ' style="width: '. $this->field['text_width'] .'px;"': '';
23
 
24
  echo $this->field_before();
25
 
26
- echo '<div class="csf--switcher'. $active .'"'. $text_width .'>';
27
- echo '<span class="csf--on">'. $text_on .'</span>';
28
- echo '<span class="csf--off">'. $text_off .'</span>';
29
  echo '<span class="csf--ball"></span>';
30
- echo '<input type="text" name="'. $this->field_name() .'" value="'. $this->value .'"'. $this->field_attributes() .' />';
31
  echo '</div>';
32
 
33
- echo ( ! empty( $this->field['label'] ) ) ? '<span class="csf--label">'. $this->field['label'] . '</span>' : '';
34
-
35
- echo '<div class="clear"></div>';
36
 
37
  echo $this->field_after();
38
 
7
  * @version 1.0.0
8
  *
9
  */
10
+ if ( ! class_exists( 'CSF_Field_switcher' ) ) {
11
  class CSF_Field_switcher extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
19
  $active = ( ! empty( $this->value ) ) ? ' csf--active' : '';
20
  $text_on = ( ! empty( $this->field['text_on'] ) ) ? $this->field['text_on'] : esc_html__( 'On', 'csf' );
21
  $text_off = ( ! empty( $this->field['text_off'] ) ) ? $this->field['text_off'] : esc_html__( 'Off', 'csf' );
22
+ $text_width = ( ! empty( $this->field['text_width'] ) ) ? ' style="width: '. esc_attr( $this->field['text_width'] ) .'px;"': '';
23
 
24
  echo $this->field_before();
25
 
26
+ echo '<div class="csf--switcher'. esc_attr( $active ) .'"'. $text_width .'>';
27
+ echo '<span class="csf--on">'. esc_attr( $text_on ) .'</span>';
28
+ echo '<span class="csf--off">'. esc_attr( $text_off ) .'</span>';
29
  echo '<span class="csf--ball"></span>';
30
+ echo '<input type="text" name="'. esc_attr( $this->field_name() ) .'" value="'. esc_attr( $this->value ) .'"'. $this->field_attributes() .' />';
31
  echo '</div>';
32
 
33
+ echo ( ! empty( $this->field['label'] ) ) ? '<span class="csf--label">'. esc_attr( $this->field['label'] ) . '</span>' : '';
 
 
34
 
35
  echo $this->field_after();
36
 
admin/settings/fields/tabbed/tabbed.php CHANGED
@@ -7,7 +7,7 @@
7
  * @version 1.0.0
8
  *
9
  */
10
- if( ! class_exists( 'CSF_Field_tabbed' ) ) {
11
  class CSF_Field_tabbed extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
@@ -23,10 +23,10 @@ if( ! class_exists( 'CSF_Field_tabbed' ) ) {
23
  echo '<div class="csf-tabbed-nav">';
24
  foreach ( $this->field['tabs'] as $key => $tab ) {
25
 
26
- $tabbed_icon = ( ! empty( $tab['icon'] ) ) ? '<i class="csf--icon '. $tab['icon'] .'"></i>' : '';
27
- $tabbed_active = ( empty( $key ) ) ? ' class="csf-tabbed-active"' : '';
28
 
29
- echo '<a href="#"'. $tabbed_active .'>'. $tabbed_icon . $tab['title'] .'</a>';
30
 
31
  }
32
  echo '</div>';
@@ -36,11 +36,11 @@ if( ! class_exists( 'CSF_Field_tabbed' ) ) {
36
 
37
  $tabbed_hidden = ( ! empty( $key ) ) ? ' hidden' : '';
38
 
39
- echo '<div class="csf-tabbed-section'. $tabbed_hidden .'">';
40
 
41
  foreach ( $tab['fields'] as $field ) {
42
 
43
- if( in_array( $field['type'], $unallows ) ) { $field['_notice'] = true; }
44
 
45
  $field_id = ( isset( $field['id'] ) ) ? $field['id'] : '';
46
  $field_default = ( isset( $field['default'] ) ) ? $field['default'] : '';
7
  * @version 1.0.0
8
  *
9
  */
10
+ if ( ! class_exists( 'CSF_Field_tabbed' ) ) {
11
  class CSF_Field_tabbed extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
23
  echo '<div class="csf-tabbed-nav">';
24
  foreach ( $this->field['tabs'] as $key => $tab ) {
25
 
26
+ $tabbed_icon = ( ! empty( $tab['icon'] ) ) ? '<i class="csf--icon '. esc_attr( $tab['icon'] ) .'"></i>' : '';
27
+ $tabbed_active = ( empty( $key ) ) ? 'csf-tabbed-active' : '';
28
 
29
+ echo '<a href="#" class="'. esc_attr( $tabbed_active ) .'"">'. $tabbed_icon . esc_attr( $tab['title'] ) .'</a>';
30
 
31
  }
32
  echo '</div>';
36
 
37
  $tabbed_hidden = ( ! empty( $key ) ) ? ' hidden' : '';
38
 
39
+ echo '<div class="csf-tabbed-section'. esc_attr( $tabbed_hidden ) .'">';
40
 
41
  foreach ( $tab['fields'] as $field ) {
42
 
43
+ if ( in_array( $field['type'], $unallows ) ) { $field['_notice'] = true; }
44
 
45
  $field_id = ( isset( $field['id'] ) ) ? $field['id'] : '';
46
  $field_default = ( isset( $field['default'] ) ) ? $field['default'] : '';
admin/settings/fields/text/text.php CHANGED
@@ -7,7 +7,7 @@
7
  * @version 1.0.0
8
  *
9
  */
10
- if( ! class_exists( 'CSF_Field_text' ) ) {
11
  class CSF_Field_text extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
@@ -20,7 +20,7 @@ if( ! class_exists( 'CSF_Field_text' ) ) {
20
 
21
  echo $this->field_before();
22
 
23
- echo '<input type="'. $type .'" name="'. $this->field_name() .'" value="'. $this->value .'"'. $this->field_attributes() .' />';
24
 
25
  echo $this->field_after();
26
 
7
  * @version 1.0.0
8
  *
9
  */
10
+ if ( ! class_exists( 'CSF_Field_text' ) ) {
11
  class CSF_Field_text extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
20
 
21
  echo $this->field_before();
22
 
23
+ echo '<input type="'. esc_attr( $type ) .'" name="'. esc_attr( $this->field_name() ) .'" value="'. esc_attr( $this->value ) .'"'. $this->field_attributes() .' />';
24
 
25
  echo $this->field_after();
26
 
admin/settings/fields/textarea/textarea.php CHANGED
@@ -7,7 +7,7 @@
7
  * @version 1.0.0
8
  *
9
  */
10
- if( ! class_exists( 'CSF_Field_textarea' ) ) {
11
  class CSF_Field_textarea extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
@@ -18,25 +18,25 @@ if( ! class_exists( 'CSF_Field_textarea' ) ) {
18
 
19
  echo $this->field_before();
20
  echo $this->shortcoder();
21
- echo '<textarea name="'. $this->field_name() .'"'. $this->field_attributes() .'>'. $this->value .'</textarea>';
22
  echo $this->field_after();
23
 
24
  }
25
 
26
  public function shortcoder() {
27
 
28
- if( ! empty( $this->field['shortcoder'] ) ) {
29
 
30
  $shortcoders = ( is_array( $this->field['shortcoder'] ) ) ? $this->field['shortcoder'] : array_filter( (array) $this->field['shortcoder'] );
31
 
32
- foreach( $shortcoders as $shortcode_id ) {
33
 
34
- if( isset( CSF::$args['shortcoders'][$shortcode_id] ) ) {
35
 
36
  $setup_args = CSF::$args['shortcoders'][$shortcode_id];
37
  $button_title = ( ! empty( $setup_args['button_title'] ) ) ? $setup_args['button_title'] : esc_html__( 'Add Shortcode', 'csf' );
38
 
39
- echo '<a href="#" class="button button-primary csf-shortcode-button" data-modal-id="'. $shortcode_id .'">'. $button_title .'</a>';
40
 
41
  }
42
 
7
  * @version 1.0.0
8
  *
9
  */
10
+ if ( ! class_exists( 'CSF_Field_textarea' ) ) {
11
  class CSF_Field_textarea extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
18
 
19
  echo $this->field_before();
20
  echo $this->shortcoder();
21
+ echo '<textarea name="'. esc_attr( $this->field_name() ) .'"'. $this->field_attributes() .'>'. $this->value .'</textarea>';
22
  echo $this->field_after();
23
 
24
  }
25
 
26
  public function shortcoder() {
27
 
28
+ if ( ! empty( $this->field['shortcoder'] ) ) {
29
 
30
  $shortcoders = ( is_array( $this->field['shortcoder'] ) ) ? $this->field['shortcoder'] : array_filter( (array) $this->field['shortcoder'] );
31
 
32
+ foreach ( $shortcoders as $shortcode_id ) {
33
 
34
+ if ( isset( CSF::$args['shortcoders'][$shortcode_id] ) ) {
35
 
36
  $setup_args = CSF::$args['shortcoders'][$shortcode_id];
37
  $button_title = ( ! empty( $setup_args['button_title'] ) ) ? $setup_args['button_title'] : esc_html__( 'Add Shortcode', 'csf' );
38
 
39
+ echo '<a href="#" class="button button-primary csf-shortcode-button" data-modal-id="'. esc_attr( $shortcode_id ) .'">'. wp_kses_post( $button_title ) .'</a>';
40
 
41
  }
42
 
admin/settings/fields/typography/google-fonts.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
 
3
- if( ! function_exists( 'csf_get_google_fonts' ) ) {
4
  function csf_get_google_fonts() {
5
  return [
6
  'ABeeZee'=>[['normal','italic'],['latin']],
1
  <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
 
3
+ if ( ! function_exists( 'csf_get_google_fonts' ) ) {
4
  function csf_get_google_fonts() {
5
  return [
6
  'ABeeZee'=>[['normal','italic'],['latin']],
admin/settings/fields/typography/typography.php CHANGED
@@ -7,7 +7,7 @@
7
  * @version 1.0.0
8
  *
9
  */
10
- if( ! class_exists( 'CSF_Field_typography' ) ) {
11
  class CSF_Field_typography extends CSF_Fields {
12
 
13
  public $chosen = false;
@@ -44,6 +44,7 @@ if( ! class_exists( 'CSF_Field_typography' ) ) {
44
  'custom_style' => false,
45
  'exclude' => '',
46
  'unit' => 'px',
 
47
  'preview_text' => 'The quick brown fox jumps over the lazy dog',
48
  ) );
49
 
@@ -67,18 +68,19 @@ if( ! class_exists( 'CSF_Field_typography' ) ) {
67
  'extra-styles' => array(),
68
  );
69
 
70
- $default_value = ( ! empty( $this->field['default'] ) ) ? wp_parse_args( $this->field['default'], $default_value ) : $default_value;
71
- $this->value = wp_parse_args( $this->value, $default_value );
72
- $this->chosen = $args['chosen'];
73
- $chosen_class = ( $this->chosen ) ? ' csf--chosen' : '';
 
74
 
75
- echo '<div class="csf--typography'. $chosen_class .'" data-unit="'. $args['unit'] .'" data-exclude="'. $args['exclude'] .'">';
76
 
77
  echo '<div class="csf--blocks csf--blocks-selects">';
78
 
79
  //
80
  // Font Family
81
- if( ! empty( $args['font_family'] ) ) {
82
  echo '<div class="csf--block">';
83
  echo '<div class="csf--title">'. esc_html__( 'Font Family', 'csf' ) .'</div>';
84
  echo $this->create_select( array( $this->value['font-family'] => $this->value['font-family'] ), 'font-family', esc_html__( 'Select a font', 'csf' ) );
@@ -87,7 +89,7 @@ if( ! class_exists( 'CSF_Field_typography' ) ) {
87
 
88
  //
89
  // Backup Font Family
90
- if( ! empty( $args['backup_font_family'] ) ) {
91
  echo '<div class="csf--block csf--block-backup-font-family hidden">';
92
  echo '<div class="csf--title">'. esc_html__( 'Backup Font Family', 'csf' ) .'</div>';
93
  echo $this->create_select( apply_filters( 'csf_field_typography_backup_font_family', array(
@@ -109,7 +111,7 @@ if( ! class_exists( 'CSF_Field_typography' ) ) {
109
 
110
  //
111
  // Font Style and Extra Style Select
112
- if( ! empty( $args['font_weight'] ) || ! empty( $args['font_style'] ) ) {
113
 
114
  //
115
  // Font Style Select
@@ -117,16 +119,16 @@ if( ! class_exists( 'CSF_Field_typography' ) ) {
117
  echo '<div class="csf--title">'. esc_html__( 'Font Style', 'csf') .'</div>';
118
  echo '<select class="csf--font-style-select" data-placeholder="Default">';
119
  echo '<option value="">'. ( ! $this->chosen ? esc_html__( 'Default', 'csf' ) : '' ) .'</option>';
120
- if( ! empty( $this->value['font-weight'] ) || ! empty( $this->value['font-style'] ) ) {
121
- echo '<option value="'. strtolower( $this->value['font-weight'] . $this->value['font-style'] ) .'" selected></option>';
122
  }
123
  echo '</select>';
124
- echo '<input type="hidden" name="'. $this->field_name( '[font-weight]' ) .'" class="csf--font-weight" value="'. $this->value['font-weight'] .'" />';
125
- echo '<input type="hidden" name="'. $this->field_name( '[font-style]' ) .'" class="csf--font-style" value="'. $this->value['font-style'] .'" />';
126
 
127
  //
128
  // Extra Font Style Select
129
- if( ! empty( $args['extra_styles'] ) ) {
130
  echo '<div class="csf--block-extra-styles hidden">';
131
  echo ( ! $this->chosen ) ? '<div class="csf--title">'. esc_html__( 'Load Extra Styles', 'csf' ) .'</div>' : '';
132
  $placeholder = ( $this->chosen ) ? esc_html__( 'Load Extra Styles', 'csf' ) : esc_html__( 'Default', 'csf' );
@@ -140,7 +142,7 @@ if( ! class_exists( 'CSF_Field_typography' ) ) {
140
 
141
  //
142
  // Subset
143
- if( ! empty( $args['subset'] ) ) {
144
  echo '<div class="csf--block csf--block-subset hidden">';
145
  echo '<div class="csf--title">'. esc_html__( 'Subset', 'csf' ) .'</div>';
146
  $subset = ( is_array( $this->value['subset'] ) ) ? $this->value['subset'] : array_filter( (array) $this->value['subset'] );
@@ -150,7 +152,7 @@ if( ! class_exists( 'CSF_Field_typography' ) ) {
150
 
151
  //
152
  // Text Align
153
- if( ! empty( $args['text_align'] ) ) {
154
  echo '<div class="csf--block">';
155
  echo '<div class="csf--title">'. esc_html__( 'Text Align', 'csf' ) .'</div>';
156
  echo $this->create_select( array(
@@ -166,7 +168,7 @@ if( ! class_exists( 'CSF_Field_typography' ) ) {
166
 
167
  //
168
  // Font Variant
169
- if( ! empty( $args['font_variant'] ) ) {
170
  echo '<div class="csf--block">';
171
  echo '<div class="csf--title">'. esc_html__( 'Font Variant', 'csf' ) .'</div>';
172
  echo $this->create_select( array(
@@ -179,7 +181,7 @@ if( ! class_exists( 'CSF_Field_typography' ) ) {
179
 
180
  //
181
  // Text Transform
182
- if( ! empty( $args['text_transform'] ) ) {
183
  echo '<div class="csf--block">';
184
  echo '<div class="csf--title">'. esc_html__( 'Text Transform', 'csf' ) .'</div>';
185
  echo $this->create_select( array(
@@ -193,7 +195,7 @@ if( ! class_exists( 'CSF_Field_typography' ) ) {
193
 
194
  //
195
  // Text Decoration
196
- if( ! empty( $args['text_decoration'] ) ) {
197
  echo '<div class="csf--block">';
198
  echo '<div class="csf--title">'. esc_html__( 'Text Decoration', 'csf' ) .'</div>';
199
  echo $this->create_select( array(
@@ -215,48 +217,48 @@ if( ! class_exists( 'CSF_Field_typography' ) ) {
215
 
216
  //
217
  // Font Size
218
- if( ! empty( $args['font_size'] ) ) {
219
  echo '<div class="csf--block">';
220
  echo '<div class="csf--title">'. esc_html__( 'Font Size', 'csf' ) .'</div>';
221
  echo '<div class="csf--input-wrap">';
222
- echo '<input type="number" name="'. $this->field_name( '[font-size]' ) .'" class="csf--font-size csf--input csf-input-number" value="'. $this->value['font-size'] .'" />';
223
- echo '<span class="csf--unit">'. $args['unit'] .'</span>';
224
  echo '</div>';
225
  echo '</div>';
226
  }
227
 
228
  //
229
  // Line Height
230
- if( ! empty( $args['line_height'] ) ) {
231
  echo '<div class="csf--block">';
232
  echo '<div class="csf--title">'. esc_html__( 'Line Height', 'csf' ) .'</div>';
233
  echo '<div class="csf--input-wrap">';
234
- echo '<input type="number" name="'. $this->field_name( '[line-height]' ) .'" class="csf--line-height csf--input csf-input-number" value="'. $this->value['line-height'] .'" />';
235
- echo '<span class="csf--unit">'. $args['unit'] .'</span>';
236
  echo '</div>';
237
  echo '</div>';
238
  }
239
 
240
  //
241
  // Letter Spacing
242
- if( ! empty( $args['letter_spacing'] ) ) {
243
  echo '<div class="csf--block">';
244
  echo '<div class="csf--title">'. esc_html__( 'Letter Spacing', 'csf' ) .'</div>';
245
  echo '<div class="csf--input-wrap">';
246
- echo '<input type="number" name="'. $this->field_name( '[letter-spacing]' ) .'" class="csf--letter-spacing csf--input csf-input-number" value="'. $this->value['letter-spacing'] .'" />';
247
- echo '<span class="csf--unit">'. $args['unit'] .'</span>';
248
  echo '</div>';
249
  echo '</div>';
250
  }
251
 
252
  //
253
  // Word Spacing
254
- if( ! empty( $args['word_spacing'] ) ) {
255
  echo '<div class="csf--block">';
256
  echo '<div class="csf--title">'. esc_html__( 'Word Spacing', 'csf' ) .'</div>';
257
  echo '<div class="csf--input-wrap">';
258
- echo '<input type="number" name="'. $this->field_name( '[word-spacing]' ) .'" class="csf--word-spacing csf--input csf-input-number" value="'. $this->value['word-spacing'] .'" />';
259
- echo '<span class="csf--unit">'. $args['unit'] .'</span>';
260
  echo '</div>';
261
  echo '</div>';
262
  }
@@ -265,22 +267,22 @@ if( ! class_exists( 'CSF_Field_typography' ) ) {
265
 
266
  //
267
  // Font Color
268
- if( ! empty( $args['color'] ) ) {
269
- $default_color_attr = ( ! empty( $default_value['color'] ) ) ? ' data-default-color="'. $default_value['color'] .'"' : '';
270
  echo '<div class="csf--block csf--block-font-color">';
271
  echo '<div class="csf--title">'. esc_html__( 'Font Color', 'csf' ) .'</div>';
272
  echo '<div class="csf-field-color">';
273
- echo '<input type="text" name="'. $this->field_name( '[color]' ) .'" class="csf-color csf--color" value="'. $this->value['color'] .'"'. $default_color_attr .' />';
274
  echo '</div>';
275
  echo '</div>';
276
  }
277
 
278
  //
279
  // Custom style
280
- if( ! empty( $args['custom_style'] ) ) {
281
  echo '<div class="csf--block csf--block-custom-style">';
282
  echo '<div class="csf--title">'. esc_html__( 'Custom Style', 'csf' ) .'</div>';
283
- echo '<textarea name="'. $this->field_name( '[custom-style]' ) .'" class="csf--custom-style">'. $this->value['custom-style'] .'</textarea>';
284
  echo '</div>';
285
  }
286
 
@@ -288,15 +290,15 @@ if( ! class_exists( 'CSF_Field_typography' ) ) {
288
  // Preview
289
  $always_preview = ( $args['preview'] !== 'always' ) ? ' hidden' : '';
290
 
291
- if( ! empty( $args['preview'] ) ) {
292
- echo '<div class="csf--block csf--block-preview'. $always_preview .'">';
293
- echo '<div class="csf--toggle fa fa-toggle-off"></div>';
294
- echo '<div class="csf--preview">'. $args['preview_text'] .'</div>';
295
  echo '</div>';
296
  }
297
 
298
- echo '<input type="hidden" name="'. $this->field_name( '[type]' ) .'" class="csf--type" value="'. $this->value['type'] .'" />';
299
- echo '<input type="hidden" name="'. $this->field_name( '[unit]' ) .'" class="csf--unit-save" value="'. $args['unit'] .'" />';
300
 
301
  echo '</div>';
302
 
@@ -310,18 +312,18 @@ if( ! class_exists( 'CSF_Field_typography' ) ) {
310
  $multiple_attr = ( $is_multiple ) ? ' multiple data-multiple="true"' : '';
311
  $chosen_rtl = ( $this->chosen && is_rtl() ) ? ' chosen-rtl' : '';
312
 
313
- $output = '<select name="'. $this->field_name( '['. $name .']'. $multiple_name ) .'" class="csf--'. $name . $chosen_rtl .'" data-placeholder="'. $placeholder .'"'. $multiple_attr .'>';
314
- $output .= ( ! empty( $placeholder ) ) ? '<option value="">'. ( ( ! $this->chosen ) ? $placeholder : '' ) .'</option>' : '';
315
 
316
- if( ! empty( $options ) ) {
317
  foreach ( $options as $option_key => $option_value ) {
318
- if( $is_multiple ) {
319
  $selected = ( in_array( $option_value, $this->value[$name] ) ) ? ' selected' : '';
320
- $output .= '<option value="'. $option_value .'"'. $selected .'>'. $option_value .'</option>';
321
  } else {
322
  $option_key = ( is_numeric( $option_key ) ) ? $option_value : $option_key;
323
  $selected = ( $option_key === $this->value[$name] ) ? ' selected' : '';
324
- $output .= '<option value="'. $option_key .'"'. $selected .'>'. $option_value .'</option>';
325
  }
326
  }
327
  }
@@ -334,17 +336,17 @@ if( ! class_exists( 'CSF_Field_typography' ) ) {
334
 
335
  public function enqueue() {
336
 
337
- if( ! wp_style_is( 'csf-webfont-loader' ) ) {
338
 
339
  CSF::include_plugin_file( 'fields/typography/google-fonts.php' );
340
 
341
- wp_enqueue_script( 'csf-webfont-loader', 'https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js', array( 'csf' ), '1.6.28', true );
342
 
343
  $webfonts = array();
344
 
345
  $customwebfonts = apply_filters( 'csf_field_typography_customwebfonts', array() );
346
 
347
- if( ! empty( $customwebfonts ) ) {
348
  $webfonts['custom'] = array(
349
  'label' => esc_html__( 'Custom Web Fonts', 'csf' ),
350
  'fonts' => $customwebfonts
@@ -417,35 +419,35 @@ if( ! class_exists( 'CSF_Field_typography' ) ) {
417
  $families = array();
418
  $is_google = false;
419
 
420
- if( ! empty( $this->value['type'] ) ) {
421
  $is_google = ( $this->value['type'] === 'google' ) ? true : false;
422
  } else {
423
  CSF::include_plugin_file( 'fields/typography/google-fonts.php' );
424
  $is_google = ( array_key_exists( $this->value['font-family'], csf_get_google_fonts() ) ) ? true : false;
425
  }
426
 
427
- if( $is_google ) {
428
 
429
  // set style
430
  $font_weight = ( ! empty( $value['font-weight'] ) ) ? $value['font-weight'] : '';
431
  $font_style = ( ! empty( $value['font-style'] ) ) ? $value['font-style'] : '';
432
 
433
- if( $font_weight || $font_style ) {
434
  $style = $font_weight . $font_style;
435
  $families['style'][$style] = $style;
436
  }
437
 
438
  // set extra styles
439
- if( ! empty( $value['extra-styles'] ) ) {
440
- foreach( $value['extra-styles'] as $extra_style ) {
441
  $families['style'][$extra_style] = $extra_style;
442
  }
443
  }
444
 
445
  // set subsets
446
- if( ! empty( $value['subset'] ) ) {
447
  $value['subset'] = ( is_array( $value['subset'] ) ) ? $value['subset'] : array_filter( (array) $value['subset'] );
448
- foreach( $value['subset'] as $subset ) {
449
  $families['subset'][$subset] = $subset;
450
  }
451
  }
@@ -475,7 +477,7 @@ if( ! class_exists( 'CSF_Field_typography' ) ) {
475
  $font_family = ( ! empty( $this->value['font-family'] ) ) ? $this->value['font-family'] : '';
476
  $backup_family = ( ! empty( $this->value['backup-font-family'] ) ) ? ', '. $this->value['backup-font-family'] : '';
477
 
478
- if( $font_family ) {
479
  $output .= 'font-family:"'. $font_family .'"'. $backup_family . $important .';';
480
  }
481
 
@@ -490,8 +492,8 @@ if( ! class_exists( 'CSF_Field_typography' ) ) {
490
  'text-decoration',
491
  );
492
 
493
- foreach( $properties as $property ) {
494
- if( isset( $this->value[$property] ) && $this->value[$property] !== '' ) {
495
  $output .= $property .':'. $this->value[$property] . $important .';';
496
  }
497
  }
@@ -504,16 +506,18 @@ if( ! class_exists( 'CSF_Field_typography' ) ) {
504
  );
505
 
506
  $unit = ( ! empty( $this->value['unit'] ) ) ? $this->value['unit'] : '';
 
507
 
508
- foreach( $properties as $property ) {
509
- if( isset( $this->value[$property] ) && $this->value[$property] !== '' ) {
 
510
  $output .= $property .':'. $this->value[$property] . $unit . $important .';';
511
  }
512
  }
513
 
514
  $custom_style = ( ! empty( $this->value['custom-style'] ) ) ? $this->value['custom-style'] : '';
515
 
516
- if( $output ) {
517
  $output = $element .'{'. $output . $custom_style .'}';
518
  }
519
 
7
  * @version 1.0.0
8
  *
9
  */
10
+ if ( ! class_exists( 'CSF_Field_typography' ) ) {
11
  class CSF_Field_typography extends CSF_Fields {
12
 
13
  public $chosen = false;
44
  'custom_style' => false,
45
  'exclude' => '',
46
  'unit' => 'px',
47
+ 'line_height_unit' => '',
48
  'preview_text' => 'The quick brown fox jumps over the lazy dog',
49
  ) );
50
 
68
  'extra-styles' => array(),
69
  );
70
 
71
+ $default_value = ( ! empty( $this->field['default'] ) ) ? wp_parse_args( $this->field['default'], $default_value ) : $default_value;
72
+ $this->value = wp_parse_args( $this->value, $default_value );
73
+ $this->chosen = $args['chosen'];
74
+ $chosen_class = ( $this->chosen ) ? ' csf--chosen' : '';
75
+ $line_height_unit = ( ! empty( $args['line_height_unit'] ) ) ? $args['line_height_unit'] : $args['unit'];
76
 
77
+ echo '<div class="csf--typography'. esc_attr( $chosen_class ) .'" data-unit="'. esc_attr( $args['unit'] ) .'" data-line-height-unit="'. esc_attr( $line_height_unit ) .'" data-exclude="'. esc_attr( $args['exclude'] ) .'">';
78
 
79
  echo '<div class="csf--blocks csf--blocks-selects">';
80
 
81
  //
82
  // Font Family
83
+ if ( ! empty( $args['font_family'] ) ) {
84
  echo '<div class="csf--block">';
85
  echo '<div class="csf--title">'. esc_html__( 'Font Family', 'csf' ) .'</div>';
86
  echo $this->create_select( array( $this->value['font-family'] => $this->value['font-family'] ), 'font-family', esc_html__( 'Select a font', 'csf' ) );
89
 
90
  //
91
  // Backup Font Family
92
+ if ( ! empty( $args['backup_font_family'] ) ) {
93
  echo '<div class="csf--block csf--block-backup-font-family hidden">';
94
  echo '<div class="csf--title">'. esc_html__( 'Backup Font Family', 'csf' ) .'</div>';
95
  echo $this->create_select( apply_filters( 'csf_field_typography_backup_font_family', array(
111
 
112
  //
113
  // Font Style and Extra Style Select
114
+ if ( ! empty( $args['font_weight'] ) || ! empty( $args['font_style'] ) ) {
115
 
116
  //
117
  // Font Style Select
119
  echo '<div class="csf--title">'. esc_html__( 'Font Style', 'csf') .'</div>';
120
  echo '<select class="csf--font-style-select" data-placeholder="Default">';
121
  echo '<option value="">'. ( ! $this->chosen ? esc_html__( 'Default', 'csf' ) : '' ) .'</option>';
122
+ if ( ! empty( $this->value['font-weight'] ) || ! empty( $this->value['font-style'] ) ) {
123
+ echo '<option value="'. esc_attr( strtolower( $this->value['font-weight'] . $this->value['font-style'] ) ) .'" selected></option>';
124
  }
125
  echo '</select>';
126
+ echo '<input type="hidden" name="'. esc_attr( $this->field_name( '[font-weight]' ) ) .'" class="csf--font-weight" value="'. esc_attr( $this->value['font-weight'] ) .'" />';
127
+ echo '<input type="hidden" name="'. esc_attr( $this->field_name( '[font-style]' ) ) .'" class="csf--font-style" value="'. esc_attr( $this->value['font-style'] ) .'" />';
128
 
129
  //
130
  // Extra Font Style Select
131
+ if ( ! empty( $args['extra_styles'] ) ) {
132
  echo '<div class="csf--block-extra-styles hidden">';
133
  echo ( ! $this->chosen ) ? '<div class="csf--title">'. esc_html__( 'Load Extra Styles', 'csf' ) .'</div>' : '';
134
  $placeholder = ( $this->chosen ) ? esc_html__( 'Load Extra Styles', 'csf' ) : esc_html__( 'Default', 'csf' );
142
 
143
  //
144
  // Subset
145
+ if ( ! empty( $args['subset'] ) ) {
146
  echo '<div class="csf--block csf--block-subset hidden">';
147
  echo '<div class="csf--title">'. esc_html__( 'Subset', 'csf' ) .'</div>';
148
  $subset = ( is_array( $this->value['subset'] ) ) ? $this->value['subset'] : array_filter( (array) $this->value['subset'] );
152
 
153
  //
154
  // Text Align
155
+ if ( ! empty( $args['text_align'] ) ) {
156
  echo '<div class="csf--block">';
157
  echo '<div class="csf--title">'. esc_html__( 'Text Align', 'csf' ) .'</div>';
158
  echo $this->create_select( array(
168
 
169
  //
170
  // Font Variant
171
+ if ( ! empty( $args['font_variant'] ) ) {
172
  echo '<div class="csf--block">';
173
  echo '<div class="csf--title">'. esc_html__( 'Font Variant', 'csf' ) .'</div>';
174
  echo $this->create_select( array(
181
 
182
  //
183
  // Text Transform
184
+ if ( ! empty( $args['text_transform'] ) ) {
185
  echo '<div class="csf--block">';
186
  echo '<div class="csf--title">'. esc_html__( 'Text Transform', 'csf' ) .'</div>';
187
  echo $this->create_select( array(
195
 
196
  //
197
  // Text Decoration
198
+ if ( ! empty( $args['text_decoration'] ) ) {
199
  echo '<div class="csf--block">';
200
  echo '<div class="csf--title">'. esc_html__( 'Text Decoration', 'csf' ) .'</div>';
201
  echo $this->create_select( array(
217
 
218
  //
219
  // Font Size
220
+ if ( ! empty( $args['font_size'] ) ) {
221
  echo '<div class="csf--block">';
222
  echo '<div class="csf--title">'. esc_html__( 'Font Size', 'csf' ) .'</div>';
223
  echo '<div class="csf--input-wrap">';
224
+ echo '<input type="number" name="'. esc_attr( $this->field_name( '[font-size]' ) ) .'" class="csf--font-size csf--input csf-input-number" value="'. esc_attr( $this->value['font-size'] ) .'" />';
225
+ echo '<span class="csf--unit">'. esc_attr( $args['unit'] ) .'</span>';
226
  echo '</div>';
227
  echo '</div>';
228
  }
229
 
230
  //
231
  // Line Height
232
+ if ( ! empty( $args['line_height'] ) ) {
233
  echo '<div class="csf--block">';
234
  echo '<div class="csf--title">'. esc_html__( 'Line Height', 'csf' ) .'</div>';
235
  echo '<div class="csf--input-wrap">';
236
+ echo '<input type="number" name="'. esc_attr( $this->field_name( '[line-height]' ) ) .'" class="csf--line-height csf--input csf-input-number" value="'. esc_attr( $this->value['line-height'] ) .'" />';
237
+ echo '<span class="csf--unit">'. esc_attr( $line_height_unit ) .'</span>';
238
  echo '</div>';
239
  echo '</div>';
240
  }
241
 
242
  //
243
  // Letter Spacing
244
+ if ( ! empty( $args['letter_spacing'] ) ) {
245
  echo '<div class="csf--block">';
246
  echo '<div class="csf--title">'. esc_html__( 'Letter Spacing', 'csf' ) .'</div>';
247
  echo '<div class="csf--input-wrap">';
248
+ echo '<input type="number" name="'. esc_attr( $this->field_name( '[letter-spacing]' ) ) .'" class="csf--letter-spacing csf--input csf-input-number" value="'. esc_attr( $this->value['letter-spacing'] ) .'" />';
249
+ echo '<span class="csf--unit">'. esc_attr( $args['unit'] ) .'</span>';
250
  echo '</div>';
251
  echo '</div>';
252
  }
253
 
254
  //
255
  // Word Spacing
256
+ if ( ! empty( $args['word_spacing'] ) ) {
257
  echo '<div class="csf--block">';
258
  echo '<div class="csf--title">'. esc_html__( 'Word Spacing', 'csf' ) .'</div>';
259
  echo '<div class="csf--input-wrap">';
260
+ echo '<input type="number" name="'. esc_attr( $this->field_name( '[word-spacing]' ) ) .'" class="csf--word-spacing csf--input csf-input-number" value="'. esc_attr( $this->value['word-spacing'] ) .'" />';
261
+ echo '<span class="csf--unit">'. esc_attr( $args['unit'] ) .'</span>';
262
  echo '</div>';
263
  echo '</div>';
264
  }
267
 
268
  //
269
  // Font Color
270
+ if ( ! empty( $args['color'] ) ) {
271
+ $default_color_attr = ( ! empty( $default_value['color'] ) ) ? ' data-default-color="'. esc_attr( $default_value['color'] ) .'"' : '';
272
  echo '<div class="csf--block csf--block-font-color">';
273
  echo '<div class="csf--title">'. esc_html__( 'Font Color', 'csf' ) .'</div>';
274
  echo '<div class="csf-field-color">';
275
+ echo '<input type="text" name="'. esc_attr( $this->field_name( '[color]' ) ) .'" class="csf-color csf--color" value="'. esc_attr( $this->value['color'] ) .'"'. $default_color_attr .' />';
276
  echo '</div>';
277
  echo '</div>';
278
  }
279
 
280
  //
281
  // Custom style
282
+ if ( ! empty( $args['custom_style'] ) ) {
283
  echo '<div class="csf--block csf--block-custom-style">';
284
  echo '<div class="csf--title">'. esc_html__( 'Custom Style', 'csf' ) .'</div>';
285
+ echo '<textarea name="'. esc_attr( $this->field_name( '[custom-style]' ) ) .'" class="csf--custom-style">'. esc_attr( $this->value['custom-style'] ) .'</textarea>';
286
  echo '</div>';
287
  }
288
 
290
  // Preview
291
  $always_preview = ( $args['preview'] !== 'always' ) ? ' hidden' : '';
292
 
293
+ if ( ! empty( $args['preview'] ) ) {
294
+ echo '<div class="csf--block csf--block-preview'. esc_attr( $always_preview ) .'">';
295
+ echo '<div class="csf--toggle fas fa-toggle-off"></div>';
296
+ echo '<div class="csf--preview">'. esc_attr( $args['preview_text'] ) .'</div>';
297
  echo '</div>';
298
  }
299
 
300
+ echo '<input type="hidden" name="'. esc_attr( $this->field_name( '[type]' ) ) .'" class="csf--type" value="'. esc_attr( $this->value['type'] ) .'" />';
301
+ echo '<input type="hidden" name="'. esc_attr( $this->field_name( '[unit]' ) ) .'" class="csf--unit-save" value="'. esc_attr( $args['unit'] ) .'" />';
302
 
303
  echo '</div>';
304
 
312
  $multiple_attr = ( $is_multiple ) ? ' multiple data-multiple="true"' : '';
313
  $chosen_rtl = ( $this->chosen && is_rtl() ) ? ' chosen-rtl' : '';
314
 
315
+ $output = '<select name="'. esc_attr( $this->field_name( '['. $name .']'. $multiple_name ) ) .'" class="csf--'. esc_attr( $name ) . esc_attr( $chosen_rtl ) .'" data-placeholder="'. esc_attr( $placeholder ) .'"'. $multiple_attr .'>';
316
+ $output .= ( ! empty( $placeholder ) ) ? '<option value="">'. esc_attr( ( ! $this->chosen ) ? $placeholder : '' ) .'</option>' : '';
317
 
318
+ if ( ! empty( $options ) ) {
319
  foreach ( $options as $option_key => $option_value ) {
320
+ if ( $is_multiple ) {
321
  $selected = ( in_array( $option_value, $this->value[$name] ) ) ? ' selected' : '';
322
+ $output .= '<option value="'. esc_attr( $option_value ) .'"'. esc_attr( $selected ).'>'. esc_attr( $option_value ) .'</option>';
323
  } else {
324
  $option_key = ( is_numeric( $option_key ) ) ? $option_value : $option_key;
325
  $selected = ( $option_key === $this->value[$name] ) ? ' selected' : '';
326
+ $output .= '<option value="'. esc_attr( $option_key ) .'"'. esc_attr( $selected ).'>'. esc_attr( $option_value ) .'</option>';
327
  }
328
  }
329
  }
336
 
337
  public function enqueue() {
338
 
339
+ if ( ! wp_script_is( 'csf-webfontloader' ) ) {
340
 
341
  CSF::include_plugin_file( 'fields/typography/google-fonts.php' );
342
 
343
+ wp_enqueue_script( 'csf-webfontloader', 'https://cdn.jsdelivr.net/npm/webfontloader@1.6.28/webfontloader.min.js', array( 'csf' ), '1.6.28', true );
344
 
345
  $webfonts = array();
346
 
347
  $customwebfonts = apply_filters( 'csf_field_typography_customwebfonts', array() );
348
 
349
+ if ( ! empty( $customwebfonts ) ) {
350
  $webfonts['custom'] = array(
351
  'label' => esc_html__( 'Custom Web Fonts', 'csf' ),
352
  'fonts' => $customwebfonts
419
  $families = array();
420
  $is_google = false;
421
 
422
+ if ( ! empty( $this->value['type'] ) ) {
423
  $is_google = ( $this->value['type'] === 'google' ) ? true : false;
424
  } else {
425
  CSF::include_plugin_file( 'fields/typography/google-fonts.php' );
426
  $is_google = ( array_key_exists( $this->value['font-family'], csf_get_google_fonts() ) ) ? true : false;
427
  }
428
 
429
+ if ( $is_google ) {
430
 
431
  // set style
432
  $font_weight = ( ! empty( $value['font-weight'] ) ) ? $value['font-weight'] : '';
433
  $font_style = ( ! empty( $value['font-style'] ) ) ? $value['font-style'] : '';
434
 
435
+ if ( $font_weight || $font_style ) {
436
  $style = $font_weight . $font_style;
437
  $families['style'][$style] = $style;
438
  }
439
 
440
  // set extra styles
441
+ if ( ! empty( $value['extra-styles'] ) ) {
442
+ foreach ( $value['extra-styles'] as $extra_style ) {
443
  $families['style'][$extra_style] = $extra_style;
444
  }
445
  }
446
 
447
  // set subsets
448
+ if ( ! empty( $value['subset'] ) ) {
449
  $value['subset'] = ( is_array( $value['subset'] ) ) ? $value['subset'] : array_filter( (array) $value['subset'] );
450
+ foreach ( $value['subset'] as $subset ) {
451
  $families['subset'][$subset] = $subset;
452
  }
453
  }
477
  $font_family = ( ! empty( $this->value['font-family'] ) ) ? $this->value['font-family'] : '';
478
  $backup_family = ( ! empty( $this->value['backup-font-family'] ) ) ? ', '. $this->value['backup-font-family'] : '';
479
 
480
+ if ( $font_family ) {
481
  $output .= 'font-family:"'. $font_family .'"'. $backup_family . $important .';';
482
  }
483
 
492
  'text-decoration',
493
  );
494
 
495
+ foreach ( $properties as $property ) {
496
+ if ( isset( $this->value[$property] ) && $this->value[$property] !== '' ) {
497
  $output .= $property .':'. $this->value[$property] . $important .';';
498
  }
499
  }
506
  );
507
 
508
  $unit = ( ! empty( $this->value['unit'] ) ) ? $this->value['unit'] : '';
509
+ $line_height_unit = ( ! empty( $this->value['line_height_unit'] ) ) ? $this->value['line_height_unit'] : $unit;
510
 
511
+ foreach ( $properties as $property ) {
512
+ if ( isset( $this->value[$property] ) && $this->value[$property] !== '' ) {
513
+ $unit = ( $property === 'line-height' ) ? $line_height_unit : $unit;
514
  $output .= $property .':'. $this->value[$property] . $unit . $important .';';
515
  }
516
  }
517
 
518
  $custom_style = ( ! empty( $this->value['custom-style'] ) ) ? $this->value['custom-style'] : '';
519
 
520
+ if ( $output ) {
521
  $output = $element .'{'. $output . $custom_style .'}';
522
  }
523
 
admin/settings/fields/upload/upload.php CHANGED
@@ -7,7 +7,7 @@
7
  * @version 1.0.0
8
  *
9
  */
10
- if( ! class_exists( 'CSF_Field_upload' ) ) {
11
  class CSF_Field_upload extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
@@ -29,9 +29,9 @@ if( ! class_exists( 'CSF_Field_upload' ) ) {
29
  $hidden = ( empty( $this->value ) ) ? ' hidden' : '';
30
 
31
  echo '<div class="csf--wrap">';
32
- echo '<input type="text" name="'. $this->field_name() .'" value="'. $this->value .'"'. $this->field_attributes() .'/>';
33
- echo '<a href="#" class="button button-primary csf--button" data-library="'. esc_attr( $library ) .'">'. $args['button_title'] .'</a>';
34
- echo '<a href="#" class="button button-secondary csf-warning-primary csf--remove'. $hidden .'">'. $args['remove_title'] .'</a>';
35
  echo '</div>';
36
 
37
  echo $this->field_after();
7
  * @version 1.0.0
8
  *
9
  */
10
+ if ( ! class_exists( 'CSF_Field_upload' ) ) {
11
  class CSF_Field_upload extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
29
  $hidden = ( empty( $this->value ) ) ? ' hidden' : '';
30
 
31
  echo '<div class="csf--wrap">';
32
+ echo '<input type="text" name="'. esc_attr( $this->field_name() ) .'" value="'. esc_attr( $this->value ) .'"'. $this->field_attributes() .'/>';
33
+ echo '<a href="#" class="button button-primary csf--button" data-library="'. esc_attr( $library ) .'">'. wp_kses_post( $args['button_title'] ) .'</a>';
34
+ echo '<a href="#" class="button button-secondary csf-warning-primary csf--remove'. esc_attr( $hidden ) .'">'. wp_kses_post( $args['remove_title'] ) .'</a>';
35
  echo '</div>';
36
 
37
  echo $this->field_after();
admin/settings/fields/wp_editor/wp_editor.php CHANGED
@@ -7,7 +7,7 @@
7
  * @version 1.0.0
8
  *
9
  */
10
- if( ! class_exists( 'CSF_Field_wp_editor' ) ) {
11
  class CSF_Field_wp_editor extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
@@ -29,7 +29,7 @@ if( ! class_exists( 'CSF_Field_wp_editor' ) ) {
29
  'autocomplete' => 'off',
30
  );
31
 
32
- $editor_height = ( ! empty( $args['height'] ) ) ? ' style="height:'. $args['height']. ';"' : '';
33
 
34
  $editor_settings = array(
35
  'tinymce' => $args['tinymce'],
@@ -39,11 +39,9 @@ if( ! class_exists( 'CSF_Field_wp_editor' ) ) {
39
 
40
  echo $this->field_before();
41
 
42
- echo ( csf_wp_editor_api() ) ? '<div class="csf-wp-editor" data-editor-settings="'. esc_attr( wp_json_encode( $editor_settings ) ) .'">' : '';
43
 
44
- echo '<textarea name="'. $this->field_name() .'"'. $this->field_attributes( $attributes ) . $editor_height .'>'. $this->value .'</textarea>';
45
-
46
- echo '<div class="clear"></div>';
47
 
48
  echo ( csf_wp_editor_api() ) ? '</div>' : '';
49
 
@@ -53,7 +51,7 @@ if( ! class_exists( 'CSF_Field_wp_editor' ) ) {
53
 
54
  public function enqueue() {
55
 
56
- if( csf_wp_editor_api() && function_exists( 'wp_enqueue_editor' ) ) {
57
 
58
  wp_enqueue_editor();
59
 
@@ -75,7 +73,7 @@ if( ! class_exists( 'CSF_Field_wp_editor' ) ) {
75
  $media_buttons = ob_get_clean();
76
 
77
  echo '<script type="text/javascript">';
78
- echo 'var csf_media_buttons = '. wp_json_encode( $media_buttons ) .';';
79
  echo '</script>';
80
 
81
  }
@@ -83,7 +81,7 @@ if( ! class_exists( 'CSF_Field_wp_editor' ) ) {
83
  // Setup wp editor settings
84
  public function setup_wp_editor_settings() {
85
 
86
- if( csf_wp_editor_api() && class_exists( '_WP_Editors') ) {
87
 
88
  $defaults = apply_filters( 'csf_wp_editor', array(
89
  'tinymce' => array(
7
  * @version 1.0.0
8
  *
9
  */
10
+ if ( ! class_exists( 'CSF_Field_wp_editor' ) ) {
11
  class CSF_Field_wp_editor extends CSF_Fields {
12
 
13
  public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
29
  'autocomplete' => 'off',
30
  );
31
 
32
+ $editor_height = ( ! empty( $args['height'] ) ) ? ' style="height:'. esc_attr( $args['height'] ) .';"' : '';
33
 
34
  $editor_settings = array(
35
  'tinymce' => $args['tinymce'],
39
 
40
  echo $this->field_before();
41
 
42
+ echo ( csf_wp_editor_api() ) ? '<div class="csf-wp-editor" data-editor-settings="'. esc_attr( json_encode( $editor_settings ) ) .'">' : '';
43
 
44
+ echo '<textarea name="'. esc_attr( $this->field_name() ) .'"'. $this->field_attributes( $attributes ) . $editor_height .'>'. $this->value .'</textarea>';
 
 
45
 
46
  echo ( csf_wp_editor_api() ) ? '</div>' : '';
47
 
51
 
52
  public function enqueue() {
53
 
54
+ if ( csf_wp_editor_api() && function_exists( 'wp_enqueue_editor' ) ) {
55
 
56
  wp_enqueue_editor();
57
 
73
  $media_buttons = ob_get_clean();
74
 
75
  echo '<script type="text/javascript">';
76
+ echo 'var csf_media_buttons = '. json_encode( $media_buttons ) .';';
77
  echo '</script>';
78
 
79
  }
81
  // Setup wp editor settings
82
  public function setup_wp_editor_settings() {
83
 
84
+ if ( csf_wp_editor_api() && class_exists( '_WP_Editors') ) {
85
 
86
  $defaults = apply_filters( 'csf_wp_editor', array(
87
  'tinymce' => array(
admin/settings/functions/actions.php CHANGED
@@ -7,43 +7,45 @@
7
  * @version 1.0.0
8
  *
9
  */
10
- if( ! function_exists( 'csf_get_icons' ) ) {
11
  function csf_get_icons() {
12
 
13
- if( ! empty( $_POST['nonce'] ) && wp_verify_nonce( $_POST['nonce'], 'csf_icon_nonce' ) ) {
14
 
15
- ob_start();
 
 
16
 
17
- CSF::include_plugin_file( 'fields/icon/default-icons.php' );
18
 
19
- $icon_lists = apply_filters( 'csf_field_icon_add_icons', csf_get_default_icons() );
20
 
21
- if( ! empty( $icon_lists ) ) {
22
 
23
- foreach ( $icon_lists as $list ) {
24
 
25
- echo ( count( $icon_lists ) >= 2 ) ? '<div class="csf-icon-title">'. $list['title'] .'</div>' : '';
26
 
27
- foreach ( $list['icons'] as $icon ) {
28
- echo '<a class="csf-icon-tooltip" data-csf-icon="'. $icon .'" title="'. $icon .'"><span class="csf-icon csf-selector"><i class="'. $icon .'"></i></span></a>';
29
- }
30
 
31
- }
32
 
33
- } else {
34
-
35
- echo '<div class="csf-text-error">'. esc_html__( 'No data provided by developer', 'csf' ) .'</div>';
36
 
37
  }
38
 
39
- wp_send_json_success( array( 'content' => ob_get_clean() ) );
40
-
41
  } else {
42
 
43
- wp_send_json_error( array( 'error' => esc_html__( 'Error: Nonce verification has failed. Please try again.', 'csf' ) ) );
44
 
45
  }
46
 
 
 
 
 
47
  }
48
  add_action( 'wp_ajax_csf-get-icons', 'csf_get_icons' );
49
  }
@@ -56,22 +58,31 @@ if( ! function_exists( 'csf_get_icons' ) ) {
56
  * @version 1.0.0
57
  *
58
  */
59
- if( ! function_exists( 'csf_export' ) ) {
60
  function csf_export() {
61
 
62
- if( ! empty( $_GET['export'] ) && ! empty( $_GET['nonce'] ) && wp_verify_nonce( $_GET['nonce'], 'csf_backup_nonce' ) ) {
 
63
 
64
- header('Content-Type: application/json');
65
- header('Content-disposition: attachment; filename=backup-'. gmdate( 'd-m-Y' ) .'.json');
66
- header('Content-Transfer-Encoding: binary');
67
- header('Pragma: no-cache');
68
- header('Expires: 0');
69
-
70
- echo json_encode( get_option( wp_unslash( $_GET['export'] ) ) );
71
 
 
 
72
  }
73
 
 
 
 
 
 
 
 
 
 
74
  die();
 
75
  }
76
  add_action( 'wp_ajax_csf-export', 'csf_export' );
77
  }
@@ -84,23 +95,29 @@ if( ! function_exists( 'csf_export' ) ) {
84
  * @version 1.0.0
85
  *
86
  */
87
- if( ! function_exists( 'csf_import_ajax' ) ) {
88
  function csf_import_ajax() {
89
 
90
- if( ! empty( $_POST['import_data'] ) && ! empty( $_POST['unique'] ) && ! empty( $_POST['nonce'] ) && wp_verify_nonce( $_POST['nonce'], 'csf_backup_nonce' ) ) {
91
-
92
- $import_data = json_decode( wp_unslash( trim( $_POST['import_data'] ) ), true );
93
 
94
- if( is_array( $import_data ) ) {
95
-
96
- update_option( wp_unslash( $_POST['unique'] ), wp_unslash( $import_data ) );
97
- wp_send_json_success();
98
 
99
- }
 
 
100
 
 
 
101
  }
102
 
103
- wp_send_json_error( array( 'error' => esc_html__( 'Error: Nonce verification has failed. Please try again.', 'csf' ) ) );
 
 
 
104
 
105
  }
106
  add_action( 'wp_ajax_csf-import', 'csf_import_ajax' );
@@ -114,15 +131,20 @@ if( ! function_exists( 'csf_import_ajax' ) ) {
114
  * @version 1.0.0
115
  *
116
  */
117
- if( ! function_exists( 'csf_reset_ajax' ) ) {
118
  function csf_reset_ajax() {
119
 
120
- if( ! empty( $_POST['unique'] ) && ! empty( $_POST['nonce'] ) && wp_verify_nonce( $_POST['nonce'], 'csf_backup_nonce' ) ) {
121
- delete_option( wp_unslash( $_POST['unique'] ) );
122
- wp_send_json_success();
 
 
123
  }
124
 
125
- wp_send_json_error( array( 'error' => esc_html__( 'Error: Nonce verification has failed. Please try again.', 'csf' ) ) );
 
 
 
126
 
127
  }
128
  add_action( 'wp_ajax_csf-reset', 'csf_reset_ajax' );
@@ -136,29 +158,32 @@ if( ! function_exists( 'csf_reset_ajax' ) ) {
136
  * @version 1.0.0
137
  *
138
  */
139
- if( ! function_exists( 'csf_chosen_ajax' ) ) {
140
  function csf_chosen_ajax() {
141
 
142
- if( ! empty( $_POST['term'] ) && ! empty( $_POST['type'] ) && ! empty( $_POST['nonce'] ) && wp_verify_nonce( $_POST['nonce'], 'csf_chosen_ajax_nonce' ) ) {
 
 
 
143
 
144
- $capability = apply_filters( 'csf_chosen_ajax_capability', 'manage_options' );
 
 
145
 
146
- if( current_user_can( $capability ) ) {
 
 
147
 
148
- $type = $_POST['type'];
149
- $term = $_POST['term'];
150
- $query_args = ( ! empty( $_POST['query_args'] ) ) ? $_POST['query_args'] : array();
151
- $options = CSF_Fields::field_data( $type, $term, $query_args );
152
 
153
- wp_send_json_success( $options );
 
 
154
 
155
- } else {
156
- wp_send_json_error( array( 'error' => esc_html__( 'You do not have required permissions to access.', 'csf' ) ) );
157
- }
158
 
159
- } else {
160
- wp_send_json_error( array( 'error' => esc_html__( 'Error: Nonce verification has failed. Please try again.', 'csf' ) ) );
161
- }
162
 
163
  }
164
  add_action( 'wp_ajax_csf-chosen', 'csf_chosen_ajax' );
@@ -172,11 +197,8 @@ if( ! function_exists( 'csf_chosen_ajax' ) ) {
172
  * @version 1.0.0
173
  *
174
  */
175
- if( ! function_exists( 'csf_set_icons' ) ) {
176
  function csf_set_icons() {
177
- if( ! wp_ulike_is_plugin_screen() ){
178
- return;
179
- }
180
  ?>
181
  <div id="csf-modal-icon" class="csf-modal csf-modal-icon">
182
  <div class="csf-modal-table">
7
  * @version 1.0.0
8
  *
9
  */
10
+ if ( ! function_exists( 'csf_get_icons' ) ) {
11
  function csf_get_icons() {
12
 
13
+ $nonce = ( ! empty( $_POST[ 'nonce' ] ) ) ? sanitize_text_field( wp_unslash( $_POST[ 'nonce' ] ) ) : '';
14
 
15
+ if ( ! wp_verify_nonce( $nonce, 'csf_icon_nonce' ) ) {
16
+ wp_send_json_error( array( 'error' => esc_html__( 'Error: Nonce verification has failed. Please try again.', 'csf' ) ) );
17
+ }
18
 
19
+ ob_start();
20
 
21
+ $icon_library = ( apply_filters( 'csf_fa4', false ) ) ? 'fa4' : 'fa5';
22
 
23
+ CSF::include_plugin_file( 'fields/icon/'. $icon_library .'-icons.php' );
24
 
25
+ $icon_lists = apply_filters( 'csf_field_icon_add_icons', csf_get_default_icons() );
26
 
27
+ if ( ! empty( $icon_lists ) ) {
28
 
29
+ foreach ( $icon_lists as $list ) {
 
 
30
 
31
+ echo ( count( $icon_lists ) >= 2 ) ? '<div class="csf-icon-title">'. esc_attr( $list['title'] ) .'</div>' : '';
32
 
33
+ foreach ( $list['icons'] as $icon ) {
34
+ echo '<i title="'. esc_attr( $icon ) .'" class="'. esc_attr( $icon ) .'"></i>';
35
+ }
36
 
37
  }
38
 
 
 
39
  } else {
40
 
41
+ echo '<div class="csf-text-error">'. esc_html__( 'No data provided by developer', 'csf' ) .'</div>';
42
 
43
  }
44
 
45
+ $content = ob_get_clean();
46
+
47
+ wp_send_json_success( array( 'content' => $content ) );
48
+
49
  }
50
  add_action( 'wp_ajax_csf-get-icons', 'csf_get_icons' );
51
  }
58
  * @version 1.0.0
59
  *
60
  */
61
+ if ( ! function_exists( 'csf_export' ) ) {
62
  function csf_export() {
63
 
64
+ $nonce = ( ! empty( $_GET[ 'nonce' ] ) ) ? sanitize_text_field( wp_unslash( $_GET[ 'nonce' ] ) ) : '';
65
+ $unique = ( ! empty( $_GET[ 'unique' ] ) ) ? sanitize_text_field( wp_unslash( $_GET[ 'unique' ] ) ) : '';
66
 
67
+ if ( ! wp_verify_nonce( $nonce, 'csf_backup_nonce' ) ) {
68
+ die( esc_html__( 'Error: Nonce verification has failed. Please try again.', 'csf' ) );
69
+ }
 
 
 
 
70
 
71
+ if ( empty( $unique ) ) {
72
+ die( esc_html__( 'Error: Options unique id could not valid.', 'csf' ) );
73
  }
74
 
75
+ // Export
76
+ header('Content-Type: application/json');
77
+ header('Content-disposition: attachment; filename=backup-'. gmdate( 'd-m-Y' ) .'.json');
78
+ header('Content-Transfer-Encoding: binary');
79
+ header('Pragma: no-cache');
80
+ header('Expires: 0');
81
+
82
+ echo json_encode( get_option( $unique ) );
83
+
84
  die();
85
+
86
  }
87
  add_action( 'wp_ajax_csf-export', 'csf_export' );
88
  }
95
  * @version 1.0.0
96
  *
97
  */
98
+ if ( ! function_exists( 'csf_import_ajax' ) ) {
99
  function csf_import_ajax() {
100
 
101
+ $nonce = ( ! empty( $_POST[ 'nonce' ] ) ) ? sanitize_text_field( wp_unslash( $_POST[ 'nonce' ] ) ) : '';
102
+ $unique = ( ! empty( $_POST[ 'unique' ] ) ) ? sanitize_text_field( wp_unslash( $_POST[ 'unique' ] ) ) : '';
103
+ $data = ( ! empty( $_POST[ 'data' ] ) ) ? wp_kses_post_deep( json_decode( wp_unslash( trim( $_POST[ 'data' ] ) ), true ) ) : array();
104
 
105
+ if ( ! wp_verify_nonce( $nonce, 'csf_backup_nonce' ) ) {
106
+ wp_send_json_error( array( 'error' => esc_html__( 'Error: Nonce verification has failed. Please try again.', 'csf' ) ) );
107
+ }
 
108
 
109
+ if ( empty( $unique ) ) {
110
+ wp_send_json_error( array( 'error' => esc_html__( 'Error: Options unique id could not valid.', 'csf' ) ) );
111
+ }
112
 
113
+ if ( empty( $data ) || ! is_array( $data ) ) {
114
+ wp_send_json_error( array( 'error' => esc_html__( 'Error: Import data could not valid.', 'csf' ) ) );
115
  }
116
 
117
+ // Success
118
+ update_option( $unique, $data );
119
+
120
+ wp_send_json_success();
121
 
122
  }
123
  add_action( 'wp_ajax_csf-import', 'csf_import_ajax' );
131
  * @version 1.0.0
132
  *
133
  */
134
+ if ( ! function_exists( 'csf_reset_ajax' ) ) {
135
  function csf_reset_ajax() {
136
 
137
+ $nonce = ( ! empty( $_POST[ 'nonce' ] ) ) ? sanitize_text_field( wp_unslash( $_POST[ 'nonce' ] ) ) : '';
138
+ $unique = ( ! empty( $_POST[ 'unique' ] ) ) ? sanitize_text_field( wp_unslash( $_POST[ 'unique' ] ) ) : '';
139
+
140
+ if ( ! wp_verify_nonce( $nonce, 'csf_backup_nonce' ) ) {
141
+ wp_send_json_error( array( 'error' => esc_html__( 'Error: Nonce verification has failed. Please try again.', 'csf' ) ) );
142
  }
143
 
144
+ // Success
145
+ delete_option( $unique );
146
+
147
+ wp_send_json_success();
148
 
149
  }
150
  add_action( 'wp_ajax_csf-reset', 'csf_reset_ajax' );
158
  * @version 1.0.0
159
  *
160
  */
161
+ if ( ! function_exists( 'csf_chosen_ajax' ) ) {
162
  function csf_chosen_ajax() {
163
 
164
+ $nonce = ( ! empty( $_POST[ 'nonce' ] ) ) ? sanitize_text_field( wp_unslash( $_POST[ 'nonce' ] ) ) : '';
165
+ $type = ( ! empty( $_POST[ 'type' ] ) ) ? sanitize_text_field( wp_unslash( $_POST[ 'type' ] ) ) : '';
166
+ $term = ( ! empty( $_POST[ 'term' ] ) ) ? sanitize_text_field( wp_unslash( $_POST[ 'term' ] ) ) : '';
167
+ $query = ( ! empty( $_POST[ 'query_args' ] ) ) ? wp_kses_post_deep( $_POST[ 'query_args' ] ) : array();
168
 
169
+ if ( ! wp_verify_nonce( $nonce, 'csf_chosen_ajax_nonce' ) ) {
170
+ wp_send_json_error( array( 'error' => esc_html__( 'Error: Nonce verification has failed. Please try again.', 'csf' ) ) );
171
+ }
172
 
173
+ if ( empty( $type ) || empty( $term ) ) {
174
+ wp_send_json_error( array( 'error' => esc_html__( 'Error: Missing request arguments.', 'csf' ) ) );
175
+ }
176
 
177
+ $capability = apply_filters( 'csf_chosen_ajax_capability', 'manage_options' );
 
 
 
178
 
179
+ if ( ! current_user_can( $capability ) ) {
180
+ wp_send_json_error( array( 'error' => esc_html__( 'You do not have required permissions to access.', 'csf' ) ) );
181
+ }
182
 
183
+ // Success
184
+ $options = CSF_Fields::field_data( $type, $term, $query );
 
185
 
186
+ wp_send_json_success( $options );
 
 
187
 
188
  }
189
  add_action( 'wp_ajax_csf-chosen', 'csf_chosen_ajax' );
197
  * @version 1.0.0
198
  *
199
  */
200
+ if ( ! function_exists( 'csf_set_icons' ) ) {
201
  function csf_set_icons() {
 
 
 
202
  ?>
203
  <div id="csf-modal-icon" class="csf-modal csf-modal-icon">
204
  <div class="csf-modal-table">
admin/settings/functions/customize.php CHANGED
@@ -7,7 +7,7 @@
7
  * @version 1.0.0
8
  *
9
  */
10
- if( ! class_exists( 'WP_Customize_Panel_CSF' ) && class_exists( 'WP_Customize_Panel' ) ) {
11
  class WP_Customize_Panel_CSF extends WP_Customize_Panel {
12
  public $type = 'csf';
13
  }
@@ -21,7 +21,7 @@ if( ! class_exists( 'WP_Customize_Panel_CSF' ) && class_exists( 'WP_Customize_Pa
21
  * @version 1.0.0
22
  *
23
  */
24
- if( ! class_exists( 'WP_Customize_Section_CSF' ) && class_exists( 'WP_Customize_Section' ) ) {
25
  class WP_Customize_Section_CSF extends WP_Customize_Section {
26
  public $type = 'csf';
27
  }
@@ -35,7 +35,7 @@ if( ! class_exists( 'WP_Customize_Section_CSF' ) && class_exists( 'WP_Customize_
35
  * @version 1.0.0
36
  *
37
  */
38
- if( ! class_exists( 'WP_Customize_Control_CSF' ) && class_exists( 'WP_Customize_Control' ) ) {
39
  class WP_Customize_Control_CSF extends WP_Customize_Control {
40
 
41
  public $type = 'csf';
@@ -49,15 +49,15 @@ if( ! class_exists( 'WP_Customize_Control_CSF' ) && class_exists( 'WP_Customize_
49
 
50
  if ( ! empty( $this->field['dependency'] ) ) {
51
  $hidden = ' csf-dependency-control hidden';
52
- $depend .= ' data-controller="'. $this->field['dependency'][0] .'"';
53
- $depend .= ' data-condition="'. $this->field['dependency'][1] .'"';
54
- $depend .= ' data-value="'. $this->field['dependency'][2] .'"';
55
  }
56
 
57
  $id = 'customize-control-' . str_replace( array( '[', ']' ), array( '-', '' ), $this->id );
58
  $class = 'customize-control customize-control-' . $this->type . $hidden;
59
 
60
- echo '<li id="'. $id .'" class="'. $class .'"'. $depend .'>';
61
  $this->render_content();
62
  echo '</li>';
63
 
@@ -68,7 +68,6 @@ if( ! class_exists( 'WP_Customize_Control_CSF' ) && class_exists( 'WP_Customize_
68
  $complex = array(
69
  'accordion',
70
  'background',
71
- 'backup',
72
  'border',
73
  'button_set',
74
  'checkbox',
@@ -94,9 +93,9 @@ if( ! class_exists( 'WP_Customize_Control_CSF' ) && class_exists( 'WP_Customize_
94
  $custom = ( ! empty( $this->field['customizer'] ) ) ? true : false;
95
  $is_complex = ( in_array( $this->field['type'], $complex ) ) ? true : false;
96
  $class = ( $is_complex || $custom ) ? ' csf-customize-complex' : '';
97
- $atts = ( $is_complex || $custom ) ? ' data-unique-id="'. $this->unique .'" data-option-id="'. $field_id .'"' : '';
98
 
99
- if( ! $is_complex && ! $custom ) {
100
  $this->field['attributes']['data-customize-setting-link'] = $this->settings['default']->id;
101
  }
102
 
@@ -104,7 +103,7 @@ if( ! class_exists( 'WP_Customize_Control_CSF' ) && class_exists( 'WP_Customize_
104
 
105
  $this->field['dependency'] = array();
106
 
107
- echo '<div class="csf-customize-field'. $class .'"'. $atts .'>';
108
 
109
  CSF::field( $this->field, $this->value(), $this->unique, 'customize' );
110
 
7
  * @version 1.0.0
8
  *
9
  */
10
+ if ( ! class_exists( 'WP_Customize_Panel_CSF' ) && class_exists( 'WP_Customize_Panel' ) ) {
11
  class WP_Customize_Panel_CSF extends WP_Customize_Panel {
12
  public $type = 'csf';
13
  }
21
  * @version 1.0.0
22
  *
23
  */
24
+ if ( ! class_exists( 'WP_Customize_Section_CSF' ) && class_exists( 'WP_Customize_Section' ) ) {
25
  class WP_Customize_Section_CSF extends WP_Customize_Section {
26
  public $type = 'csf';
27
  }
35
  * @version 1.0.0
36
  *
37
  */
38
+ if ( ! class_exists( 'WP_Customize_Control_CSF' ) && class_exists( 'WP_Customize_Control' ) ) {
39
  class WP_Customize_Control_CSF extends WP_Customize_Control {
40
 
41
  public $type = 'csf';
49
 
50
  if ( ! empty( $this->field['dependency'] ) ) {
51
  $hidden = ' csf-dependency-control hidden';
52
+ $depend .= ' data-controller="'. esc_attr( $this->field['dependency'][0] ) .'"';
53
+ $depend .= ' data-condition="'. esc_attr( $this->field['dependency'][1] ) .'"';
54
+ $depend .= ' data-value="'. esc_attr( $this->field['dependency'][2] ) .'"';
55
  }
56
 
57
  $id = 'customize-control-' . str_replace( array( '[', ']' ), array( '-', '' ), $this->id );
58
  $class = 'customize-control customize-control-' . $this->type . $hidden;
59
 
60
+ echo '<li id="'. esc_attr( $id ) .'" class="'. esc_attr( $class ) .'"'. $depend .'>';
61
  $this->render_content();
62
  echo '</li>';
63
 
68
  $complex = array(
69
  'accordion',
70
  'background',
 
71
  'border',
72
  'button_set',
73
  'checkbox',
93
  $custom = ( ! empty( $this->field['customizer'] ) ) ? true : false;
94
  $is_complex = ( in_array( $this->field['type'], $complex ) ) ? true : false;
95
  $class = ( $is_complex || $custom ) ? ' csf-customize-complex' : '';
96
+ $atts = ( $is_complex || $custom ) ? ' data-unique-id="'. esc_attr( $this->unique ) .'" data-option-id="'. esc_attr( $field_id ) .'"' : '';
97
 
98
+ if ( ! $is_complex && ! $custom ) {
99
  $this->field['attributes']['data-customize-setting-link'] = $this->settings['default']->id;
100
  }
101
 
103
 
104
  $this->field['dependency'] = array();
105
 
106
+ echo '<div class="csf-customize-field'. esc_attr( $class ) .'"'. $atts .'>';
107
 
108
  CSF::field( $this->field, $this->value(), $this->unique, 'customize' );
109
 
admin/settings/functions/helpers.php CHANGED
@@ -28,54 +28,6 @@ if ( ! function_exists( 'csf_array_search' ) ) {
28
  }
29
  }
30
 
31
- /**
32
- *
33
- * Getting POST Var
34
- *
35
- * @since 1.0.0
36
- * @version 1.0.0
37
- *
38
- */
39
- if ( ! function_exists( 'csf_get_var' ) ) {
40
- function csf_get_var( $var, $default = '' ) {
41
-
42
- if( isset( $_POST[$var] ) ) {
43
- return $_POST[$var];
44
- }
45
-
46
- if( isset( $_GET[$var] ) ) {
47
- return $_GET[$var];
48
- }
49
-
50
- return $default;
51
-
52
- }
53
- }
54
-
55
- /**
56
- *
57
- * Getting POST Vars
58
- *
59
- * @since 1.0.0
60
- * @version 1.0.0
61
- *
62
- */
63
- if ( ! function_exists( 'csf_get_vars' ) ) {
64
- function csf_get_vars( $var, $depth, $default = '' ) {
65
-
66
- if( isset( $_POST[$var][$depth] ) ) {
67
- return $_POST[$var][$depth];
68
- }
69
-
70
- if( isset( $_GET[$var][$depth] ) ) {
71
- return $_GET[$var][$depth];
72
- }
73
-
74
- return $default;
75
-
76
- }
77
- }
78
-
79
  /**
80
  *
81
  * Between Microtime
@@ -86,9 +38,7 @@ if ( ! function_exists( 'csf_get_vars' ) ) {
86
  */
87
  if ( ! function_exists( 'csf_microtime' ) ) {
88
  function csf_timeout( $timenow, $starttime, $timeout = 30 ) {
89
-
90
  return ( ( $timenow - $starttime ) < $timeout ) ? true : false;
91
-
92
  }
93
  }
94
 
@@ -102,10 +52,7 @@ if ( ! function_exists( 'csf_microtime' ) ) {
102
  */
103
  if ( ! function_exists( 'csf_wp_editor_api' ) ) {
104
  function csf_wp_editor_api() {
105
-
106
  global $wp_version;
107
-
108
  return version_compare( $wp_version, '4.8', '>=' );
109
-
110
  }
111
  }
28
  }
29
  }
30
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  /**
32
  *
33
  * Between Microtime
38
  */
39
  if ( ! function_exists( 'csf_microtime' ) ) {
40
  function csf_timeout( $timenow, $starttime, $timeout = 30 ) {
 
41
  return ( ( $timenow - $starttime ) < $timeout ) ? true : false;
 
42
  }
43
  }
44
 
52
  */
53
  if ( ! function_exists( 'csf_wp_editor_api' ) ) {
54
  function csf_wp_editor_api() {
 
55
  global $wp_version;
 
56
  return version_compare( $wp_version, '4.8', '>=' );
 
57
  }
58
  }
admin/settings/functions/sanitize.php CHANGED
@@ -8,7 +8,7 @@
8
  * @version 1.0.0
9
  *
10
  */
11
- if( ! function_exists( 'csf_sanitize_replace_a_to_b' ) ) {
12
  function csf_sanitize_replace_a_to_b( $value ) {
13
  return str_replace( 'a', 'b', $value );
14
  }
@@ -22,7 +22,7 @@ if( ! function_exists( 'csf_sanitize_replace_a_to_b' ) ) {
22
  * @version 1.0.0
23
  *
24
  */
25
- if( ! function_exists( 'csf_sanitize_title' ) ) {
26
  function csf_sanitize_title( $value ) {
27
  return sanitize_title( $value );
28
  }
8
  * @version 1.0.0
9
  *
10
  */
11
+ if ( ! function_exists( 'csf_sanitize_replace_a_to_b' ) ) {
12
  function csf_sanitize_replace_a_to_b( $value ) {
13
  return str_replace( 'a', 'b', $value );
14
  }
22
  * @version 1.0.0
23
  *
24
  */
25
+ if ( ! function_exists( 'csf_sanitize_title' ) ) {
26
  function csf_sanitize_title( $value ) {
27
  return sanitize_title( $value );
28
  }
admin/settings/functions/validate.php CHANGED
@@ -7,7 +7,7 @@
7
  * @version 1.0.0
8
  *
9
  */
10
- if( ! function_exists( 'csf_validate_email' ) ) {
11
  function csf_validate_email( $value ) {
12
 
13
  if ( ! filter_var( $value, FILTER_VALIDATE_EMAIL ) ) {
@@ -25,7 +25,7 @@ if( ! function_exists( 'csf_validate_email' ) ) {
25
  * @version 1.0.0
26
  *
27
  */
28
- if( ! function_exists( 'csf_validate_numeric' ) ) {
29
  function csf_validate_numeric( $value ) {
30
 
31
  if ( ! is_numeric( $value ) ) {
@@ -43,7 +43,7 @@ if( ! function_exists( 'csf_validate_numeric' ) ) {
43
  * @version 1.0.0
44
  *
45
  */
46
- if( ! function_exists( 'csf_validate_required' ) ) {
47
  function csf_validate_required( $value ) {
48
 
49
  if ( empty( $value ) ) {
@@ -61,10 +61,10 @@ if( ! function_exists( 'csf_validate_required' ) ) {
61
  * @version 1.0.0
62
  *
63
  */
64
- if( ! function_exists( 'csf_validate_url' ) ) {
65
  function csf_validate_url( $value ) {
66
 
67
- if( ! filter_var( $value, FILTER_VALIDATE_URL ) ) {
68
  return esc_html__( 'Please write a valid url!', 'csf' );
69
  }
70
 
@@ -79,7 +79,7 @@ if( ! function_exists( 'csf_validate_url' ) ) {
79
  * @version 1.0.0
80
  *
81
  */
82
- if( ! function_exists( 'csf_customize_validate_email' ) ) {
83
  function csf_customize_validate_email( $validity, $value, $wp_customize ) {
84
 
85
  if ( ! sanitize_email( $value ) ) {
@@ -99,7 +99,7 @@ if( ! function_exists( 'csf_customize_validate_email' ) ) {
99
  * @version 1.0.0
100
  *
101
  */
102
- if( ! function_exists( 'csf_customize_validate_numeric' ) ) {
103
  function csf_customize_validate_numeric( $validity, $value, $wp_customize ) {
104
 
105
  if ( ! is_numeric( $value ) ) {
@@ -119,7 +119,7 @@ if( ! function_exists( 'csf_customize_validate_numeric' ) ) {
119
  * @version 1.0.0
120
  *
121
  */
122
- if( ! function_exists( 'csf_customize_validate_required' ) ) {
123
  function csf_customize_validate_required( $validity, $value, $wp_customize ) {
124
 
125
  if ( empty( $value ) ) {
@@ -139,10 +139,10 @@ if( ! function_exists( 'csf_customize_validate_required' ) ) {
139
  * @version 1.0.0
140
  *
141
  */
142
- if( ! function_exists( 'csf_customize_validate_url' ) ) {
143
  function csf_customize_validate_url( $validity, $value, $wp_customize ) {
144
 
145
- if( ! filter_var( $value, FILTER_VALIDATE_URL ) ) {
146
  $validity->add( 'required', esc_html__( 'Please write a valid url!', 'csf' ) );
147
  }
148
 
7
  * @version 1.0.0
8
  *
9
  */
10
+ if ( ! function_exists( 'csf_validate_email' ) ) {
11
  function csf_validate_email( $value ) {
12
 
13
  if ( ! filter_var( $value, FILTER_VALIDATE_EMAIL ) ) {
25
  * @version 1.0.0
26
  *
27
  */
28
+ if ( ! function_exists( 'csf_validate_numeric' ) ) {
29
  function csf_validate_numeric( $value ) {
30
 
31
  if ( ! is_numeric( $value ) ) {
43
  * @version 1.0.0
44
  *
45
  */
46
+ if ( ! function_exists( 'csf_validate_required' ) ) {
47
  function csf_validate_required( $value ) {
48
 
49
  if ( empty( $value ) ) {
61
  * @version 1.0.0
62
  *
63
  */
64
+ if ( ! function_exists( 'csf_validate_url' ) ) {
65
  function csf_validate_url( $value ) {
66
 
67
+ if ( ! filter_var( $value, FILTER_VALIDATE_URL ) ) {
68
  return esc_html__( 'Please write a valid url!', 'csf' );
69
  }
70
 
79
  * @version 1.0.0
80
  *
81
  */
82
+ if ( ! function_exists( 'csf_customize_validate_email' ) ) {
83
  function csf_customize_validate_email( $validity, $value, $wp_customize ) {
84
 
85
  if ( ! sanitize_email( $value ) ) {
99
  * @version 1.0.0
100
  *
101
  */
102
+ if ( ! function_exists( 'csf_customize_validate_numeric' ) ) {
103
  function csf_customize_validate_numeric( $validity, $value, $wp_customize ) {
104
 
105
  if ( ! is_numeric( $value ) ) {
119
  * @version 1.0.0
120
  *
121
  */
122
+ if ( ! function_exists( 'csf_customize_validate_required' ) ) {
123
  function csf_customize_validate_required( $validity, $value, $wp_customize ) {
124
 
125
  if ( empty( $value ) ) {
139
  * @version 1.0.0
140
  *
141
  */
142
+ if ( ! function_exists( 'csf_customize_validate_url' ) ) {
143
  function csf_customize_validate_url( $validity, $value, $wp_customize ) {
144
 
145
+ if ( ! filter_var( $value, FILTER_VALIDATE_URL ) ) {
146
  $validity->add( 'required', esc_html__( 'Please write a valid url!', 'csf' ) );
147
  }
148
 
assets/css/wp-ulike.css CHANGED
@@ -25,10 +25,13 @@
25
  cursor: pointer;
26
  }
27
  .wpulike .wp_ulike_btn:hover, .wpulike .wp_ulike_btn:active, .wpulike .wp_ulike_btn:focus {
28
- outline: 0;
 
 
 
29
  }
30
  .wpulike .wp_ulike_btn[disabled=disabled]:hover, .wpulike .wp_ulike_btn[disabled=disabled]:active, .wpulike .wp_ulike_btn[disabled=disabled]:focus, .wpulike .wp_ulike_btn:disabled:hover, .wpulike .wp_ulike_btn:disabled:active, .wpulike .wp_ulike_btn:disabled:focus {
31
- outline: 0;
32
  background-color: initial;
33
  }
34
  .wpulike .wp_ulike_put_text {
@@ -231,228 +234,65 @@
231
  /**
232
  * Robeen template
233
  */
234
- @keyframes animateCircle {
235
- 40% {
236
- transform: scale(10);
237
- opacity: 1;
238
- fill: #DD4688;
239
- }
240
- 55% {
241
- transform: scale(11);
242
- opacity: 1;
243
- fill: #D46ABF;
244
- }
245
- 65% {
246
- transform: scale(12);
247
- opacity: 1;
248
- fill: #CC8EF5;
249
- }
250
- 75% {
251
- transform: scale(13);
252
- opacity: 1;
253
- fill: transparent;
254
- stroke: #CC8EF5;
255
- stroke-width: .5;
256
- }
257
- 85% {
258
- transform: scale(17);
259
- opacity: 1;
260
- fill: transparent;
261
- stroke: #CC8EF5;
262
- stroke-width: .2;
263
- }
264
- 95% {
265
- transform: scale(18);
266
- opacity: 1;
267
- fill: transparent;
268
- stroke: #CC8EF5;
269
- stroke-width: .1;
270
- }
271
- 100% {
272
- transform: scale(19);
273
- opacity: 1;
274
- fill: transparent;
275
- stroke: #CC8EF5;
276
- stroke-width: 0;
277
- }
278
- }
279
- @keyframes animateHeart {
280
- 0% {
281
- transform: scale(0.2);
282
- }
283
- 40% {
284
- transform: scale(1.2);
285
- }
286
- 100% {
287
- transform: scale(1);
288
- }
289
- }
290
- @keyframes animateHeartOut {
291
- 0% {
292
- transform: scale(1.4);
293
- }
294
- 100% {
295
- transform: scale(1);
296
- }
297
- }
298
  .wpulike-robeen .wp_ulike_likers_wrapper:not(.wp_ulike_display_inline) {
299
- bottom: 15px;
300
  }
301
  .wpulike-robeen .count-box {
302
  font-weight: 600;
 
 
303
  }
304
- .wpulike-robeen label {
305
- display: flex;
306
- align-items: center;
307
- margin: 0 -5px;
308
- }
309
- .wpulike-robeen svg {
310
- cursor: pointer;
311
- overflow: visible !important;
312
- width: 50px;
313
- height: 50px;
314
- }
315
- .wpulike-robeen svg .heart {
316
- transform-origin: center;
317
- animation: animateHeartOut .3s linear forwards;
318
  }
319
- .wpulike-robeen svg .main-circ {
320
- transform-origin: 29.5px 29.5px;
321
  }
322
  .wpulike-robeen .wp_ulike_btn {
323
- position: absolute;
 
324
  overflow: hidden;
325
- clip: rect(0 0 0 0);
326
- height: 1px;
327
- width: 1px;
328
- margin: -1px;
329
  padding: 0;
330
  border: 0;
 
331
  }
332
- .wpulike-robeen .wp_ulike_btn:checked + svg .heart {
333
- transform: scale(0.2);
334
- fill: #E2264D;
335
- animation: animateHeart .3s linear forwards .25s;
336
- }
337
- .wpulike-robeen .wp_ulike_btn:checked + svg .main-circ {
338
- transition: all 2s;
339
- animation: animateCircle .3s linear forwards;
340
- opacity: 1;
341
- }
342
- .wpulike-robeen .wp_ulike_btn:checked + svg .grp1 {
343
- opacity: 1;
344
- transition: .1s all .3s;
345
- }
346
- .wpulike-robeen .wp_ulike_btn:checked + svg .grp1 .oval1 {
347
- transform: scale(0) translate(0, -30px);
348
- transform-origin: 0 0 0;
349
- transition: .5s transform .3s;
350
- }
351
- .wpulike-robeen .wp_ulike_btn:checked + svg .grp1 .oval2 {
352
- transform: scale(0) translate(10px, -50px);
353
- transform-origin: 0 0 0;
354
- transition: 1.5s transform .3s;
355
- }
356
- .wpulike-robeen .wp_ulike_btn:checked + svg .grp2 {
357
- opacity: 1;
358
- transition: .1s all .3s;
359
- opacity: 1;
360
- transition: .1s opacity .3s;
361
- }
362
- .wpulike-robeen .wp_ulike_btn:checked + svg .grp2 .oval1 {
363
- transform: scale(0) translate(30px, -15px);
364
- transform-origin: 0 0 0;
365
- transition: .5s transform .3s;
366
- }
367
- .wpulike-robeen .wp_ulike_btn:checked + svg .grp2 .oval2 {
368
- transform: scale(0) translate(60px, -15px);
369
- transform-origin: 0 0 0;
370
- transition: 1.5s transform .3s;
371
- }
372
- .wpulike-robeen .wp_ulike_btn:checked + svg .grp3 {
373
- opacity: 1;
374
- transition: .1s all .3s;
375
- opacity: 1;
376
- transition: .1s opacity .3s;
377
- }
378
- .wpulike-robeen .wp_ulike_btn:checked + svg .grp3 .oval1 {
379
- transform: scale(0) translate(30px, 0px);
380
- transform-origin: 0 0 0;
381
- transition: .5s transform .3s;
382
- }
383
- .wpulike-robeen .wp_ulike_btn:checked + svg .grp3 .oval2 {
384
- transform: scale(0) translate(60px, 10px);
385
- transform-origin: 0 0 0;
386
- transition: 1.5s transform .3s;
387
- }
388
- .wpulike-robeen .wp_ulike_btn:checked + svg .grp4 {
389
- opacity: 1;
390
- transition: .1s all .3s;
391
- opacity: 1;
392
- transition: .1s opacity .3s;
393
- }
394
- .wpulike-robeen .wp_ulike_btn:checked + svg .grp4 .oval1 {
395
- transform: scale(0) translate(30px, 15px);
396
- transform-origin: 0 0 0;
397
- transition: .5s transform .3s;
398
- }
399
- .wpulike-robeen .wp_ulike_btn:checked + svg .grp4 .oval2 {
400
- transform: scale(0) translate(40px, 50px);
401
- transform-origin: 0 0 0;
402
- transition: 1.5s transform .3s;
403
- }
404
- .wpulike-robeen .wp_ulike_btn:checked + svg .grp5 {
405
- opacity: 1;
406
- transition: .1s all .3s;
407
- opacity: 1;
408
- transition: .1s opacity .3s;
409
- }
410
- .wpulike-robeen .wp_ulike_btn:checked + svg .grp5 .oval1 {
411
- transform: scale(0) translate(-10px, 20px);
412
- transform-origin: 0 0 0;
413
- transition: .5s transform .3s;
414
- }
415
- .wpulike-robeen .wp_ulike_btn:checked + svg .grp5 .oval2 {
416
- transform: scale(0) translate(-60px, 30px);
417
- transform-origin: 0 0 0;
418
- transition: 1.5s transform .3s;
419
- }
420
- .wpulike-robeen .wp_ulike_btn:checked + svg .grp6 {
421
- opacity: 1;
422
- transition: .1s all .3s;
423
- opacity: 1;
424
- transition: .1s opacity .3s;
425
  }
426
- .wpulike-robeen .wp_ulike_btn:checked + svg .grp6 .oval1 {
427
- transform: scale(0) translate(-30px, 0px);
428
- transform-origin: 0 0 0;
429
- transition: .5s transform .3s;
430
  }
431
- .wpulike-robeen .wp_ulike_btn:checked + svg .grp6 .oval2 {
432
- transform: scale(0) translate(-60px, -5px);
433
- transform-origin: 0 0 0;
434
- transition: 1.5s transform .3s;
435
  }
436
- .wpulike-robeen .wp_ulike_btn:checked + svg .grp7 {
437
- opacity: 1;
438
- transition: .1s all .3s;
439
- opacity: 1;
440
- transition: .1s opacity .3s;
441
- }
442
- .wpulike-robeen .wp_ulike_btn:checked + svg .grp7 .oval1 {
443
- transform: scale(0) translate(-30px, -15px);
444
- transform-origin: 0 0 0;
445
- transition: .5s transform .3s;
446
- }
447
- .wpulike-robeen .wp_ulike_btn:checked + svg .grp7 .oval2 {
448
- transform: scale(0) translate(-55px, -30px);
449
- transform-origin: 0 0 0;
450
- transition: 1.5s transform .3s;
451
  }
452
 
453
  /**
454
  * Animated heart template
455
  */
 
 
 
456
  .wpulike-animated-heart .wp_ulike_btn {
457
  position: relative;
458
  border-radius: 50em;
@@ -469,6 +309,9 @@
469
  .wpulike-animated-heart .wp_ulike_btn.wp_ulike_btn_is_active {
470
  background-color: #ff6f63;
471
  }
 
 
 
472
  .wpulike-animated-heart .wp_ulike_btn.wp_ulike_btn_is_active .wpulike-svg-heart {
473
  fill: #ffffff;
474
  }
25
  cursor: pointer;
26
  }
27
  .wpulike .wp_ulike_btn:hover, .wpulike .wp_ulike_btn:active, .wpulike .wp_ulike_btn:focus {
28
+ outline: none;
29
+ }
30
+ .wpulike .wp_ulike_btn::-moz-focus-inner {
31
+ border: 0;
32
  }
33
  .wpulike .wp_ulike_btn[disabled=disabled]:hover, .wpulike .wp_ulike_btn[disabled=disabled]:active, .wpulike .wp_ulike_btn[disabled=disabled]:focus, .wpulike .wp_ulike_btn:disabled:hover, .wpulike .wp_ulike_btn:disabled:active, .wpulike .wp_ulike_btn:disabled:focus {
34
+ outline: none;
35
  background-color: initial;
36
  }
37
  .wpulike .wp_ulike_put_text {
234
  /**
235
  * Robeen template
236
  */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
237
  .wpulike-robeen .wp_ulike_likers_wrapper:not(.wp_ulike_display_inline) {
238
+ bottom: 5px;
239
  }
240
  .wpulike-robeen .count-box {
241
  font-weight: 600;
242
+ padding: 0 14px;
243
+ font-size: 16px;
244
  }
245
+ .wpulike-robeen .wp_ulike_is_loading .wp_ulike_btn {
246
+ background-image: initial;
247
+ padding: 0;
 
 
 
 
 
 
 
 
 
 
 
248
  }
249
+ .wpulike-robeen .wp_ulike_is_loading .wp_ulike_btn.wp_ulike_put_image:after {
250
+ content: '';
251
  }
252
  .wpulike-robeen .wp_ulike_btn {
253
+ width: 30px;
254
+ height: 30px;
255
  overflow: hidden;
 
 
 
 
256
  padding: 0;
257
  border: 0;
258
+ background: transparent;
259
  }
260
+ .wpulike-robeen .wp_ulike_btn:after {
261
+ content: '';
262
+ background: url(../img/icons/twitter-heart.png) no-repeat;
263
+ background-position: 0 0;
264
+ transition: background-position 1s steps(28);
265
+ transition-duration: 0s;
266
+ width: 100px;
267
+ height: 100px;
268
+ position: absolute;
269
+ left: 50%;
270
+ top: 50%;
271
+ transform: translateX(-50%) translateY(-50%);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
272
  }
273
+ .wpulike-robeen .wp_ulike_btn.wp_ulike_btn_is_active {
274
+ overflow: visible;
 
 
275
  }
276
+ .wpulike-robeen .wp_ulike_btn.wp_ulike_btn_is_active:after {
277
+ transition-duration: 1s;
278
+ background-position: -2800px 0;
 
279
  }
280
+
281
+ #buddypress #activity-stream .activity-meta .wpulike-robeen .wp_ulike_btn, #buddypress #activity-stream .activity-comments .wpulike-robeen .wp_ulike_btn, #buddypress #activity-stream .activity-inner .wpulike-robeen .wp_ulike_btn {
282
+ background: transparent;
283
+ border: 0;
284
+ width: 30px;
285
+ height: 30px;
286
+ border: 0;
287
+ padding: 0;
 
 
 
 
 
 
 
288
  }
289
 
290
  /**
291
  * Animated heart template
292
  */
293
+ .wpulike-animated-heart .wp_ulike_is_loading .wp_ulike_btn {
294
+ background-image: none;
295
+ }
296
  .wpulike-animated-heart .wp_ulike_btn {
297
  position: relative;
298
  border-radius: 50em;
309
  .wpulike-animated-heart .wp_ulike_btn.wp_ulike_btn_is_active {
310
  background-color: #ff6f63;
311
  }
312
+ .wpulike-animated-heart .wp_ulike_btn.wp_ulike_btn_is_active[disabled=disabled]:hover, .wpulike-animated-heart .wp_ulike_btn.wp_ulike_btn_is_active[disabled=disabled]:active, .wpulike-animated-heart .wp_ulike_btn.wp_ulike_btn_is_active[disabled=disabled]:focus, .wpulike-animated-heart .wp_ulike_btn.wp_ulike_btn_is_active:disabled:hover, .wpulike-animated-heart .wp_ulike_btn.wp_ulike_btn_is_active:disabled:active, .wpulike-animated-heart .wp_ulike_btn.wp_ulike_btn_is_active:disabled:focus {
313
+ background-color: #ff6f63;
314
+ }
315
  .wpulike-animated-heart .wp_ulike_btn.wp_ulike_btn_is_active .wpulike-svg-heart {
316
  fill: #ffffff;
317
  }
assets/css/wp-ulike.min.css CHANGED
@@ -3,4 +3,4 @@
3
  * WP ULike
4
  * @author Alimir [https://wordpress.org/plugins/wp-ulike/]
5
  ===============================================================
6
- */.wpulike{display:block;position:relative;line-height:normal;margin:0;padding:10px 0}.wpulike .wp_ulike_btn{margin:0;position:relative;display:inline-block;vertical-align:middle;border-radius:.25em;box-shadow:none;padding:15px 25px;border:none;text-align:center;transition-property:none;cursor:pointer}.wpulike .wp_ulike_btn:active,.wpulike .wp_ulike_btn:focus,.wpulike .wp_ulike_btn:hover{outline:0}.wpulike .wp_ulike_btn:disabled:active,.wpulike .wp_ulike_btn:disabled:focus,.wpulike .wp_ulike_btn:disabled:hover,.wpulike .wp_ulike_btn[disabled=disabled]:active,.wpulike .wp_ulike_btn[disabled=disabled]:focus,.wpulike .wp_ulike_btn[disabled=disabled]:hover{outline:0;background-color:initial}.wpulike .wp_ulike_put_text{font-size:14px;font-weight:600;line-height:28px;padding:0 10px;min-width:50px}.wpulike .wp_ulike_general_class{display:inline-flex;align-items:center}.wpulike .wp_ulike_is_loading .wp_ulike_btn{background-image:url(../img/svg/loader.svg);background-repeat:no-repeat;background-position:center center}.wpulike .wp_ulike_is_loading .wp_ulike_btn span{visibility:hidden}.wpulike .wp_ulike_is_loading .wp_ulike_btn.wp_ulike_put_image:after{content:none}.wpulike.wpulike-hide-counter .count-box{display:none}.wp_ulike_click_is_disabled{pointer-events:none;cursor:default}.wp_ulike_hide_me{visibility:hidden}.wpulike-default .wp_ulike_btn{color:#616161;background-color:#e0e0e0;min-height:30px;min-width:50px}.wpulike-default .wp_ulike_btn:disabled:active,.wpulike-default .wp_ulike_btn:disabled:focus,.wpulike-default .wp_ulike_btn:disabled:hover,.wpulike-default .wp_ulike_btn[disabled=disabled]:active,.wpulike-default .wp_ulike_btn[disabled=disabled]:focus,.wpulike-default .wp_ulike_btn[disabled=disabled]:hover{background-color:#e0e0e0}.wpulike-default .wp_ulike_is_liked .wp_ulike_btn{color:#757575}.wpulike-default .wp_ulike_put_image:after{content:'';display:block;background:url(../img/svg/like.svg) no-repeat;background-size:contain;width:16px;height:16px;position:absolute;left:50%;top:50%;transform:translateX(-50%) translateY(-50%)}.wpulike-default .wp_ulike_put_image.wp_ulike_btn_is_active:after{filter:invert(44%) sepia(40%) saturate(3852%) hue-rotate(329deg) brightness(100%) contrast(111%)}.wpulike-default .count-box{position:relative;border-radius:.25em;font-size:12px;text-decoration:none;background-color:#fff;margin-left:8px;line-height:28px;display:inline-block;padding:0 10px;box-shadow:0 0 0 1px #bdbdbd inset;color:#616161;vertical-align:middle;text-align:center}.wpulike-default .count-box:before{content:'';position:absolute;border:1px solid transparent;background:#fff;border-bottom-color:#bdbdbd;left:-5px;top:50%;border-left-color:#bdbdbd;transform:rotate(45deg) translatey(-50%);width:5px;height:5px;margin:0}#buddypress #activity-stream .activity-comments .wpulike,#buddypress #activity-stream .activity-meta .wpulike{display:flex;align-items:center;padding:0}#buddypress #activity-stream .activity-comments .wpulike-default .wp_ulike_btn,#buddypress #activity-stream .activity-meta .wpulike-default .wp_ulike_btn{border-radius:0;background-color:#fff;box-shadow:0 0 0 1px #bdbdbd inset;font-size:initial;padding:initial}#buddypress #activity-stream .wp_ulike_likers_wrapper .wp-ulike-liker,#buddypress #activity-stream .wp_ulike_likers_wrapper li{border:none;padding:0}#buddypress #activity-stream .wp_ulike_likers_wrapper .wp-ulike-liker a,#buddypress #activity-stream .wp_ulike_likers_wrapper .wp-ulike-liker img,#buddypress #activity-stream .wp_ulike_likers_wrapper li a,#buddypress #activity-stream .wp_ulike_likers_wrapper li img{float:none;padding:0;margin:0}#bbpress-forums .wp_ulike_likers_wrapper:not(.wp_ulike_display_inline) .wp-ulike-likers-list,#bbpress-forums .wp_ulike_likers_wrapper:not(.wp_ulike_display_inline) ul{margin:0!important}#bbpress-forums .wp_ulike_likers_wrapper:not(.wp_ulike_display_inline) .wp-ulike-likers-list li,#bbpress-forums .wp_ulike_likers_wrapper:not(.wp_ulike_display_inline) ul li{list-style-type:none}.wpulike-heart .wp_ulike_general_class{box-shadow:0 0 0 1px #bdbdbd inset;border-radius:.25em;padding:5px}.wpulike-heart .wp_ulike_put_text{padding:0 5px;text-transform:uppercase;font-weight:600;color:#757575}.wpulike-heart .wp_ulike_btn{background:0 0}.wpulike-heart .wp_ulike_likers_wrapper:not(.wp_ulike_display_inline){bottom:10px}.wpulike-heart .wp_ulike_put_image{background:0 0;padding:15px}.wpulike-heart .wp_ulike_put_image:disabled:active,.wpulike-heart .wp_ulike_put_image:disabled:focus,.wpulike-heart .wp_ulike_put_image:disabled:hover,.wpulike-heart .wp_ulike_put_image[disabled=disabled]:active,.wpulike-heart .wp_ulike_put_image[disabled=disabled]:focus,.wpulike-heart .wp_ulike_put_image[disabled=disabled]:hover{padding:15px}.wpulike-heart .wp_ulike_put_image:after{content:'';display:block;background:url(../img/svg/love.svg) no-repeat;background-size:contain;width:20px;height:20px;position:absolute;left:50%;top:50%;transform:translateX(-50%) translateY(-50%)}.wpulike-heart .wp_ulike_put_image.wp_ulike_btn_is_active:after{filter:invert(44%) sepia(40%) saturate(3852%) hue-rotate(329deg) brightness(100%) contrast(111%)}.wpulike-heart .count-box{font-size:14px;text-decoration:none;line-height:28px;display:inline-block;color:#616161;text-align:center;font-weight:600;vertical-align:middle;padding:0 5px}#buddypress #activity-stream .wpulike-heart .wp_ulike_btn{background:0 0;border:0;font-size:initial;padding:initial}#buddypress #activity-stream .wpulike-heart .wp_ulike_put_image{padding:10px 15px}#buddypress #activity-stream .wpulike-heart .wp_ulike_general_class{border-radius:0;padding:.2em .5em;margin-bottom:0}#buddypress #activity-stream .acomment-options,#buddypress #activity-stream .activity-meta{display:flex;align-items:center}@keyframes animateCircle{40%{transform:scale(10);opacity:1;fill:#dd4688}55%{transform:scale(11);opacity:1;fill:#d46abf}65%{transform:scale(12);opacity:1;fill:#cc8ef5}75%{transform:scale(13);opacity:1;fill:transparent;stroke:#cc8ef5;stroke-width:.5}85%{transform:scale(17);opacity:1;fill:transparent;stroke:#cc8ef5;stroke-width:.2}95%{transform:scale(18);opacity:1;fill:transparent;stroke:#cc8ef5;stroke-width:.1}100%{transform:scale(19);opacity:1;fill:transparent;stroke:#cc8ef5;stroke-width:0}}@keyframes animateHeart{0%{transform:scale(.2)}40%{transform:scale(1.2)}100%{transform:scale(1)}}@keyframes animateHeartOut{0%{transform:scale(1.4)}100%{transform:scale(1)}}.wpulike-robeen .wp_ulike_likers_wrapper:not(.wp_ulike_display_inline){bottom:15px}.wpulike-robeen .count-box{font-weight:600}.wpulike-robeen label{display:flex;align-items:center;margin:0 -5px}.wpulike-robeen svg{cursor:pointer;overflow:visible!important;width:50px;height:50px}.wpulike-robeen svg .heart{transform-origin:center;animation:animateHeartOut .3s linear forwards}.wpulike-robeen svg .main-circ{transform-origin:29.5px 29.5px}.wpulike-robeen .wp_ulike_btn{position:absolute;overflow:hidden;clip:rect(0 0 0 0);height:1px;width:1px;margin:-1px;padding:0;border:0}.wpulike-robeen .wp_ulike_btn:checked+svg .heart{transform:scale(.2);fill:#e2264d;animation:animateHeart .3s linear forwards .25s}.wpulike-robeen .wp_ulike_btn:checked+svg .main-circ{transition:all 2s;animation:animateCircle .3s linear forwards;opacity:1}.wpulike-robeen .wp_ulike_btn:checked+svg .grp1{opacity:1;transition:.1s all .3s}.wpulike-robeen .wp_ulike_btn:checked+svg .grp1 .oval1{transform:scale(0) translate(0,-30px);transform-origin:0 0 0;transition:.5s transform .3s}.wpulike-robeen .wp_ulike_btn:checked+svg .grp1 .oval2{transform:scale(0) translate(10px,-50px);transform-origin:0 0 0;transition:1.5s transform .3s}.wpulike-robeen .wp_ulike_btn:checked+svg .grp2{opacity:1;transition:.1s all .3s;opacity:1;transition:.1s opacity .3s}.wpulike-robeen .wp_ulike_btn:checked+svg .grp2 .oval1{transform:scale(0) translate(30px,-15px);transform-origin:0 0 0;transition:.5s transform .3s}.wpulike-robeen .wp_ulike_btn:checked+svg .grp2 .oval2{transform:scale(0) translate(60px,-15px);transform-origin:0 0 0;transition:1.5s transform .3s}.wpulike-robeen .wp_ulike_btn:checked+svg .grp3{opacity:1;transition:.1s all .3s;opacity:1;transition:.1s opacity .3s}.wpulike-robeen .wp_ulike_btn:checked+svg .grp3 .oval1{transform:scale(0) translate(30px,0);transform-origin:0 0 0;transition:.5s transform .3s}.wpulike-robeen .wp_ulike_btn:checked+svg .grp3 .oval2{transform:scale(0) translate(60px,10px);transform-origin:0 0 0;transition:1.5s transform .3s}.wpulike-robeen .wp_ulike_btn:checked+svg .grp4{opacity:1;transition:.1s all .3s;opacity:1;transition:.1s opacity .3s}.wpulike-robeen .wp_ulike_btn:checked+svg .grp4 .oval1{transform:scale(0) translate(30px,15px);transform-origin:0 0 0;transition:.5s transform .3s}.wpulike-robeen .wp_ulike_btn:checked+svg .grp4 .oval2{transform:scale(0) translate(40px,50px);transform-origin:0 0 0;transition:1.5s transform .3s}.wpulike-robeen .wp_ulike_btn:checked+svg .grp5{opacity:1;transition:.1s all .3s;opacity:1;transition:.1s opacity .3s}.wpulike-robeen .wp_ulike_btn:checked+svg .grp5 .oval1{transform:scale(0) translate(-10px,20px);transform-origin:0 0 0;transition:.5s transform .3s}.wpulike-robeen .wp_ulike_btn:checked+svg .grp5 .oval2{transform:scale(0) translate(-60px,30px);transform-origin:0 0 0;transition:1.5s transform .3s}.wpulike-robeen .wp_ulike_btn:checked+svg .grp6{opacity:1;transition:.1s all .3s;opacity:1;transition:.1s opacity .3s}.wpulike-robeen .wp_ulike_btn:checked+svg .grp6 .oval1{transform:scale(0) translate(-30px,0);transform-origin:0 0 0;transition:.5s transform .3s}.wpulike-robeen .wp_ulike_btn:checked+svg .grp6 .oval2{transform:scale(0) translate(-60px,-5px);transform-origin:0 0 0;transition:1.5s transform .3s}.wpulike-robeen .wp_ulike_btn:checked+svg .grp7{opacity:1;transition:.1s all .3s;opacity:1;transition:.1s opacity .3s}.wpulike-robeen .wp_ulike_btn:checked+svg .grp7 .oval1{transform:scale(0) translate(-30px,-15px);transform-origin:0 0 0;transition:.5s transform .3s}.wpulike-robeen .wp_ulike_btn:checked+svg .grp7 .oval2{transform:scale(0) translate(-55px,-30px);transform-origin:0 0 0;transition:1.5s transform .3s}.wpulike-animated-heart .wp_ulike_btn{position:relative;border-radius:50em;background-color:#fff;padding:0;box-shadow:0 5px 30px rgba(255,111,99,.4);border:0;width:50px;height:50px}.wpulike-animated-heart .wp_ulike_btn:disabled:active,.wpulike-animated-heart .wp_ulike_btn:disabled:focus,.wpulike-animated-heart .wp_ulike_btn:disabled:hover,.wpulike-animated-heart .wp_ulike_btn[disabled=disabled]:active,.wpulike-animated-heart .wp_ulike_btn[disabled=disabled]:focus,.wpulike-animated-heart .wp_ulike_btn[disabled=disabled]:hover{background-color:#fff}.wpulike-animated-heart .wp_ulike_btn.wp_ulike_btn_is_active{background-color:#ff6f63}.wpulike-animated-heart .wp_ulike_btn.wp_ulike_btn_is_active .wpulike-svg-heart{fill:#fff}.wpulike-animated-heart .wp_ulike_btn.wp_ulike_btn_is_active .wpulike-svg-heart-pop{animation-direction:normal}.wpulike-animated-heart .wp_ulike_btn:active{box-shadow:0 0 4px 0 rgba(0,0,0,.25)}.wpulike-animated-heart .wpulike-svg-heart{width:20px;fill:#ff6f63;transition:fill .5s,transform .5s;pointer-events:none;position:absolute;left:50%;top:50%;transform:translateX(-50%) translateY(-50%)}.wpulike-animated-heart .wpulike-svg-heart-pop{position:absolute;width:30%;fill:#ff6f63;opacity:0;left:0;animation:popHearts 1s ease forwards reverse}.wpulike-animated-heart .wpulike-svg-heart-pop.one{left:1%;transform:rotate(-10deg);animation-delay:.45s}.wpulike-animated-heart .wpulike-svg-heart-pop.two{left:15%;transform:rotate(8deg);animation-delay:.25s}.wpulike-animated-heart .wpulike-svg-heart-pop.three{left:30%;transform:rotate(-5deg);animation-delay:0s}.wpulike-animated-heart .wpulike-svg-heart-pop.four{left:50%;transform:rotate(-8deg);animation-delay:.3s}.wpulike-animated-heart .wpulike-svg-heart-pop.five{left:60%;transform:rotate(-10deg);animation-delay:.9s}.wpulike-animated-heart .wpulike-svg-heart-pop.six{left:70%;transform:rotate(-8deg);animation-delay:.2s}.wpulike-animated-heart .wpulike-svg-heart-pop.seven{left:85%;transform:rotate(6deg);animation-delay:.35s}.wpulike-animated-heart .wpulike-svg-heart-pop.eight{left:90%;transform:rotate(-4deg);animation-delay:.5s}.wpulike-animated-heart .wpulike-svg-heart-pop.nine{left:95%;transform:rotate(8deg);animation-delay:.2s}.wpulike-animated-heart .wp_ulike_likers_wrapper:not(.wp_ulike_display_inline){bottom:30px}.wpulike-animated-heart .count-box{margin:0 15px;color:#ff6f63;display:inline-block;vertical-align:middle}#buddypress #activity-stream .wpulike-animated-heart .wp_ulike_btn{background:inherit;border:0;width:40px;height:40px}#buddypress #activity-stream .wpulike-animated-heart .wp_ulike_btn.wp_ulike_btn_is_active{background-color:#ff6f63}@keyframes popHearts{0%{left:calc(50% - 7px);top:10px}20%{opacity:1}80%{top:-20px}100%{opacity:0}}.wp_ulike_likers_wrapper{margin:10px 0;flex:0 0 100%}.wp_ulike_likers_wrapper:empty{display:none}.wp_ulike_likers_wrapper:not(.wp_ulike_display_inline){transition:all .5s cubic-bezier(.19,1,.22,1);display:block;position:absolute;left:0;transform:translateY(-30px);bottom:0;background:#eee;padding:5px;opacity:0;visibility:hidden;box-shadow:2px 2px 1px rgba(0,0,0,.1);border-radius:5px;z-index:9}.wp_ulike_likers_wrapper:not(.wp_ulike_display_inline):after{content:'';position:absolute;top:100%;left:15px;width:0;height:0;border-top:8px solid #eee;border-right:8px solid transparent;border-left:8px solid transparent}.wp_ulike_likers_wrapper .tiles,.wp_ulike_likers_wrapper .wp-ulike-likers-list{display:flex;align-items:center;flex-wrap:wrap;margin:0;padding:0}.wp_ulike_likers_wrapper .tiles .wp-ulike-liker,.wp_ulike_likers_wrapper .tiles li,.wp_ulike_likers_wrapper .wp-ulike-likers-list .wp-ulike-liker,.wp_ulike_likers_wrapper .wp-ulike-likers-list li{padding:3px;margin:0;list-style:none}.wp_ulike_likers_wrapper .tiles .wp-ulike-liker a>img,.wp_ulike_likers_wrapper .tiles li a>img,.wp_ulike_likers_wrapper .wp-ulike-likers-list .wp-ulike-liker a>img,.wp_ulike_likers_wrapper .wp-ulike-likers-list li a>img{border-radius:5px;display:block;border:0;box-shadow:none}.wpulike:hover .wp_ulike_likers_wrapper:not(.wp_ulike_display_inline){transform:translateY(-40px);opacity:1;visibility:visible}.most_liked_users{list-style-type:none!important;position:relative!important;margin:10px 0!important;padding:0!important}.most_liked_users li{display:inline-table!important;cursor:pointer!important;margin:0 2px!important}.most_liked_users li img{display:block!important;float:none!important}.most_liked_users li.inactive{visibility:hidden!important;opacity:0!important}.commentlist .tiles .avatar,.commentlist .wp-ulike-liker .avatar{left:0!important}.wp_ulike_thumbnail{vertical-align:middle;margin:0 10px 0 0}.most_liked_comment .avatar{vertical-align:middle;margin:0 10px 0 0}.wp_ulike_style_simple .wp_counter_span:before{content:"("}.wp_ulike_style_simple .wp_counter_span:after{content:")"}.wp_ulike_style_love .wp_counter_span{float:right;display:inline-block;background:#f1f1f1 url(../img/icons/heart.png) 5px center no-repeat;color:#333;font-size:9px;line-height:17px;font-weight:400;margin:2px 0 0 2px;vertical-align:middle;border-radius:10px;padding:0 5px 0 23px;z-index:26}.wpulike-notification{position:fixed;z-index:999999;pointer-events:none;right:20px;bottom:20px}.wpulike-notification *{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.wpulike-notification .wpulike-message{position:relative;pointer-events:auto;word-wrap:break-word;overflow:hidden;margin:0 0 6px;padding:15px 15px 15px 55px;width:280px;border-radius:3px;background-color:#00bcd4;color:#fff;animation:wpUlikeNotifitcationsAnimation .2s backwards;box-shadow:0 3px 5px rgba(0,0,0,.08);font-size:14px;font-weight:500}.wpulike-notification .wpulike-message:hover{opacity:.9;cursor:pointer}.wpulike-notification .wpulike-message:before{content:"";background-position:center center;background-repeat:no-repeat;background-image:url(../img/svg/info.svg);position:absolute;left:0;width:45px;top:0;height:100%;background-color:rgba(0,0,0,.08)}.wpulike-notification .wpulike-message.wpulike-success{background-color:#8bc34a}.wpulike-notification .wpulike-message.wpulike-success:before{background-image:url(../img/svg/success.svg)}.wpulike-notification .wpulike-message.wpulike-error{background-color:#ef5350}.wpulike-notification .wpulike-message.wpulike-error:before{background-image:url(../img/svg/error.svg)}.wpulike-notification .wpulike-message.wpulike-warning{background-color:#ffab00}.wpulike-notification .wpulike-message.wpulike-warning:before{background-image:url(../img/svg/warning.svg)}@keyframes wpUlikeNotifitcationsAnimation{from{opacity:0;transform:translateY(100%)}to{opacity:.8;transform:translateY(0)}}@media all and (max-width:240px){.wpulike-notification .wpulike-message{padding:8px 8px 8px 55px;width:11em}}@media all and (min-width:241px) and (max-width:480px){.wpulike-notification .wpulike-message{padding:8px 8px 8px 55px;width:18em}}@media all and (min-width:481px) and (max-width:768px){.wpulike-notification .wpulike-message{padding:15px 15px 15px 55px;width:25em}}/*!>>>>>>>>>>>>>>>>>>>>>>> #RTL <<<<<<<<<<<<<<<<<<<<<<<<<<< */.rtl .wpulike-default .count-box{margin-right:8px;margin-left:inherit}.rtl .wpulike-default .count-box:before{right:-1px;left:auto;border-color:#bdbdbd #bdbdbd transparent transparent}.rtl .wp_ulike_likers_wrapper:not(.wp_ulike_display_inline){left:auto;right:0}.rtl .wp_ulike_likers_wrapper:not(.wp_ulike_display_inline):after{left:auto;right:15px}.rtl .commentlist .tiles .avatar{left:inherit!important;right:0!important}.rtl .wp_ulike_thumbnail{margin:0 0 0 10px}.rtl .most_liked_comment .avatar{margin:0 0 0 10px}.rtl .wp_ulike_style_love .wp_counter_span{float:left;background:#f1f1f1 url(../img/icons/heart.png) no-repeat scroll 85% center;margin:2px 2px 0 0;padding:0 23px 0 5px}.rtl .wpulike-notification{left:20px;right:inherit}.rtl .wpulike-notification .wpulike-message{padding:15px 55px 15px 15px}.rtl .wpulike-notification .wpulike-message:before{left:auto;right:0}@media all and (max-width:240px){.rtl .wpulike-notification .wpulike-message{padding:8px 55px 8px 8px}}@media all and (min-width:241px) and (max-width:480px){.rtl .wpulike-notification .wpulike-message{padding:8px 55px 8px 8px}}@media all and (min-width:481px) and (max-width:768px){.rtl .wpulike-notification .wpulike-message{padding:15px 55px 15px 15px}}
3
  * WP ULike
4
  * @author Alimir [https://wordpress.org/plugins/wp-ulike/]
5
  ===============================================================
6
+ */.wpulike{display:block;position:relative;line-height:normal;margin:0;padding:10px 0}.wpulike .wp_ulike_btn{margin:0;position:relative;display:inline-block;vertical-align:middle;border-radius:.25em;box-shadow:none;padding:15px 25px;border:none;text-align:center;transition-property:none;cursor:pointer}.wpulike .wp_ulike_btn:active,.wpulike .wp_ulike_btn:focus,.wpulike .wp_ulike_btn:hover{outline:0}.wpulike .wp_ulike_btn::-moz-focus-inner{border:0}.wpulike .wp_ulike_btn:disabled:active,.wpulike .wp_ulike_btn:disabled:focus,.wpulike .wp_ulike_btn:disabled:hover,.wpulike .wp_ulike_btn[disabled=disabled]:active,.wpulike .wp_ulike_btn[disabled=disabled]:focus,.wpulike .wp_ulike_btn[disabled=disabled]:hover{outline:0;background-color:initial}.wpulike .wp_ulike_put_text{font-size:14px;font-weight:600;line-height:28px;padding:0 10px;min-width:50px}.wpulike .wp_ulike_general_class{display:inline-flex;align-items:center}.wpulike .wp_ulike_is_loading .wp_ulike_btn{background-image:url(../img/svg/loader.svg);background-repeat:no-repeat;background-position:center center}.wpulike .wp_ulike_is_loading .wp_ulike_btn span{visibility:hidden}.wpulike .wp_ulike_is_loading .wp_ulike_btn.wp_ulike_put_image:after{content:none}.wpulike.wpulike-hide-counter .count-box{display:none}.wp_ulike_click_is_disabled{pointer-events:none;cursor:default}.wp_ulike_hide_me{visibility:hidden}.wpulike-default .wp_ulike_btn{color:#616161;background-color:#e0e0e0;min-height:30px;min-width:50px}.wpulike-default .wp_ulike_btn:disabled:active,.wpulike-default .wp_ulike_btn:disabled:focus,.wpulike-default .wp_ulike_btn:disabled:hover,.wpulike-default .wp_ulike_btn[disabled=disabled]:active,.wpulike-default .wp_ulike_btn[disabled=disabled]:focus,.wpulike-default .wp_ulike_btn[disabled=disabled]:hover{background-color:#e0e0e0}.wpulike-default .wp_ulike_is_liked .wp_ulike_btn{color:#757575}.wpulike-default .wp_ulike_put_image:after{content:'';display:block;background:url(../img/svg/like.svg) no-repeat;background-size:contain;width:16px;height:16px;position:absolute;left:50%;top:50%;transform:translateX(-50%) translateY(-50%)}.wpulike-default .wp_ulike_put_image.wp_ulike_btn_is_active:after{filter:invert(44%) sepia(40%) saturate(3852%) hue-rotate(329deg) brightness(100%) contrast(111%)}.wpulike-default .count-box{position:relative;border-radius:.25em;font-size:12px;text-decoration:none;background-color:#fff;margin-left:8px;line-height:28px;display:inline-block;padding:0 10px;box-shadow:0 0 0 1px #bdbdbd inset;color:#616161;vertical-align:middle;text-align:center}.wpulike-default .count-box:before{content:'';position:absolute;border:1px solid transparent;background:#fff;border-bottom-color:#bdbdbd;left:-5px;top:50%;border-left-color:#bdbdbd;transform:rotate(45deg) translatey(-50%);width:5px;height:5px;margin:0}#buddypress #activity-stream .activity-comments .wpulike,#buddypress #activity-stream .activity-meta .wpulike{display:flex;align-items:center;padding:0}#buddypress #activity-stream .activity-comments .wpulike-default .wp_ulike_btn,#buddypress #activity-stream .activity-meta .wpulike-default .wp_ulike_btn{border-radius:0;background-color:#fff;box-shadow:0 0 0 1px #bdbdbd inset;font-size:initial;padding:initial}#buddypress #activity-stream .wp_ulike_likers_wrapper .wp-ulike-liker,#buddypress #activity-stream .wp_ulike_likers_wrapper li{border:none;padding:0}#buddypress #activity-stream .wp_ulike_likers_wrapper .wp-ulike-liker a,#buddypress #activity-stream .wp_ulike_likers_wrapper .wp-ulike-liker img,#buddypress #activity-stream .wp_ulike_likers_wrapper li a,#buddypress #activity-stream .wp_ulike_likers_wrapper li img{float:none;padding:0;margin:0}#bbpress-forums .wp_ulike_likers_wrapper:not(.wp_ulike_display_inline) .wp-ulike-likers-list,#bbpress-forums .wp_ulike_likers_wrapper:not(.wp_ulike_display_inline) ul{margin:0!important}#bbpress-forums .wp_ulike_likers_wrapper:not(.wp_ulike_display_inline) .wp-ulike-likers-list li,#bbpress-forums .wp_ulike_likers_wrapper:not(.wp_ulike_display_inline) ul li{list-style-type:none}.wpulike-heart .wp_ulike_general_class{box-shadow:0 0 0 1px #bdbdbd inset;border-radius:.25em;padding:5px}.wpulike-heart .wp_ulike_put_text{padding:0 5px;text-transform:uppercase;font-weight:600;color:#757575}.wpulike-heart .wp_ulike_btn{background:0 0}.wpulike-heart .wp_ulike_likers_wrapper:not(.wp_ulike_display_inline){bottom:10px}.wpulike-heart .wp_ulike_put_image{background:0 0;padding:15px}.wpulike-heart .wp_ulike_put_image:disabled:active,.wpulike-heart .wp_ulike_put_image:disabled:focus,.wpulike-heart .wp_ulike_put_image:disabled:hover,.wpulike-heart .wp_ulike_put_image[disabled=disabled]:active,.wpulike-heart .wp_ulike_put_image[disabled=disabled]:focus,.wpulike-heart .wp_ulike_put_image[disabled=disabled]:hover{padding:15px}.wpulike-heart .wp_ulike_put_image:after{content:'';display:block;background:url(../img/svg/love.svg) no-repeat;background-size:contain;width:20px;height:20px;position:absolute;left:50%;top:50%;transform:translateX(-50%) translateY(-50%)}.wpulike-heart .wp_ulike_put_image.wp_ulike_btn_is_active:after{filter:invert(44%) sepia(40%) saturate(3852%) hue-rotate(329deg) brightness(100%) contrast(111%)}.wpulike-heart .count-box{font-size:14px;text-decoration:none;line-height:28px;display:inline-block;color:#616161;text-align:center;font-weight:600;vertical-align:middle;padding:0 5px}#buddypress #activity-stream .wpulike-heart .wp_ulike_btn{background:0 0;border:0;font-size:initial;padding:initial}#buddypress #activity-stream .wpulike-heart .wp_ulike_put_image{padding:10px 15px}#buddypress #activity-stream .wpulike-heart .wp_ulike_general_class{border-radius:0;padding:.2em .5em;margin-bottom:0}#buddypress #activity-stream .acomment-options,#buddypress #activity-stream .activity-meta{display:flex;align-items:center}.wpulike-robeen .wp_ulike_likers_wrapper:not(.wp_ulike_display_inline){bottom:5px}.wpulike-robeen .count-box{font-weight:600;padding:0 14px;font-size:16px}.wpulike-robeen .wp_ulike_is_loading .wp_ulike_btn{background-image:initial;padding:0}.wpulike-robeen .wp_ulike_is_loading .wp_ulike_btn.wp_ulike_put_image:after{content:''}.wpulike-robeen .wp_ulike_btn{width:30px;height:30px;overflow:hidden;padding:0;border:0;background:0 0}.wpulike-robeen .wp_ulike_btn:after{content:'';background:url(../img/icons/twitter-heart.png) no-repeat;background-position:0 0;transition:background-position 1s steps(28);transition-duration:0s;width:100px;height:100px;position:absolute;left:50%;top:50%;transform:translateX(-50%) translateY(-50%)}.wpulike-robeen .wp_ulike_btn.wp_ulike_btn_is_active{overflow:visible}.wpulike-robeen .wp_ulike_btn.wp_ulike_btn_is_active:after{transition-duration:1s;background-position:-2800px 0}#buddypress #activity-stream .activity-comments .wpulike-robeen .wp_ulike_btn,#buddypress #activity-stream .activity-inner .wpulike-robeen .wp_ulike_btn,#buddypress #activity-stream .activity-meta .wpulike-robeen .wp_ulike_btn{background:0 0;border:0;width:30px;height:30px;border:0;padding:0}.wpulike-animated-heart .wp_ulike_is_loading .wp_ulike_btn{background-image:none}.wpulike-animated-heart .wp_ulike_btn{position:relative;border-radius:50em;background-color:#fff;padding:0;box-shadow:0 5px 30px rgba(255,111,99,.4);border:0;width:50px;height:50px}.wpulike-animated-heart .wp_ulike_btn:disabled:active,.wpulike-animated-heart .wp_ulike_btn:disabled:focus,.wpulike-animated-heart .wp_ulike_btn:disabled:hover,.wpulike-animated-heart .wp_ulike_btn[disabled=disabled]:active,.wpulike-animated-heart .wp_ulike_btn[disabled=disabled]:focus,.wpulike-animated-heart .wp_ulike_btn[disabled=disabled]:hover{background-color:#fff}.wpulike-animated-heart .wp_ulike_btn.wp_ulike_btn_is_active{background-color:#ff6f63}.wpulike-animated-heart .wp_ulike_btn.wp_ulike_btn_is_active:disabled:active,.wpulike-animated-heart .wp_ulike_btn.wp_ulike_btn_is_active:disabled:focus,.wpulike-animated-heart .wp_ulike_btn.wp_ulike_btn_is_active:disabled:hover,.wpulike-animated-heart .wp_ulike_btn.wp_ulike_btn_is_active[disabled=disabled]:active,.wpulike-animated-heart .wp_ulike_btn.wp_ulike_btn_is_active[disabled=disabled]:focus,.wpulike-animated-heart .wp_ulike_btn.wp_ulike_btn_is_active[disabled=disabled]:hover{background-color:#ff6f63}.wpulike-animated-heart .wp_ulike_btn.wp_ulike_btn_is_active .wpulike-svg-heart{fill:#fff}.wpulike-animated-heart .wp_ulike_btn.wp_ulike_btn_is_active .wpulike-svg-heart-pop{animation-direction:normal}.wpulike-animated-heart .wp_ulike_btn:active{box-shadow:0 0 4px 0 rgba(0,0,0,.25)}.wpulike-animated-heart .wpulike-svg-heart{width:20px;fill:#ff6f63;transition:fill .5s,transform .5s;pointer-events:none;position:absolute;left:50%;top:50%;transform:translateX(-50%) translateY(-50%)}.wpulike-animated-heart .wpulike-svg-heart-pop{position:absolute;width:30%;fill:#ff6f63;opacity:0;left:0;animation:popHearts 1s ease forwards reverse}.wpulike-animated-heart .wpulike-svg-heart-pop.one{left:1%;transform:rotate(-10deg);animation-delay:.45s}.wpulike-animated-heart .wpulike-svg-heart-pop.two{left:15%;transform:rotate(8deg);animation-delay:.25s}.wpulike-animated-heart .wpulike-svg-heart-pop.three{left:30%;transform:rotate(-5deg);animation-delay:0s}.wpulike-animated-heart .wpulike-svg-heart-pop.four{left:50%;transform:rotate(-8deg);animation-delay:.3s}.wpulike-animated-heart .wpulike-svg-heart-pop.five{left:60%;transform:rotate(-10deg);animation-delay:.9s}.wpulike-animated-heart .wpulike-svg-heart-pop.six{left:70%;transform:rotate(-8deg);animation-delay:.2s}.wpulike-animated-heart .wpulike-svg-heart-pop.seven{left:85%;transform:rotate(6deg);animation-delay:.35s}.wpulike-animated-heart .wpulike-svg-heart-pop.eight{left:90%;transform:rotate(-4deg);animation-delay:.5s}.wpulike-animated-heart .wpulike-svg-heart-pop.nine{left:95%;transform:rotate(8deg);animation-delay:.2s}.wpulike-animated-heart .wp_ulike_likers_wrapper:not(.wp_ulike_display_inline){bottom:30px}.wpulike-animated-heart .count-box{margin:0 15px;color:#ff6f63;display:inline-block;vertical-align:middle}#buddypress #activity-stream .wpulike-animated-heart .wp_ulike_btn{background:inherit;border:0;width:40px;height:40px}#buddypress #activity-stream .wpulike-animated-heart .wp_ulike_btn.wp_ulike_btn_is_active{background-color:#ff6f63}@keyframes popHearts{0%{left:calc(50% - 7px);top:10px}20%{opacity:1}80%{top:-20px}100%{opacity:0}}.wp_ulike_likers_wrapper{margin:10px 0;flex:0 0 100%}.wp_ulike_likers_wrapper:empty{display:none}.wp_ulike_likers_wrapper:not(.wp_ulike_display_inline){transition:all .5s cubic-bezier(.19,1,.22,1);display:block;position:absolute;left:0;transform:translateY(-30px);bottom:0;background:#eee;padding:5px;opacity:0;visibility:hidden;box-shadow:2px 2px 1px rgba(0,0,0,.1);border-radius:5px;z-index:9}.wp_ulike_likers_wrapper:not(.wp_ulike_display_inline):after{content:'';position:absolute;top:100%;left:15px;width:0;height:0;border-top:8px solid #eee;border-right:8px solid transparent;border-left:8px solid transparent}.wp_ulike_likers_wrapper .tiles,.wp_ulike_likers_wrapper .wp-ulike-likers-list{display:flex;align-items:center;flex-wrap:wrap;margin:0;padding:0}.wp_ulike_likers_wrapper .tiles .wp-ulike-liker,.wp_ulike_likers_wrapper .tiles li,.wp_ulike_likers_wrapper .wp-ulike-likers-list .wp-ulike-liker,.wp_ulike_likers_wrapper .wp-ulike-likers-list li{padding:3px;margin:0;list-style:none}.wp_ulike_likers_wrapper .tiles .wp-ulike-liker a>img,.wp_ulike_likers_wrapper .tiles li a>img,.wp_ulike_likers_wrapper .wp-ulike-likers-list .wp-ulike-liker a>img,.wp_ulike_likers_wrapper .wp-ulike-likers-list li a>img{border-radius:5px;display:block;border:0;box-shadow:none}.wpulike:hover .wp_ulike_likers_wrapper:not(.wp_ulike_display_inline){transform:translateY(-40px);opacity:1;visibility:visible}.most_liked_users{list-style-type:none!important;position:relative!important;margin:10px 0!important;padding:0!important}.most_liked_users li{display:inline-table!important;cursor:pointer!important;margin:0 2px!important}.most_liked_users li img{display:block!important;float:none!important}.most_liked_users li.inactive{visibility:hidden!important;opacity:0!important}.commentlist .tiles .avatar,.commentlist .wp-ulike-liker .avatar{left:0!important}.wp_ulike_thumbnail{vertical-align:middle;margin:0 10px 0 0}.most_liked_comment .avatar{vertical-align:middle;margin:0 10px 0 0}.wp_ulike_style_simple .wp_counter_span:before{content:"("}.wp_ulike_style_simple .wp_counter_span:after{content:")"}.wp_ulike_style_love .wp_counter_span{float:right;display:inline-block;background:#f1f1f1 url(../img/icons/heart.png) 5px center no-repeat;color:#333;font-size:9px;line-height:17px;font-weight:400;margin:2px 0 0 2px;vertical-align:middle;border-radius:10px;padding:0 5px 0 23px;z-index:26}.wpulike-notification{position:fixed;z-index:999999;pointer-events:none;right:20px;bottom:20px}.wpulike-notification *{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.wpulike-notification .wpulike-message{position:relative;pointer-events:auto;word-wrap:break-word;overflow:hidden;margin:0 0 6px;padding:15px 15px 15px 55px;width:280px;border-radius:3px;background-color:#00bcd4;color:#fff;animation:wpUlikeNotifitcationsAnimation .2s backwards;box-shadow:0 3px 5px rgba(0,0,0,.08);font-size:14px;font-weight:500}.wpulike-notification .wpulike-message:hover{opacity:.9;cursor:pointer}.wpulike-notification .wpulike-message:before{content:"";background-position:center center;background-repeat:no-repeat;background-image:url(../img/svg/info.svg);position:absolute;left:0;width:45px;top:0;height:100%;background-color:rgba(0,0,0,.08)}.wpulike-notification .wpulike-message.wpulike-success{background-color:#8bc34a}.wpulike-notification .wpulike-message.wpulike-success:before{background-image:url(../img/svg/success.svg)}.wpulike-notification .wpulike-message.wpulike-error{background-color:#ef5350}.wpulike-notification .wpulike-message.wpulike-error:before{background-image:url(../img/svg/error.svg)}.wpulike-notification .wpulike-message.wpulike-warning{background-color:#ffab00}.wpulike-notification .wpulike-message.wpulike-warning:before{background-image:url(../img/svg/warning.svg)}@keyframes wpUlikeNotifitcationsAnimation{from{opacity:0;transform:translateY(100%)}to{opacity:.8;transform:translateY(0)}}@media all and (max-width:240px){.wpulike-notification .wpulike-message{padding:8px 8px 8px 55px;width:11em}}@media all and (min-width:241px) and (max-width:480px){.wpulike-notification .wpulike-message{padding:8px 8px 8px 55px;width:18em}}@media all and (min-width:481px) and (max-width:768px){.wpulike-notification .wpulike-message{padding:15px 15px 15px 55px;width:25em}}/*!>>>>>>>>>>>>>>>>>>>>>>> #RTL <<<<<<<<<<<<<<<<<<<<<<<<<<< */.rtl .wpulike-default .count-box{margin-right:8px;margin-left:inherit}.rtl .wpulike-default .count-box:before{right:-1px;left:auto;border-color:#bdbdbd #bdbdbd transparent transparent}.rtl .wp_ulike_likers_wrapper:not(.wp_ulike_display_inline){left:auto;right:0}.rtl .wp_ulike_likers_wrapper:not(.wp_ulike_display_inline):after{left:auto;right:15px}.rtl .commentlist .tiles .avatar{left:inherit!important;right:0!important}.rtl .wp_ulike_thumbnail{margin:0 0 0 10px}.rtl .most_liked_comment .avatar{margin:0 0 0 10px}.rtl .wp_ulike_style_love .wp_counter_span{float:left;background:#f1f1f1 url(../img/icons/heart.png) no-repeat scroll 85% center;margin:2px 2px 0 0;padding:0 23px 0 5px}.rtl .wpulike-notification{left:20px;right:inherit}.rtl .wpulike-notification .wpulike-message{padding:15px 55px 15px 15px}.rtl .wpulike-notification .wpulike-message:before{left:auto;right:0}@media all and (max-width:240px){.rtl .wpulike-notification .wpulike-message{padding:8px 55px 8px 8px}}@media all and (min-width:241px) and (max-width:480px){.rtl .wpulike-notification .wpulike-message{padding:8px 55px 8px 8px}}@media all and (min-width:481px) and (max-width:768px){.rtl .wpulike-notification .wpulike-message{padding:15px 55px 15px 15px}}
assets/img/icons/twitter-heart.png ADDED
Binary file
assets/js/wp-ulike.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! WP ULike - v4.2.1
2
  * https://wpulike.com
3
  * TechnoWich 2020;
4
  */
1
+ /*! WP ULike - v4.2.2
2
  * https://wpulike.com
3
  * TechnoWich 2020;
4
  */
inc/classes/class-wp-ulike.php CHANGED
@@ -37,11 +37,12 @@ if ( ! class_exists( 'wp_ulike' ) ) {
37
  */
38
  public function init(){
39
  global $wpdb, $wp_user_IP;
40
- $this->wpdb = $wpdb;
41
- $this->status = 'like';
42
- $this->user_ip = $wp_user_IP;
43
- $this->user_id = $this->get_reutrn_id();
44
- $this->is_distinct = true;
 
45
  }
46
 
47
  /**
@@ -246,6 +247,7 @@ if ( ! class_exists( 'wp_ulike' ) ) {
246
 
247
  } else {
248
  $this->update_status( $factor, $this->prev_status );
 
249
  // Update status
250
  $this->wpdb->update(
251
  $this->wpdb->prefix . $table,
@@ -496,6 +498,28 @@ if ( ! class_exists( 'wp_ulike' ) ) {
496
 
497
  }
498
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
499
  /**
500
  * Get User Status (like/dislike)
501
  *
@@ -508,11 +532,11 @@ if ( ! class_exists( 'wp_ulike' ) ) {
508
  */
509
  public function get_user_status( $table, $item_type_col, $item_conditional_col, $item_type_val, $item_conditional_val ){
510
 
511
- $cache_key = sanitize_key( sprintf( 'user-status-of-item-%s-in-%s-table', $table, $item_type_val ) );
512
- $user_status = wp_cache_get( $cache_key, WP_ULIKE_SLUG );
 
513
 
514
- // Make a general query to get info from target table.
515
- if( false === $user_status ){
516
  // Create query string
517
  $query = sprintf( '
518
  SELECT `status`
@@ -530,10 +554,18 @@ if ( ! class_exists( 'wp_ulike' ) ) {
530
 
531
  // Get results
532
  $user_status = $this->wpdb->get_var( stripslashes( $query ) );
533
- wp_cache_set( $cache_key, $user_status, WP_ULIKE_SLUG, 300 );
 
 
 
 
 
 
 
 
534
  }
535
 
536
- return $user_status;
537
  }
538
 
539
  /**
@@ -589,19 +621,12 @@ if ( ! class_exists( 'wp_ulike' ) ) {
589
  }
590
 
591
  /**
592
- * Return user ID
593
  *
594
- * @author Alimir
595
- * @since 2.0
596
- * @return String
597
  */
598
  public function get_reutrn_id(){
599
-
600
- if( ! ( $user_ID = get_current_user_id() ) ){
601
- return wp_ulike_generate_user_id( $this->user_ip );
602
- } else {
603
- return $user_ID;
604
- }
605
  }
606
 
607
  /**
37
  */
38
  public function init(){
39
  global $wpdb, $wp_user_IP;
40
+ $this->wpdb = $wpdb;
41
+ $this->status = 'like';
42
+ $this->user_ip = $wp_user_IP;
43
+ $this->current_user = get_current_user_id();
44
+ $this->user_id = $this->get_reutrn_id();
45
+ $this->is_distinct = true;
46
  }
47
 
48
  /**
247
 
248
  } else {
249
  $this->update_status( $factor, $this->prev_status );
250
+ $this->update_user_meta_status( $id, $slug, $this->status );
251
  // Update status
252
  $this->wpdb->update(
253
  $this->wpdb->prefix . $table,
498
 
499
  }
500
 
501
+ /**
502
+ * Update user meta status
503
+ *
504
+ * @param integer $id
505
+ * @param string $slug
506
+ * @param string $status
507
+ * @return void
508
+ */
509
+ public function update_user_meta_status( $id, $slug, $status ){
510
+ // Update object cache (memcached issue)
511
+ $meta_key = sanitize_key( $slug . '_status' );
512
+ $user_info = wp_ulike_get_meta_data( $this->user_id, 'user', $meta_key, true );
513
+
514
+ if( empty( $user_info ) ){
515
+ $user_info = array( $id => $status );
516
+ } else {
517
+ $user_info[$id] = $status;
518
+ }
519
+
520
+ wp_ulike_update_meta_data( $this->user_id, 'user', $meta_key, $user_info );
521
+ }
522
+
523
  /**
524
  * Get User Status (like/dislike)
525
  *
532
  */
533
  public function get_user_status( $table, $item_type_col, $item_conditional_col, $item_type_val, $item_conditional_val ){
534
 
535
+ $item_type = wp_ulike_get_type_by_table( $table );
536
+ $meta_key = sanitize_key( $item_type . '_status' );
537
+ $user_info = wp_ulike_get_meta_data( $this->user_id, 'user', $meta_key, true );
538
 
539
+ if( empty( $user_info ) || ! isset( $user_info[$item_type_val] ) ){
 
540
  // Create query string
541
  $query = sprintf( '
542
  SELECT `status`
554
 
555
  // Get results
556
  $user_status = $this->wpdb->get_var( stripslashes( $query ) );
557
+ // Check user info value
558
+ $user_info = empty( $user_info ) ? array() : $user_info;
559
+
560
+ if( $user_status !== NULL || $this->current_user ){
561
+ $user_info[$item_type_val] = $this->current_user && $user_status === NULL ? NULL : $user_status;
562
+ wp_ulike_update_meta_data( $this->user_id, 'user', $meta_key, $user_info );
563
+ }
564
+ } elseif( empty( $user_info[$item_type_val] ) ) {
565
+ return false;
566
  }
567
 
568
+ return isset( $user_info[ $item_type_val ] ) ? $user_info[ $item_type_val ] : false;
569
  }
570
 
571
  /**
621
  }
622
 
623
  /**
624
+ * Get current user ID
625
  *
626
+ * @return void
 
 
627
  */
628
  public function get_reutrn_id(){
629
+ return ! $this->current_user ? wp_ulike_generate_user_id( $this->user_ip ) : $this->current_user;
 
 
 
 
 
630
  }
631
 
632
  /**
inc/general-functions.php CHANGED
@@ -68,105 +68,6 @@ if ( ! function_exists( 'wp_ulike_get_option' ) ) {
68
  }
69
  }
70
 
71
- if( ! function_exists( 'wp_ulike_delete_all_logs' ) ){
72
- /**
73
- * Delete all the users likes logs by ajax process.
74
- *
75
- * @author Alimir
76
- * @since 2.2
77
- * @return Void
78
- */
79
- function wp_ulike_delete_all_logs() {
80
- global $wpdb;
81
- $get_action = $_POST['action'];
82
- //$wpdb->hide_errors();
83
-
84
- if( !current_user_can( 'manage_options' ) ){
85
- wp_send_json_error( __( 'You\'ve not permission to remove all the logs. ', WP_ULIKE_SLUG ) );
86
- }
87
-
88
- if($get_action == 'wp_ulike_posts_delete_logs'){
89
- $logs_table = $wpdb->prefix."ulike";
90
- } else if($get_action == 'wp_ulike_comments_delete_logs'){
91
- $logs_table = $wpdb->prefix."ulike_comments";
92
- } else if($get_action == 'wp_ulike_buddypress_delete_logs'){
93
- $logs_table = $wpdb->prefix."ulike_activities";
94
- } else if($get_action == 'wp_ulike_bbpress_delete_logs'){
95
- $logs_table = $wpdb->prefix."ulike_forums";
96
- }
97
-
98
- if ($wpdb->query("TRUNCATE TABLE $logs_table") === FALSE) {
99
- wp_send_json_error( __( 'Failed! There was a problem in removing of logs.', WP_ULIKE_SLUG ) );
100
- } else {
101
- wp_send_json_success( __( 'Success! All rows has been deleted!', WP_ULIKE_SLUG ) );
102
- }
103
- }
104
- }
105
-
106
- if( ! function_exists( 'wp_ulike_delete_orphaned_rows' ) ){
107
- /**
108
- * Delete all the users likes logs by ajax process.
109
- *
110
- * @author Alimir
111
- * @since 2.2
112
- * @return Void
113
- */
114
- function wp_ulike_delete_orphaned_rows() {
115
- global $wpdb;
116
- $get_action = $_POST['action'];
117
- //$wpdb->hide_errors();
118
-
119
- if( !current_user_can( 'manage_options' ) ){
120
- wp_send_json_error( __( 'You\'ve not permission to remove all the logs. ', WP_ULIKE_SLUG ) );
121
- }
122
-
123
- $type = '';
124
- switch ($get_action) {
125
- case 'wp_ulike_posts_delete_orphaned_rows':
126
- $type = 'post';
127
- break;
128
-
129
- case 'wp_ulike_comments_delete_orphaned_rows':
130
- $type = 'comment';
131
- break;
132
-
133
- case 'wp_ulike_buddypress_delete_orphaned_rows':
134
- $type = 'activity';
135
- break;
136
-
137
- case 'wp_ulike_bbpress_delete_orphaned_rows':
138
- $type = 'topic';
139
- break;
140
- }
141
-
142
- if( empty( $type ) ){
143
- wp_send_json_error( __( 'Bad request!', WP_ULIKE_SLUG ) );
144
- }
145
-
146
- // get table info
147
- $info_args = wp_ulike_get_table_info( $type );
148
-
149
- // Create query string
150
- $query = sprintf( "
151
- DELETE FROM %s
152
- WHERE `%s`
153
- NOT IN (SELECT dt.`%s`
154
- FROM %s dt)",
155
- $wpdb->prefix . $info_args['table'],
156
- $info_args['column'],
157
- $info_args['related_column'],
158
- $wpdb->prefix . $info_args['related_table']
159
- );
160
-
161
- if ( $wpdb->query( $query ) === FALSE ) {
162
- wp_send_json_error( __( 'Failed! There was a problem in removing of orphaned rows.', WP_ULIKE_SLUG ) );
163
- } else {
164
- wp_send_json_success( __( 'Success! All orphaned rows has been deleted!', WP_ULIKE_SLUG ) );
165
- }
166
- }
167
- }
168
-
169
-
170
  if( ! function_exists( 'wp_ulike_generate_templates_list' ) ){
171
  /**
172
  * Generate templates list
@@ -234,7 +135,6 @@ if( ! function_exists( 'wp_ulike_add_meta_data' ) ){
234
  return false;
235
  }
236
 
237
- $meta_type = 'wp_ulike';
238
  $table = $wpdb->prefix . 'ulike_meta';
239
  $column = sanitize_key( 'item_id' );
240
  $id_column = 'meta_id';
@@ -274,7 +174,7 @@ if( ! function_exists( 'wp_ulike_add_meta_data' ) ){
274
 
275
  $mid = (int) $wpdb->insert_id;
276
 
277
- wp_cache_delete( $object_id, $meta_type . '_meta' );
278
 
279
  return $mid;
280
  }
@@ -308,7 +208,6 @@ if( ! function_exists( 'wp_ulike_update_meta_data' ) ){
308
  return false;
309
  }
310
 
311
- $meta_type = 'wp_ulike';
312
  $table = $wpdb->prefix . 'ulike_meta';
313
  $column = sanitize_key( 'item_id' );
314
  $id_column = 'meta_id';
@@ -356,7 +255,7 @@ if( ! function_exists( 'wp_ulike_update_meta_data' ) ){
356
  return false;
357
  }
358
 
359
- wp_cache_delete( $object_id, $meta_type . '_meta' );
360
 
361
  return true;
362
  }
@@ -378,7 +277,6 @@ if( ! function_exists( 'wp_ulike_update_meta_cache' ) ){
378
  return false;
379
  }
380
 
381
- $meta_type = 'wp_ulike';
382
  $table = $wpdb->prefix . 'ulike_meta';
383
  $column = sanitize_key( 'item_id' );
384
 
@@ -389,7 +287,7 @@ if( ! function_exists( 'wp_ulike_update_meta_cache' ) ){
389
 
390
  $object_ids = array_map( 'intval', $object_ids );
391
 
392
- $cache_key = $meta_type . '_meta';
393
  $ids = array();
394
  $cache = array();
395
  foreach ( $object_ids as $id ) {
@@ -2347,53 +2245,18 @@ if( ! function_exists( 'wp_ulike_set_robeen_template' ) ){
2347
  ?>
2348
  <div class="wpulike wpulike-robeen <?php echo $wrapper_class; ?>" <?php echo $attributes; ?>>
2349
  <div class="<?php echo $general_class; ?>">
2350
- <label title="<?php echo wp_ulike_get_option( 'like_button_aria_label', __( 'Like Button',WP_ULIKE_SLUG) ) ?>">
2351
- <input type="checkbox"
2352
- data-ulike-id="<?php echo $ID; ?>"
2353
- data-ulike-nonce="<?php echo wp_create_nonce( $type . $ID ); ?>"
2354
- data-ulike-type="<?php echo $type; ?>"
2355
- data-ulike-template="<?php echo $style; ?>"
2356
- data-ulike-display-likers="<?php echo $display_likers; ?>"
2357
- data-ulike-disable-pophover="<?php echo $disable_pophover; ?>"
2358
- class="<?php echo $button_class; ?>"
2359
- <?php echo in_array( $status, array( 2, 4 ) ) ? 'checked="checked"' : ''; ?> />
2360
  <?php do_action( 'wp_ulike_inside_like_button', $wp_ulike_template ); ?>
2361
- <svg class="heart-svg" viewBox="467 392 58 57" xmlns="http://www.w3.org/2000/svg">
2362
- <g class="Group" fill="none" fill-rule="evenodd" transform="translate(467 392)">
2363
- <path d="M29.144 20.773c-.063-.13-4.227-8.67-11.44-2.59C7.63 28.795 28.94 43.256 29.143 43.394c.204-.138 21.513-14.6 11.44-25.213-7.214-6.08-11.377 2.46-11.44 2.59z" class="heart" fill="#AAB8C2" />
2364
- <circle class="main-circ" fill="#E2264D" opacity="0" cx="29.5" cy="29.5" r="1.5" />
2365
- <g class="grp7" opacity="0" transform="translate(7 6)">
2366
- <circle class="oval1" fill="#9CD8C3" cx="2" cy="6" r="2" />
2367
- <circle class="oval2" fill="#8CE8C3" cx="5" cy="2" r="2" />
2368
- </g>
2369
- <g class="grp6" opacity="0" transform="translate(0 28)">
2370
- <circle class="oval1" fill="#CC8EF5" cx="2" cy="7" r="2" />
2371
- <circle class="oval2" fill="#91D2FA" cx="3" cy="2" r="2" />
2372
- </g>
2373
- <g class="grp3" opacity="0" transform="translate(52 28)">
2374
- <circle class="oval2" fill="#9CD8C3" cx="2" cy="7" r="2" />
2375
- <circle class="oval1" fill="#8CE8C3" cx="4" cy="2" r="2" />
2376
- </g>
2377
- <g class="grp2" opacity="0" transform="translate(44 6)" fill="#CC8EF5">
2378
- <circle class="oval2" transform="matrix(-1 0 0 1 10 0)" cx="5" cy="6" r="2" />
2379
- <circle class="oval1" transform="matrix(-1 0 0 1 4 0)" cx="2" cy="2" r="2" />
2380
- </g>
2381
- <g class="grp5" opacity="0" transform="translate(14 50)" fill="#91D2FA">
2382
- <circle class="oval1" transform="matrix(-1 0 0 1 12 0)" cx="6" cy="5" r="2" />
2383
- <circle class="oval2" transform="matrix(-1 0 0 1 4 0)" cx="2" cy="2" r="2" />
2384
- </g>
2385
- <g class="grp4" opacity="0" transform="translate(35 50)" fill="#F48EA7">
2386
- <circle class="oval1" transform="matrix(-1 0 0 1 12 0)" cx="6" cy="5" r="2" />
2387
- <circle class="oval2" transform="matrix(-1 0 0 1 4 0)" cx="2" cy="2" r="2" />
2388
- </g>
2389
- <g class="grp1" opacity="0" transform="translate(24)" fill="#9FC7FA">
2390
- <circle class="oval1" cx="2.5" cy="3" r="2" />
2391
- <circle class="oval2" cx="7.5" cy="2" r="2" />
2392
- </g>
2393
- </g>
2394
- </svg>
2395
- <?php echo $counter; ?>
2396
- </label>
2397
  </div>
2398
  <?php
2399
  do_action( 'wp_ulike_inside_template', $wp_ulike_template );
68
  }
69
  }
70
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
  if( ! function_exists( 'wp_ulike_generate_templates_list' ) ){
72
  /**
73
  * Generate templates list
135
  return false;
136
  }
137
 
 
138
  $table = $wpdb->prefix . 'ulike_meta';
139
  $column = sanitize_key( 'item_id' );
140
  $id_column = 'meta_id';
174
 
175
  $mid = (int) $wpdb->insert_id;
176
 
177
+ wp_cache_delete( $object_id, 'wp_ulike_meta' );
178
 
179
  return $mid;
180
  }
208
  return false;
209
  }
210
 
 
211
  $table = $wpdb->prefix . 'ulike_meta';
212
  $column = sanitize_key( 'item_id' );
213
  $id_column = 'meta_id';
255
  return false;
256
  }
257
 
258
+ wp_cache_delete( $object_id, 'wp_ulike_meta' );
259
 
260
  return true;
261
  }
277
  return false;
278
  }
279
 
 
280
  $table = $wpdb->prefix . 'ulike_meta';
281
  $column = sanitize_key( 'item_id' );
282
 
287
 
288
  $object_ids = array_map( 'intval', $object_ids );
289
 
290
+ $cache_key = 'wp_ulike_meta';
291
  $ids = array();
292
  $cache = array();
293
  foreach ( $object_ids as $id ) {
2245
  ?>
2246
  <div class="wpulike wpulike-robeen <?php echo $wrapper_class; ?>" <?php echo $attributes; ?>>
2247
  <div class="<?php echo $general_class; ?>">
2248
+ <button type="button"
2249
+ aria-label="<?php echo wp_ulike_get_option( 'like_button_aria_label', __( 'Like Button',WP_ULIKE_SLUG) ) ?>"
2250
+ data-ulike-id="<?php echo $ID; ?>"
2251
+ data-ulike-nonce="<?php echo wp_create_nonce( $type . $ID ); ?>"
2252
+ data-ulike-type="<?php echo $type; ?>"
2253
+ data-ulike-template="<?php echo $style; ?>"
2254
+ data-ulike-display-likers="<?php echo $display_likers; ?>"
2255
+ data-ulike-disable-pophover="<?php echo $disable_pophover; ?>"
2256
+ class="<?php echo $button_class; ?>">
 
2257
  <?php do_action( 'wp_ulike_inside_like_button', $wp_ulike_template ); ?>
2258
+ </button>
2259
+ <?php echo $counter; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2260
  </div>
2261
  <?php
2262
  do_action( 'wp_ulike_inside_template', $wp_ulike_template );
inc/general-hooks.php CHANGED
@@ -1114,7 +1114,7 @@ if( ! function_exists( 'wp_ulike_purge_wp_super_cache' ) && function_exists( 'wp
1114
  // wp rocket cache plugin
1115
  if( ! function_exists( 'wp_ulike_purge_rocket_cache' ) && function_exists( 'rocket_clean_post' ) ){
1116
  /**
1117
- * Purge wp rocket cache
1118
  *
1119
  * @param integer $ID
1120
  * @param string $type
@@ -1133,3 +1133,25 @@ if( ! function_exists( 'wp_ulike_purge_rocket_cache' ) && function_exists( 'rock
1133
  add_action( 'wp_ulike_after_process', 'wp_ulike_purge_rocket_cache' , 10, 2 );
1134
  }
1135
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1114
  // wp rocket cache plugin
1115
  if( ! function_exists( 'wp_ulike_purge_rocket_cache' ) && function_exists( 'rocket_clean_post' ) ){
1116
  /**
1117
+ * Purge wp rocket cache
1118
  *
1119
  * @param integer $ID
1120
  * @param string $type
1133
  add_action( 'wp_ulike_after_process', 'wp_ulike_purge_rocket_cache' , 10, 2 );
1134
  }
1135
 
1136
+ // wp optimize cache plugin
1137
+ if( ! function_exists( 'wp_ulike_purge_wp_optimize_cache' ) && class_exists('WPO_Page_Cache') ){
1138
+ /**
1139
+ * Purge wp optimize cache
1140
+ *
1141
+ * @param integer $ID
1142
+ * @param string $type
1143
+ * @return void
1144
+ */
1145
+ function wp_ulike_purge_wp_optimize_cache( $ID, $type ){
1146
+ if( $type === '_liked' ){
1147
+ WPO_Page_Cache::delete_single_post_cache( $ID );
1148
+ } elseif( $type === '_commentliked' ){
1149
+ $comment = get_comment( $ID );
1150
+ if( isset( $comment->comment_post_ID ) ){
1151
+ WPO_Page_Cache::delete_single_post_cache( $comment->comment_post_ID );
1152
+ }
1153
+ }
1154
+ }
1155
+ add_action( 'wp_ulike_after_process', 'wp_ulike_purge_wp_optimize_cache' , 10, 2 );
1156
+ }
1157
+
readme.txt CHANGED
@@ -5,8 +5,8 @@ Author: Ali Mirzaei
5
  Tags: wp ulike, like button, elementor, like, dislike, wordpress youlike plugin, rating, vote, voting, most liked posts, wordpress like page, wordpress like post, wordpress vote page, wordpress vote post, wp like page, wp like post, wp like plugin, buddypress like system, buddypress votes, comment like system, voting button, wordpress, buddypress, statistics, stats likes, bbpress, bbPress like, WP-Translations, forums, community, credit, points, mycred, users, ultimate member, ranking
6
  Requires PHP: 5.4
7
  Requires at least: 3.5.0
8
- Tested up to: 5.4
9
- Stable tag: 4.2.1
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
@@ -186,6 +186,14 @@ define( 'WP_MEMORY_LIMIT', '256M' );
186
 
187
  == Changelog ==
188
 
 
 
 
 
 
 
 
 
189
  = 4.2.1 =
190
  * Fixed: An issue in database tables.
191
  * Fixed: An issue with user IP method.
5
  Tags: wp ulike, like button, elementor, like, dislike, wordpress youlike plugin, rating, vote, voting, most liked posts, wordpress like page, wordpress like post, wordpress vote page, wordpress vote post, wp like page, wp like post, wp like plugin, buddypress like system, buddypress votes, comment like system, voting button, wordpress, buddypress, statistics, stats likes, bbpress, bbPress like, WP-Translations, forums, community, credit, points, mycred, users, ultimate member, ranking
6
  Requires PHP: 5.4
7
  Requires at least: 3.5.0
8
+ Tested up to: 5.4.1
9
+ Stable tag: 4.2.2
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
186
 
187
  == Changelog ==
188
 
189
+ = 4.2.2 =
190
+ * Added: New algorithms to get user status with less query.
191
+ * Added: New Optimization Panel for truncate tables & delete rows from database. [PRO]
192
+ * Added: "WP Optimize" plugin cache support.
193
+ * Fixed: Some issues in stats panel.
194
+ * Modified: Twitter template structure & styles.
195
+ * Updated: Option panel framework.
196
+
197
  = 4.2.1 =
198
  * Fixed: An issue in database tables.
199
  * Fixed: An issue with user IP method.
wp-ulike.php CHANGED
@@ -10,7 +10,7 @@
10
  * Plugin Name: WP ULike
11
  * Plugin URI: https://wpulike.com/?utm_source=wp-plugins&utm_campaign=plugin-uri&utm_medium=wp-dash
12
  * Description: WP ULike plugin allows to integrate a beautiful Ajax Like Button into your wordPress website to allow your visitors to like and unlike pages, posts, comments AND buddypress activities. Its very simple to use and supports many options.
13
- * Version: 4.2.1
14
  * Author: Ali Mirzaei
15
  * Author URI: https://wpulike.com/?utm_source=wp-plugins&utm_campaign=author-uri&utm_medium=wp-dash
16
  * Text Domain: wp-ulike
@@ -46,7 +46,7 @@ if ( defined( 'WP_INSTALLING' ) && WP_INSTALLING ) {
46
 
47
  // Do not change these values
48
  define( 'WP_ULIKE_PLUGIN_URI' , 'https://wpulike.com/' );
49
- define( 'WP_ULIKE_VERSION' , '4.2.1' );
50
  define( 'WP_ULIKE_DB_VERSION' , '2.1' );
51
  define( 'WP_ULIKE_SLUG' , 'wp-ulike' );
52
  define( 'WP_ULIKE_NAME' , __( 'WP ULike', WP_ULIKE_SLUG ));
@@ -134,8 +134,6 @@ if ( ! class_exists( 'WpUlikeInit' ) ) :
134
  // Include Files
135
  $this->includes();
136
 
137
- // @deprecate version 5.0
138
- global $wp_version;
139
  // Load plugin text domain
140
  $this->load_plugin_textdomain();
141
 
10
  * Plugin Name: WP ULike
11
  * Plugin URI: https://wpulike.com/?utm_source=wp-plugins&utm_campaign=plugin-uri&utm_medium=wp-dash
12
  * Description: WP ULike plugin allows to integrate a beautiful Ajax Like Button into your wordPress website to allow your visitors to like and unlike pages, posts, comments AND buddypress activities. Its very simple to use and supports many options.
13
+ * Version: 4.2.2
14
  * Author: Ali Mirzaei
15
  * Author URI: https://wpulike.com/?utm_source=wp-plugins&utm_campaign=author-uri&utm_medium=wp-dash
16
  * Text Domain: wp-ulike
46
 
47
  // Do not change these values
48
  define( 'WP_ULIKE_PLUGIN_URI' , 'https://wpulike.com/' );
49
+ define( 'WP_ULIKE_VERSION' , '4.2.2' );
50
  define( 'WP_ULIKE_DB_VERSION' , '2.1' );
51
  define( 'WP_ULIKE_SLUG' , 'wp-ulike' );
52
  define( 'WP_ULIKE_NAME' , __( 'WP ULike', WP_ULIKE_SLUG ));
134
  // Include Files
135
  $this->includes();
136
 
 
 
137
  // Load plugin text domain
138
  $this->load_plugin_textdomain();
139