Registers a new font collection in the font library.
Description
See <a href="https://schemas.wp.org/trunk/font-collection.json">https://schemas.wp.org/trunk/font-collection.json</a> for the schema the font collection data must adhere to.
Parameters
$slugstring
Font collection slug. May only contain alphanumeric characters, dashes, and underscores. See sanitize_title().
$argsarray
Font collection data.
$namestring
Required. Name of the font collection shown in the Font Library.
$descriptionstringdefault: empty
Optional. A short descriptive summary of the font collection.
$font_familiesarray|string
Required. Array of font family definitions that are in the collection, or a string containing the path or URL to a JSON file containing the font collection.
$categoriesarraydefault: empty
Optional. Array of categories, each with a name and slug, that are used by the fonts in the collection.
Return
WP_Font_Collection|WP_Error
A font collection if it was registered successfully, or WP_Error object on failure.
Signature, return type and hooks compared across 5 parsed releases.
About this page
Parsed data
Generated from the wordpress-develop 7.1.0 tag, from src/wp-includes/fonts.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.