Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates google-fonts collection url #60761

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions lib/compat/wordpress-6.6/fonts/fonts.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php
/**
*
* Font Library initialization.
*
* This file contains Font Library init calls.
*
* @package WordPress
* @subpackage Font Library
*/

function gutenberg_override_default_font_collections() {
// Remove the default font collection.
wp_unregister_font_collection( 'google-fonts' );

wp_register_font_collection(
'google-fonts',
array(
'name' => _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 );
1 change: 1 addition & 0 deletions lib/load.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' ) ) {
Expand Down
Loading