WP_Font_Library::unregister_font_collectionpublicWP 6.5.0

Unregisters a previously registered font collection.

Method of the class: WP_Font_Library{}

No Hooks.

Returns

true|false. True if the font collection was unregistered successfully and false otherwise.

Usage

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

Changelog

Since 6.5.0 Introduced.

WP_Font_Library::unregister_font_collection() code WP 6.8.1

public function unregister_font_collection( string $slug ) {
	if ( ! $this->is_collection_registered( $slug ) ) {
		_doing_it_wrong(
			__METHOD__,
			/* translators: %s: Font collection slug. */
			sprintf( __( 'Font collection "%s" not found.' ), $slug ),
			'6.5.0'
		);
		return false;
	}
	unset( $this->collections[ $slug ] );
	return true;
}