apply_filters( 'riff_app_preload_fonts', string[] $urls )

Filters the fonts a Listen page preloads, the faces its first paint shows, so a host that draws the app in fonts of its own has them fetched with the page rather than after the stylesheet asks. The installed app's service worker keeps them on the device too.

Parameters

$urlsstring[]
Font addresses: Roboto in the app at app/, Inter and EB Garamond in the Listen block where the theme sets no font.

More Information

Each is preloaded with crossorigin, as a font must be, so an address on another host needs CORS. Name each exactly as the stylesheet's url() does, or the browser fetches it twice.

Usage

add_filter( 'riff_app_preload_fonts', function ( $urls ) {
	return $urls;
} );

Source

$filtered = apply_filters( 'riff_app_preload_fonts', $urls );

Changelog

VersionDescription
6.6.0Introduced.