Editor: Register the Google Font collection.

By default, users will see a tab in the editor indicating the possibility
to active Google Fonts and install Fonts from there.

Props youknowriad, get_dave, mcsf.
Fixes #59166.
Built from https://develop.svn.wordpress.org/trunk@57558


git-svn-id: http://core.svn.wordpress.org/trunk@57059 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
youknowriad 2024-02-08 07:38:19 +00:00
parent 812c9ad3da
commit 58b0d3f71f
3 changed files with 12 additions and 1 deletions

View File

@ -750,5 +750,6 @@ add_action( 'wp_restore_post_revision', 'wp_restore_post_revision_meta', 10, 2 )
add_action( 'wp_head', 'wp_print_font_faces', 50 );
add_action( 'deleted_post', '_wp_after_delete_font_family', 10, 2 );
add_action( 'before_delete_post', '_wp_before_delete_font_face', 10, 2 );
add_action( 'init', '_wp_register_default_font_collections' );
unset( $filter, $action );

View File

@ -188,3 +188,13 @@ function _wp_before_delete_font_face( $post_id, $post ) {
wp_delete_file( $font_dir . '/' . $font_file );
}
}
/**
* Register the default font collections.
*
* @access private
* @since 6.5.0
*/
function _wp_register_default_font_collections() {
wp_register_font_collection( 'google-fonts', 'https://s.w.org/images/fonts/17.7/collections/google-fonts-with-preview.json' );
}

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.5-alpha-57557';
$wp_version = '6.5-alpha-57558';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.