value(); //make sure we have variants as array(Past "Redux era" ) if ( isset( $value['font-multi-style'] ) ){ $tmp_value = json_decode( $value['font-multi-style'] ); //if $value was not array try as string if($tmp_value === NULL){ $tmp_value = strlen($value['font-multi-style']) === 0? array() : array($value['font-multi-style']); } //new setting $value['variants'] = $tmp_value; //remove legacy setting unset($value['font-multi-style']); } //make sure subsets are array if ( isset( $value['subsets'] ) && ! is_array( $value['subsets'] ) ){ $value['subsets'] = array($value['subsets']); } $this->json['current_font'] = $value; } /** * Don't render any content for this control from PHP. * * @see Barter_A13_Customize_Font_Control::content_template() */ public function render_content() {} /** * Render a JS template for the content of the font control. * */ public function content_template() { ?> <# var id = data.settings.default, id_prefix = _.uniqueId( 'el' ) + '-', standard_fonts = BarterA13FECustomizerControls.standard_fonts, google_fonts = BarterA13FECustomizerControls.google_fonts, readabe_variants = BarterA13FECustomizerControls.human_font_variants, selected_font = data.current_font['font-family'], selected_subsets = data.current_font['subsets'], selected_variants = data.current_font['variants'], selected_word_spacing = parseInt(data.current_font['word-spacing'], 10), selected_letter_spacing = parseInt(data.current_font['letter-spacing'], 10), selected_attr = ' selected', checked_attr = ' checked'; #> <# if ( data.label ) { #> {{{ data.label }}} <# } #> <# if ( data.description ) { #> {{{ data.description }}} <# } #>