diff --git a/lib/experimental/fonts/font-library/font-library.php b/lib/experimental/fonts/font-library/font-library.php index e9744da5958f4c..0bf9374f9f9454 100644 --- a/lib/experimental/fonts/font-library/font-library.php +++ b/lib/experimental/fonts/font-library/font-library.php @@ -132,14 +132,14 @@ function wp_unregister_font_collection( $collection_id ) { } -$default_font_collection = array( - 'slug' => 'default-font-collection', +$google_fonts = array( + 'slug' => 'google-fonts', 'name' => 'Google Fonts', 'description' => __( 'Add from Google Fonts. Fonts are copied to and served from your site.', 'gutenberg' ), 'src' => 'https://s.w.org/images/fonts/17.6/collections/google-fonts-with-preview.json', ); -wp_register_font_collection( $default_font_collection ); +wp_register_font_collection( $google_fonts ); // @core-merge: This code should probably go into Core's src/wp-includes/functions.php. if ( ! function_exists( 'wp_get_font_dir' ) ) { diff --git a/packages/edit-site/src/components/global-styles/font-library-modal/font-collection.js b/packages/edit-site/src/components/global-styles/font-library-modal/font-collection.js index 2ee59b4ad5fd05..2ff6df30473632 100644 --- a/packages/edit-site/src/components/global-styles/font-library-modal/font-collection.js +++ b/packages/edit-site/src/components/global-styles/font-library-modal/font-collection.js @@ -36,12 +36,12 @@ const DEFAULT_CATEGORY = { name: __( 'All' ), }; function FontCollection( { slug } ) { - const requiresPermission = slug === 'default-font-collection'; + const requiresPermission = slug === 'google-fonts'; const getGoogleFontsPermissionFromStorage = () => { return ( window.localStorage.getItem( - 'wp-font-library-default-font-collection-permission' + 'wp-font-library-google-fonts-permission' ) === 'true' ); }; diff --git a/packages/edit-site/src/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js b/packages/edit-site/src/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js index cb10ec89c4fc7a..8d7954c54dbcce 100644 --- a/packages/edit-site/src/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +++ b/packages/edit-site/src/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js @@ -14,7 +14,7 @@ function GoogleFontsConfirmDialog() { const handleConfirm = () => { // eslint-disable-next-line no-undef window.localStorage.setItem( - 'wp-font-library-default-font-collection-permission', + 'wp-font-library-google-fonts-permission', 'true' ); window.dispatchEvent( new Event( 'storage' ) ); diff --git a/packages/edit-site/src/components/global-styles/font-library-modal/index.js b/packages/edit-site/src/components/global-styles/font-library-modal/index.js index c2c2d05e0c15b1..71966449eb616d 100644 --- a/packages/edit-site/src/components/global-styles/font-library-modal/index.js +++ b/packages/edit-site/src/components/global-styles/font-library-modal/index.js @@ -34,7 +34,7 @@ const tabsFromCollections = ( collections ) => collections.map( ( { slug, name } ) => ( { id: slug, title: - collections.length === 1 && slug === 'default-font-collection' + collections.length === 1 && slug === 'google-fonts' ? __( 'Install Fonts' ) : name, } ) );