Skip to content

Commit

Permalink
Fix case where a source is set.
Browse files Browse the repository at this point in the history
  • Loading branch information
jffng committed Oct 2, 2023
1 parent aa22c0a commit db72ab3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/class-wp-theme-json-gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -819,8 +819,13 @@ protected static function sanitize( $input, $valid_block_names, $valid_element_n
$schema['settings'] = static::VALID_SETTINGS;
$schema['settings']['blocks'] = $schema_settings_blocks;


// For settings.typography.fontFamilies, make the $schema have all indexes present in the $input.
if ( isset( $input['settings']['typography']['fontFamilies'] ) ) {
// Do not handle the cases where the sanitization is called before font families are merged, since it will be handled again later.
if ( isset( $input['settings']['typography']['fontFamilies']['theme']) || isset( $input['settings']['typography']['fontFamilies']['custom'] ) ) {
return $output;
}
foreach ( $input['settings']['typography']['fontFamilies'] as $font_family_key => $value ) {
$schema['settings']['typography']['fontFamilies'][ $font_family_key ] = static::VALID_SETTINGS['typography']['fontFamilies'][0];
// Do the same for fontFace.
Expand Down

0 comments on commit db72ab3

Please sign in to comment.