Skip to content

Commit

Permalink
Add download for google font version 1
Browse files Browse the repository at this point in the history
  • Loading branch information
Khadreal committed Nov 4, 2024
1 parent d6f493e commit 18a0513
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion inc/Engine/Optimization/GoogleFonts/Combine.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,19 @@ public function optimize( $html ): string {
return $html;
}

$html = preg_replace( '@<\/title>@i', '$0' . $this->get_optimized_markup( $this->get_combined_url() ), $html, 1 );
$version = 1;
$font_url = $this->get_combined_url();

$html = preg_replace( '@<\/title>@i', '$0' . $this->get_optimized_markup( $font_url ), $html, 1 );

/**
* Filter v1 google fonts that will be stored locally.
*
* @param string $font_url The combined url of the fonts
* @param string $provider The fonts provider
* @param integer $version The version of Google fonts api
*/
wpm_apply_filters_typed( 'null', 'rocket_host_google_fonts', $font_url, 'google-font', $version );

foreach ( $fonts as $font ) {
$html = str_replace( $font[0], '', $html );
Expand Down

0 comments on commit 18a0513

Please sign in to comment.