json['id'] = $this->id; $this->json['choices'] = $this->choices; $this->json['link'] = $this->get_link(); $this->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'] : false, 'font-size' => isset( $value['font-size'] ) ? $value['font-size'] : false, 'font-weight' => isset( $value['font-weight'] ) ? $value['font-weight'] : false, 'line-height' => isset( $value['line-height'] ) ? $value['line-height'] : false, 'letter-spacing' => isset( $value['letter-spacing'] ) ? $value['letter-spacing'] : false, ); $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 content_template() { ?>
<# if ( data.choices['font-style'] ) { #>
<# } #> <# if ( data.choices['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 $font => $properties ) { $fonts_array[ $font ] = $font; } return $fonts_array; } }