WP_Font_Library::get_font_collectionpublicWP 6.5.0

Gets a font collection.

Method of the class: WP_Font_Library{}

No Hooks.

Returns

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

Usage

$WP_Font_Library = new WP_Font_Library();
$WP_Font_Library->get_font_collection( $slug );
$slug(string) (required)
Font collection slug.

Changelog

Since 6.5.0 Introduced.

WP_Font_Library::get_font_collection() code WP 6.8.1

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