$font_settings as $name => $value ) { $settings['typography'][ $name ] = array(); if ( isset( $value['family'] ) && ! empty( $value['family'] ) ) { $settings['typography'][ $name ]['family'] = $value['family']; } if ( isset( $value['sizes'] ) && ! empty( $value['sizes'] ) ) { $settings['typography'][ $name ]['sizes'] = $value['sizes']; } } } return $settings; } /** * Binds JS handlers to instantly live-preview changes. */ function tripp_customizer_preview_scripts() { add_filter( 'tripp_settings', 'tripp_customizer_settings' ); $theme_version = wp_get_theme()->get( 'Version' ); wp_enqueue_media(); wp_enqueue_style( 'tripp-customize-preview', get_theme_file_uri( 'assets/css/customize-preview.css' ), array( 'wp-block-library', 'customize-preview' ), $theme_version ); wp_style_add_data( 'tripp-customize-preview', 'rtl', 'replace' ); wp_enqueue_script( 'tripp-customize-preview', get_theme_file_uri( 'assets/js/customize-preview.js' ), array( 'customize-preview', 'customize-selective-refresh', 'tripp' ), $theme_version, true ); } add_action( 'customize_preview_init', 'tripp_customizer_preview_scripts' );