WP_Font_Face::compile_src( array $value ): string

In this article

This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

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

VersionDescription
6.4.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.