Skip to content

Commit

Permalink
[Fonts API] Make local font asset file URL absolute (#51178)
Browse files Browse the repository at this point in the history
Ensures local font asset file URLs also work in iframes.
  • Loading branch information
hellofromtonya authored and cbravobernal committed Jun 2, 2023
1 parent 083a3df commit 557e939
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions lib/experimental/fonts-api/class-wp-fonts-provider-local.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,6 @@ private function compile_src( array $value ) {
$src = '';

foreach ( $value as $item ) {

if ( str_starts_with( $item['url'], get_site_url() ) ) {
$item['url'] = wp_make_link_relative( $item['url'] );
}

$src .= ( 'data' === $item['format'] )
? ", url({$item['url']})"
: ", url('{$item['url']}') format('{$item['format']}')";
Expand Down

0 comments on commit 557e939

Please sign in to comment.