函数文档

wp_unregister_font_collection()

💡 云策文档标注

概述

wp_unregister_font_collection() 函数用于从 WordPress 字体库中注销一个字体集合。它接受一个字体集合的 slug 作为参数,并返回操作是否成功的布尔值。

关键要点

  • 函数用于注销字体集合,基于字体集合的 slug 参数。
  • 返回布尔值:true 表示注销成功,false 表示失败。
  • 内部调用 WP_Font_Library::get_instance()->unregister_font_collection() 方法实现功能。
  • 此函数在 WordPress 6.5.0 版本中引入。

代码示例

function wp_unregister_font_collection( string $slug ) {
	return WP_Font_Library::get_instance()->unregister_font_collection( $slug );
}

📄 原文内容

Unregisters a font collection from the Font Library.

Parameters

$slugstringrequired
Font collection slug.

Return

bool True if the font collection was unregistered successfully, else false.

Source

function wp_unregister_font_collection( string $slug ) {
	return WP_Font_Library::get_instance()->unregister_font_collection( $slug );
}

Changelog

Version Description
6.5.0 Introduced.