W3cubDocs

/WordPress

WP_Font_Library::get_font_collection( string $slug ): WP_Font_Collection|null

Gets a font collection.

Parameters

$slugstringrequired
Font collection slug.

Return

WP_Font_Collection|null Font collection object, or null if the font collection doesn’t exist.

Source

public function get_font_collection( string $slug ) {
	if ( $this->is_collection_registered( $slug ) ) {
		return $this->collections[ $slug ];
	}
	return null;
}

Changelog

Version Description
6.5.0 Introduced.

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