add_values_backwards_compatibility();
$this->json['l10n'] = Kirki_l10n::get_strings();
$defaults = array(
'font-family' => false,
'font-size' => false,
'line-height' => false,
'line-height' => false,
'letter-spacing' => false,
'color' => false,
'text-align' => false,
);
$this->json['default'] = wp_parse_args( $this->json['default'], $defaults );
}
/**
* An Underscore (JS) template for this control's content (but not its container).
*
* Class variables for this control class are available in the `data` JS object;
* export custom variables by overriding {@see Kirki_Customize_Control::to_json()}.
*
* @see WP_Customize_Control::print_template()
*
* @access protected
*/
protected function content_template() {
?>
<# if ( data.tooltip ) { #>
<# } #>
value();
$old_values = array(
'font-family' => '',
'font-size' => '',
'variant' => ( isset( $value['font-weight'] ) ) ? $value['font-weight'] : 'regular',
'line-height' => '',
'letter-spacing' => '',
'color' => '',
);
// Font-weight is now variant.
// All values are the same with the exception of 400 (becomes regular).
if ( '400' == $old_values['variant'] ) {
$old_values['variant'] = 'regular';
}
// Letter spacing was in px, now it requires units.
if ( isset( $value['letter-spacing'] ) && is_numeric( $value['letter-spacing'] ) && $value['letter-spacing'] ) {
$value['letter-spacing'] .= 'px';
}
$this->json['value'] = wp_parse_args( $value, $old_values );
}
}
}