W3cubDocs

/WordPress

WP_Font_Face::compile_src( array $value ): string

Compiles the src into valid CSS.

Parameters

$valuearrayrequired
Value to process.

Return

string The CSS.

Source

private function compile_src( array $value ) {
	$src = '';

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

	$src = ltrim( $src, ', ' );
	return $src;
}

Changelog

Version Description
6.4.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_font_face/compile_src