at path:ROOT / wp-includes / fonts.php
run:R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:51
R W Run
23.8 KB
2026-03-11 16:18:51
R W Run
7.8 KB
2026-03-11 16:18:52
R W Run
36.1 KB
2026-03-11 16:18:51
R W Run
11.9 KB
2026-03-11 16:18:52
R W Run
18.94 KB
2026-03-11 16:18:52
R W Run
7.35 KB
2026-03-11 16:18:52
R W Run
28.6 KB
2026-03-11 16:18:51
R W Run
316 By
2026-03-11 16:18:51
R W Run
12.9 KB
2026-03-11 16:18:51
R W Run
61.02 KB
2026-03-11 16:18:52
R W Run
15 KB
2026-03-11 16:18:51
R W Run
112.05 KB
2026-03-11 16:18:51
R W Run
12.47 KB
2026-03-11 16:18:51
R W Run
15.07 KB
2026-03-11 16:18:52
R W Run
9.84 KB
2026-03-11 16:18:52
R W Run
13.17 KB
2026-03-11 16:18:52
R W Run
33.83 KB
2026-03-11 16:18:51
R W Run
42.63 KB
2026-03-11 16:18:51
R W Run
55.71 KB
2026-03-11 16:18:52
R W Run
12.53 KB
2026-03-11 16:18:51
R W Run
2.55 KB
2026-03-11 16:18:52
R W Run
28.92 KB
2026-03-11 16:18:52
R W Run
539 By
2026-03-11 16:18:51
R W Run
367 By
2026-03-11 16:18:52
R W Run
42.65 KB
2026-03-11 16:18:51
R W Run
401 By
2026-03-11 16:18:51
R W Run
6.61 KB
2026-03-11 16:18:51
R W Run
664 By
2026-03-11 16:18:52
R W Run
20.63 KB
2026-03-11 16:18:51
R W Run
2.18 KB
2026-03-11 16:18:52
R W Run
453 By
2026-03-11 16:18:52
R W Run
457 By
2026-03-11 16:18:51
R W Run
36.83 KB
2026-03-11 16:18:52
R W Run
2.41 KB
2026-03-11 16:18:52
R W Run
8.28 KB
2026-03-11 16:18:51
R W Run
13.89 KB
2026-03-11 16:18:51
R W Run
11.76 KB
2026-03-11 16:18:51
R W Run
2.65 KB
2026-03-11 16:18:51
R W Run
7.43 KB
2026-03-11 16:18:51
R W Run
17.46 KB
2026-03-11 16:18:51
R W Run
5.14 KB
2026-03-11 16:18:52
R W Run
16.7 KB
2026-03-11 16:18:51
R W Run
8.28 KB
2026-03-11 16:18:52
R W Run
2.92 KB
2026-03-11 16:18:52
R W Run
1.32 KB
2026-03-11 16:18:51
R W Run
4.6 KB
2026-03-11 16:18:52
R W Run
11.62 KB
2026-03-11 16:18:52
R W Run
2.5 KB
2026-03-11 16:18:51
R W Run
1.97 KB
2026-03-11 16:18:51
R W Run
11.25 KB
2026-03-11 16:18:52
R W Run
5.32 KB
2026-03-11 16:18:51
R W Run
10.99 KB
2026-03-11 16:18:52
R W Run
68.32 KB
2026-03-11 16:18:51
R W Run
6.34 KB
2026-03-11 16:18:51
R W Run
5.49 KB
2026-03-11 16:18:51
R W Run
1.99 KB
2026-03-11 16:18:52
R W Run
7.02 KB
2026-03-11 16:18:51
R W Run
4.91 KB
2026-03-11 16:18:52
R W Run
16.86 KB
2026-03-11 16:18:51
R W Run
24.23 KB
2026-03-11 16:18:51
R W Run
3.97 KB
2026-03-11 16:18:51
R W Run
47.66 KB
2026-03-11 16:18:51
R W Run
9.22 KB
2026-03-11 16:18:51
R W Run
25.51 KB
2026-03-11 16:18:51
R W Run
198.38 KB
2026-03-11 16:18:52
R W Run
56.65 KB
2026-03-11 16:18:51
R W Run
10.46 KB
2026-03-11 16:18:51
R W Run
10.95 KB
2026-03-11 16:18:52
R W Run
29.26 KB
2026-03-11 16:18:51
R W Run
70.91 KB
2026-03-11 16:18:52
R W Run
35.3 KB
2026-03-11 16:18:52
R W Run
16.61 KB
2026-03-11 16:18:52
R W Run
2.57 KB
2026-03-11 16:18:52
R W Run
39.83 KB
2026-03-11 16:18:51
R W Run
70.64 KB
2026-03-11 16:18:51
R W Run
15.56 KB
2026-03-11 16:18:52
R W Run
7.33 KB
2026-03-11 16:18:52
R W Run
253 By
2026-03-11 16:18:51
R W Run
7.96 KB
2026-03-11 16:18:52
R W Run
3.23 KB
2026-03-11 16:18:52
R W Run
969 By
2026-03-11 16:18:52
R W Run
16.28 KB
2026-03-11 16:18:51
R W Run
7.22 KB
2026-03-11 16:18:51
R W Run
12.95 KB
2026-03-11 16:18:51
R W Run
6.53 KB
2026-03-11 16:18:51
R W Run
3.42 KB
2026-03-11 16:18:52
R W Run
5.84 KB
2026-03-11 16:18:51
R W Run
1.97 KB
2026-03-11 16:18:51
R W Run
4.3 KB
2026-03-11 16:18:52
R W Run
2.91 KB
2026-03-11 16:18:51
R W Run
16.46 KB
2026-03-11 16:18:52
R W Run
40.6 KB
2026-03-11 16:18:51
R W Run
20.22 KB
2026-03-11 16:18:51
R W Run
36.11 KB
2026-03-11 16:18:52
R W Run
17.01 KB
2026-03-11 16:18:51
R W Run
7.27 KB
2026-03-11 16:18:52
R W Run
6.62 KB
2026-03-11 16:18:52
R W Run
16.49 KB
2026-03-11 16:18:52
R W Run
1.79 KB
2026-03-11 16:18:52
R W Run
29.82 KB
2026-03-11 16:18:51
R W Run
6.67 KB
2026-03-11 16:18:52
R W Run
8.98 KB
2026-03-11 16:18:52
R W Run
19.42 KB
2026-03-11 16:18:51
R W Run
12.01 KB
2026-03-11 16:18:51
R W Run
17.11 KB
2026-03-11 16:18:51
R W Run
6.74 KB
2026-03-11 16:18:52
R W Run
30.93 KB
2026-03-11 16:18:51
R W Run
4.99 KB
2026-03-11 16:18:51
R W Run
4.25 KB
2026-03-11 16:18:51
R W Run
24.72 KB
2026-03-11 16:18:51
R W Run
29.96 KB
2026-03-11 16:18:52
R W Run
6.41 KB
2026-03-11 16:18:51
R W Run
160 KB
2026-03-11 16:18:51
R W Run
6.72 KB
2026-03-11 16:18:52
R W Run
10.92 KB
2026-03-11 16:18:51
R W Run
4.77 KB
2026-03-11 16:18:51
R W Run
3.38 KB
2026-03-11 16:18:51
R W Run
11.18 KB
2026-03-11 16:18:51
R W Run
62.19 KB
2026-03-11 16:18:51
R W Run
2.46 KB
2026-03-11 16:18:51
R W Run
9.17 KB
2026-03-11 16:18:51
R W Run
32.15 KB
2026-03-11 16:18:51
R W Run
34.05 KB
2026-03-11 16:18:52
R W Run
7.15 KB
2026-03-11 16:18:51
R W Run
3.47 KB
2026-03-11 16:18:52
R W Run
1.87 KB
2026-03-11 16:18:52
R W Run
30.91 KB
2026-03-11 16:18:51
R W Run
7.29 KB
2026-03-11 16:18:52
R W Run
7.35 KB
2026-03-11 16:18:51
R W Run
12.54 KB
2026-03-11 16:18:51
R W Run
19.12 KB
2026-03-11 16:18:51
R W Run
18.12 KB
2026-03-11 16:18:52
R W Run
39.99 KB
2026-03-11 16:18:52
R W Run
5.17 KB
2026-03-11 16:18:52
R W Run
979 By
2026-03-11 16:18:51
R W Run
18.44 KB
2026-03-11 16:18:52
R W Run
10.24 KB
2026-03-11 16:18:51
R W Run
1.77 KB
2026-03-11 16:18:52
R W Run
34.9 KB
2026-03-11 16:18:51
R W Run
7.19 KB
2026-03-11 16:18:52
R W Run
160.5 KB
2026-03-11 16:18:51
R W Run
64.27 KB
2026-03-11 16:18:51
R W Run
27.95 KB
2026-03-11 16:18:51
R W Run
4.69 KB
2026-03-11 16:18:51
R W Run
2.94 KB
2026-03-11 16:18:51
R W Run
43.13 KB
2026-03-11 16:18:52
R W Run
2.25 KB
2026-03-11 16:18:52
R W Run
22.5 KB
2026-03-11 16:18:51
R W Run
13.01 KB
2026-03-11 16:18:52
R W Run
3.27 KB
2026-03-11 16:18:51
R W Run
18 KB
2026-03-11 16:18:51
R W Run
210.4 KB
2026-03-11 16:18:52
R W Run
25.86 KB
2026-03-11 16:18:52
R W Run
115.85 KB
2026-03-11 16:18:51
R W Run
373 By
2026-03-11 16:18:52
R W Run
343 By
2026-03-11 16:18:52
R W Run
338 By
2026-03-11 16:18:51
R W Run
100.73 KB
2026-03-11 16:18:52
R W Run
130.93 KB
2026-03-11 16:18:51
R W Run
19.1 KB
2026-03-11 16:18:51
R W Run
17.41 KB
2026-03-11 16:18:52
R W Run
41.98 KB
2026-03-11 16:18:52
R W Run
400 By
2026-03-11 16:18:52
R W Run
11.1 KB
2026-03-11 16:18:52
R W Run
37.02 KB
2026-03-11 16:18:51
R W Run
2.24 KB
2026-03-11 16:18:51
R W Run
188.13 KB
2026-03-11 16:18:51
R W Run
338 By
2026-03-11 16:18:51
R W Run
38 KB
2026-03-11 16:18:51
R W Run
4.02 KB
2026-03-11 16:18:52
R W Run
5.38 KB
2026-03-11 16:18:51
R W Run
3.05 KB
2026-03-11 16:18:52
R W Run
2.61 KB
2026-03-11 16:18:51
R W Run
1.16 KB
2026-03-11 16:18:52
R W Run
4.04 KB
2026-03-11 16:18:51
R W Run
3.71 KB
2026-03-11 16:18:51
R W Run
24.6 KB
2026-03-11 16:18:51
R W Run
9.56 KB
2026-03-11 16:18:51
R W Run
346.43 KB
2026-03-11 16:18:52
R W Run
281.84 KB
2026-03-11 16:18:52
R W Run
14.95 KB
2026-03-11 16:18:51
R W Run
8.44 KB
2026-03-11 16:18:52
R W Run
168.95 KB
2026-03-11 16:18:52
R W Run
20.71 KB
2026-03-11 16:18:52
R W Run
25.27 KB
2026-03-11 16:18:51
R W Run
5.72 KB
2026-03-11 16:18:51
R W Run
4.63 KB
2026-03-11 16:18:52
R W Run
81.73 KB
2026-03-11 16:18:51
R W Run
67.18 KB
2026-03-11 16:18:51
R W Run
156.36 KB
2026-03-11 16:18:52
R W Run
55.19 KB
2026-03-11 16:18:51
R W Run
162 By
2026-03-11 16:18:51
R W Run
61.72 KB
2026-03-11 16:18:51
R W Run
216.06 KB
2026-03-11 16:18:52
R W Run
65.09 KB
2026-03-11 16:18:51
R W Run
25.24 KB
2026-03-11 16:18:52
R W Run
4.81 KB
2026-03-11 16:18:51
R W Run
6.48 KB
2026-03-11 16:18:52
R W Run
21.25 KB
2026-03-11 16:18:51
R W Run
2.79 KB
2026-03-11 16:18:52
R W Run
89.69 KB
2026-03-11 16:18:52
R W Run
19.42 KB
2026-03-11 16:18:52
R W Run
3.69 KB
2026-03-11 16:18:52
R W Run
4.11 KB
2026-03-11 16:18:51
R W Run
40.74 KB
2026-03-11 16:18:51
R W Run
25.38 KB
2026-03-11 16:18:51
R W Run
43.31 KB
2026-03-11 16:18:52
R W Run
102.57 KB
2026-03-11 16:18:52
R W Run
6.18 KB
2026-03-11 16:18:51
R W Run
124.47 KB
2026-03-11 16:18:52
R W Run
35.65 KB
2026-03-11 16:18:52
R W Run
6.94 KB
2026-03-11 16:18:52
R W Run
67.04 KB
2026-03-11 16:18:52
R W Run
10.62 KB
2026-03-11 16:18:51
R W Run
289.35 KB
2026-03-11 16:18:52
R W Run
36.23 KB
2026-03-11 16:18:51
R W Run
200 By
2026-03-11 16:18:52
R W Run
200 By
2026-03-11 16:18:52
R W Run
98.29 KB
2026-03-11 16:18:52
R W Run
30.02 KB
2026-03-11 16:18:52
R W Run
19.03 KB
2026-03-11 16:18:52
R W Run
5.06 KB
2026-03-11 16:18:52
R W Run
255 By
2026-03-11 16:18:51
R W Run
22.66 KB
2026-03-11 16:18:52
R W Run
154.63 KB
2026-03-11 16:18:51
R W Run
9.68 KB
2026-03-11 16:18:51
R W Run
258 By
2026-03-11 16:18:51
R W Run
23.49 KB
2026-03-11 16:18:51
R W Run
3.16 KB
2026-03-11 16:18:51
R W Run
8.4 KB
2026-03-11 16:18:52
R W Run
441 By
2026-03-11 16:18:51
R W Run
7.39 KB
2026-03-11 16:18:51
R W Run
173 KB
2026-03-11 16:18:52
R W Run
544 By
2026-03-11 16:18:52
R W Run
4.17 KB
2026-03-11 16:18:51
R W Run
35.97 KB
2026-03-11 16:18:52
R W Run
1.69 KB
2026-03-11 16:18:51
R W Run
2.84 KB
2026-03-11 16:18:52
R W Run
6.09 KB
2026-03-11 16:18:51
R W Run
8.71 KB
2026-03-11 16:18:51
R W Run
131.84 KB
2026-03-11 16:18:51
R W Run
37.45 KB
2026-03-11 16:18:51
R W Run
173.89 KB
2026-03-11 16:18:51
R W Run
7.09 KB
2026-03-11 16:18:51
R W Run
6.41 KB
2026-03-11 16:18:51
R W Run
1.08 KB
2026-03-11 16:18:51
R W Run
69.46 KB
2026-03-11 16:18:52
R W Run
445 By
2026-03-11 16:18:51
R W Run
799 By
2026-03-11 16:18:52
R W Run
error_log
📄fonts.php
1<?php
2/**
3 * Fonts functions.
4 *
5 * @package WordPress
6 * @subpackage Fonts
7 * @since 6.4.0
8 */
9
10/**
11 * Generates and prints font-face styles for given fonts or theme.json fonts.
12 *
13 * @since 6.4.0
14 *
15 * @param array[][] $fonts {
16 * Optional. The font-families and their font faces. Default empty array.
17 *
18 * @type array ...$0 {
19 * An indexed or associative (keyed by font-family) array of font variations for this font-family.
20 * Each font face has the following structure.
21 *
22 * @type array ...$0 {
23 * The font face properties.
24 *
25 * @type string $font-family The font-family property.
26 * @type string|string[] $src The URL(s) to each resource containing the font data.
27 * @type string $font-style Optional. The font-style property. Default 'normal'.
28 * @type string $font-weight Optional. The font-weight property. Default '400'.
29 * @type string $font-display Optional. The font-display property. Default 'fallback'.
30 * @type string $ascent-override Optional. The ascent-override property.
31 * @type string $descent-override Optional. The descent-override property.
32 * @type string $font-stretch Optional. The font-stretch property.
33 * @type string $font-variant Optional. The font-variant property.
34 * @type string $font-feature-settings Optional. The font-feature-settings property.
35 * @type string $font-variation-settings Optional. The font-variation-settings property.
36 * @type string $line-gap-override Optional. The line-gap-override property.
37 * @type string $size-adjust Optional. The size-adjust property.
38 * @type string $unicode-range Optional. The unicode-range property.
39 * }
40 * }
41 * }
42 */
43function wp_print_font_faces( $fonts = array() ) {
44
45 if ( empty( $fonts ) ) {
46 $fonts = WP_Font_Face_Resolver::get_fonts_from_theme_json();
47 }
48
49 if ( empty( $fonts ) ) {
50 return;
51 }
52
53 $wp_font_face = new WP_Font_Face();
54 $wp_font_face->generate_and_print( $fonts );
55}
56
57/**
58 * Generates and prints font-face styles defined the the theme style variations.
59 *
60 * @since 6.7.0
61 *
62 */
63function wp_print_font_faces_from_style_variations() {
64 $fonts = WP_Font_Face_Resolver::get_fonts_from_style_variations();
65
66 if ( empty( $fonts ) ) {
67 return;
68 }
69
70 wp_print_font_faces( $fonts );
71}
72
73/**
74 * Registers a new font collection in the font library.
75 *
76 * See {@link https://schemas.wp.org/trunk/font-collection.json} for the schema
77 * the font collection data must adhere to.
78 *
79 * @since 6.5.0
80 *
81 * @param string $slug Font collection slug. May only contain alphanumeric characters, dashes,
82 * and underscores. See sanitize_title().
83 * @param array $args {
84 * Font collection data.
85 *
86 * @type string $name Required. Name of the font collection shown in the Font Library.
87 * @type string $description Optional. A short descriptive summary of the font collection. Default empty.
88 * @type array|string $font_families Required. Array of font family definitions that are in the collection,
89 * or a string containing the path or URL to a JSON file containing the font collection.
90 * @type array $categories Optional. Array of categories, each with a name and slug, that are used by the
91 * fonts in the collection. Default empty.
92 * }
93 * @return WP_Font_Collection|WP_Error A font collection if it was registered
94 * successfully, or WP_Error object on failure.
95 */
96function wp_register_font_collection( string $slug, array $args ) {
97 return WP_Font_Library::get_instance()->register_font_collection( $slug, $args );
98}
99
100/**
101 * Unregisters a font collection from the Font Library.
102 *
103 * @since 6.5.0
104 *
105 * @param string $slug Font collection slug.
106 * @return bool True if the font collection was unregistered successfully, else false.
107 */
108function wp_unregister_font_collection( string $slug ) {
109 return WP_Font_Library::get_instance()->unregister_font_collection( $slug );
110}
111
112/**
113 * Retrieves font uploads directory information.
114 *
115 * Same as wp_font_dir() but "light weight" as it doesn't attempt to create the font uploads directory.
116 * Intended for use in themes, when only 'basedir' and 'baseurl' are needed, generally in all cases
117 * when not uploading files.
118 *
119 * @since 6.5.0
120 *
121 * @see wp_font_dir()
122 *
123 * @return array See wp_font_dir() for description.
124 */
125function wp_get_font_dir() {
126 return wp_font_dir( false );
127}
128
129/**
130 * Returns an array containing the current fonts upload directory's path and URL.
131 *
132 * @since 6.5.0
133 *
134 * @param bool $create_dir Optional. Whether to check and create the font uploads directory. Default true.
135 * @return array {
136 * Array of information about the font upload directory.
137 *
138 * @type string $path Base directory and subdirectory or full path to the fonts upload directory.
139 * @type string $url Base URL and subdirectory or absolute URL to the fonts upload directory.
140 * @type string $subdir Subdirectory
141 * @type string $basedir Path without subdir.
142 * @type string $baseurl URL path without subdir.
143 * @type string|false $error False or error message.
144 * }
145 */
146function wp_font_dir( $create_dir = true ) {
147 /*
148 * Allow extenders to manipulate the font directory consistently.
149 *
150 * Ensures the upload_dir filter is fired both when calling this function
151 * directly and when the upload directory is filtered in the Font Face
152 * REST API endpoint.
153 */
154 add_filter( 'upload_dir', '_wp_filter_font_directory' );
155 $font_dir = wp_upload_dir( null, $create_dir, false );
156 remove_filter( 'upload_dir', '_wp_filter_font_directory' );
157 return $font_dir;
158}
159
160/**
161 * A callback function for use in the {@see 'upload_dir'} filter.
162 *
163 * This function is intended for internal use only and should not be used by plugins and themes.
164 * Use wp_get_font_dir() instead.
165 *
166 * @since 6.5.0
167 * @access private
168 *
169 * @param string $font_dir The font directory.
170 * @return string The modified font directory.
171 */
172function _wp_filter_font_directory( $font_dir ) {
173 if ( doing_filter( 'font_dir' ) ) {
174 // Avoid an infinite loop.
175 return $font_dir;
176 }
177
178 $font_dir = array(
179 'path' => untrailingslashit( $font_dir['basedir'] ) . '/fonts',
180 'url' => untrailingslashit( $font_dir['baseurl'] ) . '/fonts',
181 'subdir' => '',
182 'basedir' => untrailingslashit( $font_dir['basedir'] ) . '/fonts',
183 'baseurl' => untrailingslashit( $font_dir['baseurl'] ) . '/fonts',
184 'error' => false,
185 );
186
187 /**
188 * Filters the fonts directory data.
189 *
190 * This filter allows developers to modify the fonts directory data.
191 *
192 * @since 6.5.0
193 *
194 * @param array $font_dir {
195 * Array of information about the font upload directory.
196 *
197 * @type string $path Base directory and subdirectory or full path to the fonts upload directory.
198 * @type string $url Base URL and subdirectory or absolute URL to the fonts upload directory.
199 * @type string $subdir Subdirectory
200 * @type string $basedir Path without subdir.
201 * @type string $baseurl URL path without subdir.
202 * @type string|false $error False or error message.
203 * }
204 */
205 return apply_filters( 'font_dir', $font_dir );
206}
207
208/**
209 * Deletes child font faces when a font family is deleted.
210 *
211 * @access private
212 * @since 6.5.0
213 *
214 * @param int $post_id Post ID.
215 * @param WP_Post $post Post object.
216 */
217function _wp_after_delete_font_family( $post_id, $post ) {
218 if ( 'wp_font_family' !== $post->post_type ) {
219 return;
220 }
221
222 $font_faces_ids = get_children(
223 array(
224 'post_parent' => $post_id,
225 'post_type' => 'wp_font_face',
226 'fields' => 'ids',
227 )
228 );
229
230 foreach ( $font_faces_ids as $font_faces_id ) {
231 wp_delete_post( $font_faces_id, true );
232 }
233}
234
235/**
236 * Deletes associated font files when a font face is deleted.
237 *
238 * @access private
239 * @since 6.5.0
240 *
241 * @param int $post_id Post ID.
242 * @param WP_Post $post Post object.
243 */
244function _wp_before_delete_font_face( $post_id, $post ) {
245 if ( 'wp_font_face' !== $post->post_type ) {
246 return;
247 }
248
249 $font_files = get_post_meta( $post_id, '_wp_font_face_file', false );
250 $font_dir = untrailingslashit( wp_get_font_dir()['basedir'] );
251
252 foreach ( $font_files as $font_file ) {
253 wp_delete_file( $font_dir . '/' . $font_file );
254 }
255}
256
257/**
258 * Register the default font collections.
259 *
260 * @access private
261 * @since 6.5.0
262 */
263function _wp_register_default_font_collections() {
264 wp_register_font_collection(
265 'google-fonts',
266 array(
267 'name' => _x( 'Google Fonts', 'font collection name' ),
268 'description' => __( 'Install from Google Fonts. Fonts are copied to and served from your site.' ),
269 'font_families' => 'https://s.w.org/images/fonts/wp-6.9/collections/google-fonts-with-preview.json',
270 'categories' => array(
271 array(
272 'name' => _x( 'Sans Serif', 'font category' ),
273 'slug' => 'sans-serif',
274 ),
275 array(
276 'name' => _x( 'Display', 'font category' ),
277 'slug' => 'display',
278 ),
279 array(
280 'name' => _x( 'Serif', 'font category' ),
281 'slug' => 'serif',
282 ),
283 array(
284 'name' => _x( 'Handwriting', 'font category' ),
285 'slug' => 'handwriting',
286 ),
287 array(
288 'name' => _x( 'Monospace', 'font category' ),
289 'slug' => 'monospace',
290 ),
291 ),
292 )
293 );
294}
295