Kirki - Version 3.0.35

Version Description

Dec. 6, 2018, dev time: 15h

  • New: Add Gutenberg support #2009 props @timelsass
  • Fix: Add additional check for variants in the typography control - fixes JS issue if no variants were found.
  • Fix: Reviews all sanitization, validation & escaping calls and adjusted them where necessary. This is one step closer to full WPTRT compliance. Props @poena for bringing this to my attention.
  • Fix: Improved implementation for the sortable control.
  • Fix: kirki_modules filter was not working. #2023
  • Fix: Issue with google-fonts loading when in the customizer and the typography field uses postMessage. #1988
  • Fix: Changed the priority for css-vars.
  • Fix: Dependencies for the code control. #2020
  • Fix: PHP 5.2 error T_PAAMAYIM_NEKUDOTAYIM #2032
  • Fix: Code cleanup in the repeater control, props @joyously ticket
  • Tweak: Removed deprecated code & code cleanups.
Download this release

Release Info

Developer aristath
Plugin Icon 128x128 Kirki
Version 3.0.35
Comparing to
See all releases

Code changes from version 3.0.34.1 to 3.0.35

Files changed (182) hide show
  1. LICENSE +0 -0
  2. assets/css/kirki-styles.css +0 -0
  3. assets/images/1c.png +0 -0
  4. assets/images/2cl.png +0 -0
  5. assets/images/2cr.png +0 -0
  6. assets/images/3cl.png +0 -0
  7. assets/images/3cm.png +0 -0
  8. assets/images/3cr.png +0 -0
  9. assets/images/jquery.fs.stepper-arrows.png +0 -0
  10. assets/images/kirki-bottom.png +0 -0
  11. assets/images/kirki-bottom.svg +0 -0
  12. assets/images/kirki-logo.svg +0 -0
  13. assets/vendor/fontawesome/fontawesome.json +0 -0
  14. assets/vendor/selectWoo/kirki.css +0 -0
  15. assets/vendor/selectWoo/kirki.css.map +0 -0
  16. assets/vendor/selectWoo/kirki.scss +0 -0
  17. assets/vendor/wp-color-picker-alpha/wp-color-picker-alpha.js +0 -0
  18. class-kirki-autoload.php +2 -0
  19. controls/class-kirki-controls.php +0 -1
  20. controls/css/styles.css +0 -0
  21. controls/js/script.js +16 -43
  22. controls/js/script.min.js +1 -1
  23. controls/php/class-kirki-control-background.php +27 -27
  24. controls/php/class-kirki-control-base.php +25 -8
  25. controls/php/class-kirki-control-checkbox.php +0 -0
  26. controls/php/class-kirki-control-code.php +26 -2
  27. controls/php/class-kirki-control-color-palette.php +0 -0
  28. controls/php/class-kirki-control-color.php +0 -0
  29. controls/php/class-kirki-control-cropped-image.php +0 -0
  30. controls/php/class-kirki-control-custom.php +0 -1
  31. controls/php/class-kirki-control-dashicons.php +0 -1
  32. controls/php/class-kirki-control-date.php +0 -0
  33. controls/php/class-kirki-control-dimension.php +1 -2
  34. controls/php/class-kirki-control-dimensions.php +25 -26
  35. controls/php/class-kirki-control-editor.php +0 -0
  36. controls/php/class-kirki-control-fontawesome.php +0 -0
  37. controls/php/class-kirki-control-generic.php +0 -0
  38. controls/php/class-kirki-control-image.php +0 -0
  39. controls/php/class-kirki-control-multicheck.php +0 -0
  40. controls/php/class-kirki-control-multicolor.php +0 -1
  41. controls/php/class-kirki-control-number.php +0 -0
  42. controls/php/class-kirki-control-palette.php +0 -0
  43. controls/php/class-kirki-control-radio-buttonset.php +0 -0
  44. controls/php/class-kirki-control-radio-image.php +0 -1
  45. controls/php/class-kirki-control-radio.php +0 -0
  46. controls/php/class-kirki-control-repeater.php +17 -15
  47. controls/php/class-kirki-control-select.php +0 -1
  48. controls/php/class-kirki-control-slider.php +1 -2
  49. controls/php/class-kirki-control-sortable.php +0 -1
  50. controls/php/class-kirki-control-switch.php +2 -2
  51. controls/php/class-kirki-control-toggle.php +0 -0
  52. controls/php/class-kirki-control-typography.php +32 -31
  53. controls/php/class-kirki-control-upload.php +0 -0
  54. controls/php/class-kirki-settings-repeater-setting.php +11 -16
  55. controls/views/code.php +0 -0
  56. controls/views/color.php +0 -0
  57. controls/views/generic.php +0 -0
  58. controls/views/image.php +7 -7
  59. controls/views/number.php +0 -0
  60. controls/views/radio.php +0 -0
  61. controls/views/select.php +0 -0
  62. controls/views/textarea.php +0 -0
  63. core/class-kirki-config.php +3 -5
  64. core/class-kirki-control.php +3 -2
  65. core/class-kirki-field.php +15 -83
  66. core/class-kirki-helper.php +1 -14
  67. core/class-kirki-init.php +2 -9
  68. core/class-kirki-l10n.php +0 -11
  69. core/class-kirki-modules.php +11 -18
  70. core/class-kirki-panel.php +1 -4
  71. core/class-kirki-sanitize-values.php +5 -0
  72. core/class-kirki-section.php +1 -5
  73. core/class-kirki-sections.php +3 -4
  74. core/class-kirki-setting-site-option.php +0 -0
  75. core/class-kirki-setting-user-meta.php +0 -0
  76. core/class-kirki-settings.php +1 -0
  77. core/class-kirki-toolkit.php +0 -0
  78. core/class-kirki-util.php +3 -8
  79. core/class-kirki-values.php +0 -4
  80. core/class-kirki.php +29 -23
  81. core/dynamic-css.php +0 -0
  82. deprecated/classes.php +0 -0
  83. deprecated/deprecated.php +0 -0
  84. deprecated/filters.php +0 -0
  85. deprecated/functions.php +1 -1
  86. field/class-kirki-field-background.php +5 -10
  87. field/class-kirki-field-checkbox.php +1 -13
  88. field/class-kirki-field-code.php +0 -1
  89. field/class-kirki-field-color-alpha.php +0 -2
  90. field/class-kirki-field-color-palette.php +0 -2
  91. field/class-kirki-field-color.php +1 -5
  92. field/class-kirki-field-custom.php +1 -3
  93. field/class-kirki-field-dashicons.php +1 -3
  94. field/class-kirki-field-date.php +1 -4
  95. field/class-kirki-field-dimension.php +0 -2
  96. field/class-kirki-field-dimensions.php +0 -5
  97. field/class-kirki-field-editor.php +1 -2
  98. field/class-kirki-field-fontawesome.php +1 -4
  99. field/class-kirki-field-generic.php +0 -0
  100. field/class-kirki-field-group-title.php +0 -0
  101. field/class-kirki-field-image.php +7 -12
  102. field/class-kirki-field-kirki-generic.php +0 -5
  103. field/class-kirki-field-link.php +0 -0
  104. field/class-kirki-field-multicheck.php +0 -5
  105. field/class-kirki-field-multicolor.php +0 -2
  106. field/class-kirki-field-number.php +0 -4
  107. field/class-kirki-field-palette.php +0 -2
  108. field/class-kirki-field-preset.php +0 -2
  109. field/class-kirki-field-radio-buttonset.php +0 -2
  110. field/class-kirki-field-radio-image.php +0 -2
  111. field/class-kirki-field-radio.php +3 -5
  112. field/class-kirki-field-repeater.php +9 -13
  113. field/class-kirki-field-select.php +2 -18
  114. field/class-kirki-field-select2-multiple.php +0 -2
  115. field/class-kirki-field-select2.php +0 -0
  116. field/class-kirki-field-slider.php +0 -2
  117. field/class-kirki-field-sortable.php +2 -8
  118. field/class-kirki-field-spacing.php +4 -6
  119. field/class-kirki-field-switch.php +2 -5
  120. field/class-kirki-field-text.php +1 -4
  121. field/class-kirki-field-textarea.php +0 -1
  122. field/class-kirki-field-toggle.php +0 -2
  123. field/class-kirki-field-typography.php +4 -9
  124. field/class-kirki-field-upload.php +0 -3
  125. field/class-kirki-field-url.php +0 -3
  126. kirki.php +1 -1
  127. lib/class-aricolor.php +0 -0
  128. lib/class-kirki-color.php +0 -0
  129. modules/css-vars/class-kirki-modules-css-vars.php +49 -8
  130. modules/css-vars/script.js +0 -0
  131. modules/css/class-kirki-css-to-file.php +2 -10
  132. modules/css/class-kirki-modules-css-generator.php +0 -2
  133. modules/css/class-kirki-modules-css.php +22 -7
  134. modules/css/class-kirki-output.php +12 -5
  135. modules/css/field/class-kirki-output-field-background.php +0 -1
  136. modules/css/field/class-kirki-output-field-dimensions.php +0 -1
  137. modules/css/field/class-kirki-output-field-image.php +0 -1
  138. modules/css/field/class-kirki-output-field-multicolor.php +0 -1
  139. modules/css/field/class-kirki-output-field-typography.php +0 -1
  140. modules/css/property/class-kirki-output-property-background-image.php +0 -3
  141. modules/css/property/class-kirki-output-property-background-position.php +0 -1
  142. modules/css/property/class-kirki-output-property-font-family.php +0 -1
  143. modules/css/property/class-kirki-output-property.php +0 -0
  144. modules/custom-sections/class-kirki-modules-custom-sections.php +4 -8
  145. modules/custom-sections/panels/class-kirki-panels-nested-panel.php +0 -1
  146. modules/custom-sections/sections.css +0 -0
  147. modules/custom-sections/sections.js +0 -0
  148. modules/custom-sections/sections/class-kirki-sections-default-section.php +0 -0
  149. modules/custom-sections/sections/class-kirki-sections-expanded-section.php +0 -1
  150. modules/custom-sections/sections/class-kirki-sections-nested-section.php +2 -3
  151. modules/customizer-branding/branding.js +0 -0
  152. modules/customizer-branding/class-kirki-modules-customizer-branding.php +0 -1
  153. modules/customizer-styling/class-kirki-modules-customizer-styling.php +97 -98
  154. modules/field-dependencies/class-kirki-modules-field-dependencies.php +0 -1
  155. modules/field-dependencies/field-dependencies.js +0 -0
  156. modules/gutenberg/class-kirki-modules-gutenberg.php +352 -0
  157. modules/icons/class-kirki-modules-icons.php +0 -4
  158. modules/icons/icons.js +0 -0
  159. modules/loading/class-kirki-modules-loading.php +0 -2
  160. modules/post-meta/class-kirki-modules-post-meta.php +0 -4
  161. modules/post-meta/customize-controls.js +0 -0
  162. modules/post-meta/customize-preview.js +0 -0
  163. modules/postmessage/class-kirki-modules-postmessage.php +7 -11
  164. modules/postmessage/postmessage.js +0 -0
  165. modules/preset/class-kirki-modules-preset.php +0 -0
  166. modules/preset/preset.js +0 -0
  167. modules/selective-refresh/class-kirki-modules-selective-refresh.php +0 -0
  168. modules/tooltips/class-kirki-modules-tooltips.php +1 -6
  169. modules/tooltips/tooltip.css +0 -0
  170. modules/tooltips/tooltip.js +0 -0
  171. modules/webfont-loader/class-kirki-modules-webfont-loader.php +13 -0
  172. modules/webfonts/class-kirki-fonts-google-local.php +2 -0
  173. modules/webfonts/class-kirki-fonts-google.php +1 -2
  174. modules/webfonts/class-kirki-fonts.php +23 -24
  175. modules/webfonts/class-kirki-modules-webfonts-async.php +4 -5
  176. modules/webfonts/class-kirki-modules-webfonts-local.php +1 -1
  177. modules/webfonts/class-kirki-modules-webfonts.php +0 -2
  178. modules/webfonts/webfont-files.json +1 -1
  179. modules/webfonts/webfont-names.json +1 -1
  180. modules/webfonts/webfonts.json +1 -1
  181. readme.txt +18 -8
  182. upgrade-notifications.php +1 -1
LICENSE CHANGED
File without changes
assets/css/kirki-styles.css CHANGED
File without changes
assets/images/1c.png CHANGED
File without changes
assets/images/2cl.png CHANGED
File without changes
assets/images/2cr.png CHANGED
File without changes
assets/images/3cl.png CHANGED
File without changes
assets/images/3cm.png CHANGED
File without changes
assets/images/3cr.png CHANGED
File without changes
assets/images/jquery.fs.stepper-arrows.png CHANGED
File without changes
assets/images/kirki-bottom.png CHANGED
File without changes
assets/images/kirki-bottom.svg CHANGED
File without changes
assets/images/kirki-logo.svg CHANGED
File without changes
assets/vendor/fontawesome/fontawesome.json CHANGED
File without changes
assets/vendor/selectWoo/kirki.css CHANGED
File without changes
assets/vendor/selectWoo/kirki.css.map CHANGED
File without changes
assets/vendor/selectWoo/kirki.scss CHANGED
File without changes
assets/vendor/wp-color-picker-alpha/wp-color-picker-alpha.js CHANGED
File without changes
class-kirki-autoload.php CHANGED
@@ -93,6 +93,8 @@ class Kirki_Autoload {
93
$path = dirname( __FILE__ ) . '/modules/';
94
$path .= strtolower( str_replace( '_', '-', str_replace( 'Kirki_Modules_', '', $class_name ) ) ) . '/';
95
$paths[] = $path . $filename;
96
}
97
98
if ( isset( $name_parts[0] ) ) {
93
$path = dirname( __FILE__ ) . '/modules/';
94
$path .= strtolower( str_replace( '_', '-', str_replace( 'Kirki_Modules_', '', $class_name ) ) ) . '/';
95
$paths[] = $path . $filename;
96
+ } elseif ( 'Kirki_Fonts' === $class_name ) {
97
+ $paths[] = dirname( __FILE__ ) . '/modules/webfonts/class-kirki-fonts.php';
98
}
99
100
if ( isset( $name_parts[0] ) ) {
controls/class-kirki-controls.php CHANGED
@@ -48,7 +48,6 @@ class Kirki_Controls {
48
* @since 3.0.17
49
*/
50
public function __construct() {
51
-
52
if ( ! $this->views_path ) {
53
$this->views_path = wp_normalize_path( dirname( KIRKI_PLUGIN_FILE ) . '/controls/views/' );
54
}
48
* @since 3.0.17
49
*/
50
public function __construct() {
51
if ( ! $this->views_path ) {
52
$this->views_path = wp_normalize_path( dirname( KIRKI_PLUGIN_FILE ) . '/controls/views/' );
53
}
controls/css/styles.css CHANGED
File without changes
controls/js/script.js CHANGED
@@ -861,8 +861,6 @@ kirki = jQuery.extend( kirki, {
861
// Make sure value is properly formatted.
862
value = ( 'array' === saveAs && _.isString( value ) ) ? { url: value } : value;
863
864
- control.container.find( '.kirki-controls-loading-spinner' ).hide();
865
-
866
// Tweaks for save_as = id.
867
if ( ( 'id' === saveAs || 'ID' === saveAs ) && '' !== value ) {
868
wp.media.attachment( value ).fetch().then( function() {
@@ -1812,8 +1810,6 @@ wp.customize.controlConstructor['kirki-date'] = wp.customize.kirkiDynamicControl
1812
dateFormat: 'yy-mm-dd'
1813
} );
1814
1815
- control.container.find( '.kirki-controls-loading-spinner' ).hide();
1816
-
1817
// Save the changes
1818
this.container.on( 'change keyup paste', 'input.datepicker', function() {
1819
control.setting.set( jQuery( this ).val() );
@@ -2246,8 +2242,6 @@ wp.customize.controlConstructor.repeater = wp.customize.Control.extend( {
2246
// The current value set in Control Class (set in Kirki_Customize_Repeater_Control::to_json() function)
2247
var settingValue = this.params.value;
2248
2249
- control.container.find( '.kirki-controls-loading-spinner' ).hide();
2250
-
2251
// The hidden field that keeps the data saved (though we never update it)
2252
this.settingField = this.container.find( '[data-customize-setting-link]' ).first();
2253
@@ -3086,7 +3080,6 @@ wp.customize.controlConstructor['kirki-slider'] = wp.customize.kirkiDynamicContr
3086
} );
3087
}
3088
} );
3089
- /* global kirkiControlLoader */
3090
wp.customize.controlConstructor['kirki-sortable'] = wp.customize.Control.extend( {
3091
3092
// When we're finished loading continue processing
@@ -3096,31 +3089,12 @@ wp.customize.controlConstructor['kirki-sortable'] = wp.customize.Control.extend(
3096
3097
var control = this;
3098
3099
- // Init the control.
3100
- if ( ! _.isUndefined( window.kirkiControlLoader ) && _.isFunction( kirkiControlLoader ) ) {
3101
- kirkiControlLoader( control );
3102
- } else {
3103
- control.initKirkiControl();
3104
- }
3105
- },
3106
-
3107
- initKirkiControl: function() {
3108
-
3109
- 'use strict';
3110
-
3111
- var control = this;
3112
-
3113
- control.container.find( '.kirki-controls-loading-spinner' ).hide();
3114
-
3115
- // Set the sortable container.
3116
- control.sortableContainer = control.container.find( 'ul.sortable' ).first();
3117
-
3118
// Init sortable.
3119
- control.sortableContainer.sortable( {
3120
3121
// Update value when we stop sorting.
3122
- stop: function() {
3123
- control.updateValue();
3124
}
3125
} ).disableSelection().find( 'li' ).each( function() {
3126
@@ -3131,26 +3105,25 @@ wp.customize.controlConstructor['kirki-sortable'] = wp.customize.Control.extend(
3131
} ).click( function() {
3132
3133
// Update value on click.
3134
- control.updateValue();
3135
} );
3136
},
3137
3138
/**
3139
- * Updates the sorting list
3140
*/
3141
- updateValue: function() {
3142
-
3143
- 'use strict';
3144
-
3145
- var control = this,
3146
- newValue = [];
3147
-
3148
- this.sortableContainer.find( 'li' ).each( function() {
3149
- if ( ! jQuery( this ).is( '.invisible' ) ) {
3150
- newValue.push( jQuery( this ).data( 'value' ) );
3151
}
3152
} );
3153
- control.setting.set( newValue );
3154
}
3155
} );
3156
wp.customize.controlConstructor['kirki-switch'] = wp.customize.kirkiDynamicControl.extend( {
@@ -3478,7 +3451,7 @@ wp.customize.controlConstructor['kirki-typography'] = wp.customize.kirkiDynamicC
3478
} else {
3479
fontWeight = ( ! _.isString( value.variant ) ) ? '400' : value.variant.match( /\d/g );
3480
fontWeight = ( ! _.isObject( fontWeight ) ) ? '400' : fontWeight.join( '' );
3481
- fontStyle = ( -1 !== value.variant.indexOf( 'italic' ) ) ? 'italic' : 'normal';
3482
}
3483
3484
control.saveValue( 'font-weight', fontWeight );
861
// Make sure value is properly formatted.
862
value = ( 'array' === saveAs && _.isString( value ) ) ? { url: value } : value;
863
864
// Tweaks for save_as = id.
865
if ( ( 'id' === saveAs || 'ID' === saveAs ) && '' !== value ) {
866
wp.media.attachment( value ).fetch().then( function() {
1810
dateFormat: 'yy-mm-dd'
1811
} );
1812
1813
// Save the changes
1814
this.container.on( 'change keyup paste', 'input.datepicker', function() {
1815
control.setting.set( jQuery( this ).val() );
2242
// The current value set in Control Class (set in Kirki_Customize_Repeater_Control::to_json() function)
2243
var settingValue = this.params.value;
2244
2245
// The hidden field that keeps the data saved (though we never update it)
2246
this.settingField = this.container.find( '[data-customize-setting-link]' ).first();
2247
3080
} );
3081
}
3082
} );
3083
wp.customize.controlConstructor['kirki-sortable'] = wp.customize.Control.extend( {
3084
3085
// When we're finished loading continue processing
3089
3090
var control = this;
3091
3092
// Init sortable.
3093
+ jQuery( control.container.find( 'ul.sortable' ).first() ).sortable( {
3094
3095
// Update value when we stop sorting.
3096
+ update: function() {
3097
+ control.setting.set( control.getNewVal() );
3098
}
3099
} ).disableSelection().find( 'li' ).each( function() {
3100
3105
} ).click( function() {
3106
3107
// Update value on click.
3108
+ control.setting.set( control.getNewVal() );
3109
} );
3110
},
3111
3112
/**
3113
+ * Getss thhe new vvalue.
3114
+ *
3115
+ * @since 3.0.35
3116
+ * @returns {Array}
3117
*/
3118
+ getNewVal: function() {
3119
+ var items = jQuery( this.container.find( 'li' ) ),
3120
+ newVal = [];
3121
+ _.each ( items, function( item ) {
3122
+ if ( ! jQuery( item ).hasClass( 'invisible' ) ) {
3123
+ newVal.push( jQuery( item ).data( 'value' ) );
3124
}
3125
} );
3126
+ return newVal;
3127
}
3128
} );
3129
wp.customize.controlConstructor['kirki-switch'] = wp.customize.kirkiDynamicControl.extend( {
3451
} else {
3452
fontWeight = ( ! _.isString( value.variant ) ) ? '400' : value.variant.match( /\d/g );
3453
fontWeight = ( ! _.isObject( fontWeight ) ) ? '400' : fontWeight.join( '' );
3454
+ fontStyle = ( value.variant && -1 !== value.variant.indexOf( 'italic' ) ) ? 'italic' : 'normal';
3455
}
3456
3457
control.saveValue( 'font-weight', fontWeight );
controls/js/script.min.js CHANGED
@@ -1 +1 @@
1
- if(_.isUndefined(window.kirkiSetSettingValue))var kirkiSetSettingValue={set:function(i,n){var e,a=this,t=wp.customize.settings.controls[i];if(_.isUndefined(t))return!0;switch(a.setValue(i,n),t.type){case"kirki-background":_.isUndefined(n["background-color"])||a.setColorPicker(a.findElement(i,".kirki-color-control"),n["background-color"]),a.findElement(i,".placeholder, .thumbnail").removeClass().addClass("placeholder").html("No file selected"),_.each(["background-repeat","background-position"],function(e){_.isUndefined(n[e])||a.setSelectWoo(a.findElement(i,"."+e+" select"),n[e])}),_.each(["background-size","background-attachment"],function(e){jQuery(a.findElement(i,"."+e+' input[value="'+n+'"]')).prop("checked",!0)}),e=JSON.stringify(n).replace(/'/g,"&#39"),jQuery(a.findElement(i,".background-hidden-value").attr("value",e)).trigger("change");break;case"kirki-code":jQuery(a.findElement(i,".CodeMirror"))[0].CodeMirror.setValue(n);break;case"checkbox":case"kirki-switch":case"kirki-toggle":n=1===n||"1"===n||!0===n,jQuery(a.findElement(i,"input")).prop("checked",n),wp.customize.instance(i).set(n);break;case"kirki-select":case"kirki-fontawesome":a.setSelectWoo(a.findElement(i,"select"),n);break;case"kirki-slider":jQuery(a.findElement(i,"input")).prop("value",n),jQuery(a.findElement(i,".kirki_range_value .value")).html(n);break;case"kirki-generic":(_.isUndefined(t.choices)||_.isUndefined(t.choices.element))&&(t.choices.element="input"),jQuery(a.findElement(i,t.choices.element)).prop("value",n);break;case"kirki-color":a.setColorPicker(a.findElement(i,".kirki-color-control"),n);break;case"kirki-multicheck":a.findElement(i,"input").each(function(){jQuery(this).prop("checked",!1)}),_.each(n,function(e,t){jQuery(a.findElement(i,'input[value="'+n[t]+'"]')).prop("checked",!0)});break;case"kirki-multicolor":_.each(n,function(e,t){a.setColorPicker(a.findElement(i,".multicolor-index-"+t),e)});break;case"kirki-radio-buttonset":case"kirki-radio-image":case"kirki-radio":case"kirki-dashicons":case"kirki-color-palette":case"kirki-palette":jQuery(a.findElement(i,'input[value="'+n+'"]')).prop("checked",!0);break;case"kirki-typography":_.each(["font-family","variant"],function(e){_.isUndefined(n[e])||a.setSelectWoo(a.findElement(i,"."+e+" select"),n[e])}),_.each(["font-size","line-height","letter-spacing","word-spacing"],function(e){_.isUndefined(n[e])||jQuery(a.findElement(i,"."+e+" input")).prop("value",n[e])}),_.isUndefined(n.color)||a.setColorPicker(a.findElement(i,".kirki-color-control"),n.color),e=JSON.stringify(n).replace(/'/g,"&#39"),jQuery(a.findElement(i,".typography-hidden-value").attr("value",e)).trigger("change");break;case"kirki-dimensions":_.each(n,function(e,t){jQuery(a.findElement(i,"."+t+" input")).prop("value",e)});break;case"kirki-repeater":case"kirki-custom":break;default:jQuery(a.findElement(i,"input")).prop("value",n)}},setColorPicker:function(e,t){e.attr("data-default-color",t).data("default-color",t).wpColorPicker("color",t)},setSelectWoo:function(e,t){jQuery(e).selectWoo().val(t).trigger("change")},setTextarea:function(e,t){jQuery(e).prop("value",t)},findElement:function(e,t){return wp.customize.control(e).container.find(t)},setValue:function(e,t,i){i=_.isUndefined(i)?100:parseInt(i,10),wp.customize.instance(e).set({}),setTimeout(function(){wp.customize.instance(e).set(t)},i)}};(kirki={initialized:!1,initialize:function(){this.initialized||(setTimeout(function(){kirki.util.webfonts.standard.initialize(),kirki.util.webfonts.google.initialize()},150),this.initialized=!0)}}).initialize();var kirki=kirki||{};kirki=(kirki=jQuery.extend(kirki,{control:{"kirki-radio":{init:function(e){this.template(e),kirki.input.radio.init(e)},template:function(e){var t=wp.template("kirki-input-radio");e.container.html(t({label:e.params.label,description:e.params.description,"data-id":e.id,inputAttrs:e.params.inputAttrs,default:e.params.default,value:kirki.setting.get(e.id),choices:e.params.choices}))}},"kirki-color":{init:function(e){this.template(e),kirki.input.color.init(e)},template:function(e){var t=wp.template("kirki-input-color");e.container.html(t({label:e.params.label,description:e.params.description,"data-id":e.id,mode:e.params.mode,inputAttrs:e.params.inputAttrs,"data-palette":e.params.palette,"data-default-color":e.params.default,"data-alpha":e.params.choices.alpha,value:kirki.setting.get(e.id)}))}},"kirki-generic":{init:function(e){this.template(e),_.isUndefined(e.params)||_.isUndefined(e.params.choices)||_.isUndefined(e.params.choices.element)||"textarea"!==e.params.choices.element?kirki.input.genericInput.init(e):kirki.input.textarea.init(e)},template:function(e){var t,i={label:e.params.label,description:e.params.description,"data-id":e.id,inputAttrs:e.params.inputAttrs,choices:e.params.choices,value:kirki.setting.get(e.id)};if(!_.isUndefined(e.params)&&!_.isUndefined(e.params.choices)&&!_.isUndefined(e.params.choices.element)&&"textarea"===e.params.choices.element)return t=wp.template("kirki-input-textarea"),void e.container.html(t(i));t=wp.template("kirki-input-generic"),e.container.html(t(i))}},"kirki-number":{init:function(e){this.template(e),kirki.input.number.init(e)},template:function(e){var t=wp.template("kirki-input-number");e.container.html(t(args={label:e.params.label,description:e.params.description,"data-id":e.id,inputAttrs:e.params.inputAttrs,choices:e.params.choices,value:kirki.setting.get(e.id)}))}},"kirki-image":{init:function(e){this.template(e),kirki.input.image.init(e)},template:function(e){var t=wp.template("kirki-input-image");e.container.html(t(args={label:e.params.label,description:e.params.description,"data-id":e.id,inputAttrs:e.params.inputAttrs,choices:e.params.choices,value:kirki.setting.get(e.id)}))}},"kirki-select":{init:function(e){this.template(e),kirki.input.select.init(e)},template:function(e){var t=wp.template("kirki-input-select");e.container.html(t({label:e.params.label,description:e.params.description,"data-id":e.id,inputAttrs:e.params.inputAttrs,choices:e.params.choices,value:kirki.setting.get(e.id),multiple:e.params.multiple||1,placeholder:e.params.placeholder}))}}}}))||{},kirki=(kirki=jQuery.extend(kirki,{input:{radio:{init:function(e){jQuery('input[data-id="'+e.id+'"]').on("change keyup paste click",function(){kirki.setting.set(e.id,jQuery(this).val())})}},color:{init:function(e){var t,i=jQuery('.kirki-color-control[data-id="'+e.id+'"]');e.choices=e.choices||{},_.isEmpty(e.choices)&&e.params.choices&&(e.choices=e.params.choices),_.isEmpty(e.choices)||i.wpColorPicker(e.choices),setTimeout(function(){(t=jQuery('.kirki-input-container[data-id="'+e.id+'"] .wp-picker-clear')).length&&t.click(function(){kirki.setting.set(e.id,"")})},200),i.wpColorPicker({change:function(){setTimeout(function(){kirki.setting.set(e.id,i.val())},20)}})}},genericInput:{init:function(e){jQuery('input[data-id="'+e.id+'"]').on("change keyup paste click",function(){kirki.setting.set(e.id,jQuery(this).val())})}},textarea:{init:function(e){jQuery('textarea[data-id="'+e.id+'"]').on("change keyup paste click",function(){kirki.setting.set(e.id,jQuery(this).val())})}},select:{init:function(e){var t,i=jQuery('select[data-id="'+e.id+'"]'),n=parseInt(i.data("multiple"),10),a={escapeMarkup:function(e){return e}};e.params.placeholder&&(a.placeholder=e.params.placeholder,a.allowClear=!0),1<n&&(a.maximumSelectionLength=n),jQuery(i).selectWoo(a).on("change",function(){t=null===(t=jQuery(this).val())&&1<n?[]:t,kirki.setting.set(e.id,t)})}},number:{init:function(i){var e,t,n=jQuery('input[data-id="'+i.id+'"]'),a=i.setting._value;i.params.choices=_.defaults(i.params.choices,{min:0,max:100,step:1}),(isNaN(a)||""===a)&&(a=i.params.choices.min<0&&0<i.params.choices.max?0:i.params.choices.min),a=parseFloat(a),i.params.choices.step="any"===i.params.choices.step?.001:i.params.choices.step,i.params.choices.min=parseFloat(i.params.choices.min),i.params.choices.max=parseFloat(i.params.choices.max),i.params.choices.step=parseFloat(i.params.choices.step),e=jQuery('.kirki-input-container[data-id="'+i.id+'"] .plus'),t=jQuery('.kirki-input-container[data-id="'+i.id+'"] .minus'),e.click(function(){var e,t=parseFloat(n.val());e=t>=i.params.choices.max?t:t+i.params.choices.step,n.val(e),n.trigger("change")}),t.click(function(){var e,t=parseFloat(n.val());e=t<=i.params.choices.min?t:t-i.params.choices.step,n.val(e),n.trigger("change")}),n.on("change keyup paste click",function(){kirki.setting.set(i.id,jQuery(this).val())})}},image:{init:function(a){var t=kirki.setting.get(a.id),n=_.isUndefined(a.params.choices)||_.isUndefined(a.params.choices.save_as)?"url":a.params.choices.save_as,r=a.container.find(".placeholder, .thumbnail"),e="array"===n?t.url:t,o=a.container.find(".image-upload-remove-button"),s=a.container.find(".image-default-button");t="array"===n&&_.isString(t)?{url:t}:t,a.container.find(".kirki-controls-loading-spinner").hide(),"id"!==n&&"ID"!==n||""===t||wp.media.attachment(t).fetch().then(function(){setTimeout(function(){var e=wp.media.attachment(t).get("url");r.removeClass().addClass("thumbnail thumbnail-image").html('<img src="'+e+'" alt="" />')},700)}),("url"===n&&""!==t||"array"===n&&!_.isUndefined(t.url)&&""!==t.url)&&a.container.find("image-default-button").hide(),("url"===n&&""===t||"array"===n&&(_.isUndefined(t.url)||""===t.url))&&o.hide(),t===a.params.default&&a.container.find("image-default-button").hide(),""!==e&&r.removeClass().addClass("thumbnail thumbnail-image").html('<img src="'+e+'" alt="" />'),a.container.on("click",".image-upload-button",function(e){var i=wp.media({multiple:!1}).open().on("select",function(){var e=i.state().get("selection").first().toJSON(),t=e.url;_.isUndefined(e.sizes)||(previewImg=e.sizes.full.url,_.isUndefined(e.sizes.medium)?_.isUndefined(e.sizes.thumbnail)||(t=e.sizes.thumbnail.url):t=e.sizes.medium.url),"array"===n?kirki.setting.set(a.id,{id:e.id,url:e.sizes.full.url,width:e.width,height:e.height}):"id"===n?kirki.setting.set(a.id,e.id):kirki.setting.set(a.id,_.isUndefined(e.sizes)?e.url:e.sizes.full.url),r.length&&r.removeClass().addClass("thumbnail thumbnail-image").html('<img src="'+t+'" alt="" />'),o.length&&(o.show(),s.hide())});e.preventDefault()}),a.container.on("click",".image-upload-remove-button",function(e){var t,i,n;e.preventDefault(),kirki.setting.set(a.id,""),t=a.container.find(".placeholder, .thumbnail"),i=a.container.find(".image-upload-remove-button"),n=a.container.find(".image-default-button"),t.length&&t.removeClass().addClass("placeholder").html(kirkiL10n.noFileSelected),i.length&&(i.hide(),jQuery(n).hasClass("button")&&n.show())}),a.container.on("click",".image-default-button",function(e){var t,i,n;e.preventDefault(),kirki.setting.set(a.id,a.params.default),t=a.container.find(".placeholder, .thumbnail"),i=a.container.find(".image-upload-remove-button"),n=a.container.find(".image-default-button"),t.length&&t.removeClass().addClass("thumbnail thumbnail-image").html('<img src="'+a.params.default+'" alt="" />'),i.length&&(i.show(),n.hide())})}}}}))||{},kirki=(kirki=jQuery.extend(kirki,{setting:{get:function(e){var t=e.split("["),i="",n=0,a="";return _.each(t,function(e,t){e=e.replace("]",""),0===t?i=e:i+="["+e+"]",_.isUndefined(wp.customize.instance(i))||(a=wp.customize.instance(i).get(),n=t),n<t&&_.isObject(a)&&!_.isUndefined(a[e])&&(a=a[e])}),a},set:function(e,t,i){var n,a,r,o,s,c="",l="",u={};n=e,_.isObject(e)&&(n=jQuery(e).attr("data-id")?e.attr("data-id"):e.parents("[data-id]").attr("data-id")),void 0===wp.customize.control(n)?(a=n.split("["),_.each(a,function(e,t){e=e.replace("]",""),c=0===t?e:"["+e+"]",_.isUndefined(wp.customize.instance(c))||(l=c,r=wp.customize.instance(l).get())}),""!==(o=n.replace(l,""))?(_.isObject(r)||(r={}),"["===o.charAt(0)&&(o=o.replace("[","")),s=o.split("["),_.each(s,function(e,t){s[t]=e.replace("]","")}),i&&s.push(i),u='{"'+s.join('":{"')+'":"'+t+'"'+"}".repeat(s.length),u=JSON.parse(u),jQuery.extend(!0,r,u),t=r):i&&((r=_.isObject(r)?r:{})[i]=t,t=r),wp.customize.control(l).setting.set(t)):wp.customize.control(n).setting.set(t)}}}))||{};kirki=jQuery.extend(kirki,{util:{webfonts:{google:{fonts:{},initialize:function(){this.setFonts()},setFonts:function(){var t=this;_.isEmpty(t.fonts)&&jQuery.post(ajaxurl,{action:"kirki_fonts_google_all_get"},function(e){t.fonts=JSON.parse(e)})},getFont:function(e){var t=this.getFonts();return void 0!==t[e]&&t[e]},getFonts:function(e,i,t){var n=this,a={},r={},o={};return e="alpha"!==(e=e||"alpha")&&"popularity"!==e&&"trending"!==e?"alpha":e,t=t||0,t=parseInt(t,10),"alpha"===e?a=jQuery.extend({},n.fonts.items):_.each(n.fonts.order[e],function(e){a[e]=n.fonts.items[e]}),""!==i&&i?_.each(a,function(e,t){i===e.category&&(r[t]=e)}):r=a,0<t?(_.each(_.first(_.keys(r),t),function(e){o[e]=r[e]}),o):r},getVariants:function(e){var t=this.getFont(e);return!!t&&(!_.isUndefined(t.variants)&&t.variants)}},standard:{fonts:{},initialize:function(){this.setFonts()},setFonts:function(){var t=this;_.isEmpty(t.fonts)&&jQuery.post(ajaxurl,{action:"kirki_fonts_standard_all_get"},function(e){t.fonts=JSON.parse(e)})},getVariants:function(){return["regular","italic","700","700italic"]}},getFontType:function(e){return void 0!==this.standard.fonts[e]||void 0!==this.standard.fonts.stack&&void 0!==this.standard.fonts.stack[e]?"standard":void 0!==this.google.fonts.items[e]&&"google"}},validate:{cssValue:function(e){var t,i;return void 0===e||(0===e||"0"===e||"auto"===e||"inherit"===e||"initial"===e||(0<=e.indexOf("calc(")&&0<=e.indexOf(")")||(t=parseFloat(e),i=e.replace(t,""),e?!isNaN(t)&&-1<jQuery.inArray(i,["fr","rem","em","ex","%","px","cm","mm","in","pt","pc","ch","vh","vw","vmin","vmax"]):void 0)))}},parseHtmlEntities:function(e){return(new DOMParser).parseFromString("<!doctype html><body>"+e,"text/html").body.textContent}}}),function(){"use strict";wp.customize.kirkiDynamicControl=wp.customize.Control.extend({initialize:function(e,t){var i=t||{};i.params=i.params||{},i.params.type||(i.params.type="kirki-generic"),i.params.content||(i.params.content=jQuery("<li></li>"),i.params.content.attr("id","customize-control-"+e.replace(/]/g,"").replace(/\[/g,"-")),i.params.content.attr("class","customize-control customize-control-"+i.params.type)),this.propertyElements=[],wp.customize.Control.prototype.initialize.call(this,e,i)},_setUpSettingRootLinks:function(){var n=this;n.container.find("[data-customize-setting-link]").each(function(){var i=jQuery(this);wp.customize(i.data("customizeSettingLink"),function(e){var t=new wp.customize.Element(i);n.elements.push(t),t.sync(e),t.set(e())})})},_setUpSettingPropertyLinks:function(){var n=this;n.setting&&n.container.find("[data-customize-setting-property-link]").each(function(){var t,e=jQuery(this),i=e.data("customizeSettingPropertyLink");t=new wp.customize.Element(e),n.propertyElements.push(t),t.set(n.setting()[i]),t.bind(function(e){var t=n.setting();e!==t[i]&&((t=_.clone(t))[i]=e,n.setting.set(t))}),n.setting.bind(function(e){e[i]!==t.get()&&t.set(e[i])})})},ready:function(){var e=this;e._setUpSettingRootLinks(),e._setUpSettingPropertyLinks(),wp.customize.Control.prototype.ready.call(e),e.deferred.embedded.done(function(){e.initKirkiControl(e)})},embed:function(){var t=this,e=t.section();e&&wp.customize.section(e,function(e){"kirki-expanded"===e.params.type||e.expanded()||wp.customize.settings.autofocus.control===t.id?t.actuallyEmbed():e.expanded.bind(function(e){e&&t.actuallyEmbed()})})},actuallyEmbed:function(){"resolved"!==this.deferred.embedded.state()&&(this.renderContent(),this.deferred.embedded.resolve())},focus:function(e){this.actuallyEmbed(),wp.customize.Control.prototype.focus.call(this,e)},initKirkiControl:function(e){void 0===kirki.control[e.params.type]?this.container.on("change keyup paste click","input",function(){e.setting.set(jQuery(this).val())}):kirki.control[e.params.type].init(e)}})}(),_.each(kirki.control,function(e,t){wp.customize.controlConstructor[t]=wp.customize.kirkiDynamicControl.extend({})}),wp.customize.controlConstructor["kirki-background"]=wp.customize.Control.extend({ready:function(){"use strict";!_.isUndefined(window.kirkiControlLoader)&&_.isFunction(kirkiControlLoader)?kirkiControlLoader(this):this.initKirkiControl()},initKirkiControl:function(){var o=this,e=o.setting._value,t=o.container.find(".kirki-color-control");(_.isUndefined(e["background-image"])||""===e["background-image"])&&(o.container.find(".background-wrapper > .background-repeat").hide(),o.container.find(".background-wrapper > .background-position").hide(),o.container.find(".background-wrapper > .background-size").hide(),o.container.find(".background-wrapper > .background-attachment").hide()),t.wpColorPicker({change:function(){setTimeout(function(){o.saveValue("background-color",t.val())},100)}}),o.container.on("change",".background-repeat select",function(){o.saveValue("background-repeat",jQuery(this).val())}),o.container.on("change click",".background-size input",function(){o.saveValue("background-size",jQuery(this).val())}),o.container.on("change",".background-position select",function(){o.saveValue("background-position",jQuery(this).val())}),o.container.on("change click",".background-attachment input",function(){o.saveValue("background-attachment",jQuery(this).val())}),o.container.on("click",".background-image-upload-button",function(e){var r=wp.media({multiple:!1}).open().on("select",function(){var e,t,i,n=r.state().get("selection").first(),a=n.toJSON().sizes.full.url;_.isUndefined(n.toJSON().sizes.medium)?_.isUndefined(n.toJSON().sizes.thumbnail)||(a=n.toJSON().sizes.thumbnail.url):a=n.toJSON().sizes.medium.url,e=n.toJSON().sizes.full.url,n.toJSON().id,n.toJSON().width,n.toJSON().height,""!==e&&o.container.find(".background-wrapper > .background-repeat, .background-wrapper > .background-position, .background-wrapper > .background-size, .background-wrapper > .background-attachment").show(),o.saveValue("background-image",e),t=o.container.find(".placeholder, .thumbnail"),i=o.container.find(".background-image-upload-remove-button"),t.length&&t.removeClass().addClass("thumbnail thumbnail-image").html('<img src="'+a+'" alt="" />'),i.length&&i.show()});e.preventDefault()}),o.container.on("click",".background-image-upload-remove-button",function(e){var t,i;e.preventDefault(),o.saveValue("background-image",""),t=o.container.find(".placeholder, .thumbnail"),i=o.container.find(".background-image-upload-remove-button"),o.container.find(".background-wrapper > .background-repeat").hide(),o.container.find(".background-wrapper > .background-position").hide(),o.container.find(".background-wrapper > .background-size").hide(),o.container.find(".background-wrapper > .background-attachment").hide(),t.length&&t.removeClass().addClass("placeholder").html("No file selected"),i.length&&i.hide()})},saveValue:function(e,t){var i=jQuery("#customize-control-"+this.id.replace("[","-").replace("]","")+" .background-hidden-value"),n=this.setting._value;n[e]=t,jQuery(i).attr("value",JSON.stringify(n)).trigger("change"),this.setting.set(n)}}),wp.customize.controlConstructor["kirki-color-palette"]=wp.customize.kirkiDynamicControl.extend({}),wp.customize.controlConstructor["kirki-dashicons"]=wp.customize.kirkiDynamicControl.extend({}),wp.customize.controlConstructor["kirki-date"]=wp.customize.kirkiDynamicControl.extend({initKirkiControl:function(){var e=this,t=e.selector+" input.datepicker";jQuery(t).datepicker({dateFormat:"yy-mm-dd"}),e.container.find(".kirki-controls-loading-spinner").hide(),this.container.on("change keyup paste","input.datepicker",function(){e.setting.set(jQuery(this).val())})}}),wp.customize.controlConstructor["kirki-dimension"]=wp.customize.kirkiDynamicControl.extend({initKirkiControl:function(){var e,t=this;t.kirkiNotifications(),this.container.on("change keyup paste","input",function(){e=jQuery(this).val(),t.setting.set(e)})},kirkiNotifications:function(){var n=void 0!==this.params.choices&&void 0!==this.params.choices.accept_unitless&&!0===this.params.choices.accept_unitless;wp.customize(this.id,function(i){i.bind(function(e){var t="long_title";!1!==kirki.util.validate.cssValue(e)||n&&!isNaN(e)?i.notifications.remove(t):i.notifications.add(t,new wp.customize.Notification(t,{type:"warning",message:dimensionkirkiL10n["invalid-value"]}))})})}}),wp.customize.controlConstructor["kirki-dimensions"]=wp.customize.kirkiDynamicControl.extend({initKirkiControl:function(){var e,t=this.params.choices.controls,i={},n=[];for(_.each(t,function(e,t){!0===e&&n.push(t)}),e=0;e<n.length;e++)i[n[e]]=this.setting._value[n[e]],this.updateDimensionsValue(n[e],i)},updateDimensionsValue:function(e,t){var i=this;i.container.on("change keyup paste","."+e+" input",function(){t[e]=jQuery(this).val(),i.kirkiNotifications(),i.saveValue(t)})},saveValue:function(e){var i={};_.each(e,function(e,t){i[t]=e}),this.setting.set(i)},kirkiNotifications:function(){wp.customize(this.id,function(a){a.bind(function(e){var t,i="long_title",n={};if(a.notifications.remove(i),_.each(e,function(e,t){!1===kirki.util.validate.cssValue(e)?n[t]=e:delete n[t]}),!_.isEmpty(n))return t=dimensionskirkiL10n["invalid-value"]+" ("+_.values(n).toString()+") ",void a.notifications.add(i,new wp.customize.Notification(i,{type:"warning",message:t}));a.notifications.remove(i)})})}}),wp.customize.controlConstructor["kirki-editor"]=wp.customize.kirkiDynamicControl.extend({initKirkiControl:function(){var i,n=this,a=n.container.find("textarea"),e="kirki-editor-"+n.id.replace("[","").replace("]","");wp.editor.initialize(e,{tinymce:{wpautop:!0},quicktags:!0,mediaButtons:!0}),(i=tinyMCE.get(e))&&i.onChange.add(function(e){var t;e.save(),t=i.getContent(),a.val(t).trigger("change"),wp.customize.instance(n.id).set(t)})}}),wp.customize.controlConstructor["kirki-fontawesome"]=wp.customize.kirkiDynamicControl.extend({initKirkiControl:function(){var e,t,i=this,n=this.container.find("select"),a=jQuery.parseJSON(fontAwesomeJSON),r={data:[],escapeMarkup:function(e){return e},templateResult:function(e){return'<i class="fa fa-lg fa-'+e.id+'" aria-hidden="true"></i> '+e.text},templateSelection:function(e){return'<i class="fa fa-lg fa-'+e.id+'" aria-hidden="true"></i> '+e.text}};_.each(a.icons,function(e){r.data.push({id:e.id,text:e.name})}),(t=jQuery(n).selectWoo(r)).on("change",function(){e=jQuery(this).val(),i.setting.set(e)}),t.val(i.setting._value).trigger("change")}}),wp.customize.controlConstructor["kirki-multicheck"]=wp.customize.kirkiDynamicControl.extend({initKirkiControl:function(){var n=this;n.container.on("change","input",function(){var t=[],i=0;jQuery.each(n.params.choices,function(e){n.container.find('input[value="'+e+'"]').is(":checked")?(n.container.find('input[value="'+e+'"]').parent().addClass("checked"),t[i]=e,i++):n.container.find('input[value="'+e+'"]').parent().removeClass("checked")}),n.setting.set(t)})}}),wp.customize.controlConstructor["kirki-multicolor"]=wp.customize.Control.extend({ready:function(){"use strict";!_.isUndefined(window.kirkiControlLoader)&&_.isFunction(kirkiControlLoader)?kirkiControlLoader(this):this.initKirkiControl()},initKirkiControl:function(){"use strict";var r=this.params.choices,e=Object.keys(r),t=(this.params.value,0);function i(e,t,i){var n=e.container.find(".multicolor-index-"+i),a={change:function(){setTimeout(function(){e.saveValue(i,n.val()),e.container.find(".multicolor-index-"+i).trigger("change")},100)}};_.isObject(r.irisArgs)&&_.each(r.irisArgs,function(e,t){a[t]=e}),n.wpColorPicker(a)}for(;t<Object.keys(r).length;)i(this,0,e[t]),t++},saveValue:function(e,t){var i=this.container.find(".multicolor-hidden-value"),n=this.setting._value;n[e]=t,jQuery(i).attr("value",JSON.stringify(n)).trigger("change"),this.setting.set(n)}}),wp.customize.controlConstructor["kirki-palette"]=wp.customize.kirkiDynamicControl.extend({}),wp.customize.controlConstructor["kirki-radio-buttonset"]=wp.customize.kirkiDynamicControl.extend({}),wp.customize.controlConstructor["kirki-radio-image"]=wp.customize.kirkiDynamicControl.extend({});var RepeaterRow=function(e,t,i,n){"use strict";var a=this;this.rowIndex=e,this.container=t,this.label=i,this.header=this.container.find(".repeater-row-header"),this.header.on("click",function(){a.toggleMinimize()}),this.container.on("click",".repeater-row-remove",function(){a.remove()}),this.header.on("mousedown",function(){a.container.trigger("row:start-dragging")}),this.container.on("keyup change","input, select, textarea",function(e){a.container.trigger("row:update",[a.rowIndex,jQuery(e.target).data("field"),e.target])}),this.setRowIndex=function(e){this.rowIndex=e,this.container.attr("data-row",e),this.container.data("row",e),this.updateLabel()},this.toggleMinimize=function(){this.container.toggleClass("minimized"),this.header.find(".dashicons").toggleClass("dashicons-arrow-up").toggleClass("dashicons-arrow-down")},this.remove=function(){this.container.slideUp(300,function(){jQuery(this).detach()}),this.container.trigger("row:remove",[this.rowIndex])},this.updateLabel=function(){var e,t,i;if("field"===this.label.type&&(e=this.container.find('.repeater-field [data-field="'+this.label.field+'"]'),_.isFunction(e.val)&&""!==(t=e.val())))return _.isUndefined(n.params.fields[this.label.field])||_.isUndefined(n.params.fields[this.label.field].type)||("select"===n.params.fields[this.label.field].type?_.isUndefined(n.params.fields[this.label.field].choices)||_.isUndefined(n.params.fields[this.label.field].choices[e.val()])||(t=n.params.fields[this.label.field].choices[e.val()]):"radio"!==n.params.fields[this.label.field].type&&"radio-image"!==n.params.fields[this.label.field].type||(i=n.selector+' [data-row="'+this.rowIndex+'"] .repeater-field [data-field="'+this.label.field+'"]:checked',t=jQuery(i).val())),void this.header.find(".repeater-row-label").text(t);this.header.find(".repeater-row-label").text(this.label.value+" "+(this.rowIndex+1))},this.updateLabel()};wp.customize.controlConstructor.repeater=wp.customize.Control.extend({ready:function(){"use strict";!_.isUndefined(window.kirkiControlLoader)&&_.isFunction(kirkiControlLoader)?kirkiControlLoader(this):this.initKirkiControl()},initKirkiControl:function(){"use strict";var t,i,n=this,e=this.params.value;n.container.find(".kirki-controls-loading-spinner").hide(),this.settingField=this.container.find("[data-customize-setting-link]").first(),this.setValue([],!1),this.repeaterFieldsContainer=this.container.find(".repeater-fields").first(),this.currentIndex=0,this.rows=[],t=!1,_.isUndefined(this.params.choices.limit)||(t=!(this.params.choices.limit<=0)&&parseInt(this.params.choices.limit,10)),this.container.on("click","button.repeater-add",function(e){e.preventDefault(),!t||n.currentIndex<t?((i=n.addRow()).toggleMinimize(),n.initColorPicker(),n.initSelect(i)):jQuery(n.selector+" .limit").addClass("highlight")}),this.container.on("click",".repeater-row-remove",function(){n.currentIndex--,(!t||n.currentIndex<t)&&jQuery(n.selector+" .limit").removeClass("highlight")}),this.container.on("click keypress",".repeater-field-image .upload-button,.repeater-field-cropped_image .upload-button,.repeater-field-upload .upload-button",function(e){e.preventDefault(),n.$thisButton=jQuery(this),n.openFrame(e)}),this.container.on("click keypress",".repeater-field-image .remove-button,.repeater-field-cropped_image .remove-button",function(e){e.preventDefault(),n.$thisButton=jQuery(this),n.removeImage(e)}),this.container.on("click keypress",".repeater-field-upload .remove-button",function(e){e.preventDefault(),n.$thisButton=jQuery(this),n.removeFile(e)}),this.repeaterTemplate=_.memoize(function(){var t={evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g,variable:"data"};return function(e){return _.template(n.container.find(".customize-control-repeater-content").first().html(),null,t)(e)}}),e.length&&_.each(e,function(e){i=n.addRow(e),n.initColorPicker(),n.initSelect(i,e)}),this.setValue(e,!0,!0),this.repeaterFieldsContainer.sortable({handle:".repeater-row-header",update:function(){n.sort()}})},openFrame:function(e){"use strict";wp.customize.utils.isKeydownButNotEnterEvent(e)||(this.$thisButton.closest(".repeater-field").hasClass("repeater-field-cropped_image")?this.initCropperFrame():this.initFrame(),this.frame.open())},initFrame:function(){"use strict";var e=this.getMimeType();this.frame=wp.media({states:[new wp.media.controller.Library({library:wp.media.query({type:e}),multiple:!1,date:!1})]}),this.frame.on("select",this.onSelect,this)},initCropperFrame:function(){"use strict";var t=this.$thisButton.siblings("input.hidden-field").attr("data-field"),e=this.getMimeType();_.isString(t)&&""!==t&&_.isObject(this.params.fields[t])&&"cropped_image"===this.params.fields[t].type&&["width","height","flex_width","flex_height"].forEach(function(e){_.isUndefined(this.params.fields[t][e])||(this.params[e]=this.params.fields[t][e])}.bind(this)),this.frame=wp.media({button:{text:"Select and Crop",close:!1},states:[new wp.media.controller.Library({library:wp.media.query({type:e}),multiple:!1,date:!1,suggestedWidth:this.params.width,suggestedHeight:this.params.height}),new wp.media.controller.CustomizeImageCropper({imgSelectOptions:this.calculateImageSelectOptions,control:this})]}),this.frame.on("select",this.onSelectForCrop,this),this.frame.on("cropped",this.onCropped,this),this.frame.on("skippedcrop",this.onSkippedCrop,this)},onSelect:function(){"use strict";var e=this.frame.state().get("selection").first().toJSON();this.$thisButton.closest(".repeater-field").hasClass("repeater-field-upload")?this.setFileInRepeaterField(e):this.setImageInRepeaterField(e)},onSelectForCrop:function(){"use strict";var e=this.frame.state().get("selection").first().toJSON();this.params.width!==e.width||this.params.height!==e.height||this.params.flex_width||this.params.flex_height?this.frame.setState("cropper"):this.setImageInRepeaterField(e)},onCropped:function(e){"use strict";this.setImageInRepeaterField(e)},calculateImageSelectOptions:function(e,t){"use strict";var i,n,a,r=t.get("control"),o=!!parseInt(r.params.flex_width,10),s=!!parseInt(r.params.flex_height,10),c=e.get("width"),l=e.get("height"),u=parseInt(r.params.width,10),d=parseInt(r.params.height,10),p=u/d,h=c,f=l;return t.set("canSkipCrop",!r.mustBeCropped(o,s,u,d,c,l)),p<h/f?u=(d=f)*p:d=(u=h)/p,!(a={handles:!0,keys:!0,instance:!0,persistent:!0,imageWidth:c,imageHeight:l,x1:i=(h-u)/2,y1:n=(f-d)/2,x2:u+i,y2:d+n})===s&&!1===o&&(a.aspectRatio=u+":"+d),!1===s&&(a.maxHeight=d),!1===o&&(a.maxWidth=u),a},mustBeCropped:function(e,t,i,n,a,r){"use strict";return!(!0===e&&!0===t||!0===e&&n===r||!0===t&&i===a||i===a&&n===r||a<=i)},onSkippedCrop:function(){"use strict";var e=this.frame.state().get("selection").first().toJSON();this.setImageInRepeaterField(e)},setImageInRepeaterField:function(e){"use strict";var t=this.$thisButton.closest(".repeater-field-image,.repeater-field-cropped_image");t.find(".kirki-image-attachment").html('<img src="'+e.url+'">').hide().slideDown("slow"),t.find(".hidden-field").val(e.id),this.$thisButton.text(this.$thisButton.data("alt-label")),t.find(".remove-button").show(),t.find("input, textarea, select").trigger("change"),this.frame.close()},setFileInRepeaterField:function(e){"use strict";var t=this.$thisButton.closest(".repeater-field-upload");t.find(".kirki-file-attachment").html('<span class="file"><span class="dashicons dashicons-media-default"></span> '+e.filename+"</span>").hide().slideDown("slow"),t.find(".hidden-field").val(e.id),this.$thisButton.text(this.$thisButton.data("alt-label")),t.find(".upload-button").show(),t.find(".remove-button").show(),t.find("input, textarea, select").trigger("change"),this.frame.close()},getMimeType:function(){"use strict";var e=this.$thisButton.siblings("input.hidden-field").attr("data-field");return _.isString(e)&&""!==e&&_.isObject(this.params.fields[e])&&"upload"===this.params.fields[e].type&&!_.isUndefined(this.params.fields[e].mime_type)?this.params.fields[e].mime_type:"image"},removeImage:function(e){"use strict";var t,i;wp.customize.utils.isKeydownButNotEnterEvent(e)||(i=(t=this.$thisButton.closest(".repeater-field-image,.repeater-field-cropped_image,.repeater-field-upload")).find(".upload-button"),t.find(".kirki-image-attachment").slideUp("fast",function(){jQuery(this).show().html(jQuery(this).data("placeholder"))}),t.find(".hidden-field").val(""),i.text(i.data("label")),this.$thisButton.hide(),t.find("input, textarea, select").trigger("change"))},removeFile:function(e){"use strict";var t,i;wp.customize.utils.isKeydownButNotEnterEvent(e)||(i=(t=this.$thisButton.closest(".repeater-field-upload")).find(".upload-button"),t.find(".kirki-file-attachment").slideUp("fast",function(){jQuery(this).show().html(jQuery(this).data("placeholder"))}),t.find(".hidden-field").val(""),i.text(i.data("label")),this.$thisButton.hide(),t.find("input, textarea, select").trigger("change"))},getValue:function(){"use strict";return JSON.parse(decodeURI(this.setting.get()))},setValue:function(e,t,i){"use strict";var a=e,r=[];i&&(jQuery.each(this.params.fields,function(e,t){"image"!==t.type&&"cropped_image"!==t.type&&"upload"!==t.type||r.push(e)}),jQuery.each(e,function(i,n){jQuery.each(r,function(e,t){_.isUndefined(n[t])||_.isUndefined(n[t].id)||(a[i][t]=n[t].id)})})),this.setting.set(encodeURI(JSON.stringify(a))),t&&this.settingField.trigger("change")},addRow:function(e){"use strict";var t,a,i,r=this,n=r.repeaterTemplate(),o=this.getValue(),s={};if(n){if(t=jQuery.extend(!0,{},r.params.fields),e)for(i in e)e.hasOwnProperty(i)&&t.hasOwnProperty(i)&&(t[i].default=e[i]);for(i in t.index=this.currentIndex,n=n(t),(a=new RepeaterRow(r.currentIndex,jQuery(n).appendTo(r.repeaterFieldsContainer),r.params.row_label,r)).container.on("row:remove",function(e,t){r.deleteRow(t)}),a.container.on("row:update",function(e,t,i,n){r.updateField.call(r,e,t,i,n),a.updateLabel()}),this.rows[this.currentIndex]=a,t)t.hasOwnProperty(i)&&(s[i]=t[i].default);return o[this.currentIndex]=s,this.setValue(o,!0),this.currentIndex++,a}},sort:function(){"use strict";var i=this,e=this.repeaterFieldsContainer.find(".repeater-row"),n=[],a=i.getValue(),r=[],o=[];e.each(function(e,t){n.push(jQuery(t).data("row"))}),jQuery.each(n,function(e,t){r[e]=i.rows[t],r[e].setRowIndex(e),o[e]=a[t]}),i.rows=r,i.setValue(o)},deleteRow:function(e){"use strict";var t,i=this.getValue();for(t in i[e]&&this.rows[e]&&(delete i[e],delete this.rows[e],this.setValue(i,!0)),1,this.rows)this.rows.hasOwnProperty(t)&&this.rows[t]&&(this.rows[t].updateLabel(),0)},updateField:function(e,t,i,n){"use strict";var a,r,o;this.rows[t]&&this.params.fields[i]&&(a=this.params.fields[i].type,r=this.rows[t],o=this.getValue(),n=jQuery(n),_.isUndefined(o[r.rowIndex][i])||(o[r.rowIndex][i]="checkbox"===a?n.is(":checked"):n.val(),this.setValue(o,!0)))},initColorPicker:function(){"use strict";var r=this,e=r.container.find(".color-picker-hex"),t={},i=e.data("field");_.isUndefined(i)||_.isUndefined(r.params.fields[i])||_.isUndefined(r.params.fields[i].palettes)||!_.isObject(r.params.fields[i].palettes)||(t.palettes=r.params.fields[i].palettes),t.change=function(e,t){var i=jQuery(e.target),n=i.closest(".repeater-row").data("row"),a=r.getValue();a[n][i.data("field")]=t.color.toString(),r.setValue(a,!0)},0!==e.length&&e.wpColorPicker(t)},initSelect:function(e,t){"use strict";var i,n,a=this,r=e.container.find(".repeater-field select"),o={};0!==r.length&&(i=r.data("field"),"undefed"!==(n=jQuery(r).data("multiple"))&&jQuery.isNumeric(n)&&1<(n=parseInt(n,10))&&(o.maximumSelectionLength=n),(t=t||{})[i]=t[i]||"",jQuery(r).selectWoo(o).val(t[i]||jQuery(r).val()),this.container.on("change",".repeater-field select",function(e){var t=jQuery(e.target),i=t.closest(".repeater-row").data("row"),n=a.getValue();n[i][t.data("field")]=jQuery(this).val(),a.setValue(n)}))}}),wp.customize.controlConstructor["kirki-slider"]=wp.customize.kirkiDynamicControl.extend({initKirkiControl:function(){var e=this,t="postMessage"===e.setting.transport?"mousemove change":"change",i=e.container.find('input[type="range"]'),n=e.container.find('input[type="text"]'),a=e.setting._value;n.attr("value",a),i.on("mousemove change",function(){n.attr("value",i.val())}),i.on(t,function(){e.setting.set(i.val())}),n.on("input paste change",function(){i.attr("value",n.val()),e.setting.set(n.val())}),e.container.find(".slider-reset").on("click",function(){n.attr("value",e.params.default),i.attr("value",e.params.default),e.setting.set(n.val())})}}),wp.customize.controlConstructor["kirki-sortable"]=wp.customize.Control.extend({ready:function(){"use strict";!_.isUndefined(window.kirkiControlLoader)&&_.isFunction(kirkiControlLoader)?kirkiControlLoader(this):this.initKirkiControl()},initKirkiControl:function(){"use strict";var e=this;e.container.find(".kirki-controls-loading-spinner").hide(),e.sortableContainer=e.container.find("ul.sortable").first(),e.sortableContainer.sortable({stop:function(){e.updateValue()}}).disableSelection().find("li").each(function(){jQuery(this).find("i.visibility").click(function(){jQuery(this).toggleClass("dashicons-visibility-faint").parents("li:eq(0)").toggleClass("invisible")})}).click(function(){e.updateValue()})},updateValue:function(){"use strict";var e=[];this.sortableContainer.find("li").each(function(){jQuery(this).is(".invisible")||e.push(jQuery(this).data("value"))}),this.setting.set(e)}}),wp.customize.controlConstructor["kirki-switch"]=wp.customize.kirkiDynamicControl.extend({initKirkiControl:function(){"use strict";var e=this,t=e.setting._value;this.container.on("change","input",function(){t=!!jQuery(this).is(":checked"),e.setting.set(t)})}}),wp.customize.controlConstructor["kirki-toggle"]=wp.customize.kirkiDynamicControl.extend({initKirkiControl:function(){var e=this,t=e.setting._value;this.container.on("change","input",function(){t=!!jQuery(this).is(":checked"),e.setting.set(t)})}}),wp.customize.controlConstructor["kirki-typography"]=wp.customize.kirkiDynamicControl.extend({initKirkiControl:function(){"use strict";var e,t=this,i=t.setting._value;t.renderFontSelector(),t.renderBackupFontSelector(),t.renderVariantSelector(),t.localFontsCheckbox(),void 0!==t.params.default["font-size"]&&this.container.on("change keyup paste",".font-size input",function(){t.saveValue("font-size",jQuery(this).val())}),void 0!==t.params.default["line-height"]&&this.container.on("change keyup paste",".line-height input",function(){t.saveValue("line-height",jQuery(this).val())}),void 0!==t.params.default["margin-top"]&&this.container.on("change keyup paste",".margin-top input",function(){t.saveValue("margin-top",jQuery(this).val())}),void 0!==t.params.default["margin-bottom"]&&this.container.on("change keyup paste",".margin-bottom input",function(){t.saveValue("margin-bottom",jQuery(this).val())}),void 0!==t.params.default["letter-spacing"]&&(i["letter-spacing"]=jQuery.isNumeric(i["letter-spacing"])?i["letter-spacing"]+"px":i["letter-spacing"],this.container.on("change keyup paste",".letter-spacing input",function(){i["letter-spacing"]=jQuery.isNumeric(jQuery(this).val())?jQuery(this).val()+"px":jQuery(this).val(),t.saveValue("letter-spacing",i["letter-spacing"])})),void 0!==t.params.default["word-spacing"]&&this.container.on("change keyup paste",".word-spacing input",function(){t.saveValue("word-spacing",jQuery(this).val())}),void 0!==t.params.default["text-align"]&&this.container.on("change",".text-align input",function(){t.saveValue("text-align",jQuery(this).val())}),void 0!==t.params.default["text-transform"]&&jQuery(t.selector+" .text-transform select").selectWoo().on("change",function(){t.saveValue("text-transform",jQuery(this).val())}),void 0!==t.params.default["text-decoration"]&&jQuery(t.selector+" .text-decoration select").selectWoo().on("change",function(){t.saveValue("text-decoration",jQuery(this).val())}),void 0!==t.params.default.color&&(e=this.container.find(".kirki-color-control")).wpColorPicker({change:function(){setTimeout(function(){t.saveValue("color",e.val())},100)}})},renderFontSelector:function(){var e,t,i=this,n=i.selector+" .font-family select",a=[],r=[],o=[],s=i.setting._value,c=i.getFonts();_.isUndefined(c.standard)||_.each(c.standard,function(e){r.push({id:e.family.replace(/&quot;/g,"&#39"),text:e.label})}),_.isUndefined(c.google)||_.each(c.google,function(e){o.push({id:e.family,text:e.family})}),t={},_.isUndefined(i.params)||_.isUndefined(i.params.choices)||_.isUndefined(i.params.choices.fonts)||_.isUndefined(i.params.choices.fonts.families)||(t=i.params.choices.fonts.families),a=jQuery.extend({},t,{default:{text:kirkiL10n.defaultCSSValues,children:[{id:"",text:kirkiL10n.defaultBrowserFamily},{id:"initial",text:"initial"},{id:"inherit",text:"inherit"}]},standard:{text:kirkiL10n.standardFonts,children:r},google:{text:kirkiL10n.googleFonts,children:o}}),kirkiL10n.isScriptDebug&&(console.info('Kirki Debug: Font families for control "'+i.id+'":'),console.info(a)),a=_.values(a),e=jQuery(n).selectWoo({data:a}),(s["font-family"]||""===s["font-family"])&&(s["font-family"]=kirki.util.parseHtmlEntities(s["font-family"].replace(/'/g,'"')),e.val(s["font-family"]).trigger("change")),e.on("change",function(){i.saveValue("font-family",jQuery(this).val()),i.renderBackupFontSelector(),i.renderVariantSelector()})},renderBackupFontSelector:function(){var e,t=this,i=t.selector+" .font-backup select",n=[],a=t.setting._value,r=a["font-family"],o=t.getFonts();(_.isUndefined(a["font-backup"])||null===a["font-backup"])&&(a["font-backup"]=""),"inherit"!==r&&"initial"!==r&&"google"===kirki.util.webfonts.getFontType(r)?(jQuery(t.selector+" .font-backup").show(),_.isUndefined(o.standard)||_.each(o.standard,function(e){n.push({id:e.family.replace(/&quot;/g,"&#39"),text:e.label})}),e=jQuery(i).selectWoo({data:n}),void 0!==a["font-backup"]&&e.val(a["font-backup"].replace(/'/g,'"')).trigger("change"),e.on("change",function(){t.saveValue("font-backup",jQuery(this).val())})):jQuery(t.selector+" .font-backup").hide()},renderVariantSelector:function(){var e,t,i,n=this,a=n.setting._value,r=a["font-family"],o=n.selector+" .variant select",s=[],c=!1,l=kirki.util.webfonts.getFontType(r),u=["","regular","italic","700","700italic"];if("google"===l&&(u=kirki.util.webfonts.google.getVariants(r)),_.isUndefined(n.params)||_.isUndefined(n.params.choices)||_.isUndefined(n.params.choices.fonts)||_.isUndefined(n.params.choices.fonts.variants)||_.isUndefined(n.params.choices.fonts.variants[r])||(u=n.params.choices.fonts.variants[r]),kirkiL10n.isScriptDebug&&(console.info('Kirki Debug: Font variants for font-family "'+r+'":'),console.info(u)),"inherit"!==r&&"initial"!==r&&""!==r||(a.variant="inherit",u=[""],jQuery(n.selector+" .variant").hide()),u.length<=1)return jQuery(n.selector+" .variant").hide(),a.variant=u[0],n.saveValue("variant",a.variant),i=""!==a.variant&&a.variant?(e=_.isString(a.variant)?a.variant.match(/\d/g):"400",e=_.isObject(e)?e.join(""):"400",-1!==a.variant.indexOf("italic")?"italic":"normal"):e="",n.saveValue("font-weight",e),void n.saveValue("font-style",i);jQuery(n.selector+" .font-backup").show(),jQuery(n.selector+" .variant").show(),_.each(u,function(e){a.variant===e&&(c=!0),s.push({id:e,text:e})}),c||(a.variant="regular"),jQuery(o).hasClass("select2-hidden-accessible")&&(jQuery(o).selectWoo("destroy"),jQuery(o).empty()),(t=jQuery(o).selectWoo({data:s})).val(a.variant).trigger("change"),t.on("change",function(){n.saveValue("variant",jQuery(this).val()),"string"!=typeof a.variant&&(a.variant=u[0]),e=_.isString(a.variant)?a.variant.match(/\d/g):"400",e=_.isObject(e)?e.join(""):"400",i=-1!==a.variant.indexOf("italic")?"italic":"normal",n.saveValue("font-weight",e),n.saveValue("font-style",i)})},getFonts:function(){var e=this,t=kirki.util.webfonts.google.getFonts(),i={},n="alpha",a=0,r={};return _.isEmpty(e.params.choices.fonts.google)?i=kirki.util.webfonts.google.getFonts(n,"",a):"alpha"===e.params.choices.fonts.google[0]||"popularity"===e.params.choices.fonts.google[0]||"trending"===e.params.choices.fonts.google[0]?(n=e.params.choices.fonts.google[0],isNaN(e.params.choices.fonts.google[1])||(a=parseInt(e.params.choices.fonts.google[1],10)),i=kirki.util.webfonts.google.getFonts(n,"",a)):_.each(e.params.choices.fonts.google,function(e){void 0===t[e]||_.isEmpty(t[e])||(i[e]=t[e])}),_.isEmpty(e.params.choices.fonts.standard)?_.each(kirki.util.webfonts.standard.fonts,function(e,t){r[t]={family:e.stack,label:e.label}}):_.each(e.params.choices.fonts.standard,function(e){void 0===kirki.util.webfonts.standard.fonts[e]||_.isEmpty(kirki.util.webfonts.standard.fonts[e])?r[e]={family:e,label:e}:(r[e]={},"undefined"===kirki.util.webfonts.standard.fonts[e].stack||_.isEmpty(kirki.util.webfonts.standard.fonts[e].stack)?r[e].family=i[e]:r[e].family=kirki.util.webfonts.standard.fonts[e].stack,"undefined"===kirki.util.webfonts.standard.fonts[e].label||_.isEmpty(kirki.util.webfonts.standard.fonts[e].label)?_.isEmpty(r[e])||(r[e].label=r[e]):r[e].label=kirki.util.webfonts.standard.fonts[e].label)}),{google:i,standard:r}},localFontsCheckbox:function(){var e=this,t=(e.container.find(".kirki-host-font-locally"),e.container.find(".kirki-host-font-locally input")),i=jQuery(t).is(":checked");e.setting._value&&e.setting._value.downloadFont&&jQuery(t).attr("checked","checked"),jQuery(t).on("change",function(){i=jQuery(t).is(":checked"),e.saveValue("downloadFont",i)})},saveValue:function(e,t){var i=this.container.find(".typography-hidden-value"),n=this.setting._value;n[e]=t,jQuery(i).attr("value",JSON.stringify(n)).trigger("change"),this.setting.set(n)}});
1
+ if(_.isUndefined(window.kirkiSetSettingValue))var kirkiSetSettingValue={set:function(i,n){var e,a=this,t=wp.customize.settings.controls[i];if(_.isUndefined(t))return!0;switch(a.setValue(i,n),t.type){case"kirki-background":_.isUndefined(n["background-color"])||a.setColorPicker(a.findElement(i,".kirki-color-control"),n["background-color"]),a.findElement(i,".placeholder, .thumbnail").removeClass().addClass("placeholder").html("No file selected"),_.each(["background-repeat","background-position"],function(e){_.isUndefined(n[e])||a.setSelectWoo(a.findElement(i,"."+e+" select"),n[e])}),_.each(["background-size","background-attachment"],function(e){jQuery(a.findElement(i,"."+e+' input[value="'+n+'"]')).prop("checked",!0)}),e=JSON.stringify(n).replace(/'/g,"&#39"),jQuery(a.findElement(i,".background-hidden-value").attr("value",e)).trigger("change");break;case"kirki-code":jQuery(a.findElement(i,".CodeMirror"))[0].CodeMirror.setValue(n);break;case"checkbox":case"kirki-switch":case"kirki-toggle":n=1===n||"1"===n||!0===n,jQuery(a.findElement(i,"input")).prop("checked",n),wp.customize.instance(i).set(n);break;case"kirki-select":case"kirki-fontawesome":a.setSelectWoo(a.findElement(i,"select"),n);break;case"kirki-slider":jQuery(a.findElement(i,"input")).prop("value",n),jQuery(a.findElement(i,".kirki_range_value .value")).html(n);break;case"kirki-generic":(_.isUndefined(t.choices)||_.isUndefined(t.choices.element))&&(t.choices.element="input"),jQuery(a.findElement(i,t.choices.element)).prop("value",n);break;case"kirki-color":a.setColorPicker(a.findElement(i,".kirki-color-control"),n);break;case"kirki-multicheck":a.findElement(i,"input").each(function(){jQuery(this).prop("checked",!1)}),_.each(n,function(e,t){jQuery(a.findElement(i,'input[value="'+n[t]+'"]')).prop("checked",!0)});break;case"kirki-multicolor":_.each(n,function(e,t){a.setColorPicker(a.findElement(i,".multicolor-index-"+t),e)});break;case"kirki-radio-buttonset":case"kirki-radio-image":case"kirki-radio":case"kirki-dashicons":case"kirki-color-palette":case"kirki-palette":jQuery(a.findElement(i,'input[value="'+n+'"]')).prop("checked",!0);break;case"kirki-typography":_.each(["font-family","variant"],function(e){_.isUndefined(n[e])||a.setSelectWoo(a.findElement(i,"."+e+" select"),n[e])}),_.each(["font-size","line-height","letter-spacing","word-spacing"],function(e){_.isUndefined(n[e])||jQuery(a.findElement(i,"."+e+" input")).prop("value",n[e])}),_.isUndefined(n.color)||a.setColorPicker(a.findElement(i,".kirki-color-control"),n.color),e=JSON.stringify(n).replace(/'/g,"&#39"),jQuery(a.findElement(i,".typography-hidden-value").attr("value",e)).trigger("change");break;case"kirki-dimensions":_.each(n,function(e,t){jQuery(a.findElement(i,"."+t+" input")).prop("value",e)});break;case"kirki-repeater":case"kirki-custom":break;default:jQuery(a.findElement(i,"input")).prop("value",n)}},setColorPicker:function(e,t){e.attr("data-default-color",t).data("default-color",t).wpColorPicker("color",t)},setSelectWoo:function(e,t){jQuery(e).selectWoo().val(t).trigger("change")},setTextarea:function(e,t){jQuery(e).prop("value",t)},findElement:function(e,t){return wp.customize.control(e).container.find(t)},setValue:function(e,t,i){i=_.isUndefined(i)?100:parseInt(i,10),wp.customize.instance(e).set({}),setTimeout(function(){wp.customize.instance(e).set(t)},i)}};(kirki={initialized:!1,initialize:function(){this.initialized||(setTimeout(function(){kirki.util.webfonts.standard.initialize(),kirki.util.webfonts.google.initialize()},150),this.initialized=!0)}}).initialize();var kirki=kirki||{};kirki=(kirki=jQuery.extend(kirki,{control:{"kirki-radio":{init:function(e){this.template(e),kirki.input.radio.init(e)},template:function(e){var t=wp.template("kirki-input-radio");e.container.html(t({label:e.params.label,description:e.params.description,"data-id":e.id,inputAttrs:e.params.inputAttrs,default:e.params.default,value:kirki.setting.get(e.id),choices:e.params.choices}))}},"kirki-color":{init:function(e){this.template(e),kirki.input.color.init(e)},template:function(e){var t=wp.template("kirki-input-color");e.container.html(t({label:e.params.label,description:e.params.description,"data-id":e.id,mode:e.params.mode,inputAttrs:e.params.inputAttrs,"data-palette":e.params.palette,"data-default-color":e.params.default,"data-alpha":e.params.choices.alpha,value:kirki.setting.get(e.id)}))}},"kirki-generic":{init:function(e){this.template(e),_.isUndefined(e.params)||_.isUndefined(e.params.choices)||_.isUndefined(e.params.choices.element)||"textarea"!==e.params.choices.element?kirki.input.genericInput.init(e):kirki.input.textarea.init(e)},template:function(e){var t,i={label:e.params.label,description:e.params.description,"data-id":e.id,inputAttrs:e.params.inputAttrs,choices:e.params.choices,value:kirki.setting.get(e.id)};if(!_.isUndefined(e.params)&&!_.isUndefined(e.params.choices)&&!_.isUndefined(e.params.choices.element)&&"textarea"===e.params.choices.element)return t=wp.template("kirki-input-textarea"),void e.container.html(t(i));t=wp.template("kirki-input-generic"),e.container.html(t(i))}},"kirki-number":{init:function(e){this.template(e),kirki.input.number.init(e)},template:function(e){var t=wp.template("kirki-input-number");e.container.html(t(args={label:e.params.label,description:e.params.description,"data-id":e.id,inputAttrs:e.params.inputAttrs,choices:e.params.choices,value:kirki.setting.get(e.id)}))}},"kirki-image":{init:function(e){this.template(e),kirki.input.image.init(e)},template:function(e){var t=wp.template("kirki-input-image");e.container.html(t(args={label:e.params.label,description:e.params.description,"data-id":e.id,inputAttrs:e.params.inputAttrs,choices:e.params.choices,value:kirki.setting.get(e.id)}))}},"kirki-select":{init:function(e){this.template(e),kirki.input.select.init(e)},template:function(e){var t=wp.template("kirki-input-select");e.container.html(t({label:e.params.label,description:e.params.description,"data-id":e.id,inputAttrs:e.params.inputAttrs,choices:e.params.choices,value:kirki.setting.get(e.id),multiple:e.params.multiple||1,placeholder:e.params.placeholder}))}}}}))||{},kirki=(kirki=jQuery.extend(kirki,{input:{radio:{init:function(e){jQuery('input[data-id="'+e.id+'"]').on("change keyup paste click",function(){kirki.setting.set(e.id,jQuery(this).val())})}},color:{init:function(e){var t,i=jQuery('.kirki-color-control[data-id="'+e.id+'"]');e.choices=e.choices||{},_.isEmpty(e.choices)&&e.params.choices&&(e.choices=e.params.choices),_.isEmpty(e.choices)||i.wpColorPicker(e.choices),setTimeout(function(){(t=jQuery('.kirki-input-container[data-id="'+e.id+'"] .wp-picker-clear')).length&&t.click(function(){kirki.setting.set(e.id,"")})},200),i.wpColorPicker({change:function(){setTimeout(function(){kirki.setting.set(e.id,i.val())},20)}})}},genericInput:{init:function(e){jQuery('input[data-id="'+e.id+'"]').on("change keyup paste click",function(){kirki.setting.set(e.id,jQuery(this).val())})}},textarea:{init:function(e){jQuery('textarea[data-id="'+e.id+'"]').on("change keyup paste click",function(){kirki.setting.set(e.id,jQuery(this).val())})}},select:{init:function(e){var t,i=jQuery('select[data-id="'+e.id+'"]'),n=parseInt(i.data("multiple"),10),a={escapeMarkup:function(e){return e}};e.params.placeholder&&(a.placeholder=e.params.placeholder,a.allowClear=!0),1<n&&(a.maximumSelectionLength=n),jQuery(i).selectWoo(a).on("change",function(){t=null===(t=jQuery(this).val())&&1<n?[]:t,kirki.setting.set(e.id,t)})}},number:{init:function(i){var e,t,n=jQuery('input[data-id="'+i.id+'"]'),a=i.setting._value;i.params.choices=_.defaults(i.params.choices,{min:0,max:100,step:1}),(isNaN(a)||""===a)&&(a=i.params.choices.min<0&&0<i.params.choices.max?0:i.params.choices.min),a=parseFloat(a),i.params.choices.step="any"===i.params.choices.step?.001:i.params.choices.step,i.params.choices.min=parseFloat(i.params.choices.min),i.params.choices.max=parseFloat(i.params.choices.max),i.params.choices.step=parseFloat(i.params.choices.step),e=jQuery('.kirki-input-container[data-id="'+i.id+'"] .plus'),t=jQuery('.kirki-input-container[data-id="'+i.id+'"] .minus'),e.click(function(){var e,t=parseFloat(n.val());e=t>=i.params.choices.max?t:t+i.params.choices.step,n.val(e),n.trigger("change")}),t.click(function(){var e,t=parseFloat(n.val());e=t<=i.params.choices.min?t:t-i.params.choices.step,n.val(e),n.trigger("change")}),n.on("change keyup paste click",function(){kirki.setting.set(i.id,jQuery(this).val())})}},image:{init:function(a){var t=kirki.setting.get(a.id),n=_.isUndefined(a.params.choices)||_.isUndefined(a.params.choices.save_as)?"url":a.params.choices.save_as,r=a.container.find(".placeholder, .thumbnail"),e="array"===n?t.url:t,o=a.container.find(".image-upload-remove-button"),s=a.container.find(".image-default-button");t="array"===n&&_.isString(t)?{url:t}:t,"id"!==n&&"ID"!==n||""===t||wp.media.attachment(t).fetch().then(function(){setTimeout(function(){var e=wp.media.attachment(t).get("url");r.removeClass().addClass("thumbnail thumbnail-image").html('<img src="'+e+'" alt="" />')},700)}),("url"===n&&""!==t||"array"===n&&!_.isUndefined(t.url)&&""!==t.url)&&a.container.find("image-default-button").hide(),("url"===n&&""===t||"array"===n&&(_.isUndefined(t.url)||""===t.url))&&o.hide(),t===a.params.default&&a.container.find("image-default-button").hide(),""!==e&&r.removeClass().addClass("thumbnail thumbnail-image").html('<img src="'+e+'" alt="" />'),a.container.on("click",".image-upload-button",function(e){var i=wp.media({multiple:!1}).open().on("select",function(){var e=i.state().get("selection").first().toJSON(),t=e.url;_.isUndefined(e.sizes)||(previewImg=e.sizes.full.url,_.isUndefined(e.sizes.medium)?_.isUndefined(e.sizes.thumbnail)||(t=e.sizes.thumbnail.url):t=e.sizes.medium.url),"array"===n?kirki.setting.set(a.id,{id:e.id,url:e.sizes.full.url,width:e.width,height:e.height}):"id"===n?kirki.setting.set(a.id,e.id):kirki.setting.set(a.id,_.isUndefined(e.sizes)?e.url:e.sizes.full.url),r.length&&r.removeClass().addClass("thumbnail thumbnail-image").html('<img src="'+t+'" alt="" />'),o.length&&(o.show(),s.hide())});e.preventDefault()}),a.container.on("click",".image-upload-remove-button",function(e){var t,i,n;e.preventDefault(),kirki.setting.set(a.id,""),t=a.container.find(".placeholder, .thumbnail"),i=a.container.find(".image-upload-remove-button"),n=a.container.find(".image-default-button"),t.length&&t.removeClass().addClass("placeholder").html(kirkiL10n.noFileSelected),i.length&&(i.hide(),jQuery(n).hasClass("button")&&n.show())}),a.container.on("click",".image-default-button",function(e){var t,i,n;e.preventDefault(),kirki.setting.set(a.id,a.params.default),t=a.container.find(".placeholder, .thumbnail"),i=a.container.find(".image-upload-remove-button"),n=a.container.find(".image-default-button"),t.length&&t.removeClass().addClass("thumbnail thumbnail-image").html('<img src="'+a.params.default+'" alt="" />'),i.length&&(i.show(),n.hide())})}}}}))||{},kirki=(kirki=jQuery.extend(kirki,{setting:{get:function(e){var t=e.split("["),i="",n=0,a="";return _.each(t,function(e,t){e=e.replace("]",""),0===t?i=e:i+="["+e+"]",_.isUndefined(wp.customize.instance(i))||(a=wp.customize.instance(i).get(),n=t),n<t&&_.isObject(a)&&!_.isUndefined(a[e])&&(a=a[e])}),a},set:function(e,t,i){var n,a,r,o,s,c="",l="",u={};n=e,_.isObject(e)&&(n=jQuery(e).attr("data-id")?e.attr("data-id"):e.parents("[data-id]").attr("data-id")),void 0===wp.customize.control(n)?(a=n.split("["),_.each(a,function(e,t){e=e.replace("]",""),c=0===t?e:"["+e+"]",_.isUndefined(wp.customize.instance(c))||(l=c,r=wp.customize.instance(l).get())}),""!==(o=n.replace(l,""))?(_.isObject(r)||(r={}),"["===o.charAt(0)&&(o=o.replace("[","")),s=o.split("["),_.each(s,function(e,t){s[t]=e.replace("]","")}),i&&s.push(i),u='{"'+s.join('":{"')+'":"'+t+'"'+"}".repeat(s.length),u=JSON.parse(u),jQuery.extend(!0,r,u),t=r):i&&((r=_.isObject(r)?r:{})[i]=t,t=r),wp.customize.control(l).setting.set(t)):wp.customize.control(n).setting.set(t)}}}))||{};kirki=jQuery.extend(kirki,{util:{webfonts:{google:{fonts:{},initialize:function(){this.setFonts()},setFonts:function(){var t=this;_.isEmpty(t.fonts)&&jQuery.post(ajaxurl,{action:"kirki_fonts_google_all_get"},function(e){t.fonts=JSON.parse(e)})},getFont:function(e){var t=this.getFonts();return void 0!==t[e]&&t[e]},getFonts:function(e,i,t){var n=this,a={},r={},o={};return e="alpha"!==(e=e||"alpha")&&"popularity"!==e&&"trending"!==e?"alpha":e,t=t||0,t=parseInt(t,10),"alpha"===e?a=jQuery.extend({},n.fonts.items):_.each(n.fonts.order[e],function(e){a[e]=n.fonts.items[e]}),""!==i&&i?_.each(a,function(e,t){i===e.category&&(r[t]=e)}):r=a,0<t?(_.each(_.first(_.keys(r),t),function(e){o[e]=r[e]}),o):r},getVariants:function(e){var t=this.getFont(e);return!!t&&(!_.isUndefined(t.variants)&&t.variants)}},standard:{fonts:{},initialize:function(){this.setFonts()},setFonts:function(){var t=this;_.isEmpty(t.fonts)&&jQuery.post(ajaxurl,{action:"kirki_fonts_standard_all_get"},function(e){t.fonts=JSON.parse(e)})},getVariants:function(){return["regular","italic","700","700italic"]}},getFontType:function(e){return void 0!==this.standard.fonts[e]||void 0!==this.standard.fonts.stack&&void 0!==this.standard.fonts.stack[e]?"standard":void 0!==this.google.fonts.items[e]&&"google"}},validate:{cssValue:function(e){var t,i;return void 0===e||(0===e||"0"===e||"auto"===e||"inherit"===e||"initial"===e||(0<=e.indexOf("calc(")&&0<=e.indexOf(")")||(t=parseFloat(e),i=e.replace(t,""),e?!isNaN(t)&&-1<jQuery.inArray(i,["fr","rem","em","ex","%","px","cm","mm","in","pt","pc","ch","vh","vw","vmin","vmax"]):void 0)))}},parseHtmlEntities:function(e){return(new DOMParser).parseFromString("<!doctype html><body>"+e,"text/html").body.textContent}}}),function(){"use strict";wp.customize.kirkiDynamicControl=wp.customize.Control.extend({initialize:function(e,t){var i=t||{};i.params=i.params||{},i.params.type||(i.params.type="kirki-generic"),i.params.content||(i.params.content=jQuery("<li></li>"),i.params.content.attr("id","customize-control-"+e.replace(/]/g,"").replace(/\[/g,"-")),i.params.content.attr("class","customize-control customize-control-"+i.params.type)),this.propertyElements=[],wp.customize.Control.prototype.initialize.call(this,e,i)},_setUpSettingRootLinks:function(){var n=this;n.container.find("[data-customize-setting-link]").each(function(){var i=jQuery(this);wp.customize(i.data("customizeSettingLink"),function(e){var t=new wp.customize.Element(i);n.elements.push(t),t.sync(e),t.set(e())})})},_setUpSettingPropertyLinks:function(){var n=this;n.setting&&n.container.find("[data-customize-setting-property-link]").each(function(){var t,e=jQuery(this),i=e.data("customizeSettingPropertyLink");t=new wp.customize.Element(e),n.propertyElements.push(t),t.set(n.setting()[i]),t.bind(function(e){var t=n.setting();e!==t[i]&&((t=_.clone(t))[i]=e,n.setting.set(t))}),n.setting.bind(function(e){e[i]!==t.get()&&t.set(e[i])})})},ready:function(){var e=this;e._setUpSettingRootLinks(),e._setUpSettingPropertyLinks(),wp.customize.Control.prototype.ready.call(e),e.deferred.embedded.done(function(){e.initKirkiControl(e)})},embed:function(){var t=this,e=t.section();e&&wp.customize.section(e,function(e){"kirki-expanded"===e.params.type||e.expanded()||wp.customize.settings.autofocus.control===t.id?t.actuallyEmbed():e.expanded.bind(function(e){e&&t.actuallyEmbed()})})},actuallyEmbed:function(){"resolved"!==this.deferred.embedded.state()&&(this.renderContent(),this.deferred.embedded.resolve())},focus:function(e){this.actuallyEmbed(),wp.customize.Control.prototype.focus.call(this,e)},initKirkiControl:function(e){void 0===kirki.control[e.params.type]?this.container.on("change keyup paste click","input",function(){e.setting.set(jQuery(this).val())}):kirki.control[e.params.type].init(e)}})}(),_.each(kirki.control,function(e,t){wp.customize.controlConstructor[t]=wp.customize.kirkiDynamicControl.extend({})}),wp.customize.controlConstructor["kirki-background"]=wp.customize.Control.extend({ready:function(){"use strict";!_.isUndefined(window.kirkiControlLoader)&&_.isFunction(kirkiControlLoader)?kirkiControlLoader(this):this.initKirkiControl()},initKirkiControl:function(){var o=this,e=o.setting._value,t=o.container.find(".kirki-color-control");(_.isUndefined(e["background-image"])||""===e["background-image"])&&(o.container.find(".background-wrapper > .background-repeat").hide(),o.container.find(".background-wrapper > .background-position").hide(),o.container.find(".background-wrapper > .background-size").hide(),o.container.find(".background-wrapper > .background-attachment").hide()),t.wpColorPicker({change:function(){setTimeout(function(){o.saveValue("background-color",t.val())},100)}}),o.container.on("change",".background-repeat select",function(){o.saveValue("background-repeat",jQuery(this).val())}),o.container.on("change click",".background-size input",function(){o.saveValue("background-size",jQuery(this).val())}),o.container.on("change",".background-position select",function(){o.saveValue("background-position",jQuery(this).val())}),o.container.on("change click",".background-attachment input",function(){o.saveValue("background-attachment",jQuery(this).val())}),o.container.on("click",".background-image-upload-button",function(e){var r=wp.media({multiple:!1}).open().on("select",function(){var e,t,i,n=r.state().get("selection").first(),a=n.toJSON().sizes.full.url;_.isUndefined(n.toJSON().sizes.medium)?_.isUndefined(n.toJSON().sizes.thumbnail)||(a=n.toJSON().sizes.thumbnail.url):a=n.toJSON().sizes.medium.url,e=n.toJSON().sizes.full.url,n.toJSON().id,n.toJSON().width,n.toJSON().height,""!==e&&o.container.find(".background-wrapper > .background-repeat, .background-wrapper > .background-position, .background-wrapper > .background-size, .background-wrapper > .background-attachment").show(),o.saveValue("background-image",e),t=o.container.find(".placeholder, .thumbnail"),i=o.container.find(".background-image-upload-remove-button"),t.length&&t.removeClass().addClass("thumbnail thumbnail-image").html('<img src="'+a+'" alt="" />'),i.length&&i.show()});e.preventDefault()}),o.container.on("click",".background-image-upload-remove-button",function(e){var t,i;e.preventDefault(),o.saveValue("background-image",""),t=o.container.find(".placeholder, .thumbnail"),i=o.container.find(".background-image-upload-remove-button"),o.container.find(".background-wrapper > .background-repeat").hide(),o.container.find(".background-wrapper > .background-position").hide(),o.container.find(".background-wrapper > .background-size").hide(),o.container.find(".background-wrapper > .background-attachment").hide(),t.length&&t.removeClass().addClass("placeholder").html("No file selected"),i.length&&i.hide()})},saveValue:function(e,t){var i=jQuery("#customize-control-"+this.id.replace("[","-").replace("]","")+" .background-hidden-value"),n=this.setting._value;n[e]=t,jQuery(i).attr("value",JSON.stringify(n)).trigger("change"),this.setting.set(n)}}),wp.customize.controlConstructor["kirki-color-palette"]=wp.customize.kirkiDynamicControl.extend({}),wp.customize.controlConstructor["kirki-dashicons"]=wp.customize.kirkiDynamicControl.extend({}),wp.customize.controlConstructor["kirki-date"]=wp.customize.kirkiDynamicControl.extend({initKirkiControl:function(){var e=this,t=e.selector+" input.datepicker";jQuery(t).datepicker({dateFormat:"yy-mm-dd"}),this.container.on("change keyup paste","input.datepicker",function(){e.setting.set(jQuery(this).val())})}}),wp.customize.controlConstructor["kirki-dimension"]=wp.customize.kirkiDynamicControl.extend({initKirkiControl:function(){var e,t=this;t.kirkiNotifications(),this.container.on("change keyup paste","input",function(){e=jQuery(this).val(),t.setting.set(e)})},kirkiNotifications:function(){var n=void 0!==this.params.choices&&void 0!==this.params.choices.accept_unitless&&!0===this.params.choices.accept_unitless;wp.customize(this.id,function(i){i.bind(function(e){var t="long_title";!1!==kirki.util.validate.cssValue(e)||n&&!isNaN(e)?i.notifications.remove(t):i.notifications.add(t,new wp.customize.Notification(t,{type:"warning",message:dimensionkirkiL10n["invalid-value"]}))})})}}),wp.customize.controlConstructor["kirki-dimensions"]=wp.customize.kirkiDynamicControl.extend({initKirkiControl:function(){var e,t=this.params.choices.controls,i={},n=[];for(_.each(t,function(e,t){!0===e&&n.push(t)}),e=0;e<n.length;e++)i[n[e]]=this.setting._value[n[e]],this.updateDimensionsValue(n[e],i)},updateDimensionsValue:function(e,t){var i=this;i.container.on("change keyup paste","."+e+" input",function(){t[e]=jQuery(this).val(),i.kirkiNotifications(),i.saveValue(t)})},saveValue:function(e){var i={};_.each(e,function(e,t){i[t]=e}),this.setting.set(i)},kirkiNotifications:function(){wp.customize(this.id,function(a){a.bind(function(e){var t,i="long_title",n={};if(a.notifications.remove(i),_.each(e,function(e,t){!1===kirki.util.validate.cssValue(e)?n[t]=e:delete n[t]}),!_.isEmpty(n))return t=dimensionskirkiL10n["invalid-value"]+" ("+_.values(n).toString()+") ",void a.notifications.add(i,new wp.customize.Notification(i,{type:"warning",message:t}));a.notifications.remove(i)})})}}),wp.customize.controlConstructor["kirki-editor"]=wp.customize.kirkiDynamicControl.extend({initKirkiControl:function(){var i,n=this,a=n.container.find("textarea"),e="kirki-editor-"+n.id.replace("[","").replace("]","");wp.editor.initialize(e,{tinymce:{wpautop:!0},quicktags:!0,mediaButtons:!0}),(i=tinyMCE.get(e))&&i.onChange.add(function(e){var t;e.save(),t=i.getContent(),a.val(t).trigger("change"),wp.customize.instance(n.id).set(t)})}}),wp.customize.controlConstructor["kirki-fontawesome"]=wp.customize.kirkiDynamicControl.extend({initKirkiControl:function(){var e,t,i=this,n=this.container.find("select"),a=jQuery.parseJSON(fontAwesomeJSON),r={data:[],escapeMarkup:function(e){return e},templateResult:function(e){return'<i class="fa fa-lg fa-'+e.id+'" aria-hidden="true"></i> '+e.text},templateSelection:function(e){return'<i class="fa fa-lg fa-'+e.id+'" aria-hidden="true"></i> '+e.text}};_.each(a.icons,function(e){r.data.push({id:e.id,text:e.name})}),(t=jQuery(n).selectWoo(r)).on("change",function(){e=jQuery(this).val(),i.setting.set(e)}),t.val(i.setting._value).trigger("change")}}),wp.customize.controlConstructor["kirki-multicheck"]=wp.customize.kirkiDynamicControl.extend({initKirkiControl:function(){var n=this;n.container.on("change","input",function(){var t=[],i=0;jQuery.each(n.params.choices,function(e){n.container.find('input[value="'+e+'"]').is(":checked")?(n.container.find('input[value="'+e+'"]').parent().addClass("checked"),t[i]=e,i++):n.container.find('input[value="'+e+'"]').parent().removeClass("checked")}),n.setting.set(t)})}}),wp.customize.controlConstructor["kirki-multicolor"]=wp.customize.Control.extend({ready:function(){"use strict";!_.isUndefined(window.kirkiControlLoader)&&_.isFunction(kirkiControlLoader)?kirkiControlLoader(this):this.initKirkiControl()},initKirkiControl:function(){"use strict";var r=this.params.choices,e=Object.keys(r),t=(this.params.value,0);function i(e,t,i){var n=e.container.find(".multicolor-index-"+i),a={change:function(){setTimeout(function(){e.saveValue(i,n.val()),e.container.find(".multicolor-index-"+i).trigger("change")},100)}};_.isObject(r.irisArgs)&&_.each(r.irisArgs,function(e,t){a[t]=e}),n.wpColorPicker(a)}for(;t<Object.keys(r).length;)i(this,0,e[t]),t++},saveValue:function(e,t){var i=this.container.find(".multicolor-hidden-value"),n=this.setting._value;n[e]=t,jQuery(i).attr("value",JSON.stringify(n)).trigger("change"),this.setting.set(n)}}),wp.customize.controlConstructor["kirki-palette"]=wp.customize.kirkiDynamicControl.extend({}),wp.customize.controlConstructor["kirki-radio-buttonset"]=wp.customize.kirkiDynamicControl.extend({}),wp.customize.controlConstructor["kirki-radio-image"]=wp.customize.kirkiDynamicControl.extend({});var RepeaterRow=function(e,t,i,n){"use strict";var a=this;this.rowIndex=e,this.container=t,this.label=i,this.header=this.container.find(".repeater-row-header"),this.header.on("click",function(){a.toggleMinimize()}),this.container.on("click",".repeater-row-remove",function(){a.remove()}),this.header.on("mousedown",function(){a.container.trigger("row:start-dragging")}),this.container.on("keyup change","input, select, textarea",function(e){a.container.trigger("row:update",[a.rowIndex,jQuery(e.target).data("field"),e.target])}),this.setRowIndex=function(e){this.rowIndex=e,this.container.attr("data-row",e),this.container.data("row",e),this.updateLabel()},this.toggleMinimize=function(){this.container.toggleClass("minimized"),this.header.find(".dashicons").toggleClass("dashicons-arrow-up").toggleClass("dashicons-arrow-down")},this.remove=function(){this.container.slideUp(300,function(){jQuery(this).detach()}),this.container.trigger("row:remove",[this.rowIndex])},this.updateLabel=function(){var e,t,i;if("field"===this.label.type&&(e=this.container.find('.repeater-field [data-field="'+this.label.field+'"]'),_.isFunction(e.val)&&""!==(t=e.val())))return _.isUndefined(n.params.fields[this.label.field])||_.isUndefined(n.params.fields[this.label.field].type)||("select"===n.params.fields[this.label.field].type?_.isUndefined(n.params.fields[this.label.field].choices)||_.isUndefined(n.params.fields[this.label.field].choices[e.val()])||(t=n.params.fields[this.label.field].choices[e.val()]):"radio"!==n.params.fields[this.label.field].type&&"radio-image"!==n.params.fields[this.label.field].type||(i=n.selector+' [data-row="'+this.rowIndex+'"] .repeater-field [data-field="'+this.label.field+'"]:checked',t=jQuery(i).val())),void this.header.find(".repeater-row-label").text(t);this.header.find(".repeater-row-label").text(this.label.value+" "+(this.rowIndex+1))},this.updateLabel()};wp.customize.controlConstructor.repeater=wp.customize.Control.extend({ready:function(){"use strict";!_.isUndefined(window.kirkiControlLoader)&&_.isFunction(kirkiControlLoader)?kirkiControlLoader(this):this.initKirkiControl()},initKirkiControl:function(){"use strict";var t,i,n=this,e=this.params.value;this.settingField=this.container.find("[data-customize-setting-link]").first(),this.setValue([],!1),this.repeaterFieldsContainer=this.container.find(".repeater-fields").first(),this.currentIndex=0,this.rows=[],t=!1,_.isUndefined(this.params.choices.limit)||(t=!(this.params.choices.limit<=0)&&parseInt(this.params.choices.limit,10)),this.container.on("click","button.repeater-add",function(e){e.preventDefault(),!t||n.currentIndex<t?((i=n.addRow()).toggleMinimize(),n.initColorPicker(),n.initSelect(i)):jQuery(n.selector+" .limit").addClass("highlight")}),this.container.on("click",".repeater-row-remove",function(){n.currentIndex--,(!t||n.currentIndex<t)&&jQuery(n.selector+" .limit").removeClass("highlight")}),this.container.on("click keypress",".repeater-field-image .upload-button,.repeater-field-cropped_image .upload-button,.repeater-field-upload .upload-button",function(e){e.preventDefault(),n.$thisButton=jQuery(this),n.openFrame(e)}),this.container.on("click keypress",".repeater-field-image .remove-button,.repeater-field-cropped_image .remove-button",function(e){e.preventDefault(),n.$thisButton=jQuery(this),n.removeImage(e)}),this.container.on("click keypress",".repeater-field-upload .remove-button",function(e){e.preventDefault(),n.$thisButton=jQuery(this),n.removeFile(e)}),this.repeaterTemplate=_.memoize(function(){var t={evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g,variable:"data"};return function(e){return _.template(n.container.find(".customize-control-repeater-content").first().html(),null,t)(e)}}),e.length&&_.each(e,function(e){i=n.addRow(e),n.initColorPicker(),n.initSelect(i,e)}),this.setValue(e,!0,!0),this.repeaterFieldsContainer.sortable({handle:".repeater-row-header",update:function(){n.sort()}})},openFrame:function(e){"use strict";wp.customize.utils.isKeydownButNotEnterEvent(e)||(this.$thisButton.closest(".repeater-field").hasClass("repeater-field-cropped_image")?this.initCropperFrame():this.initFrame(),this.frame.open())},initFrame:function(){"use strict";var e=this.getMimeType();this.frame=wp.media({states:[new wp.media.controller.Library({library:wp.media.query({type:e}),multiple:!1,date:!1})]}),this.frame.on("select",this.onSelect,this)},initCropperFrame:function(){"use strict";var t=this.$thisButton.siblings("input.hidden-field").attr("data-field"),e=this.getMimeType();_.isString(t)&&""!==t&&_.isObject(this.params.fields[t])&&"cropped_image"===this.params.fields[t].type&&["width","height","flex_width","flex_height"].forEach(function(e){_.isUndefined(this.params.fields[t][e])||(this.params[e]=this.params.fields[t][e])}.bind(this)),this.frame=wp.media({button:{text:"Select and Crop",close:!1},states:[new wp.media.controller.Library({library:wp.media.query({type:e}),multiple:!1,date:!1,suggestedWidth:this.params.width,suggestedHeight:this.params.height}),new wp.media.controller.CustomizeImageCropper({imgSelectOptions:this.calculateImageSelectOptions,control:this})]}),this.frame.on("select",this.onSelectForCrop,this),this.frame.on("cropped",this.onCropped,this),this.frame.on("skippedcrop",this.onSkippedCrop,this)},onSelect:function(){"use strict";var e=this.frame.state().get("selection").first().toJSON();this.$thisButton.closest(".repeater-field").hasClass("repeater-field-upload")?this.setFileInRepeaterField(e):this.setImageInRepeaterField(e)},onSelectForCrop:function(){"use strict";var e=this.frame.state().get("selection").first().toJSON();this.params.width!==e.width||this.params.height!==e.height||this.params.flex_width||this.params.flex_height?this.frame.setState("cropper"):this.setImageInRepeaterField(e)},onCropped:function(e){"use strict";this.setImageInRepeaterField(e)},calculateImageSelectOptions:function(e,t){"use strict";var i,n,a,r=t.get("control"),o=!!parseInt(r.params.flex_width,10),s=!!parseInt(r.params.flex_height,10),c=e.get("width"),l=e.get("height"),u=parseInt(r.params.width,10),d=parseInt(r.params.height,10),p=u/d,h=c,f=l;return t.set("canSkipCrop",!r.mustBeCropped(o,s,u,d,c,l)),p<h/f?u=(d=f)*p:d=(u=h)/p,!(a={handles:!0,keys:!0,instance:!0,persistent:!0,imageWidth:c,imageHeight:l,x1:i=(h-u)/2,y1:n=(f-d)/2,x2:u+i,y2:d+n})===s&&!1===o&&(a.aspectRatio=u+":"+d),!1===s&&(a.maxHeight=d),!1===o&&(a.maxWidth=u),a},mustBeCropped:function(e,t,i,n,a,r){"use strict";return!(!0===e&&!0===t||!0===e&&n===r||!0===t&&i===a||i===a&&n===r||a<=i)},onSkippedCrop:function(){"use strict";var e=this.frame.state().get("selection").first().toJSON();this.setImageInRepeaterField(e)},setImageInRepeaterField:function(e){"use strict";var t=this.$thisButton.closest(".repeater-field-image,.repeater-field-cropped_image");t.find(".kirki-image-attachment").html('<img src="'+e.url+'">').hide().slideDown("slow"),t.find(".hidden-field").val(e.id),this.$thisButton.text(this.$thisButton.data("alt-label")),t.find(".remove-button").show(),t.find("input, textarea, select").trigger("change"),this.frame.close()},setFileInRepeaterField:function(e){"use strict";var t=this.$thisButton.closest(".repeater-field-upload");t.find(".kirki-file-attachment").html('<span class="file"><span class="dashicons dashicons-media-default"></span> '+e.filename+"</span>").hide().slideDown("slow"),t.find(".hidden-field").val(e.id),this.$thisButton.text(this.$thisButton.data("alt-label")),t.find(".upload-button").show(),t.find(".remove-button").show(),t.find("input, textarea, select").trigger("change"),this.frame.close()},getMimeType:function(){"use strict";var e=this.$thisButton.siblings("input.hidden-field").attr("data-field");return _.isString(e)&&""!==e&&_.isObject(this.params.fields[e])&&"upload"===this.params.fields[e].type&&!_.isUndefined(this.params.fields[e].mime_type)?this.params.fields[e].mime_type:"image"},removeImage:function(e){"use strict";var t,i;wp.customize.utils.isKeydownButNotEnterEvent(e)||(i=(t=this.$thisButton.closest(".repeater-field-image,.repeater-field-cropped_image,.repeater-field-upload")).find(".upload-button"),t.find(".kirki-image-attachment").slideUp("fast",function(){jQuery(this).show().html(jQuery(this).data("placeholder"))}),t.find(".hidden-field").val(""),i.text(i.data("label")),this.$thisButton.hide(),t.find("input, textarea, select").trigger("change"))},removeFile:function(e){"use strict";var t,i;wp.customize.utils.isKeydownButNotEnterEvent(e)||(i=(t=this.$thisButton.closest(".repeater-field-upload")).find(".upload-button"),t.find(".kirki-file-attachment").slideUp("fast",function(){jQuery(this).show().html(jQuery(this).data("placeholder"))}),t.find(".hidden-field").val(""),i.text(i.data("label")),this.$thisButton.hide(),t.find("input, textarea, select").trigger("change"))},getValue:function(){"use strict";return JSON.parse(decodeURI(this.setting.get()))},setValue:function(e,t,i){"use strict";var a=e,r=[];i&&(jQuery.each(this.params.fields,function(e,t){"image"!==t.type&&"cropped_image"!==t.type&&"upload"!==t.type||r.push(e)}),jQuery.each(e,function(i,n){jQuery.each(r,function(e,t){_.isUndefined(n[t])||_.isUndefined(n[t].id)||(a[i][t]=n[t].id)})})),this.setting.set(encodeURI(JSON.stringify(a))),t&&this.settingField.trigger("change")},addRow:function(e){"use strict";var t,a,i,r=this,n=r.repeaterTemplate(),o=this.getValue(),s={};if(n){if(t=jQuery.extend(!0,{},r.params.fields),e)for(i in e)e.hasOwnProperty(i)&&t.hasOwnProperty(i)&&(t[i].default=e[i]);for(i in t.index=this.currentIndex,n=n(t),(a=new RepeaterRow(r.currentIndex,jQuery(n).appendTo(r.repeaterFieldsContainer),r.params.row_label,r)).container.on("row:remove",function(e,t){r.deleteRow(t)}),a.container.on("row:update",function(e,t,i,n){r.updateField.call(r,e,t,i,n),a.updateLabel()}),this.rows[this.currentIndex]=a,t)t.hasOwnProperty(i)&&(s[i]=t[i].default);return o[this.currentIndex]=s,this.setValue(o,!0),this.currentIndex++,a}},sort:function(){"use strict";var i=this,e=this.repeaterFieldsContainer.find(".repeater-row"),n=[],a=i.getValue(),r=[],o=[];e.each(function(e,t){n.push(jQuery(t).data("row"))}),jQuery.each(n,function(e,t){r[e]=i.rows[t],r[e].setRowIndex(e),o[e]=a[t]}),i.rows=r,i.setValue(o)},deleteRow:function(e){"use strict";var t,i=this.getValue();for(t in i[e]&&this.rows[e]&&(delete i[e],delete this.rows[e],this.setValue(i,!0)),1,this.rows)this.rows.hasOwnProperty(t)&&this.rows[t]&&(this.rows[t].updateLabel(),0)},updateField:function(e,t,i,n){"use strict";var a,r,o;this.rows[t]&&this.params.fields[i]&&(a=this.params.fields[i].type,r=this.rows[t],o=this.getValue(),n=jQuery(n),_.isUndefined(o[r.rowIndex][i])||(o[r.rowIndex][i]="checkbox"===a?n.is(":checked"):n.val(),this.setValue(o,!0)))},initColorPicker:function(){"use strict";var r=this,e=r.container.find(".color-picker-hex"),t={},i=e.data("field");_.isUndefined(i)||_.isUndefined(r.params.fields[i])||_.isUndefined(r.params.fields[i].palettes)||!_.isObject(r.params.fields[i].palettes)||(t.palettes=r.params.fields[i].palettes),t.change=function(e,t){var i=jQuery(e.target),n=i.closest(".repeater-row").data("row"),a=r.getValue();a[n][i.data("field")]=t.color.toString(),r.setValue(a,!0)},0!==e.length&&e.wpColorPicker(t)},initSelect:function(e,t){"use strict";var i,n,a=this,r=e.container.find(".repeater-field select"),o={};0!==r.length&&(i=r.data("field"),"undefed"!==(n=jQuery(r).data("multiple"))&&jQuery.isNumeric(n)&&1<(n=parseInt(n,10))&&(o.maximumSelectionLength=n),(t=t||{})[i]=t[i]||"",jQuery(r).selectWoo(o).val(t[i]||jQuery(r).val()),this.container.on("change",".repeater-field select",function(e){var t=jQuery(e.target),i=t.closest(".repeater-row").data("row"),n=a.getValue();n[i][t.data("field")]=jQuery(this).val(),a.setValue(n)}))}}),wp.customize.controlConstructor["kirki-slider"]=wp.customize.kirkiDynamicControl.extend({initKirkiControl:function(){var e=this,t="postMessage"===e.setting.transport?"mousemove change":"change",i=e.container.find('input[type="range"]'),n=e.container.find('input[type="text"]'),a=e.setting._value;n.attr("value",a),i.on("mousemove change",function(){n.attr("value",i.val())}),i.on(t,function(){e.setting.set(i.val())}),n.on("input paste change",function(){i.attr("value",n.val()),e.setting.set(n.val())}),e.container.find(".slider-reset").on("click",function(){n.attr("value",e.params.default),i.attr("value",e.params.default),e.setting.set(n.val())})}}),wp.customize.controlConstructor["kirki-sortable"]=wp.customize.Control.extend({ready:function(){"use strict";var e=this;jQuery(e.container.find("ul.sortable").first()).sortable({update:function(){e.setting.set(e.getNewVal())}}).disableSelection().find("li").each(function(){jQuery(this).find("i.visibility").click(function(){jQuery(this).toggleClass("dashicons-visibility-faint").parents("li:eq(0)").toggleClass("invisible")})}).click(function(){e.setting.set(e.getNewVal())})},getNewVal:function(){var e=jQuery(this.container.find("li")),t=[];return _.each(e,function(e){jQuery(e).hasClass("invisible")||t.push(jQuery(e).data("value"))}),t}}),wp.customize.controlConstructor["kirki-switch"]=wp.customize.kirkiDynamicControl.extend({initKirkiControl:function(){"use strict";var e=this,t=e.setting._value;this.container.on("change","input",function(){t=!!jQuery(this).is(":checked"),e.setting.set(t)})}}),wp.customize.controlConstructor["kirki-toggle"]=wp.customize.kirkiDynamicControl.extend({initKirkiControl:function(){var e=this,t=e.setting._value;this.container.on("change","input",function(){t=!!jQuery(this).is(":checked"),e.setting.set(t)})}}),wp.customize.controlConstructor["kirki-typography"]=wp.customize.kirkiDynamicControl.extend({initKirkiControl:function(){"use strict";var e,t=this,i=t.setting._value;t.renderFontSelector(),t.renderBackupFontSelector(),t.renderVariantSelector(),t.localFontsCheckbox(),void 0!==t.params.default["font-size"]&&this.container.on("change keyup paste",".font-size input",function(){t.saveValue("font-size",jQuery(this).val())}),void 0!==t.params.default["line-height"]&&this.container.on("change keyup paste",".line-height input",function(){t.saveValue("line-height",jQuery(this).val())}),void 0!==t.params.default["margin-top"]&&this.container.on("change keyup paste",".margin-top input",function(){t.saveValue("margin-top",jQuery(this).val())}),void 0!==t.params.default["margin-bottom"]&&this.container.on("change keyup paste",".margin-bottom input",function(){t.saveValue("margin-bottom",jQuery(this).val())}),void 0!==t.params.default["letter-spacing"]&&(i["letter-spacing"]=jQuery.isNumeric(i["letter-spacing"])?i["letter-spacing"]+"px":i["letter-spacing"],this.container.on("change keyup paste",".letter-spacing input",function(){i["letter-spacing"]=jQuery.isNumeric(jQuery(this).val())?jQuery(this).val()+"px":jQuery(this).val(),t.saveValue("letter-spacing",i["letter-spacing"])})),void 0!==t.params.default["word-spacing"]&&this.container.on("change keyup paste",".word-spacing input",function(){t.saveValue("word-spacing",jQuery(this).val())}),void 0!==t.params.default["text-align"]&&this.container.on("change",".text-align input",function(){t.saveValue("text-align",jQuery(this).val())}),void 0!==t.params.default["text-transform"]&&jQuery(t.selector+" .text-transform select").selectWoo().on("change",function(){t.saveValue("text-transform",jQuery(this).val())}),void 0!==t.params.default["text-decoration"]&&jQuery(t.selector+" .text-decoration select").selectWoo().on("change",function(){t.saveValue("text-decoration",jQuery(this).val())}),void 0!==t.params.default.color&&(e=this.container.find(".kirki-color-control")).wpColorPicker({change:function(){setTimeout(function(){t.saveValue("color",e.val())},100)}})},renderFontSelector:function(){var e,t,i=this,n=i.selector+" .font-family select",a=[],r=[],o=[],s=i.setting._value,c=i.getFonts();_.isUndefined(c.standard)||_.each(c.standard,function(e){r.push({id:e.family.replace(/&quot;/g,"&#39"),text:e.label})}),_.isUndefined(c.google)||_.each(c.google,function(e){o.push({id:e.family,text:e.family})}),t={},_.isUndefined(i.params)||_.isUndefined(i.params.choices)||_.isUndefined(i.params.choices.fonts)||_.isUndefined(i.params.choices.fonts.families)||(t=i.params.choices.fonts.families),a=jQuery.extend({},t,{default:{text:kirkiL10n.defaultCSSValues,children:[{id:"",text:kirkiL10n.defaultBrowserFamily},{id:"initial",text:"initial"},{id:"inherit",text:"inherit"}]},standard:{text:kirkiL10n.standardFonts,children:r},google:{text:kirkiL10n.googleFonts,children:o}}),kirkiL10n.isScriptDebug&&(console.info('Kirki Debug: Font families for control "'+i.id+'":'),console.info(a)),a=_.values(a),e=jQuery(n).selectWoo({data:a}),(s["font-family"]||""===s["font-family"])&&(s["font-family"]=kirki.util.parseHtmlEntities(s["font-family"].replace(/'/g,'"')),e.val(s["font-family"]).trigger("change")),e.on("change",function(){i.saveValue("font-family",jQuery(this).val()),i.renderBackupFontSelector(),i.renderVariantSelector()})},renderBackupFontSelector:function(){var e,t=this,i=t.selector+" .font-backup select",n=[],a=t.setting._value,r=a["font-family"],o=t.getFonts();(_.isUndefined(a["font-backup"])||null===a["font-backup"])&&(a["font-backup"]=""),"inherit"!==r&&"initial"!==r&&"google"===kirki.util.webfonts.getFontType(r)?(jQuery(t.selector+" .font-backup").show(),_.isUndefined(o.standard)||_.each(o.standard,function(e){n.push({id:e.family.replace(/&quot;/g,"&#39"),text:e.label})}),e=jQuery(i).selectWoo({data:n}),void 0!==a["font-backup"]&&e.val(a["font-backup"].replace(/'/g,'"')).trigger("change"),e.on("change",function(){t.saveValue("font-backup",jQuery(this).val())})):jQuery(t.selector+" .font-backup").hide()},renderVariantSelector:function(){var e,t,i,n=this,a=n.setting._value,r=a["font-family"],o=n.selector+" .variant select",s=[],c=!1,l=kirki.util.webfonts.getFontType(r),u=["","regular","italic","700","700italic"];if("google"===l&&(u=kirki.util.webfonts.google.getVariants(r)),_.isUndefined(n.params)||_.isUndefined(n.params.choices)||_.isUndefined(n.params.choices.fonts)||_.isUndefined(n.params.choices.fonts.variants)||_.isUndefined(n.params.choices.fonts.variants[r])||(u=n.params.choices.fonts.variants[r]),kirkiL10n.isScriptDebug&&(console.info('Kirki Debug: Font variants for font-family "'+r+'":'),console.info(u)),"inherit"!==r&&"initial"!==r&&""!==r||(a.variant="inherit",u=[""],jQuery(n.selector+" .variant").hide()),u.length<=1)return jQuery(n.selector+" .variant").hide(),a.variant=u[0],n.saveValue("variant",a.variant),i=""!==a.variant&&a.variant?(e=_.isString(a.variant)?a.variant.match(/\d/g):"400",e=_.isObject(e)?e.join(""):"400",a.variant&&-1!==a.variant.indexOf("italic")?"italic":"normal"):e="",n.saveValue("font-weight",e),void n.saveValue("font-style",i);jQuery(n.selector+" .font-backup").show(),jQuery(n.selector+" .variant").show(),_.each(u,function(e){a.variant===e&&(c=!0),s.push({id:e,text:e})}),c||(a.variant="regular"),jQuery(o).hasClass("select2-hidden-accessible")&&(jQuery(o).selectWoo("destroy"),jQuery(o).empty()),(t=jQuery(o).selectWoo({data:s})).val(a.variant).trigger("change"),t.on("change",function(){n.saveValue("variant",jQuery(this).val()),"string"!=typeof a.variant&&(a.variant=u[0]),e=_.isString(a.variant)?a.variant.match(/\d/g):"400",e=_.isObject(e)?e.join(""):"400",i=-1!==a.variant.indexOf("italic")?"italic":"normal",n.saveValue("font-weight",e),n.saveValue("font-style",i)})},getFonts:function(){var e=this,t=kirki.util.webfonts.google.getFonts(),i={},n="alpha",a=0,r={};return _.isEmpty(e.params.choices.fonts.google)?i=kirki.util.webfonts.google.getFonts(n,"",a):"alpha"===e.params.choices.fonts.google[0]||"popularity"===e.params.choices.fonts.google[0]||"trending"===e.params.choices.fonts.google[0]?(n=e.params.choices.fonts.google[0],isNaN(e.params.choices.fonts.google[1])||(a=parseInt(e.params.choices.fonts.google[1],10)),i=kirki.util.webfonts.google.getFonts(n,"",a)):_.each(e.params.choices.fonts.google,function(e){void 0===t[e]||_.isEmpty(t[e])||(i[e]=t[e])}),_.isEmpty(e.params.choices.fonts.standard)?_.each(kirki.util.webfonts.standard.fonts,function(e,t){r[t]={family:e.stack,label:e.label}}):_.each(e.params.choices.fonts.standard,function(e){void 0===kirki.util.webfonts.standard.fonts[e]||_.isEmpty(kirki.util.webfonts.standard.fonts[e])?r[e]={family:e,label:e}:(r[e]={},"undefined"===kirki.util.webfonts.standard.fonts[e].stack||_.isEmpty(kirki.util.webfonts.standard.fonts[e].stack)?r[e].family=i[e]:r[e].family=kirki.util.webfonts.standard.fonts[e].stack,"undefined"===kirki.util.webfonts.standard.fonts[e].label||_.isEmpty(kirki.util.webfonts.standard.fonts[e].label)?_.isEmpty(r[e])||(r[e].label=r[e]):r[e].label=kirki.util.webfonts.standard.fonts[e].label)}),{google:i,standard:r}},localFontsCheckbox:function(){var e=this,t=(e.container.find(".kirki-host-font-locally"),e.container.find(".kirki-host-font-locally input")),i=jQuery(t).is(":checked");e.setting._value&&e.setting._value.downloadFont&&jQuery(t).attr("checked","checked"),jQuery(t).on("change",function(){i=jQuery(t).is(":checked"),e.saveValue("downloadFont",i)})},saveValue:function(e,t){var i=this.container.find(".typography-hidden-value"),n=this.setting._value;n[e]=t,jQuery(i).attr("value",JSON.stringify(n)).trigger("change"),this.setting.set(n)}});
controls/php/class-kirki-control-background.php CHANGED
@@ -45,78 +45,78 @@ class Kirki_Control_Background extends Kirki_Control_Base {
45
46
<!-- background-color -->
47
<div class="background-color">
48
- <h4><?php esc_attr_e( 'Background Color', 'kirki' ); ?></h4>
49
<input type="text" data-default-color="{{ data.default['background-color'] }}" data-alpha="true" value="{{ data.value['background-color'] }}" class="kirki-color-control"/>
50
</div>
51
52
<!-- background-image -->
53
<div class="background-image">
54
- <h4><?php esc_attr_e( 'Background Image', 'kirki' ); ?></h4>
55
<div class="attachment-media-view background-image-upload">
56
<# if ( data.value['background-image'] ) { #>
57
<div class="thumbnail thumbnail-image"><img src="{{ data.value['background-image'] }}"/></div>
58
<# } else { #>
59
- <div class="placeholder"><?php esc_attr_e( 'No File Selected', 'kirki' ); ?></div>
60
<# } #>
61
<div class="actions">
62
- <button class="button background-image-upload-remove-button<# if ( ! data.value['background-image'] ) { #> hidden <# } #>"><?php esc_attr_e( 'Remove', 'kirki' ); ?></button>
63
- <button type="button" class="button background-image-upload-button"><?php esc_attr_e( 'Select File', 'kirki' ); ?></button>
64
</div>
65
</div>
66
</div>
67
68
<!-- background-repeat -->
69
<div class="background-repeat">
70
- <h4><?php esc_attr_e( 'Background Repeat', 'kirki' ); ?></h4>
71
<select {{{ data.inputAttrs }}}>
72
- <option value="no-repeat"<# if ( 'no-repeat' === data.value['background-repeat'] ) { #> selected <# } #>><?php esc_attr_e( 'No Repeat', 'kirki' ); ?></option>
73
- <option value="repeat"<# if ( 'repeat' === data.value['background-repeat'] ) { #> selected <# } #>><?php esc_attr_e( 'Repeat All', 'kirki' ); ?></option>
74
- <option value="repeat-x"<# if ( 'repeat-x' === data.value['background-repeat'] ) { #> selected <# } #>><?php esc_attr_e( 'Repeat Horizontally', 'kirki' ); ?></option>
75
- <option value="repeat-y"<# if ( 'repeat-y' === data.value['background-repeat'] ) { #> selected <# } #>><?php esc_attr_e( 'Repeat Vertically', 'kirki' ); ?></option>
76
</select>
77
</div>
78
79
<!-- background-position -->
80
<div class="background-position">
81
- <h4><?php esc_attr_e( 'Background Position', 'kirki' ); ?></h4>
82
<select {{{ data.inputAttrs }}}>
83
- <option value="left top"<# if ( 'left top' === data.value['background-position'] ) { #> selected <# } #>><?php esc_attr_e( 'Left Top', 'kirki' ); ?></option>
84
- <option value="left center"<# if ( 'left center' === data.value['background-position'] ) { #> selected <# } #>><?php esc_attr_e( 'Left Center', 'kirki' ); ?></option>
85
- <option value="left bottom"<# if ( 'left bottom' === data.value['background-position'] ) { #> selected <# } #>><?php esc_attr_e( 'Left Bottom', 'kirki' ); ?></option>
86
- <option value="right top"<# if ( 'right top' === data.value['background-position'] ) { #> selected <# } #>><?php esc_attr_e( 'Right Top', 'kirki' ); ?></option>
87
- <option value="right center"<# if ( 'right center' === data.value['background-position'] ) { #> selected <# } #>><?php esc_attr_e( 'Right Center', 'kirki' ); ?></option>
88
- <option value="right bottom"<# if ( 'right bottom' === data.value['background-position'] ) { #> selected <# } #>><?php esc_attr_e( 'Right Bottom', 'kirki' ); ?></option>
89
- <option value="center top"<# if ( 'center top' === data.value['background-position'] ) { #> selected <# } #>><?php esc_attr_e( 'Center Top', 'kirki' ); ?></option>
90
- <option value="center center"<# if ( 'center center' === data.value['background-position'] ) { #> selected <# } #>><?php esc_attr_e( 'Center Center', 'kirki' ); ?></option>
91
- <option value="center bottom"<# if ( 'center bottom' === data.value['background-position'] ) { #> selected <# } #>><?php esc_attr_e( 'Center Bottom', 'kirki' ); ?></option>
92
</select>
93
</div>
94
95
<!-- background-size -->
96
<div class="background-size">
97
- <h4><?php esc_attr_e( 'Background Size', 'kirki' ); ?></h4>
98
<div class="buttonset">
99
<input {{{ data.inputAttrs }}} class="switch-input screen-reader-text" type="radio" value="cover" name="_customize-bg-{{{ data.id }}}-size" id="{{ data.id }}cover" <# if ( 'cover' === data.value['background-size'] ) { #> checked="checked" <# } #>>
100
- <label class="switch-label switch-label-<# if ( 'cover' === data.value['background-size'] ) { #>on <# } else { #>off<# } #>" for="{{ data.id }}cover"><?php esc_attr_e( 'Cover', 'kirki' ); ?></label>
101
</input>
102
<input {{{ data.inputAttrs }}} class="switch-input screen-reader-text" type="radio" value="contain" name="_customize-bg-{{{ data.id }}}-size" id="{{ data.id }}contain" <# if ( 'contain' === data.value['background-size'] ) { #> checked="checked" <# } #>>
103
- <label class="switch-label switch-label-<# if ( 'contain' === data.value['background-size'] ) { #>on <# } else { #>off<# } #>" for="{{ data.id }}contain"><?php esc_attr_e( 'Contain', 'kirki' ); ?></label>
104
</input>
105
<input {{{ data.inputAttrs }}} class="switch-input screen-reader-text" type="radio" value="auto" name="_customize-bg-{{{ data.id }}}-size" id="{{ data.id }}auto" <# if ( 'auto' === data.value['background-size'] ) { #> checked="checked" <# } #>>
106
- <label class="switch-label switch-label-<# if ( 'auto' === data.value['background-size'] ) { #>on <# } else { #>off<# } #>" for="{{ data.id }}auto"><?php esc_attr_e( 'Auto', 'kirki' ); ?></label>
107
</input>
108
</div>
109
</div>
110
111
<!-- background-attachment -->
112
<div class="background-attachment">
113
- <h4><?php esc_attr_e( 'Background Attachment', 'kirki' ); ?></h4>
114
<div class="buttonset">
115
<input {{{ data.inputAttrs }}} class="switch-input screen-reader-text" type="radio" value="scroll" name="_customize-bg-{{{ data.id }}}-attachment" id="{{ data.id }}scroll" <# if ( 'scroll' === data.value['background-attachment'] ) { #> checked="checked" <# } #>>
116
- <label class="switch-label switch-label-<# if ( 'scroll' === data.value['background-attachment'] ) { #>on <# } else { #>off<# } #>" for="{{ data.id }}scroll"><?php esc_attr_e( 'Scroll', 'kirki' ); ?></label>
117
</input>
118
<input {{{ data.inputAttrs }}} class="switch-input screen-reader-text" type="radio" value="fixed" name="_customize-bg-{{{ data.id }}}-attachment" id="{{ data.id }}fixed" <# if ( 'fixed' === data.value['background-attachment'] ) { #> checked="checked" <# } #>>
119
- <label class="switch-label switch-label-<# if ( 'fixed' === data.value['background-attachment'] ) { #>on <# } else { #>off<# } #>" for="{{ data.id }}fixed"><?php esc_attr_e( 'Fixed', 'kirki' ); ?></label>
120
</input>
121
</div>
122
</div>
45
46
<!-- background-color -->
47
<div class="background-color">
48
+ <h4><?php esc_html_e( 'Background Color', 'kirki' ); ?></h4>
49
<input type="text" data-default-color="{{ data.default['background-color'] }}" data-alpha="true" value="{{ data.value['background-color'] }}" class="kirki-color-control"/>
50
</div>
51
52
<!-- background-image -->
53
<div class="background-image">
54
+ <h4><?php esc_html_e( 'Background Image', 'kirki' ); ?></h4>
55
<div class="attachment-media-view background-image-upload">
56
<# if ( data.value['background-image'] ) { #>
57
<div class="thumbnail thumbnail-image"><img src="{{ data.value['background-image'] }}"/></div>
58
<# } else { #>
59
+ <div class="placeholder"><?php esc_html_e( 'No File Selected', 'kirki' ); ?></div>
60
<# } #>
61
<div class="actions">
62
+ <button class="button background-image-upload-remove-button<# if ( ! data.value['background-image'] ) { #> hidden <# } #>"><?php esc_html_e( 'Remove', 'kirki' ); ?></button>
63
+ <button type="button" class="button background-image-upload-button"><?php esc_html_e( 'Select File', 'kirki' ); ?></button>
64
</div>
65
</div>
66
</div>
67
68
<!-- background-repeat -->
69
<div class="background-repeat">
70
+ <h4><?php esc_html_e( 'Background Repeat', 'kirki' ); ?></h4>
71
<select {{{ data.inputAttrs }}}>
72
+ <option value="no-repeat"<# if ( 'no-repeat' === data.value['background-repeat'] ) { #> selected <# } #>><?php esc_html_e( 'No Repeat', 'kirki' ); ?></option>
73
+ <option value="repeat"<# if ( 'repeat' === data.value['background-repeat'] ) { #> selected <# } #>><?php esc_html_e( 'Repeat All', 'kirki' ); ?></option>
74
+ <option value="repeat-x"<# if ( 'repeat-x' === data.value['background-repeat'] ) { #> selected <# } #>><?php esc_html_e( 'Repeat Horizontally', 'kirki' ); ?></option>
75
+ <option value="repeat-y"<# if ( 'repeat-y' === data.value['background-repeat'] ) { #> selected <# } #>><?php esc_html_e( 'Repeat Vertically', 'kirki' ); ?></option>
76
</select>
77
</div>
78
79
<!-- background-position -->
80
<div class="background-position">
81
+ <h4><?php esc_html_e( 'Background Position', 'kirki' ); ?></h4>
82
<select {{{ data.inputAttrs }}}>
83
+ <option value="left top"<# if ( 'left top' === data.value['background-position'] ) { #> selected <# } #>><?php esc_html_e( 'Left Top', 'kirki' ); ?></option>
84
+ <option value="left center"<# if ( 'left center' === data.value['background-position'] ) { #> selected <# } #>><?php esc_html_e( 'Left Center', 'kirki' ); ?></option>
85
+ <option value="left bottom"<# if ( 'left bottom' === data.value['background-position'] ) { #> selected <# } #>><?php esc_html_e( 'Left Bottom', 'kirki' ); ?></option>
86
+ <option value="right top"<# if ( 'right top' === data.value['background-position'] ) { #> selected <# } #>><?php esc_html_e( 'Right Top', 'kirki' ); ?></option>
87
+ <option value="right center"<# if ( 'right center' === data.value['background-position'] ) { #> selected <# } #>><?php esc_html_e( 'Right Center', 'kirki' ); ?></option>
88
+ <option value="right bottom"<# if ( 'right bottom' === data.value['background-position'] ) { #> selected <# } #>><?php esc_html_e( 'Right Bottom', 'kirki' ); ?></option>
89
+ <option value="center top"<# if ( 'center top' === data.value['background-position'] ) { #> selected <# } #>><?php esc_html_e( 'Center Top', 'kirki' ); ?></option>
90
+ <option value="center center"<# if ( 'center center' === data.value['background-position'] ) { #> selected <# } #>><?php esc_html_e( 'Center Center', 'kirki' ); ?></option>
91
+ <option value="center bottom"<# if ( 'center bottom' === data.value['background-position'] ) { #> selected <# } #>><?php esc_html_e( 'Center Bottom', 'kirki' ); ?></option>
92
</select>
93
</div>
94
95
<!-- background-size -->
96
<div class="background-size">
97
+ <h4><?php esc_html_e( 'Background Size', 'kirki' ); ?></h4>
98
<div class="buttonset">
99
<input {{{ data.inputAttrs }}} class="switch-input screen-reader-text" type="radio" value="cover" name="_customize-bg-{{{ data.id }}}-size" id="{{ data.id }}cover" <# if ( 'cover' === data.value['background-size'] ) { #> checked="checked" <# } #>>
100
+ <label class="switch-label switch-label-<# if ( 'cover' === data.value['background-size'] ) { #>on <# } else { #>off<# } #>" for="{{ data.id }}cover"><?php esc_html_e( 'Cover', 'kirki' ); ?></label>
101
</input>
102
<input {{{ data.inputAttrs }}} class="switch-input screen-reader-text" type="radio" value="contain" name="_customize-bg-{{{ data.id }}}-size" id="{{ data.id }}contain" <# if ( 'contain' === data.value['background-size'] ) { #> checked="checked" <# } #>>
103
+ <label class="switch-label switch-label-<# if ( 'contain' === data.value['background-size'] ) { #>on <# } else { #>off<# } #>" for="{{ data.id }}contain"><?php esc_html_e( 'Contain', 'kirki' ); ?></label>
104
</input>
105
<input {{{ data.inputAttrs }}} class="switch-input screen-reader-text" type="radio" value="auto" name="_customize-bg-{{{ data.id }}}-size" id="{{ data.id }}auto" <# if ( 'auto' === data.value['background-size'] ) { #> checked="checked" <# } #>>
106
+ <label class="switch-label switch-label-<# if ( 'auto' === data.value['background-size'] ) { #>on <# } else { #>off<# } #>" for="{{ data.id }}auto"><?php esc_html_e( 'Auto', 'kirki' ); ?></label>
107
</input>
108
</div>
109
</div>
110
111
<!-- background-attachment -->
112
<div class="background-attachment">
113
+ <h4><?php esc_html_e( 'Background Attachment', 'kirki' ); ?></h4>
114
<div class="buttonset">
115
<input {{{ data.inputAttrs }}} class="switch-input screen-reader-text" type="radio" value="scroll" name="_customize-bg-{{{ data.id }}}-attachment" id="{{ data.id }}scroll" <# if ( 'scroll' === data.value['background-attachment'] ) { #> checked="checked" <# } #>>
116
+ <label class="switch-label switch-label-<# if ( 'scroll' === data.value['background-attachment'] ) { #>on <# } else { #>off<# } #>" for="{{ data.id }}scroll"><?php esc_html_e( 'Scroll', 'kirki' ); ?></label>
117
</input>
118
<input {{{ data.inputAttrs }}} class="switch-input screen-reader-text" type="radio" value="fixed" name="_customize-bg-{{{ data.id }}}-attachment" id="{{ data.id }}fixed" <# if ( 'fixed' === data.value['background-attachment'] ) { #> checked="checked" <# } #>>
119
+ <label class="switch-label switch-label-<# if ( 'fixed' === data.value['background-attachment'] ) { #>on <# } else { #>off<# } #>" for="{{ data.id }}fixed"><?php esc_html_e( 'Fixed', 'kirki' ); ?></label>
120
</input>
121
</div>
122
</div>
controls/php/class-kirki-control-base.php CHANGED
@@ -129,18 +129,19 @@ class Kirki_Control_Base extends WP_Customize_Control {
129
'kirkiL10n',
130
array(
131
'isScriptDebug' => ( defined( 'SCRIPT_DEBUG' ) && true === SCRIPT_DEBUG ),
132
- 'noFileSelected' => esc_attr__( 'No File Selected', 'kirki' ),
133
- 'remove' => esc_attr__( 'Remove', 'kirki' ),
134
- 'default' => esc_attr__( 'Default', 'kirki' ),
135
- 'selectFile' => esc_attr__( 'Select File', 'kirki' ),
136
- 'standardFonts' => esc_attr__( 'Standard Fonts', 'kirki' ),
137
- 'googleFonts' => esc_attr__( 'Google Fonts', 'kirki' ),
138
- 'defaultCSSValues' => esc_attr__( 'CSS Defaults', 'kirki' ),
139
- 'defaultBrowserFamily' => esc_attr__( 'Default Browser Font-Family', 'kirki' ),
140
)
141
);
142
143
$suffix = str_replace( '.min', '', $suffix );
144
// Enqueue the style.
145
wp_enqueue_style(
146
'kirki-styles',
@@ -156,42 +157,58 @@ class Kirki_Control_Base extends WP_Customize_Control {
156
* @see WP_Customize_Control::to_json()
157
*/
158
public function to_json() {
159
// Get the basics from the parent class.
160
parent::to_json();
161
// Default value.
162
$this->json['default'] = $this->setting->default;
163
if ( isset( $this->default ) ) {
164
$this->json['default'] = $this->default;
165
}
166
// Required.
167
$this->json['required'] = $this->required;
168
// Output.
169
$this->json['output'] = $this->output;
170
// Value.
171
$this->json['value'] = $this->value();
172
// Choices.
173
$this->json['choices'] = $this->choices;
174
// The link.
175
$this->json['link'] = $this->get_link();
176
// The ID.
177
$this->json['id'] = $this->id;
178
// Translation strings.
179
$this->json['l10n'] = $this->l10n();
180
// The ajaxurl in case we need it.
181
$this->json['ajaxurl'] = admin_url( 'admin-ajax.php' );
182
// Input attributes.
183
$this->json['inputAttrs'] = '';
184
foreach ( $this->input_attrs as $attr => $value ) {
185
$this->json['inputAttrs'] .= $attr . '="' . esc_attr( $value ) . '" ';
186
}
187
// The kirki-config.
188
$this->json['kirkiConfig'] = $this->kirki_config;
189
// The option-type.
190
$this->json['kirkiOptionType'] = $this->option_type;
191
// The option-name.
192
$this->json['kirkiOptionName'] = $this->option_name;
193
// The preset.
194
$this->json['preset'] = $this->preset;
195
// The CSS-Variables.
196
$this->json['css-var'] = $this->css_vars;
197
}
129
'kirkiL10n',
130
array(
131
'isScriptDebug' => ( defined( 'SCRIPT_DEBUG' ) && true === SCRIPT_DEBUG ),
132
+ 'noFileSelected' => esc_html__( 'No File Selected', 'kirki' ),
133
+ 'remove' => esc_html__( 'Remove', 'kirki' ),
134
+ 'default' => esc_html__( 'Default', 'kirki' ),
135
+ 'selectFile' => esc_html__( 'Select File', 'kirki' ),
136
+ 'standardFonts' => esc_html__( 'Standard Fonts', 'kirki' ),
137
+ 'googleFonts' => esc_html__( 'Google Fonts', 'kirki' ),
138
+ 'defaultCSSValues' => esc_html__( 'CSS Defaults', 'kirki' ),
139
+ 'defaultBrowserFamily' => esc_html__( 'Default Browser Font-Family', 'kirki' ),
140
)
141
);
142
143
$suffix = str_replace( '.min', '', $suffix );
144
+
145
// Enqueue the style.
146
wp_enqueue_style(
147
'kirki-styles',
157
* @see WP_Customize_Control::to_json()
158
*/
159
public function to_json() {
160
+
161
// Get the basics from the parent class.
162
parent::to_json();
163
+
164
// Default value.
165
$this->json['default'] = $this->setting->default;
166
if ( isset( $this->default ) ) {
167
$this->json['default'] = $this->default;
168
}
169
+
170
// Required.
171
$this->json['required'] = $this->required;
172
+
173
// Output.
174
$this->json['output'] = $this->output;
175
+
176
// Value.
177
$this->json['value'] = $this->value();
178
+
179
// Choices.
180
$this->json['choices'] = $this->choices;
181
+
182
// The link.
183
$this->json['link'] = $this->get_link();
184
+
185
// The ID.
186
$this->json['id'] = $this->id;
187
+
188
// Translation strings.
189
$this->json['l10n'] = $this->l10n();
190
+
191
// The ajaxurl in case we need it.
192
$this->json['ajaxurl'] = admin_url( 'admin-ajax.php' );
193
+
194
// Input attributes.
195
$this->json['inputAttrs'] = '';
196
foreach ( $this->input_attrs as $attr => $value ) {
197
$this->json['inputAttrs'] .= $attr . '="' . esc_attr( $value ) . '" ';
198
}
199
+
200
// The kirki-config.
201
$this->json['kirkiConfig'] = $this->kirki_config;
202
+
203
// The option-type.
204
$this->json['kirkiOptionType'] = $this->option_type;
205
+
206
// The option-name.
207
$this->json['kirkiOptionName'] = $this->option_name;
208
+
209
// The preset.
210
$this->json['preset'] = $this->preset;
211
+
212
// The CSS-Variables.
213
$this->json['css-var'] = $this->css_vars;
214
}
controls/php/class-kirki-control-checkbox.php CHANGED
File without changes
controls/php/class-kirki-control-code.php CHANGED
@@ -36,7 +36,7 @@ if ( ! class_exists( 'WP_Customize_Code_Editor_Control' ) ) {
36
protected function content_template() {
37
?>
38
<div class="notice notice-error" data-type="error"><div class="notification-message">
39
- <?php esc_attr_e( 'Please update your WordPress installation to a version newer than 4.9 to access the code control.', 'kirki' ); ?>
40
</div></div>
41
<?php
42
}
@@ -46,5 +46,29 @@ if ( ! class_exists( 'WP_Customize_Code_Editor_Control' ) ) {
46
/**
47
* Adds a "code" control, alias of the WP_Customize_Code_Editor_Control class.
48
*/
49
- class Kirki_Control_Code extends WP_Customize_Code_Editor_Control {}
50
}
36
protected function content_template() {
37
?>
38
<div class="notice notice-error" data-type="error"><div class="notification-message">
39
+ <?php esc_html_e( 'Please update your WordPress installation to a version newer than 4.9 to access the code control.', 'kirki' ); ?>
40
</div></div>
41
<?php
42
}
46
/**
47
* Adds a "code" control, alias of the WP_Customize_Code_Editor_Control class.
48
*/
49
+ class Kirki_Control_Code extends WP_Customize_Code_Editor_Control {
50
+
51
+ /**
52
+ * Whitelisting the "required" argument.
53
+ *
54
+ * @since 3.0.17
55
+ * @access public
56
+ * @var array
57
+ */
58
+ public $required = array();
59
+
60
+ /**
61
+ * Refresh the parameters passed to the JavaScript via JSON.
62
+ *
63
+ * @see WP_Customize_Control::to_json()
64
+ */
65
+ public function to_json() {
66
+
67
+ // Get the basics from the parent class.
68
+ parent::to_json();
69
+
70
+ // Required.
71
+ $this->json['required'] = $this->required;
72
+ }
73
+ }
74
}
controls/php/class-kirki-control-color-palette.php CHANGED
File without changes
controls/php/class-kirki-control-color.php CHANGED
File without changes
controls/php/class-kirki-control-cropped-image.php CHANGED
File without changes
controls/php/class-kirki-control-custom.php CHANGED
@@ -57,6 +57,5 @@ class Kirki_Control_Custom extends Kirki_Control_Base {
57
{{{ data.value }}}
58
</label>
59
<?php
60
-
61
}
62
}
57
{{{ data.value }}}
58
</label>
59
<?php
60
}
61
}
controls/php/class-kirki-control-dashicons.php CHANGED
@@ -34,7 +34,6 @@ class Kirki_Control_Dashicons extends Kirki_Control_Base {
34
*/
35
public function to_json() {
36
parent::to_json();
37
-
38
$this->json['icons'] = Kirki_Helper::get_dashicons();
39
}
40
34
*/
35
public function to_json() {
36
parent::to_json();
37
$this->json['icons'] = Kirki_Helper::get_dashicons();
38
}
39
controls/php/class-kirki-control-date.php CHANGED
File without changes
controls/php/class-kirki-control-dimension.php CHANGED
@@ -34,10 +34,9 @@ class Kirki_Control_Dimension extends Kirki_Control_Base {
34
*/
35
public function enqueue() {
36
parent::enqueue();
37
-
38
wp_localize_script(
39
'kirki-script', 'dimensionkirkiL10n', array(
40
- 'invalid-value' => esc_attr__( 'Invalid Value', 'kirki' ),
41
)
42
);
43
}
34
*/
35
public function enqueue() {
36
parent::enqueue();
37
wp_localize_script(
38
'kirki-script', 'dimensionkirkiL10n', array(
39
+ 'invalid-value' => esc_html__( 'Invalid Value', 'kirki' ),
40
)
41
);
42
}
controls/php/class-kirki-control-dimensions.php CHANGED
@@ -58,7 +58,6 @@ class Kirki_Control_Dimensions extends Kirki_Control_Base {
58
* @access public
59
*/
60
public function enqueue() {
61
-
62
wp_enqueue_style( 'kirki-styles', trailingslashit( Kirki::$url ) . 'controls/css/styles.css', array(), KIRKI_VERSION );
63
wp_localize_script( 'kirki-script', 'dimensionskirkiL10n', $this->l10n() );
64
}
@@ -112,31 +111,31 @@ class Kirki_Control_Dimensions extends Kirki_Control_Base {
112
*/
113
protected function l10n() {
114
return array(
115
- 'left-top' => esc_attr__( 'Left Top', 'kirki' ),
116
- 'left-center' => esc_attr__( 'Left Center', 'kirki' ),
117
- 'left-bottom' => esc_attr__( 'Left Bottom', 'kirki' ),
118
- 'right-top' => esc_attr__( 'Right Top', 'kirki' ),
119
- 'right-center' => esc_attr__( 'Right Center', 'kirki' ),
120
- 'right-bottom' => esc_attr__( 'Right Bottom', 'kirki' ),
121
- 'center-top' => esc_attr__( 'Center Top', 'kirki' ),
122
- 'center-center' => esc_attr__( 'Center Center', 'kirki' ),
123
- 'center-bottom' => esc_attr__( 'Center Bottom', 'kirki' ),
124
- 'font-size' => esc_attr__( 'Font Size', 'kirki' ),
125
- 'font-weight' => esc_attr__( 'Font Weight', 'kirki' ),
126
- 'line-height' => esc_attr__( 'Line Height', 'kirki' ),
127
- 'font-style' => esc_attr__( 'Font Style', 'kirki' ),
128
- 'letter-spacing' => esc_attr__( 'Letter Spacing', 'kirki' ),
129
- 'word-spacing' => esc_attr__( 'Word Spacing', 'kirki' ),
130
- 'top' => esc_attr__( 'Top', 'kirki' ),
131
- 'bottom' => esc_attr__( 'Bottom', 'kirki' ),
132
- 'left' => esc_attr__( 'Left', 'kirki' ),
133
- 'right' => esc_attr__( 'Right', 'kirki' ),
134
- 'center' => esc_attr__( 'Center', 'kirki' ),
135
- 'size' => esc_attr__( 'Size', 'kirki' ),
136
- 'spacing' => esc_attr__( 'Spacing', 'kirki' ),
137
- 'width' => esc_attr__( 'Width', 'kirki' ),
138
- 'height' => esc_attr__( 'Height', 'kirki' ),
139
- 'invalid-value' => esc_attr__( 'Invalid Value', 'kirki' ),
140
);
141
}
142
}
58
* @access public
59
*/
60
public function enqueue() {
61
wp_enqueue_style( 'kirki-styles', trailingslashit( Kirki::$url ) . 'controls/css/styles.css', array(), KIRKI_VERSION );
62
wp_localize_script( 'kirki-script', 'dimensionskirkiL10n', $this->l10n() );
63
}
111
*/
112
protected function l10n() {
113
return array(
114
+ 'left-top' => esc_html__( 'Left Top', 'kirki' ),
115
+ 'left-center' => esc_html__( 'Left Center', 'kirki' ),
116
+ 'left-bottom' => esc_html__( 'Left Bottom', 'kirki' ),
117
+ 'right-top' => esc_html__( 'Right Top', 'kirki' ),
118
+ 'right-center' => esc_html__( 'Right Center', 'kirki' ),
119
+ 'right-bottom' => esc_html__( 'Right Bottom', 'kirki' ),
120
+ 'center-top' => esc_html__( 'Center Top', 'kirki' ),
121
+ 'center-center' => esc_html__( 'Center Center', 'kirki' ),
122
+ 'center-bottom' => esc_html__( 'Center Bottom', 'kirki' ),
123
+ 'font-size' => esc_html__( 'Font Size', 'kirki' ),
124
+ 'font-weight' => esc_html__( 'Font Weight', 'kirki' ),
125
+ 'line-height' => esc_html__( 'Line Height', 'kirki' ),
126
+ 'font-style' => esc_html__( 'Font Style', 'kirki' ),
127
+ 'letter-spacing' => esc_html__( 'Letter Spacing', 'kirki' ),
128
+ 'word-spacing' => esc_html__( 'Word Spacing', 'kirki' ),
129
+ 'top' => esc_html__( 'Top', 'kirki' ),
130
+ 'bottom' => esc_html__( 'Bottom', 'kirki' ),
131
+ 'left' => esc_html__( 'Left', 'kirki' ),
132
+ 'right' => esc_html__( 'Right', 'kirki' ),
133
+ 'center' => esc_html__( 'Center', 'kirki' ),
134
+ 'size' => esc_html__( 'Size', 'kirki' ),
135
+ 'spacing' => esc_html__( 'Spacing', 'kirki' ),
136
+ 'width' => esc_html__( 'Width', 'kirki' ),
137
+ 'height' => esc_html__( 'Height', 'kirki' ),
138
+ 'invalid-value' => esc_html__( 'Invalid Value', 'kirki' ),
139
);
140
}
141
}
controls/php/class-kirki-control-editor.php CHANGED
File without changes
controls/php/class-kirki-control-fontawesome.php CHANGED
File without changes
controls/php/class-kirki-control-generic.php CHANGED
File without changes
controls/php/class-kirki-control-image.php CHANGED
File without changes
controls/php/class-kirki-control-multicheck.php CHANGED
File without changes
controls/php/class-kirki-control-multicolor.php CHANGED
@@ -42,7 +42,6 @@ class Kirki_Control_Multicolor extends Kirki_Control_Base {
42
*/
43
public function to_json() {
44
parent::to_json();
45
-
46
$this->json['alpha'] = (bool) $this->alpha;
47
}
48
42
*/
43
public function to_json() {
44
parent::to_json();
45
$this->json['alpha'] = (bool) $this->alpha;
46
}
47
controls/php/class-kirki-control-number.php CHANGED
File without changes
controls/php/class-kirki-control-palette.php CHANGED
File without changes
controls/php/class-kirki-control-radio-buttonset.php CHANGED
File without changes
controls/php/class-kirki-control-radio-image.php CHANGED
@@ -34,7 +34,6 @@ class Kirki_Control_Radio_Image extends Kirki_Control_Base {
34
*/
35
public function to_json() {
36
parent::to_json();
37
-
38
foreach ( $this->input_attrs as $attr => $value ) {
39
if ( 'style' !== $attr ) {
40
$this->json['inputAttrs'] .= $attr . '="' . esc_attr( $value ) . '" ';
34
*/
35
public function to_json() {
36
parent::to_json();
37
foreach ( $this->input_attrs as $attr => $value ) {
38
if ( 'style' !== $attr ) {
39
$this->json['inputAttrs'] .= $attr . '="' . esc_attr( $value ) . '" ';
controls/php/class-kirki-control-radio.php CHANGED
File without changes
controls/php/class-kirki-control-repeater.php CHANGED
@@ -69,7 +69,6 @@ class Kirki_Control_Repeater extends Kirki_Control_Base {
69
* @param array $args {@see WP_Customize_Control::__construct}.
70
*/
71
public function __construct( $manager, $id, $args = array() ) {
72
-
73
parent::__construct( $manager, $id, $args );
74
75
// Set up defaults for row labels.
@@ -84,7 +83,7 @@ class Kirki_Control_Repeater extends Kirki_Control_Base {
84
85
if ( empty( $this->button_label ) ) {
86
/* translators: %s represents the label of the row. */
87
- $this->button_label = sprintf( esc_attr__( 'Add new %s', 'kirki' ), $this->row_label['value'] );
88
}
89
90
if ( empty( $args['fields'] ) || ! is_array( $args['fields'] ) ) {
@@ -109,21 +108,24 @@ class Kirki_Control_Repeater extends Kirki_Control_Base {
109
case 'image':
110
case 'cropped_image':
111
case 'upload':
112
// We add it to the list of fields that need some extra filtering/processing.
113
$media_fields_to_filter[ $key ] = true;
114
break;
115
116
case 'dropdown-pages':
117
// If the field is a dropdown-pages field then add it to args.
118
$dropdown = wp_dropdown_pages(
119
array(
120
'name' => '',
121
'echo' => 0,
122
- 'show_option_none' => esc_attr__( 'Select a Page', 'kirki' ),
123
'option_none_value' => '0',
124
'selected' => '',
125
)
126
);
127
// Hackily add in the data link parameter.
128
$dropdown = str_replace( '<select', '<select data-field="' . esc_attr( $args['fields'][ $key ]['id'] ) . '"' . $this->get_link(), $dropdown ); // phpcs:ignore Generic.Formatting.MultipleStatementAlignment.NotSameWarning
129
$args['fields'][ $key ]['dropdown'] = $dropdown;
@@ -224,7 +226,7 @@ class Kirki_Control_Repeater extends Kirki_Control_Base {
224
225
<?php if ( isset( $this->choices['limit'] ) ) : ?>
226
<?php /* translators: %s represents the number of rows we're limiting the repeater to allow. */ ?>
227
- <p class="limit"><?php printf( esc_attr__( 'Limit: %s rows', 'kirki' ), esc_html( $this->choices['limit'] ) ); ?></p>
228
<?php endif; ?>
229
<button class="button-secondary repeater-add"><?php echo esc_html( $this->button_label ); ?></button>
230
@@ -378,17 +380,17 @@ class Kirki_Control_Repeater extends Kirki_Control_Base {
378
<# var defaultImageURL = ( field.default.url ) ? field.default.url : field.default; #>
379
<img src="{{{ defaultImageURL }}}">
380
<# } else { #>
381
- <?php esc_attr_e( 'No Image Selected', 'kirki' ); ?>
382
<# } #>
383
</figure>
384
385
<div class="actions">
386
- <button type="button" class="button remove-button<# if ( ! field.default ) { #> hidden<# } #>"><?php esc_attr_e( 'Remove', 'kirki' ); ?></button>
387
<button type="button" class="button upload-button" data-label=" <?php esc_attr_e( 'Add Image', 'kirki' ); ?>" data-alt-label="<?php echo esc_attr_e( 'Change Image', 'kirki' ); ?>" >
388
<# if ( field.default ) { #>
389
- <?php esc_attr_e( 'Change Image', 'kirki' ); ?>
390
<# } else { #>
391
- <?php esc_attr_e( 'Add Image', 'kirki' ); ?>
392
<# } #>
393
</button>
394
<# if ( field.default.id ) { #>
@@ -410,7 +412,7 @@ class Kirki_Control_Repeater extends Kirki_Control_Base {
410
<# var defaultFilename = ( field.default.filename ) ? field.default.filename : field.default; #>
411
<span class="file"><span class="dashicons dashicons-media-default"></span> {{ defaultFilename }}</span>
412
<# } else { #>
413
- <?php esc_attr_e( 'No File Selected', 'kirki' ); ?>
414
<# } #>
415
</figure>
416
@@ -418,9 +420,9 @@ class Kirki_Control_Repeater extends Kirki_Control_Base {
418
<button type="button" class="button remove-button<# if ( ! field.default ) { #> hidden<# } #>"></button>
419
<button type="button" class="button upload-button" data-label="<?php esc_attr_e( 'Add File', 'kirki' ); ?>" data-alt-label="<?php esc_attr_e( 'Change File', 'kirki' ); ?>">
420
<# if ( field.default ) { #>
421
- <?php esc_attr_e( 'Change File', 'kirki' ); ?>
422
<# } else { #>
423
- <?php esc_attr_e( 'Add File', 'kirki' ); ?>
424
<# } #>
425
</button>
426
<# if ( field.default.id ) { #>
@@ -440,7 +442,7 @@ class Kirki_Control_Repeater extends Kirki_Control_Base {
440
441
</div>
442
<# }); #>
443
- <button type="button" class="button-link repeater-row-remove"><?php esc_attr_e( 'Remove', 'kirki' ); ?></button>
444
</div>
445
</li>
446
</script>
@@ -466,12 +468,12 @@ class Kirki_Control_Repeater extends Kirki_Control_Base {
466
467
// Validating row label type.
468
if ( isset( $args['row_label']['value'] ) && ! empty( $args['row_label']['value'] ) ) {
469
- $this->row_label['value'] = esc_attr( $args['row_label']['value'] );
470
}
471
472
// Validating row label field.
473
- if ( isset( $args['row_label']['field'] ) && ! empty( $args['row_label']['field'] ) && isset( $args['fields'][ esc_attr( $args['row_label']['field'] ) ] ) ) {
474
- $this->row_label['field'] = esc_attr( $args['row_label']['field'] );
475
} else {
476
// If from field is not set correctly, making sure standard is set as the type.
477
$this->row_label['type'] = 'text';
69
* @param array $args {@see WP_Customize_Control::__construct}.
70
*/
71
public function __construct( $manager, $id, $args = array() ) {
72
parent::__construct( $manager, $id, $args );
73
74
// Set up defaults for row labels.
83
84
if ( empty( $this->button_label ) ) {
85
/* translators: %s represents the label of the row. */
86
+ $this->button_label = sprintf( esc_html__( 'Add new %s', 'kirki' ), $this->row_label['value'] );
87
}
88
89
if ( empty( $args['fields'] ) || ! is_array( $args['fields'] ) ) {
108
case 'image':
109
case 'cropped_image':
110
case 'upload':
111
+
112
// We add it to the list of fields that need some extra filtering/processing.
113
$media_fields_to_filter[ $key ] = true;
114
break;
115
116
case 'dropdown-pages':
117
+
118
// If the field is a dropdown-pages field then add it to args.
119
$dropdown = wp_dropdown_pages(
120
array(
121
'name' => '',
122
'echo' => 0,
123
+ 'show_option_none' => esc_html__( 'Select a Page', 'kirki' ),
124
'option_none_value' => '0',
125
'selected' => '',
126
)
127
);
128
+
129
// Hackily add in the data link parameter.
130
$dropdown = str_replace( '<select', '<select data-field="' . esc_attr( $args['fields'][ $key ]['id'] ) . '"' . $this->get_link(), $dropdown ); // phpcs:ignore Generic.Formatting.MultipleStatementAlignment.NotSameWarning
131
$args['fields'][ $key ]['dropdown'] = $dropdown;
226
227
<?php if ( isset( $this->choices['limit'] ) ) : ?>
228
<?php /* translators: %s represents the number of rows we're limiting the repeater to allow. */ ?>
229
+ <p class="limit"><?php printf( esc_html__( 'Limit: %s rows', 'kirki' ), esc_html( $this->choices['limit'] ) ); ?></p>
230
<?php endif; ?>
231
<button class="button-secondary repeater-add"><?php echo esc_html( $this->button_label ); ?></button>
232
380
<# var defaultImageURL = ( field.default.url ) ? field.default.url : field.default; #>
381
<img src="{{{ defaultImageURL }}}">
382
<# } else { #>
383
+ <?php esc_html_e( 'No Image Selected', 'kirki' ); ?>
384
<# } #>
385
</figure>
386
387
<div class="actions">
388
+ <button type="button" class="button remove-button<# if ( ! field.default ) { #> hidden<# } #>"><?php esc_html_e( 'Remove', 'kirki' ); ?></button>
389
<button type="button" class="button upload-button" data-label=" <?php esc_attr_e( 'Add Image', 'kirki' ); ?>" data-alt-label="<?php echo esc_attr_e( 'Change Image', 'kirki' ); ?>" >
390
<# if ( field.default ) { #>
391
+ <?php esc_html_e( 'Change Image', 'kirki' ); ?>
392
<# } else { #>
393
+ <?php esc_html_e( 'Add Image', 'kirki' ); ?>
394
<# } #>
395
</button>
396
<# if ( field.default.id ) { #>
412
<# var defaultFilename = ( field.default.filename ) ? field.default.filename : field.default; #>
413
<span class="file"><span class="dashicons dashicons-media-default"></span> {{ defaultFilename }}</span>
414
<# } else { #>
415
+ <?php esc_html_e( 'No File Selected', 'kirki' ); ?>
416
<# } #>
417
</figure>
418
420
<button type="button" class="button remove-button<# if ( ! field.default ) { #> hidden<# } #>"></button>
421
<button type="button" class="button upload-button" data-label="<?php esc_attr_e( 'Add File', 'kirki' ); ?>" data-alt-label="<?php esc_attr_e( 'Change File', 'kirki' ); ?>">
422
<# if ( field.default ) { #>
423
+ <?php esc_html_e( 'Change File', 'kirki' ); ?>
424
<# } else { #>
425
+ <?php esc_html_e( 'Add File', 'kirki' ); ?>
426
<# } #>
427
</button>
428
<# if ( field.default.id ) { #>
442
443
</div>
444
<# }); #>
445
+ <button type="button" class="button-link repeater-row-remove"><?php esc_html_e( 'Remove', 'kirki' ); ?></button>
446
</div>
447
</li>
448
</script>
468
469
// Validating row label type.
470
if ( isset( $args['row_label']['value'] ) && ! empty( $args['row_label']['value'] ) ) {
471
+ $this->row_label['value'] = esc_html( $args['row_label']['value'] );
472
}
473
474
// Validating row label field.
475
+ if ( isset( $args['row_label']['field'] ) && ! empty( $args['row_label']['field'] ) && isset( $args['fields'][ sanitize_key( $args['row_label']['field'] ) ] ) ) {
476
+ $this->row_label['field'] = esc_html( $args['row_label']['field'] );
477
} else {
478
// If from field is not set correctly, making sure standard is set as the type.
479
$this->row_label['type'] = 'text';
controls/php/class-kirki-control-select.php CHANGED
@@ -52,7 +52,6 @@ class Kirki_Control_Select extends Kirki_Control_Base {
52
*/
53
public function to_json() {
54
parent::to_json();
55
-
56
$this->json['multiple'] = $this->multiple;
57
$this->json['placeholder'] = $this->placeholder;
58
}
52
*/
53
public function to_json() {
54
parent::to_json();
55
$this->json['multiple'] = $this->multiple;
56
$this->json['placeholder'] = $this->placeholder;
57
}
controls/php/class-kirki-control-slider.php CHANGED
@@ -36,7 +36,6 @@ class Kirki_Control_Slider extends Kirki_Control_Base {
36
*/
37
public function to_json() {
38
parent::to_json();
39
-
40
$this->json['choices'] = wp_parse_args(
41
$this->json['choices'], array(
42
'min' => '0',
@@ -64,7 +63,7 @@ class Kirki_Control_Slider extends Kirki_Control_Base {
64
<# if ( data.description ) { #><span class="description customize-control-description">{{{ data.description }}}</span><# } #>
65
<div class="wrapper">
66
<input {{{ data.inputAttrs }}} type="range" min="{{ data.choices['min'] }}" max="{{ data.choices['max'] }}" step="{{ data.choices['step'] }}" value="{{ data.value }}" {{{ data.link }}} />
67
- <span class="slider-reset dashicons dashicons-image-rotate"><span class="screen-reader-text"><?php esc_attr_e( 'Reset', 'kirki' ); ?></span></span>
68
<span class="value">
69
<input {{{ data.inputAttrs }}} type="text"/>
70
<span class="suffix">{{ data.choices['suffix'] }}</span>
36
*/
37
public function to_json() {
38
parent::to_json();
39
$this->json['choices'] = wp_parse_args(
40
$this->json['choices'], array(
41
'min' => '0',
63
<# if ( data.description ) { #><span class="description customize-control-description">{{{ data.description }}}</span><# } #>
64
<div class="wrapper">
65
<input {{{ data.inputAttrs }}} type="range" min="{{ data.choices['min'] }}" max="{{ data.choices['max'] }}" step="{{ data.choices['step'] }}" value="{{ data.value }}" {{{ data.link }}} />
66
+ <span class="slider-reset dashicons dashicons-image-rotate"><span class="screen-reader-text"><?php esc_html_e( 'Reset', 'kirki' ); ?></span></span>
67
<span class="value">
68
<input {{{ data.inputAttrs }}} type="text"/>
69
<span class="suffix">{{ data.choices['suffix'] }}</span>
controls/php/class-kirki-control-sortable.php CHANGED
@@ -66,7 +66,6 @@ class Kirki_Control_Sortable extends Kirki_Control_Base {
66
<# }); #>
67
</ul>
68
</label>
69
-
70
<?php
71
}
72
}
66
<# }); #>
67
</ul>
68
</label>
69
<?php
70
}
71
}
controls/php/class-kirki-control-switch.php CHANGED
@@ -49,11 +49,11 @@ class Kirki_Control_Switch extends Kirki_Control_Base {
49
<input class="screen-reader-text" {{{ data.inputAttrs }}} name="switch_{{ data.id }}" id="switch_{{ data.id }}" type="checkbox" value="{{ data.value }}" {{{ data.link }}}<# if ( '1' == data.value ) { #> checked<# } #> />
50
<label class="switch-label" for="switch_{{ data.id }}">
51
<span class="switch-on">
52
- <# data.choices.on = data.choices.on || '<?php esc_attr_e( 'On', 'kirki' ); ?>' #>
53
{{ data.choices.on }}
54
</span>
55
<span class="switch-off">
56
- <# data.choices.off = data.choices.off || '<?php esc_attr_e( 'Off', 'kirki' ); ?>' #>
57
{{ data.choices.off }}
58
</span>
59
</label>
49
<input class="screen-reader-text" {{{ data.inputAttrs }}} name="switch_{{ data.id }}" id="switch_{{ data.id }}" type="checkbox" value="{{ data.value }}" {{{ data.link }}}<# if ( '1' == data.value ) { #> checked<# } #> />
50
<label class="switch-label" for="switch_{{ data.id }}">
51
<span class="switch-on">
52
+ <# data.choices.on = data.choices.on || '<?php esc_html_e( 'On', 'kirki' ); ?>' #>
53
{{ data.choices.on }}
54
</span>
55
<span class="switch-off">
56
+ <# data.choices.off = data.choices.off || '<?php esc_html_e( 'Off', 'kirki' ); ?>' #>
57
{{ data.choices.off }}
58
</span>
59
</label>
controls/php/class-kirki-control-toggle.php CHANGED
File without changes
controls/php/class-kirki-control-typography.php CHANGED
@@ -40,10 +40,12 @@ class Kirki_Control_Typography extends Kirki_Control_Base {
40
if ( ! in_array( $key, array( 'variant', 'font-weight', 'font-style' ), true ) && ! isset( $this->json['default'][ $key ] ) ) {
41
unset( $this->json['value'][ $key ] );
42
}
43
// Fix for https://wordpress.org/support/topic/white-font-after-updateing-to-3-0-16.
44
if ( ! isset( $this->json['default'][ $key ] ) ) {
45
unset( $this->json['value'][ $key ] );
46
}
47
// Fix for https://github.com/aristath/kirki/issues/1405.
48
if ( isset( $this->json['default'][ $key ] ) && false === $this->json['default'][ $key ] ) {
49
unset( $this->json['value'][ $key ] );
@@ -77,18 +79,18 @@ class Kirki_Control_Typography extends Kirki_Control_Base {
77
<# data.value['font-family'] = data.value['font-family'] || data['default']['font-family']; #>
78
<# if ( data.choices['fonts'] ) { data.fonts = data.choices['fonts']; } #>
79
<div class="font-family">
80
- <h5><?php esc_attr_e( 'Font Family', 'kirki' ); ?></h5>
81
<select {{{ data.inputAttrs }}} id="kirki-typography-font-family-{{{ data.id }}}" placeholder="<?php esc_attr_e( 'Select Font Family', 'kirki' ); ?>"></select>
82
</div>
83
<# if ( ! _.isUndefined( data.choices['font-backup'] ) && true === data.choices['font-backup'] ) { #>
84
<div class="font-backup hide-on-standard-fonts kirki-font-backup-wrapper">
85
- <h5><?php esc_attr_e( 'Backup Font', 'kirki' ); ?></h5>
86
<select {{{ data.inputAttrs }}} id="kirki-typography-font-backup-{{{ data.id }}}" placeholder="<?php esc_attr_e( 'Select Font Family', 'kirki' ); ?>"></select>
87
</div>
88
<# } #>
89
<# if ( true === data.show_variants || false !== data.default.variant ) { #>
90
<div class="variant kirki-variant-wrapper">
91
- <h5><?php esc_attr_e( 'Variant', 'kirki' ); ?></h5>
92
<select {{{ data.inputAttrs }}} class="variant" id="kirki-typography-variant-{{{ data.id }}}"></select>
93
</div>
94
<# } #>
@@ -103,7 +105,7 @@ class Kirki_Control_Typography extends Kirki_Control_Base {
103
<# if ( ! _.isUndefined( data.default['font-size'] ) ) { #>
104
<# data.value['font-size'] = data.value['font-size'] || data['default']['font-size']; #>
105
<div class="font-size">
106
- <h5><?php esc_attr_e( 'Font Size', 'kirki' ); ?></h5>
107
<input {{{ data.inputAttrs }}} type="text" value="{{ data.value['font-size'] }}"/>
108
</div>
109
<# } #>
@@ -111,7 +113,7 @@ class Kirki_Control_Typography extends Kirki_Control_Base {
111
<# if ( ! _.isUndefined( data.default['line-height'] ) ) { #>
112
<# data.value['line-height'] = data.value['line-height'] || data['default']['line-height']; #>
113
<div class="line-height">
114
- <h5><?php esc_attr_e( 'Line Height', 'kirki' ); ?></h5>
115
<input {{{ data.inputAttrs }}} type="text" value="{{ data.value['line-height'] }}"/>
116
</div>
117
<# } #>
@@ -119,7 +121,7 @@ class Kirki_Control_Typography extends Kirki_Control_Base {
119
<# if ( ! _.isUndefined( data.default['letter-spacing'] ) ) { #>
120
<# data.value['letter-spacing'] = data.value['letter-spacing'] || data['default']['letter-spacing']; #>
121
<div class="letter-spacing">
122
- <h5><?php esc_attr_e( 'Letter Spacing', 'kirki' ); ?></h5>
123
<input {{{ data.inputAttrs }}} type="text" value="{{ data.value['letter-spacing'] }}"/>
124
</div>
125
<# } #>
@@ -127,7 +129,7 @@ class Kirki_Control_Typography extends Kirki_Control_Base {
127
<# if ( ! _.isUndefined( data.default['word-spacing'] ) ) { #>
128
<# data.value['word-spacing'] = data.value['word-spacing'] || data['default']['word-spacing']; #>
129
<div class="word-spacing">
130
- <h5><?php esc_attr_e( 'Word Spacing', 'kirki' ); ?></h5>
131
<input {{{ data.inputAttrs }}} type="text" value="{{ data.value['word-spacing'] }}"/>
132
</div>
133
<# } #>
@@ -135,36 +137,36 @@ class Kirki_Control_Typography extends Kirki_Control_Base {
135
<# if ( ! _.isUndefined( data.default['text-align'] ) ) { #>
136
<# data.value['text-align'] = data.value['text-align'] || data['default']['text-align']; #>
137
<div class="text-align">
138
- <h5><?php esc_attr_e( 'Text Align', 'kirki' ); ?></h5>
139
<div class="text-align-choices">
140
<input {{{ data.inputAttrs }}} type="radio" value="inherit" name="_customize-typography-text-align-radio-{{ data.id }}" id="{{ data.id }}-text-align-inherit" <# if ( data.value['text-align'] === 'inherit' ) { #> checked="checked"<# } #>>
141
<label for="{{ data.id }}-text-align-inherit">
142
<span class="dashicons dashicons-editor-removeformatting"></span>
143
- <span class="screen-reader-text"><?php esc_attr_e( 'Inherit', 'kirki' ); ?></span>
144
</label>
145
</input>
146
<input {{{ data.inputAttrs }}} type="radio" value="left" name="_customize-typography-text-align-radio-{{ data.id }}" id="{{ data.id }}-text-align-left" <# if ( data.value['text-align'] === 'left' ) { #> checked="checked"<# } #>>
147
<label for="{{ data.id }}-text-align-left">
148
<span class="dashicons dashicons-editor-alignleft"></span>
149
- <span class="screen-reader-text"><?php esc_attr_e( 'Left', 'kirki' ); ?></span>
150
</label>
151
</input>
152
<input {{{ data.inputAttrs }}} type="radio" value="center" name="_customize-typography-text-align-radio-{{ data.id }}" id="{{ data.id }}-text-align-center" <# if ( data.value['text-align'] === 'center' ) { #> checked="checked"<# } #>>
153
<label for="{{ data.id }}-text-align-center">
154
<span class="dashicons dashicons-editor-aligncenter"></span>
155
- <span class="screen-reader-text"><?php esc_attr_e( 'Center', 'kirki' ); ?></span>
156
</label>
157
</input>
158
<input {{{ data.inputAttrs }}} type="radio" value="right" name="_customize-typography-text-align-radio-{{ data.id }}" id="{{ data.id }}-text-align-right" <# if ( data.value['text-align'] === 'right' ) { #> checked="checked"<# } #>>
159
<label for="{{ data.id }}-text-align-right">
160
<span class="dashicons dashicons-editor-alignright"></span>
161
- <span class="screen-reader-text"><?php esc_attr_e( 'Right', 'kirki' ); ?></span>
162
</label>
163
</input>
164
<input {{{ data.inputAttrs }}} type="radio" value="justify" name="_customize-typography-text-align-radio-{{ data.id }}" id="{{ data.id }}-text-align-justify" <# if ( data.value['text-align'] === 'justify' ) { #> checked="checked"<# } #>>
165
<label for="{{ data.id }}-text-align-justify">
166
<span class="dashicons dashicons-editor-justify"></span>
167
- <span class="screen-reader-text"><?php esc_attr_e( 'Justify', 'kirki' ); ?></span>
168
</label>
169
</input>
170
</div>
@@ -174,15 +176,15 @@ class Kirki_Control_Typography extends Kirki_Control_Base {
174
<# if ( ! _.isUndefined( data.default['text-transform'] ) ) { #>
175
<# data.value['text-transform'] = data.value['text-transform'] || data['default']['text-transform']; #>
176
<div class="text-transform">
177
- <h5><?php esc_attr_e( 'Text Transform', 'kirki' ); ?></h5>
178
<select {{{ data.inputAttrs }}} id="kirki-typography-text-transform-{{{ data.id }}}">
179
<option value=""<# if ( '' === data.value['text-transform'] ) { #>selected<# } #>></option>
180
- <option value="none"<# if ( 'none' === data.value['text-transform'] ) { #>selected<# } #>><?php esc_attr_e( 'None', 'kirki' ); ?></option>
181
- <option value="capitalize"<# if ( 'capitalize' === data.value['text-transform'] ) { #>selected<# } #>><?php esc_attr_e( 'Capitalize', 'kirki' ); ?></option>
182
- <option value="uppercase"<# if ( 'uppercase' === data.value['text-transform'] ) { #>selected<# } #>><?php esc_attr_e( 'Uppercase', 'kirki' ); ?></option>
183
- <option value="lowercase"<# if ( 'lowercase' === data.value['text-transform'] ) { #>selected<# } #>><?php esc_attr_e( 'Lowercase', 'kirki' ); ?></option>
184
- <option value="initial"<# if ( 'initial' === data.value['text-transform'] ) { #>selected<# } #>><?php esc_attr_e( 'Initial', 'kirki' ); ?></option>
185
- <option value="inherit"<# if ( 'inherit' === data.value['text-transform'] ) { #>selected<# } #>><?php esc_attr_e( 'Inherit', 'kirki' ); ?></option>
186
</select>
187
</div>
188
<# } #>
@@ -190,15 +192,15 @@ class Kirki_Control_Typography extends Kirki_Control_Base {
190
<# if ( ! _.isUndefined( data.default['text-decoration'] ) ) { #>
191
<# data.value['text-decoration'] = data.value['text-decoration'] || data['default']['text-decoration']; #>
192
<div class="text-decoration">
193
- <h5><?php esc_attr_e( 'Text Decoration', 'kirki' ); ?></h5>
194
<select {{{ data.inputAttrs }}} id="kirki-typography-text-decoration-{{{ data.id }}}">
195
<option value=""<# if ( '' === data.value['text-decoration'] ) { #>selected<# } #>></option>
196
- <option value="none"<# if ( 'none' === data.value['text-decoration'] ) { #>selected<# } #>><?php esc_attr_e( 'None', 'kirki' ); ?></option>
197
- <option value="underline"<# if ( 'underline' === data.value['text-decoration'] ) { #>selected<# } #>><?php esc_attr_e( 'Underline', 'kirki' ); ?></option>
198
- <option value="overline"<# if ( 'overline' === data.value['text-decoration'] ) { #>selected<# } #>><?php esc_attr_e( 'Overline', 'kirki' ); ?></option>
199
- <option value="line-through"<# if ( 'line-through' === data.value['text-decoration'] ) { #>selected<# } #>><?php esc_attr_e( 'Line-Through', 'kirki' ); ?></option>
200
- <option value="initial"<# if ( 'initial' === data.value['text-decoration'] ) { #>selected<# } #>><?php esc_attr_e( 'Initial', 'kirki' ); ?></option>
201
- <option value="inherit"<# if ( 'inherit' === data.value['text-decoration'] ) { #>selected<# } #>><?php esc_attr_e( 'Inherit', 'kirki' ); ?></option>
202
</select>
203
</div>
204
<# } #>
@@ -206,7 +208,7 @@ class Kirki_Control_Typography extends Kirki_Control_Base {
206
<# if ( ! _.isUndefined( data.default['margin-top'] ) ) { #>
207
<# data.value['margin-top'] = data.value['margin-top'] || data['default']['margin-top']; #>
208
<div class="margin-top">
209
- <h5><?php esc_attr_e( 'Margin Top', 'kirki' ); ?></h5>
210
<input {{{ data.inputAttrs }}} type="text" value="{{ data.value['margin-top'] }}"/>
211
</div>
212
<# } #>
@@ -214,7 +216,7 @@ class Kirki_Control_Typography extends Kirki_Control_Base {
214
<# if ( ! _.isUndefined( data.default['margin-bottom'] ) ) { #>
215
<# data.value['margin-bottom'] = data.value['margin-bottom'] || data['default']['margin-bottom']; #>
216
<div class="margin-bottom">
217
- <h5><?php esc_attr_e( 'Margin Bottom', 'kirki' ); ?></h5>
218
<input {{{ data.inputAttrs }}} type="text" value="{{ data.value['margin-bottom'] }}"/>
219
</div>
220
<# } #>
@@ -222,7 +224,7 @@ class Kirki_Control_Typography extends Kirki_Control_Base {
222
<# if ( ! _.isUndefined( data.default['color'] ) && false !== data.default['color'] ) { #>
223
<# data.value['color'] = data.value['color'] || data['default']['color']; #>
224
<div class="color">
225
- <h5><?php esc_attr_e( 'Color', 'kirki' ); ?></h5>
226
<input {{{ data.inputAttrs }}} type="text" data-palette="{{ data.palette }}" data-default-color="{{ data.default['color'] }}" value="{{ data.value['color'] }}" class="kirki-color-control"/>
227
</div>
228
<# } #>
@@ -241,7 +243,6 @@ class Kirki_Control_Typography extends Kirki_Control_Base {
241
* @return array
242
*/
243
protected function format_variants_array( $variants ) {
244
-
245
$all_variants = Kirki_Fonts::get_all_variants();
246
$final_variants = array();
247
foreach ( $variants as $variant ) {
40
if ( ! in_array( $key, array( 'variant', 'font-weight', 'font-style' ), true ) && ! isset( $this->json['default'][ $key ] ) ) {
41
unset( $this->json['value'][ $key ] );
42
}
43
+
44
// Fix for https://wordpress.org/support/topic/white-font-after-updateing-to-3-0-16.
45
if ( ! isset( $this->json['default'][ $key ] ) ) {
46
unset( $this->json['value'][ $key ] );
47
}
48
+
49
// Fix for https://github.com/aristath/kirki/issues/1405.
50
if ( isset( $this->json['default'][ $key ] ) && false === $this->json['default'][ $key ] ) {
51
unset( $this->json['value'][ $key ] );
79
<# data.value['font-family'] = data.value['font-family'] || data['default']['font-family']; #>
80
<# if ( data.choices['fonts'] ) { data.fonts = data.choices['fonts']; } #>
81
<div class="font-family">
82
+ <h5><?php esc_html_e( 'Font Family', 'kirki' ); ?></h5>
83
<select {{{ data.inputAttrs }}} id="kirki-typography-font-family-{{{ data.id }}}" placeholder="<?php esc_attr_e( 'Select Font Family', 'kirki' ); ?>"></select>
84
</div>
85
<# if ( ! _.isUndefined( data.choices['font-backup'] ) && true === data.choices['font-backup'] ) { #>
86
<div class="font-backup hide-on-standard-fonts kirki-font-backup-wrapper">
87
+ <h5><?php esc_html_e( 'Backup Font', 'kirki' ); ?></h5>
88
<select {{{ data.inputAttrs }}} id="kirki-typography-font-backup-{{{ data.id }}}" placeholder="<?php esc_attr_e( 'Select Font Family', 'kirki' ); ?>"></select>
89
</div>
90
<# } #>
91
<# if ( true === data.show_variants || false !== data.default.variant ) { #>
92
<div class="variant kirki-variant-wrapper">
93
+ <h5><?php esc_html_e( 'Variant', 'kirki' ); ?></h5>
94
<select {{{ data.inputAttrs }}} class="variant" id="kirki-typography-variant-{{{ data.id }}}"></select>
95
</div>
96
<# } #>
105
<# if ( ! _.isUndefined( data.default['font-size'] ) ) { #>
106
<# data.value['font-size'] = data.value['font-size'] || data['default']['font-size']; #>
107
<div class="font-size">
108
+ <h5><?php esc_html_e( 'Font Size', 'kirki' ); ?></h5>
109
<input {{{ data.inputAttrs }}} type="text" value="{{ data.value['font-size'] }}"/>
110
</div>
111
<# } #>
113
<# if ( ! _.isUndefined( data.default['line-height'] ) ) { #>
114
<# data.value['line-height'] = data.value['line-height'] || data['default']['line-height']; #>
115
<div class="line-height">
116
+ <h5><?php esc_html_e( 'Line Height', 'kirki' ); ?></h5>
117
<input {{{ data.inputAttrs }}} type="text" value="{{ data.value['line-height'] }}"/>
118
</div>
119
<# } #>
121
<# if ( ! _.isUndefined( data.default['letter-spacing'] ) ) { #>
122
<# data.value['letter-spacing'] = data.value['letter-spacing'] || data['default']['letter-spacing']; #>
123
<div class="letter-spacing">
124
+ <h5><?php esc_html_e( 'Letter Spacing', 'kirki' ); ?></h5>
125
<input {{{ data.inputAttrs }}} type="text" value="{{ data.value['letter-spacing'] }}"/>
126
</div>
127
<# } #>
129
<# if ( ! _.isUndefined( data.default['word-spacing'] ) ) { #>
130
<# data.value['word-spacing'] = data.value['word-spacing'] || data['default']['word-spacing']; #>
131
<div class="word-spacing">
132
+ <h5><?php esc_html_e( 'Word Spacing', 'kirki' ); ?></h5>
133
<input {{{ data.inputAttrs }}} type="text" value="{{ data.value['word-spacing'] }}"/>
134
</div>
135
<# } #>
137
<# if ( ! _.isUndefined( data.default['text-align'] ) ) { #>
138
<# data.value['text-align'] = data.value['text-align'] || data['default']['text-align']; #>
139
<div class="text-align">
140
+ <h5><?php esc_html_e( 'Text Align', 'kirki' ); ?></h5>
141
<div class="text-align-choices">
142
<input {{{ data.inputAttrs }}} type="radio" value="inherit" name="_customize-typography-text-align-radio-{{ data.id }}" id="{{ data.id }}-text-align-inherit" <# if ( data.value['text-align'] === 'inherit' ) { #> checked="checked"<# } #>>
143
<label for="{{ data.id }}-text-align-inherit">
144
<span class="dashicons dashicons-editor-removeformatting"></span>
145
+ <span class="screen-reader-text"><?php esc_html_e( 'Inherit', 'kirki' ); ?></span>
146
</label>
147
</input>
148
<input {{{ data.inputAttrs }}} type="radio" value="left" name="_customize-typography-text-align-radio-{{ data.id }}" id="{{ data.id }}-text-align-left" <# if ( data.value['text-align'] === 'left' ) { #> checked="checked"<# } #>>
149
<label for="{{ data.id }}-text-align-left">
150
<span class="dashicons dashicons-editor-alignleft"></span>
151
+ <span class="screen-reader-text"><?php esc_html_e( 'Left', 'kirki' ); ?></span>
152
</label>
153
</input>
154
<input {{{ data.inputAttrs }}} type="radio" value="center" name="_customize-typography-text-align-radio-{{ data.id }}" id="{{ data.id }}-text-align-center" <# if ( data.value['text-align'] === 'center' ) { #> checked="checked"<# } #>>
155
<label for="{{ data.id }}-text-align-center">
156
<span class="dashicons dashicons-editor-aligncenter"></span>
157
+ <span class="screen-reader-text"><?php esc_html_e( 'Center', 'kirki' ); ?></span>
158
</label>
159
</input>
160
<input {{{ data.inputAttrs }}} type="radio" value="right" name="_customize-typography-text-align-radio-{{ data.id }}" id="{{ data.id }}-text-align-right" <# if ( data.value['text-align'] === 'right' ) { #> checked="checked"<# } #>>
161
<label for="{{ data.id }}-text-align-right">
162
<span class="dashicons dashicons-editor-alignright"></span>
163
+ <span class="screen-reader-text"><?php esc_html_e( 'Right', 'kirki' ); ?></span>
164
</label>
165
</input>
166
<input {{{ data.inputAttrs }}} type="radio" value="justify" name="_customize-typography-text-align-radio-{{ data.id }}" id="{{ data.id }}-text-align-justify" <# if ( data.value['text-align'] === 'justify' ) { #> checked="checked"<# } #>>
167
<label for="{{ data.id }}-text-align-justify">
168
<span class="dashicons dashicons-editor-justify"></span>
169
+ <span class="screen-reader-text"><?php esc_html_e( 'Justify', 'kirki' ); ?></span>
170
</label>
171
</input>
172
</div>
176
<# if ( ! _.isUndefined( data.default['text-transform'] ) ) { #>
177
<# data.value['text-transform'] = data.value['text-transform'] || data['default']['text-transform']; #>
178
<div class="text-transform">
179
+ <h5><?php esc_html_e( 'Text Transform', 'kirki' ); ?></h5>
180
<select {{{ data.inputAttrs }}} id="kirki-typography-text-transform-{{{ data.id }}}">
181
<option value=""<# if ( '' === data.value['text-transform'] ) { #>selected<# } #>></option>
182
+ <option value="none"<# if ( 'none' === data.value['text-transform'] ) { #>selected<# } #>><?php esc_html_e( 'None', 'kirki' ); ?></option>
183
+ <option value="capitalize"<# if ( 'capitalize' === data.value['text-transform'] ) { #>selected<# } #>><?php esc_html_e( 'Capitalize', 'kirki' ); ?></option>
184
+ <option value="uppercase"<# if ( 'uppercase' === data.value['text-transform'] ) { #>selected<# } #>><?php esc_html_e( 'Uppercase', 'kirki' ); ?></option>
185
+ <option value="lowercase"<# if ( 'lowercase' === data.value['text-transform'] ) { #>selected<# } #>><?php esc_html_e( 'Lowercase', 'kirki' ); ?></option>
186
+ <option value="initial"<# if ( 'initial' === data.value['text-transform'] ) { #>selected<# } #>><?php esc_html_e( 'Initial', 'kirki' ); ?></option>
187
+ <option value="inherit"<# if ( 'inherit' === data.value['text-transform'] ) { #>selected<# } #>><?php esc_html_e( 'Inherit', 'kirki' ); ?></option>
188
</select>
189
</div>
190
<# } #>
192
<# if ( ! _.isUndefined( data.default['text-decoration'] ) ) { #>
193
<# data.value['text-decoration'] = data.value['text-decoration'] || data['default']['text-decoration']; #>
194
<div class="text-decoration">
195
+ <h5><?php esc_html_e( 'Text Decoration', 'kirki' ); ?></h5>
196
<select {{{ data.inputAttrs }}} id="kirki-typography-text-decoration-{{{ data.id }}}">
197
<option value=""<# if ( '' === data.value['text-decoration'] ) { #>selected<# } #>></option>
198
+ <option value="none"<# if ( 'none' === data.value['text-decoration'] ) { #>selected<# } #>><?php esc_html_e( 'None', 'kirki' ); ?></option>
199
+ <option value="underline"<# if ( 'underline' === data.value['text-decoration'] ) { #>selected<# } #>><?php esc_html_e( 'Underline', 'kirki' ); ?></option>
200
+ <option value="overline"<# if ( 'overline' === data.value['text-decoration'] ) { #>selected<# } #>><?php esc_html_e( 'Overline', 'kirki' ); ?></option>
201
+ <option value="line-through"<# if ( 'line-through' === data.value['text-decoration'] ) { #>selected<# } #>><?php esc_html_e( 'Line-Through', 'kirki' ); ?></option>
202
+ <option value="initial"<# if ( 'initial' === data.value['text-decoration'] ) { #>selected<# } #>><?php esc_html_e( 'Initial', 'kirki' ); ?></option>
203
+ <option value="inherit"<# if ( 'inherit' === data.value['text-decoration'] ) { #>selected<# } #>><?php esc_html_e( 'Inherit', 'kirki' ); ?></option>
204
</select>
205
</div>
206
<# } #>
208
<# if ( ! _.isUndefined( data.default['margin-top'] ) ) { #>
209
<# data.value['margin-top'] = data.value['margin-top'] || data['default']['margin-top']; #>
210
<div class="margin-top">
211
+ <h5><?php esc_html_e( 'Margin Top', 'kirki' ); ?></h5>
212
<input {{{ data.inputAttrs }}} type="text" value="{{ data.value['margin-top'] }}"/>
213
</div>
214
<# } #>
216
<# if ( ! _.isUndefined( data.default['margin-bottom'] ) ) { #>
217
<# data.value['margin-bottom'] = data.value['margin-bottom'] || data['default']['margin-bottom']; #>
218
<div class="margin-bottom">
219
+ <h5><?php esc_html_e( 'Margin Bottom', 'kirki' ); ?></h5>
220
<input {{{ data.inputAttrs }}} type="text" value="{{ data.value['margin-bottom'] }}"/>
221
</div>
222
<# } #>
224
<# if ( ! _.isUndefined( data.default['color'] ) && false !== data.default['color'] ) { #>
225
<# data.value['color'] = data.value['color'] || data['default']['color']; #>
226
<div class="color">
227
+ <h5><?php esc_html_e( 'Color', 'kirki' ); ?></h5>
228
<input {{{ data.inputAttrs }}} type="text" data-palette="{{ data.palette }}" data-default-color="{{ data.default['color'] }}" value="{{ data.value['color'] }}" class="kirki-color-control"/>
229
</div>
230
<# } #>
243
* @return array
244
*/
245
protected function format_variants_array( $variants ) {
246
$all_variants = Kirki_Fonts::get_all_variants();
247
$final_variants = array();
248
foreach ( $variants as $variant ) {
controls/php/class-kirki-control-upload.php CHANGED
File without changes
controls/php/class-kirki-settings-repeater-setting.php CHANGED
@@ -43,12 +43,7 @@ class Kirki_Settings_Repeater_Setting extends WP_Customize_Setting {
43
* @return mixed The value.
44
*/
45
public function value() {
46
- $value = parent::value();
47
- if ( ! is_array( $value ) ) {
48
- $value = array();
49
- }
50
-
51
- return $value;
52
}
53
54
/**
@@ -59,26 +54,26 @@ class Kirki_Settings_Repeater_Setting extends WP_Customize_Setting {
59
* @return array
60
*/
61
public function sanitize_repeater_setting( $value ) {
62
-
63
if ( ! is_array( $value ) ) {
64
$value = json_decode( urldecode( $value ) );
65
}
66
- $sanitized = ( empty( $value ) || ! is_array( $value ) ) ? array() : $value;
67
68
// Make sure that every row is an array, not an object.
69
- foreach ( $sanitized as $key => $_value ) {
70
- $sanitized[ $key ] = (array) $_value;
71
- if ( empty( $_value ) ) {
72
- unset( $sanitized[ $key ] );
73
}
74
}
75
76
// Reindex array.
77
- if ( is_array( $sanitized ) ) {
78
- $sanitized = array_values( $sanitized );
79
}
80
81
- return $sanitized;
82
-
83
}
84
}
43
* @return mixed The value.
44
*/
45
public function value() {
46
+ return (array) parent::value();
47
}
48
49
/**
54
* @return array
55
*/
56
public function sanitize_repeater_setting( $value ) {
57
if ( ! is_array( $value ) ) {
58
$value = json_decode( urldecode( $value ) );
59
}
60
+ if ( empty( $value ) || ! is_array( $value ) ) {
61
+ $value = array();
62
+ }
63
64
// Make sure that every row is an array, not an object.
65
+ foreach ( $value as $key => $val ) {
66
+ $value[ $key ] = (array) $val;
67
+ if ( empty( $val ) ) {
68
+ unset( $value[ $key ] );
69
}
70
}
71
72
// Reindex array.
73
+ if ( is_array( $value ) ) {
74
+ $value = array_values( $value );
75
}
76
77
+ return $value;
78
}
79
}
controls/views/code.php CHANGED
File without changes
controls/views/color.php CHANGED
File without changes
controls/views/generic.php CHANGED
File without changes
controls/views/image.php CHANGED
@@ -31,13 +31,13 @@ if ( _.isObject( data.value ) && ! _.isUndefined( data.value.url ) ) {
31
32
data.choices.labels = _.isObject( data.choices.labels ) ? data.choices.labels : {};
33
data.choices.labels = _.defaults( data.choices.labels, {
34
- select: '<?php esc_attr_e( 'Select image', 'kirki' ); ?>',
35
- change: '<?php esc_attr_e( 'Change image', 'kirki' ); ?>',
36
- 'default': '<?php esc_attr_e( 'Default', 'kirki' ); ?>',
37
- remove: '<?php esc_attr_e( 'Remove', 'kirki' ); ?>',
38
- placeholder: '<?php esc_attr_e( 'No image selected', 'kirki' ); ?>',
39
- frame_title: '<?php esc_attr_e( 'Select image', 'kirki' ); ?>',
40
- frame_button: '<?php esc_attr_e( 'Choose image', 'kirki' ); ?>',
41
} );
42
#>
43
31
32
data.choices.labels = _.isObject( data.choices.labels ) ? data.choices.labels : {};
33
data.choices.labels = _.defaults( data.choices.labels, {
34
+ select: '<?php esc_html_e( 'Select image', 'kirki' ); ?>',
35
+ change: '<?php esc_html_e( 'Change image', 'kirki' ); ?>',
36
+ 'default': '<?php esc_html_e( 'Default', 'kirki' ); ?>',
37
+ remove: '<?php esc_html_e( 'Remove', 'kirki' ); ?>',
38
+ placeholder: '<?php esc_html_e( 'No image selected', 'kirki' ); ?>',
39
+ frame_title: '<?php esc_html_e( 'Select image', 'kirki' ); ?>',
40
+ frame_button: '<?php esc_html_e( 'Choose image', 'kirki' ); ?>',
41
} );
42
#>
43
controls/views/number.php CHANGED
File without changes
controls/views/radio.php CHANGED
File without changes
controls/views/select.php CHANGED
File without changes
controls/views/textarea.php CHANGED
File without changes
core/class-kirki-config.php CHANGED
@@ -139,15 +139,14 @@ final class Kirki_Config {
139
* @return Kirki_Config
140
*/
141
public static function get_instance( $id = 'global', $args = array() ) {
142
- $id = trim( esc_attr( $id ) );
143
- $id = ( '' === $id ) ? 'global' : $id;
144
-
145
$id_md5 = md5( $id );
146
if ( ! isset( self::$instances[ $id_md5 ] ) ) {
147
self::$instances[ $id_md5 ] = new self( $id, $args );
148
}
149
return self::$instances[ $id_md5 ];
150
-
151
}
152
153
/**
@@ -173,7 +172,6 @@ final class Kirki_Config {
173
* @return array
174
*/
175
public function get_config() {
176
-
177
return $this->config_final;
178
}
179
}
139
* @return Kirki_Config
140
*/
141
public static function get_instance( $id = 'global', $args = array() ) {
142
+ if ( empty( $id ) ) {
143
+ $id = 'global';
144
+ }
145
$id_md5 = md5( $id );
146
if ( ! isset( self::$instances[ $id_md5 ] ) ) {
147
self::$instances[ $id_md5 ] = new self( $id, $args );
148
}
149
return self::$instances[ $id_md5 ];
150
}
151
152
/**
172
* @return array
173
*/
174
public function get_config() {
175
return $this->config_final;
176
}
177
}
core/class-kirki-control.php CHANGED
@@ -48,6 +48,7 @@ class Kirki_Control {
48
49
// Set the control types.
50
$this->set_control_types();
51
// Add the control.
52
$this->add_control( $args );
53
@@ -65,12 +66,12 @@ class Kirki_Control {
65
66
// Set a default class name.
67
$class_name = 'WP_Customize_Control';
68
// Get the classname from the array of control classnames.
69
if ( array_key_exists( $args['type'], self::$control_types ) ) {
70
$class_name = self::$control_types[ $args['type'] ];
71
}
72
return $class_name;
73
-
74
}
75
76
/**
@@ -83,6 +84,7 @@ class Kirki_Control {
83
84
// Get the name of the class we're going to use.
85
$class_name = $this->get_control_class_name( $args );
86
// Add the control.
87
$this->wp_customize->add_control( new $class_name( $this->wp_customize, $args['settings'], $args ) );
88
@@ -107,7 +109,6 @@ class Kirki_Control {
107
108
// Make sure the defined classes actually exist.
109
foreach ( self::$control_types as $key => $classname ) {
110
-
111
if ( ! class_exists( $classname ) ) {
112
unset( self::$control_types[ $key ] );
113
}
48
49
// Set the control types.
50
$this->set_control_types();
51
+
52
// Add the control.
53
$this->add_control( $args );
54
66
67
// Set a default class name.
68
$class_name = 'WP_Customize_Control';
69
+
70
// Get the classname from the array of control classnames.
71
if ( array_key_exists( $args['type'], self::$control_types ) ) {
72
$class_name = self::$control_types[ $args['type'] ];
73
}
74
return $class_name;
75
}
76
77
/**
84
85
// Get the name of the class we're going to use.
86
$class_name = $this->get_control_class_name( $args );
87
+
88
// Add the control.
89
$this->wp_customize->add_control( new $class_name( $this->wp_customize, $args['settings'], $args ) );
90
109
110
// Make sure the defined classes actually exist.
111
foreach ( self::$control_types as $key => $classname ) {
112
if ( ! class_exists( $classname ) ) {
113
unset( self::$control_types[ $key ] );
114
}
core/class-kirki-field.php CHANGED
@@ -245,7 +245,7 @@ class Kirki_Field {
245
246
if ( isset( $args['setting'] ) && ! empty( $args['setting'] ) && ( ! isset( $args['settings'] ) || empty( $args['settings'] ) ) ) {
247
/* translators: %s represents the field ID where the error occurs. */
248
- _doing_it_wrong( __METHOD__, sprintf( esc_attr__( 'Typo found in field %s - setting instead of settings.', 'kirki' ), esc_attr( $args['settings'] ) ), '3.0.10' );
249
$args['settings'] = $args['setting'];
250
unset( $args['setting'] );
251
}
@@ -254,17 +254,17 @@ class Kirki_Field {
254
// assume that the provided argument is $args and set $config_id = 'global'.
255
if ( is_array( $config_id ) && empty( $args ) ) {
256
/* translators: %1$s represents the field ID where the error occurs. %2$s is the URL in the documentation site. */
257
- _doing_it_wrong( __METHOD__, sprintf( esc_attr__( 'Config not defined for field %1$s - See %2$s for details on how to properly add fields.', 'kirki' ), esc_attr( $args['settings'] ), 'https://aristath.github.io/kirki/docs/getting-started/fields.html' ), '3.0.10' );
258
$args = $config_id;
259
$config_id = 'global';
260
}
261
262
$args['kirki_config'] = $config_id;
263
264
- $this->kirki_config = trim( esc_attr( $config_id ) );
265
if ( '' === $config_id ) {
266
/* translators: %1$s represents the field ID where the error occurs. %2$s is the URL in the documentation site. */
267
- _doing_it_wrong( __METHOD__, sprintf( esc_attr__( 'Config not defined for field %1$s - See %2$s for details on how to properly add fields.', 'kirki' ), esc_attr( $args['settings'] ), 'https://aristath.github.io/kirki/docs/getting-started/fields.html' ), '3.0.10' );
268
$this->kirki_config = 'global';
269
}
270
@@ -306,7 +306,6 @@ class Kirki_Field {
306
$properties = get_class_vars( __CLASS__ );
307
308
// Some things must run before the others.
309
- $this->set_option_name();
310
$this->set_option_type();
311
$this->set_settings();
312
@@ -332,62 +331,13 @@ class Kirki_Field {
332
333
}
334
335
- /**
336
- * Escape $kirki_config.
337
- *
338
- * @access protected
339
- */
340
- protected function set_kirki_config() {
341
-
342
- $this->kirki_config = esc_attr( $this->kirki_config );
343
- }
344
-
345
- /**
346
- * Escape $option_name.
347
- *
348
- * @access protected
349
- */
350
- protected function set_option_name() {
351
-
352
- $this->option_name = esc_attr( $this->option_name );
353
- }
354
-
355
- /**
356
- * Escape the $section.
357
- *
358
- * @access protected
359
- */
360
- protected function set_section() {
361
-
362
- $this->section = sanitize_key( $this->section );
363
- }
364
-
365
/**
366
* Escape the $section.
367
*
368
* @access protected
369
*/
370
protected function set_input_attrs() {
371
-
372
- if ( ! is_array( $this->input_attrs ) ) {
373
- $this->input_attrs = array();
374
- }
375
- }
376
-
377
- /**
378
- * Checks the capability chosen is valid.
379
- * If not, then falls back to 'edit_theme_options'
380
- *
381
- * @access protected
382
- */
383
- protected function set_capability() {
384
-
385
- // Early exit if we're using 'edit_theme_options'.
386
- if ( 'edit_theme_options' === $this->capability ) {
387
- return;
388
- }
389
- // Escape & trim the capability.
390
- $this->capability = trim( esc_attr( $this->capability ) );
391
}
392
393
/**
@@ -401,10 +351,11 @@ class Kirki_Field {
401
if ( 'options' === $this->option_type ) {
402
$this->option_type = 'option';
403
}
404
// Take care of common typos.
405
if ( 'theme_mods' === $this->option_type ) {
406
/* translators: %1$s represents the field ID where the error occurs. */
407
- _doing_it_wrong( __METHOD__, sprintf( esc_attr__( 'Typo found in field %s - "theme_mods" vs "theme_mod"', 'kirki' ), esc_attr( $this->settings ) ), '3.0.10' );
408
$this->option_type = 'theme_mod';
409
}
410
}
@@ -415,14 +366,13 @@ class Kirki_Field {
415
* @access protected
416
*/
417
protected function set_partial_refresh() {
418
-
419
if ( ! is_array( $this->partial_refresh ) ) {
420
$this->partial_refresh = array();
421
}
422
foreach ( $this->partial_refresh as $id => $args ) {
423
if ( ! is_array( $args ) || ! isset( $args['selector'] ) || ! isset( $args['render_callback'] ) || ! is_callable( $args['render_callback'] ) ) {
424
/* translators: %1$s represents the field ID where the error occurs. */
425
- _doing_it_wrong( __METHOD__, sprintf( esc_attr__( '"partial_refresh" invalid entry in field %s', 'kirki' ), esc_attr( $this->settings ) ), '3.0.10' );
426
unset( $this->partial_refresh[ $id ] );
427
continue;
428
}
@@ -452,6 +402,7 @@ class Kirki_Field {
452
$settings = array();
453
foreach ( $this->settings as $setting_key => $setting_value ) {
454
$settings[ $setting_key ] = $setting_value;
455
// If we're using serialized options then we need to spice this up.
456
if ( 'option' === $this->option_type && '' !== $this->option_name && ( false === strpos( $setting_key, '[' ) ) ) {
457
$settings[ $setting_key ] = "{$this->option_name}[{$setting_value}]";
@@ -471,7 +422,6 @@ class Kirki_Field {
471
* @access protected
472
*/
473
protected function set_active_callback() {
474
-
475
if ( is_array( $this->active_callback ) ) {
476
if ( ! is_callable( $this->active_callback ) ) {
477
@@ -495,23 +445,13 @@ class Kirki_Field {
495
if ( '__return_true' === $this->active_callback ) {
496
return;
497
}
498
// Make sure the function is callable, otherwise fallback to __return_true.
499
if ( ! is_callable( $this->active_callback ) ) {
500
$this->active_callback = '__return_true';
501
}
502
}
503
504
- /**
505
- * Sets the control type.
506
- *
507
- * @access protected
508
- */
509
- protected function set_type() {
510
-
511
- // Escape the control type (it doesn't hurt to be sure).
512
- $this->type = esc_attr( $this->type );
513
- }
514
-
515
/**
516
* Sets the $id.
517
* Setting the ID should happen after the 'settings' sanitization.
@@ -521,7 +461,6 @@ class Kirki_Field {
521
* @access protected
522
*/
523
protected function set_id() {
524
-
525
$this->id = sanitize_key( str_replace( '[', '-', str_replace( ']', '', $this->settings ) ) );
526
}
527
@@ -531,7 +470,6 @@ class Kirki_Field {
531
* @access protected
532
*/
533
protected function set_choices() {
534
-
535
if ( ! is_array( $this->choices ) ) {
536
$this->choices = array();
537
}
@@ -543,9 +481,7 @@ class Kirki_Field {
543
* @access protected
544
*/
545
protected function set_disable_output() {
546
-
547
$this->disable_output = (bool) $this->disable_output;
548
-
549
}
550
551
/**
@@ -554,25 +490,26 @@ class Kirki_Field {
554
* @access protected
555
*/
556
protected function set_output() {
557
-
558
if ( empty( $this->output ) ) {
559
return;
560
}
561
if ( ! is_array( $this->output ) ) {
562
/* translators: The field ID where the error occurs. */
563
- _doing_it_wrong( __METHOD__, sprintf( esc_attr__( '"output" invalid format in field %s. The "output" argument should be defined as an array of arrays.', 'kirki' ), esc_attr( $this->settings ) ), '3.0.10' );
564
$this->output = array(
565
array(
566
'element' => $this->output,
567
),
568
);
569
}
570
// Convert to array of arrays if needed.
571
if ( isset( $this->output['element'] ) ) {
572
/* translators: The field ID where the error occurs. */
573
- _doing_it_wrong( __METHOD__, sprintf( esc_attr__( '"output" invalid format in field %s. The "output" argument should be defined as an array of arrays.', 'kirki' ), esc_attr( $this->settings ) ), '3.0.10' );
574
$this->output = array( $this->output );
575
}
576
foreach ( $this->output as $key => $output ) {
577
if ( empty( $output ) || ! isset( $output['element'] ) ) {
578
unset( $this->output[ $key ] );
@@ -581,6 +518,7 @@ class Kirki_Field {
581
if ( ! isset( $output['sanitize_callback'] ) && isset( $output['callback'] ) ) {
582
$this->output[ $key ]['sanitize_callback'] = $output['callback'];
583
}
584
// Convert element arrays to strings.
585
if ( isset( $output['element'] ) && is_array( $output['element'] ) ) {
586
$this->output[ $key ]['element'] = array_unique( $this->output[ $key ]['element'] );
@@ -605,7 +543,6 @@ class Kirki_Field {
605
* @access protected
606
*/
607
protected function set_js_vars() {
608
-
609
if ( ! is_array( $this->js_vars ) ) {
610
$this->js_vars = array();
611
}
@@ -654,7 +591,6 @@ class Kirki_Field {
654
}
655
$this->js_vars = $js_vars;
656
$this->transport = 'postMessage';
657
-
658
}
659
}
660
@@ -664,7 +600,6 @@ class Kirki_Field {
664
* @access protected
665
*/
666
protected function set_variables() {
667
-
668
if ( ! is_array( $this->variables ) ) {
669
$variable = ( is_string( $this->variables ) && ! empty( $this->variables ) ) ? $this->variables : false;
670
$this->variables = array();
@@ -680,7 +615,6 @@ class Kirki_Field {
680
* @access protected
681
*/
682
protected function set_transport() {
683
-
684
if ( 'postmessage' === trim( strtolower( $this->transport ) ) ) {
685
$this->transport = 'postMessage';
686
}
@@ -692,7 +626,6 @@ class Kirki_Field {
692
* @access protected
693
*/
694
protected function set_required() {
695
-
696
if ( ! is_array( $this->required ) ) {
697
$this->required = array();
698
}
@@ -704,7 +637,6 @@ class Kirki_Field {
704
* @access protected
705
*/
706
protected function set_priority() {
707
-
708
$this->priority = absint( $this->priority );
709
}
710
245
246
if ( isset( $args['setting'] ) && ! empty( $args['setting'] ) && ( ! isset( $args['settings'] ) || empty( $args['settings'] ) ) ) {
247
/* translators: %s represents the field ID where the error occurs. */
248
+ _doing_it_wrong( __METHOD__, sprintf( esc_html__( 'Typo found in field %s - setting instead of settings.', 'kirki' ), esc_html( $args['settings'] ) ), '3.0.10' );
249
$args['settings'] = $args['setting'];
250
unset( $args['setting'] );
251
}
254
// assume that the provided argument is $args and set $config_id = 'global'.
255
if ( is_array( $config_id ) && empty( $args ) ) {
256
/* translators: %1$s represents the field ID where the error occurs. %2$s is the URL in the documentation site. */
257
+ _doing_it_wrong( __METHOD__, sprintf( esc_html__( 'Config not defined for field %1$s - See %2$s for details on how to properly add fields.', 'kirki' ), esc_html( $args['settings'] ), 'https://aristath.github.io/kirki/docs/getting-started/fields.html' ), '3.0.10' );
258
$args = $config_id;
259
$config_id = 'global';
260
}
261
262
$args['kirki_config'] = $config_id;
263
264
+ $this->kirki_config = $config_id;
265
if ( '' === $config_id ) {
266
/* translators: %1$s represents the field ID where the error occurs. %2$s is the URL in the documentation site. */
267
+ _doing_it_wrong( __METHOD__, sprintf( esc_html__( 'Config not defined for field %1$s - See %2$s for details on how to properly add fields.', 'kirki' ), esc_html( $args['settings'] ), 'https://aristath.github.io/kirki/docs/getting-started/fields.html' ), '3.0.10' );
268
$this->kirki_config = 'global';
269
}
270
306
$properties = get_class_vars( __CLASS__ );
307
308
// Some things must run before the others.
309
$this->set_option_type();
310
$this->set_settings();
311
331
332
}
333
334
/**
335
* Escape the $section.
336
*
337
* @access protected
338
*/
339
protected function set_input_attrs() {
340
+ $this->input_attrs = (array) $this->input_attrs;
341
}
342
343
/**
351
if ( 'options' === $this->option_type ) {
352
$this->option_type = 'option';
353
}
354
+
355
// Take care of common typos.
356
if ( 'theme_mods' === $this->option_type ) {
357
/* translators: %1$s represents the field ID where the error occurs. */
358
+ _doing_it_wrong( __METHOD__, sprintf( esc_html( 'Typo found in field %s - "theme_mods" vs "theme_mod"', 'kirki' ), esc_html( $this->settings ) ), '3.0.10' );
359
$this->option_type = 'theme_mod';
360
}
361
}
366
* @access protected
367
*/
368
protected function set_partial_refresh() {
369
if ( ! is_array( $this->partial_refresh ) ) {
370
$this->partial_refresh = array();
371
}
372
foreach ( $this->partial_refresh as $id => $args ) {
373
if ( ! is_array( $args ) || ! isset( $args['selector'] ) || ! isset( $args['render_callback'] ) || ! is_callable( $args['render_callback'] ) ) {
374
/* translators: %1$s represents the field ID where the error occurs. */
375
+ _doing_it_wrong( __METHOD__, sprintf( esc_html__( '"partial_refresh" invalid entry in field %s', 'kirki' ), esc_html( $this->settings ) ), '3.0.10' );
376
unset( $this->partial_refresh[ $id ] );
377
continue;
378
}
402
$settings = array();
403
foreach ( $this->settings as $setting_key => $setting_value ) {
404
$settings[ $setting_key ] = $setting_value;
405
+
406
// If we're using serialized options then we need to spice this up.
407
if ( 'option' === $this->option_type && '' !== $this->option_name && ( false === strpos( $setting_key, '[' ) ) ) {
408
$settings[ $setting_key ] = "{$this->option_name}[{$setting_value}]";
422
* @access protected
423
*/
424
protected function set_active_callback() {
425
if ( is_array( $this->active_callback ) ) {
426
if ( ! is_callable( $this->active_callback ) ) {
427
445
if ( '__return_true' === $this->active_callback ) {
446
return;
447
}
448
+
449
// Make sure the function is callable, otherwise fallback to __return_true.
450
if ( ! is_callable( $this->active_callback ) ) {
451
$this->active_callback = '__return_true';
452
}
453
}
454
455
/**
456
* Sets the $id.
457
* Setting the ID should happen after the 'settings' sanitization.
461
* @access protected
462
*/
463
protected function set_id() {
464
$this->id = sanitize_key( str_replace( '[', '-', str_replace( ']', '', $this->settings ) ) );
465
}
466
470
* @access protected
471
*/
472
protected function set_choices() {
473
if ( ! is_array( $this->choices ) ) {
474
$this->choices = array();
475
}
481
* @access protected
482
*/
483
protected function set_disable_output() {
484
$this->disable_output = (bool) $this->disable_output;
485
}
486
487
/**
490
* @access protected
491
*/
492
protected function set_output() {
493
if ( empty( $this->output ) ) {
494
return;
495
}
496
if ( ! is_array( $this->output ) ) {
497
/* translators: The field ID where the error occurs. */
498
+ _doing_it_wrong( __METHOD__, sprintf( esc_html__( '"output" invalid format in field %s. The "output" argument should be defined as an array of arrays.', 'kirki' ), esc_html( $this->settings ) ), '3.0.10' );
499
$this->output = array(
500
array(
501
'element' => $this->output,
502
),
503
);
504
}
505
+
506
// Convert to array of arrays if needed.
507
if ( isset( $this->output['element'] ) ) {
508
/* translators: The field ID where the error occurs. */
509
+ _doing_it_wrong( __METHOD__, sprintf( esc_html__( '"output" invalid format in field %s. The "output" argument should be defined as an array of arrays.', 'kirki' ), esc_html( $this->settings ) ), '3.0.10' );
510
$this->output = array( $this->output );
511
}
512
+
513
foreach ( $this->output as $key => $output ) {
514
if ( empty( $output ) || ! isset( $output['element'] ) ) {
515
unset( $this->output[ $key ] );
518
if ( ! isset( $output['sanitize_callback'] ) && isset( $output['callback'] ) ) {
519
$this->output[ $key ]['sanitize_callback'] = $output['callback'];
520
}
521
+
522
// Convert element arrays to strings.
523
if ( isset( $output['element'] ) && is_array( $output['element'] ) ) {
524
$this->output[ $key ]['element'] = array_unique( $this->output[ $key ]['element'] );
543
* @access protected
544
*/
545
protected function set_js_vars() {
546
if ( ! is_array( $this->js_vars ) ) {
547
$this->js_vars = array();
548
}
591
}
592
$this->js_vars = $js_vars;
593
$this->transport = 'postMessage';
594
}
595
}
596
600
* @access protected
601
*/
602
protected function set_variables() {
603
if ( ! is_array( $this->variables ) ) {
604
$variable = ( is_string( $this->variables ) && ! empty( $this->variables ) ) ? $this->variables : false;
605
$this->variables = array();
615
* @access protected
616
*/
617
protected function set_transport() {
618
if ( 'postmessage' === trim( strtolower( $this->transport ) ) ) {
619
$this->transport = 'postMessage';
620
}
626
* @access protected
627
*/