Skip to content

Commit

Permalink
skip font faces that has already a theme relative path
Browse files Browse the repository at this point in the history
  • Loading branch information
matiasbenedetto committed Sep 20, 2024
1 parent 469958b commit 884cc70
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions includes/create-theme/theme-fonts.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ public static function copy_font_assets_to_theme( $font_families ) {
// if it is a string, cast it to an array
$font_face['src'] = (array) $font_face['src'];
foreach ( $font_face['src'] as $font_src_index => &$font_src ) {
if ( str_starts_with( $font_src, 'file:' ) ) {
// If the font source starts with 'file:' then it's already a theme asset.
continue;
}
$font_filename = basename( $font_src );
$font_pretty_filename = self::make_filename_from_fontface( $font_face, $font_src, $font_src_index );
$font_face_path = path_join( $font_family_dir_path, $font_pretty_filename );
Expand Down

0 comments on commit 884cc70

Please sign in to comment.