Registers a new font collection in the font library.
Description
See https://schemas.wp.org/trunk/font-collection.json for the schema the font collection data must adhere to.
Parameters
$slug
stringrequired- Font collection slug. May only contain alphanumeric characters, dashes, and underscores. See sanitize_title() .
$args
arrayrequired- Font collection data.
name
stringRequired. Name of the font collection shown in the Font Library.description
stringOptional. A short descriptive summary of the font collection. Default empty.font_families
array|stringRequired. 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.categories
arrayOptional. Array of categories, each with a name and slug, that are used by the fonts in the collection. Default empty.
Source
function wp_register_font_collection( string $slug, array $args ) {
return WP_Font_Library::get_instance()->register_font_collection( $slug, $args );
}
Changelog
Version | Description |
---|---|
6.5.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.