Reflect font selection on settings page

This commit is contained in:
Tetrakern 2024-02-08 00:14:57 +01:00
parent 21fed199cb
commit c5964805d5
2 changed files with 16 additions and 4 deletions

View File

@ -10,7 +10,7 @@
"styles": ["normal", "italic"],
"weights": [100, 200, 300, 400, 500, 700, 900],
"charsets": ["latin"],
"formats": [],
"formats": ["ttf"],
"about": "Helvetica, also known by its original name Neue Haas Grotesk, is a widely used sans-serif typeface developed in 1957 by Swiss typeface designer Max Miedinger and Eduard Hoffmann. Helvetica Neue is a reworking of the typeface with a more structurally unified set of heights and widths. Other changes include improved legibility, heavier punctuation marks, and increased spacing in the numbers.",
"note": "This is a font provided by the operating system and not always available.",
"sources": {

View File

@ -12,9 +12,9 @@
// Setup
$fonts = fictioneer_get_font_data();
// $primary_font = get_theme_mod( 'primary_font_family_value', 'Open Sans' );
// $secondary_font = get_theme_mod( 'secondary_font_family_value', 'Lato' );
// $heading_font = get_theme_mod( 'heading_font_family_value', 'Open Sans' );
$primary_font = get_theme_mod( 'primary_font_family_value', 'Open Sans' );
$secondary_font = get_theme_mod( 'secondary_font_family_value', 'Lato' );
$heading_font = get_theme_mod( 'heading_font_family_value', 'Open Sans' );
?>
@ -67,6 +67,18 @@ $fonts = fictioneer_get_font_data();
if ( ! empty( $version ) ) {
printf( _x( ' (v%s)', 'Settings font card.', 'fictioneer' ), $version );
}
if ( $primary_font === $font['family'] ) {
_ex( ' — Primary Font', 'Settings font card.', 'fictioneer' );
}
if ( $secondary_font === $font['family'] ) {
_ex( ' — Secondary Font', 'Settings font card.', 'fictioneer' );
}
if ( $heading_font === $font['family'] ) {
_ex( ' — Heading Font', 'Settings font card.', 'fictioneer' );
}
?></h3>
<div class="fictioneer-card__content">