WPDev.one
Core Class

WP_Font_Utils

class WP_Font_Utils // Constructor: function Object() { [native code] }

A class of utilities for working with the Font Library.

Methods 6 methods

Method / Return Description
maybe_add_quotes()
string

Adds surrounding quotes to font family names that contain special characters.

Parameters: $item: mixed
sanitize_font_family()
string

Sanitizes and formats font family names.

Parameters: $font_family: mixed
get_font_face_slug()
string

Generates a slug from font face properties, e.g. `open sans;normal;400;100%;U+0-10FFFF`

Parameters: $settings: mixed
sanitize_from_schema()
array

Sanitizes a tree of data using a schema.

Parameters: $tree: mixed, $schema: mixed
apply_sanitizer()
mixed

Applies a sanitizer function to a value.

Parameters: $value: mixed, $sanitizer: mixed
get_allowed_font_mime_types()
string[]

Returns the expected mime-type values for font files, depending on PHP version.

Class Information

Since Version
6.5.0
Source File
wp-includes/fonts/class-wp-font-utils.php
Advertisement