WP_Font_Library::unregister_font_collection()publicWP 6.5.0

Unregisters a previously registered font collection.

Метод класса: WP_Font_Library{}

Хуков нет.

Возвращает

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

Использование

$WP_Font_Library = new WP_Font_Library();
$WP_Font_Library->unregister_font_collection( $slug );
$slug(строка) (обязательный)
Font collection slug.

Список изменений

С версии 6.5.0 Введена.

Код WP_Font_Library::unregister_font_collection() WP 6.7.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;
}