Editor: Fix font paths in iframed editor.

By making font asset files URLs absolute instead of relative, this ensures each font asset file does properly relate to the actual location of the files.

See https://github.com/WordPress/gutenberg/pull/50875.

Props ironprogrammer, antonvlasenko, ndiego, shuvo247, robinwpdeveloper.
Fixes #58672.




git-svn-id: https://develop.svn.wordpress.org/trunk@56139 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jb Audras 2023-07-05 12:32:52 +00:00
parent 80494d2e8a
commit 6e1f9dfbcd

View File

@ -3525,14 +3525,6 @@ function _wp_theme_json_webfonts_handler() {
$src = '';
foreach ( $value as $item ) {
if (
str_starts_with( $item['url'], site_url() ) ||
str_starts_with( $item['url'], home_url() )
) {
$item['url'] = wp_make_link_relative( $item['url'] );
}
$src .= ( 'data' === $item['format'] )
? ", url({$item['url']})"
: ", url('{$item['url']}') format('{$item['format']}')";