Skip to content

Commit

Permalink
refactor missing array cast
Browse files Browse the repository at this point in the history
  • Loading branch information
vcanales committed Jun 4, 2024
1 parent ca60fbd commit 2b409f8
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions includes/create-theme/theme-fonts.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,7 @@ public static function copy_activated_fonts_to_theme() {
foreach ( $font_family['fontFace'] as &$font_face ) {
// src can be a string or an array
// if it is a string, cast it to an array
if ( ! is_array( $font_face['src'] ) ) {
$font_face['src'] = array( $font_face['src'] );
}
$font_face['src'] = (array) $font_face['src'];
foreach ( $font_face['src'] as $font_src_index => &$font_src ) {
$font_filename = basename( $font_src );
$font_dir = wp_get_font_dir();
Expand Down

0 comments on commit 2b409f8

Please sign in to comment.