wp-includes/fonts/class-wp-font-utils.php:60Sanitizes and formats font family names.
$font_familystringstring public static function sanitize_font_family( $font_family ) { if ( ! $font_family ) { return ''; } $output = sanitize_text_field( $font_family ); $formatted_items = array(); if ( str_contains( $output, ',' ) ) { $items = explode( ',', $output ); foreach ( $items as $item ) { $formatted_item = self::maybe_add_quotes( $item ); if ( ! empty( $formatted_item ) ) { $formatted_items[] = $formatted_item; } } return implode( ', ', $formatted_items ); } return self::maybe_add_quotes( $output ); }Introduced in 6.5.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
src/wp-includes/fonts/class-wp-font-utils.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.