json['fonts'] = $this->get_all_fonts();
$value = $this->value();
$this->json['value'] = array(
'bold' => isset( $value['bold'] ) ? $value['bold'] : false,
'italic' => isset( $value['italic'] ) ? $value['italic'] : false,
'underline' => isset( $value['underline'] ) ? $value['underline'] : false,
'strikethrough' => isset( $value['strikethrough'] ) ? $value['strikethrough'] : false,
'font-family' => isset( $value['font-family'] ) ? $value['font-family'] : '',
'font-size' => isset( $value['font-size'] ) ? $value['font-size'] : '',
'font-weight' => isset( $value['font-weight'] ) ? $value['font-weight'] : '',
'line-height' => isset( $value['line-height'] ) ? $value['line-height'] : '',
'letter-spacing' => isset( $value['letter-spacing'] ) ? $value['letter-spacing'] : '',
);
$this->json['l10n'] = array(
'font-family' => $i18n['font-family'],
'font-size' => $i18n['font-size'],
'font-weight' => $i18n['font-weight'],
'line-height' => $i18n['line-height'],
'letter-spacing' => $i18n['letter-spacing'],
);
}
public function render_content() {}
protected function content_template() { ?>
<# if ( data.help ) { #>
<# } #>
<# if ( data.choices['font-style'] ) { #>
<# } #>
<# if ( data.choices['font-family'] ) { #>
<# if ( '' == data.value['font-family'] ) { data.value['font-family'] = data.default['font-family']; } #>
{{ data.l10n['font-family'] }}
<# } #>
<# if ( data.choices['font-size'] ) { #>
{{ data.l10n['font-size'] }}
<# } #>
<# if ( data.choices['font-weight'] ) { #>
{{ data.l10n['font-weight'] }}
<# } #>
<# if ( data.choices['line-height'] ) { #>
{{ data.l10n['line-height'] }}
<# } #>
<# if ( data.choices['letter-spacing'] ) { #>
{{ data.l10n['letter-spacing'] }}
<# } #>
font_registry->get_standard_fonts();
}
public function get_google_fonts() {
return Kirki()->font_registry->get_google_fonts();
}
public function get_all_fonts() {
$fonts = Kirki()->font_registry->get_all_fonts();
$fonts_array = array();
foreach ( $fonts as $key => $font ) {
if ( is_array( $font ) ) {
if ( isset( $font['label'] ) ) {
if ( isset( $font['stack'] ) ) {
$fonts_array[ $font['stack'] ] = $font['label'];
} else {
$fonts_array[ $key ] = $font['label'];
}
} else {
$fonts_array[ $key ] = $key;
}
} else {
$fonts_array[ $key ] = $font;
}
}
return $fonts_array;
}
}