$variant ) { $prefix = 'n'; $sufix = '4'; $value = strtolower( trim( $variant ) ); $value = str_replace( ' ', '', $variant ); if ( is_numeric( $value ) && isset( $value[0] ) ) { $sufix = $value[0]; $prefix = 'n'; } if ( preg_match( '#italic#', $value ) ) { if ( 'italic' === $value ) { $sufix = 4; $prefix = 'i'; } else { $value = trim( str_replace( 'italic', '', $value ) ); if ( is_numeric( $value ) && isset( $value[0] ) ) { $sufix = $value[0]; $prefix = 'i'; } } } if ( preg_match( '#regular|normal#', $value ) ) { if ( 'regular' === $value ) { $sufix = 4; $prefix = 'n'; } else { $value = trim( str_replace( array( 'regular', 'normal' ), '', $value ) ); if ( is_numeric( $value ) && isset( $value[0] ) ) { $sufix = $value[0]; $prefix = 'n'; } } } $variants[ $variant_key ] = "{$prefix}{$sufix}"; } $font_data = array( $variants, $font['category'], ); self::$google_fonts[ $font['family'] ] = $font_data; } } return apply_filters( 'kemet_google_fonts', self::$google_fonts ); } } endif;