'Select font', 'font-weight' => 'initial', 'font-style' => 'initial', 'font-size' => '16', 'line-height' => '18', ); $arr = array(); foreach ( $this->choices as $choice ) { if ( array_key_exists( $choice, $defaults ) ) { $arr[ $choice ] = $defaults[ $choice ]; } } if ( empty( $values ) ) { return $arr; } $json = get_theme_mod( $values, '' ); if ( '' === $json ) { return $arr; } $json = str_replace( '"', '"', $json ); $json = (array) json_decode( $json ); $options = (array) $json['json']; $return = array_merge( $arr, $options ); foreach ( $return as $k => $v ) { $return[ $k ] = esc_attr( $v ); } return $return; } /** * Access the GFonts Json and parse its content. * * @since 1.0.0 * @access public * @return array|mixed|object */ public function google_fonts() { global $wp_filesystem; if ( empty( $wp_filesystem ) ) { require_once( ABSPATH . '/wp-admin/includes/file.php' ); WP_Filesystem(); } $path = get_template_directory() . '/inc/libraries/epsilon-framework/assets/data/gfonts.json'; $gfonts = $wp_filesystem->get_contents( $path ); return json_decode( $gfonts ); } /** * @return string */ public function set_selectors() { return implode( ',', $this->selectors ); } /** * Displays the control content. * * @since 1.0.0 * @access public * @return void */ public function render_content() { ?> get_values( $this->id ); $fonts = $this->google_fonts(); ?>
choices ) ) : ?>
choices ) ) : ?>
choices ) ) : ?>
choices ) ) : ?>
px
choices ) ) : ?>
px