Make WordPress Core


Ignore:
Timestamp:
02/27/2024 12:04:55 PM (9 months ago)
Author:
youknowriad
Message:

Font face resolver: print font faces from font families defined in all theme.json origins.

This commit updates the theme.json style generation to allow a font family name to be repeated across theme.json origins (default, theme, custom).

Props mmaattiiaass, hellofromtonya, arthur791004, ironprogrammer.
Fixes #60605.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/fonts/class-wp-font-face-resolver.php

    r56688 r57720  
    6868                }
    6969
    70                 // Prepare the fonts array structure for this font-family.
    71                 if ( ! array_key_exists( $font_family_name, $fonts ) ) {
    72                     $fonts[ $font_family_name ] = array();
    73                 }
    74 
    75                 $fonts[ $font_family_name ] = static::convert_font_face_properties( $definition['fontFace'], $font_family_name );
     70                $fonts[] = static::convert_font_face_properties( $definition['fontFace'], $font_family_name );
    7671            }
    7772        }
Note: See TracChangeset for help on using the changeset viewer.