Skip to content

Commit

Permalink
Do not kebab font slugs.
Browse files Browse the repository at this point in the history
  • Loading branch information
jffng committed Nov 13, 2023
1 parent cc2c462 commit 01fe4d9
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lib/class-wp-theme-json-gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -1704,7 +1704,11 @@ protected static function get_settings_values_by_slug( $settings, $preset_metada
continue;
}
foreach ( $preset_per_origin[ $origin ] as $preset ) {
$slug = _wp_to_kebab_case( $preset['slug'] );
if ( ! empty( $preset['fontFace'] ) ){
$slug = $preset['slug'];
} else {
$slug = _wp_to_kebab_case( $preset['slug'] );
}

$value = '';
if ( isset( $preset_metadata['value_key'], $preset[ $preset_metadata['value_key'] ] ) ) {
Expand Down Expand Up @@ -1750,7 +1754,11 @@ protected static function get_settings_slugs( $settings, $preset_metadata, $orig
continue;
}
foreach ( $preset_per_origin[ $origin ] as $preset ) {
$slug = _wp_to_kebab_case( $preset['slug'] );
if ( ! empty( $preset['fontFace'] ) ){
$slug = $preset['slug'];
} else {
$slug = _wp_to_kebab_case( $preset['slug'] );
}

// Use the array as a set so we don't get duplicates.
$result[ $slug ] = $slug;
Expand Down

0 comments on commit 01fe4d9

Please sign in to comment.