* @copyright Copyright (c) 2017 - 2017, Satish Gandham */ add_action( 'customize_register', 'helium_typography_control_register', 1 ); function helium_typography_control_register( $wp_customize ) { $wp_customize->register_control_type( 'Helium_Customize_Control_Typography' ); class Helium_Customize_Control_Typography extends WP_Customize_Control { public $type = 'he_typography'; public function to_json() { parent::to_json(); $this->json['value']['stack'] = $this->value( 'stack' ); $this->json['value']['size'] = $this->value( 'size' ); $this->json['value']['lh'] = $this->value( 'lh' ); $this->json['value']['weight'] = $this->value( 'weight' ); $this->json['stacks'] = helium_get_font_stacks(); $this->json['fontSizes'] = array( 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32 ); $this->json['fontWeights'] = array( 100, 200, 300, 400, 500, 600, 700, 800, 900, 'lighter', 'light', 'normal', 'bold', 'bolder' ); } public function content_template() { ?>
<# if ( data.label ) { #> {{{ data.label }}} <# } #>
<# if ( data.description ) { #> {{{ data.description }}} <# } #>