From f211d03ae691c2107e0236365a0b8aa7c52304b5 Mon Sep 17 00:00:00 2001 From: Grant Kinney Date: Mon, 15 Apr 2024 16:58:36 -0500 Subject: [PATCH] Updates google-fonts collection url --- lib/compat/wordpress-6.6/fonts/fonts.php | 49 ++++++++++++++++++++++++ lib/load.php | 1 + 2 files changed, 50 insertions(+) create mode 100644 lib/compat/wordpress-6.6/fonts/fonts.php diff --git a/lib/compat/wordpress-6.6/fonts/fonts.php b/lib/compat/wordpress-6.6/fonts/fonts.php new file mode 100644 index 00000000000000..33f8d6dd5a6d44 --- /dev/null +++ b/lib/compat/wordpress-6.6/fonts/fonts.php @@ -0,0 +1,49 @@ + _x( 'Google Fonts', 'font collection name' ), + 'description' => __( 'Install from Google Fonts. Fonts are copied to and served from your site.' ), + 'font_families' => 'https://s.w.org/images/fonts/18.2/collections/google-fonts-with-preview.json', + 'categories' => array( + array( + 'name' => _x( 'Sans Serif', 'font category' ), + 'slug' => 'sans-serif', + ), + array( + 'name' => _x( 'Display', 'font category' ), + 'slug' => 'display', + ), + array( + 'name' => _x( 'Serif', 'font category' ), + 'slug' => 'serif', + ), + array( + 'name' => _x( 'Handwriting', 'font category' ), + 'slug' => 'handwriting', + ), + array( + 'name' => _x( 'Monospace', 'font category' ), + 'slug' => 'monospace', + ), + ), + ) + ); +} + +// Run after default priority to make sure the default font collections are registered. +// add_action( 'init', 'gutenberg_override_default_font_collections', 20 ); diff --git a/lib/load.php b/lib/load.php index ead9a1b9743fb8..da1337d6d1f161 100644 --- a/lib/load.php +++ b/lib/load.php @@ -156,6 +156,7 @@ function gutenberg_is_experiment_enabled( $name ) { require __DIR__ . '/compat/wordpress-6.5/fonts/class-wp-rest-font-faces-controller.php'; require __DIR__ . '/compat/wordpress-6.5/fonts/class-wp-rest-font-collections-controller.php'; require __DIR__ . '/compat/wordpress-6.5/fonts/fonts.php'; +require __DIR__ . '/compat/wordpress-6.6/fonts/fonts.php'; // Load the Font Face and Font Face Resolver, if not already loaded by WordPress Core. if ( ! class_exists( 'WP_Font_Face' ) ) {