Apply new theme mods

This commit is contained in:
Tetrakern 2024-02-07 22:56:39 +01:00
parent a815876995
commit 2f3a26f4fa
3 changed files with 14 additions and 3 deletions

View File

@ -69,12 +69,12 @@ if ( ! defined( 'FICTIONEER_LOGOUT_ENDPOINT' ) ) {
// String: CSS name of the primary font
if ( ! defined( 'FICTIONEER_PRIMARY_FONT_CSS' ) ) {
define( 'FICTIONEER_PRIMARY_FONT_CSS', 'Open Sans' );
define( 'FICTIONEER_PRIMARY_FONT_CSS', get_theme_mod( 'primary_font_family_value', 'Open Sans' ) );
}
// String: Display name of the primary font
if ( ! defined( 'FICTIONEER_PRIMARY_FONT_NAME' ) ) {
define( 'FICTIONEER_PRIMARY_FONT_NAME', 'Open Sans' );
define( 'FICTIONEER_PRIMARY_FONT_NAME', get_theme_mod( 'primary_font_family_value', 'Open Sans' ) );
}
// String: TTS regex (used to split text into sentences)

View File

@ -271,9 +271,17 @@ if ( ! function_exists( 'fictioneer_hsl_font_code' ) ) {
*/
function fictioneer_watch_for_customer_updates() {
// Transient caches
delete_transient( 'fictioneer_customized_light_mode' );
delete_transient( 'fictioneer_customized_dark_mode' );
delete_transient( 'fictioneer_customized_layout' );
// Files
$bundled_fonts = WP_CONTENT_DIR . '/themes/fictioneer/cache/bundled-fonts.css';
if ( file_exists( $bundled_fonts ) ) {
unlink( $bundled_fonts );
}
}
add_action( 'customize_save_after', 'fictioneer_watch_for_customer_updates' );
@ -528,6 +536,9 @@ if ( ! function_exists( 'fictioneer_add_customized_layout_css' ) ) {
--site-title-font-size: " . fictioneer_get_css_clamp( $title_min, $title_max, 320, $site_width ) . ";
--site-title-tagline-font-size: " . fictioneer_get_css_clamp( $tagline_min, $tagline_max, 320, $site_width ) . ";
--grid-columns-min: " . $card_grid_column_min . "px;
--ff-base: " . get_theme_mod( 'primary_font_family_value', 'Open Sans' ) . ", var(--ff-system);
--ff-note: " . get_theme_mod( 'secondary_font_family_value', 'Lato' ) . ", var(--ff-base);
--ff-heading: " . get_theme_mod( 'heading_font_family_value', 'Open Sans' ) . ", var(--ff-base);
}";
if ( get_theme_mod( 'use_custom_layout', false ) ) {

View File

@ -1075,7 +1075,7 @@ if ( ! function_exists( 'fictioneer_output_head_meta' ) ) {
$custom_fonts_href = get_template_directory_uri() . '/cache/bundled-fonts.css?ver=' . FICTIONEER_VERSION;
// Start HTML ---> ?>
<link rel="stylesheet" href="<?php echo $base_fonts_href; ?>" media="print" onload="this.media='all'; this.onload = null;">
<link rel="stylesheet" id="base-fonts-stylesheet" href="<?php echo $base_fonts_href; ?>" media="print" onload="this.media='all'; this.onload = null;">
<noscript><link rel="stylesheet" href="<?php echo $base_fonts_href; ?>"></noscript>
<link rel="stylesheet" id="bundled-fonts-stylesheet" href="<?php echo $custom_fonts_href; ?>" media="print" onload="this.media='all'; this.onload = null;">
<noscript><link rel="stylesheet" href="<?php echo $custom_fonts_href; ?>"></noscript>