Skip to content
Merged
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
6 changes: 0 additions & 6 deletions lib/experimental/fonts/font-library/font-library.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,6 @@ function wp_register_font_collection( $config ) {
}
}

add_action(
'enqueue_block_editor_assets',
function () {
wp_add_inline_script( 'wp-block-editor', 'window.__experimentalFontLibrary = true', 'before' );
}
);

$default_font_collection = array(
'id' => 'default-font-collection',
Expand Down
10 changes: 10 additions & 0 deletions lib/load.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,16 @@ function gutenberg_is_experiment_enabled( $name ) {
require __DIR__ . '/experimental/fonts/font-face/bc-layer/class-wp-webfonts.php';
require __DIR__ . '/experimental/fonts/font-face/bc-layer/class-wp-web-fonts.php';
} elseif ( ! class_exists( 'WP_Fonts' ) ) {

// Disables the Font Library.
// @core-merge: this should not go to core.
add_action(
'enqueue_block_editor_assets',
function () {
wp_add_inline_script( 'wp-block-editor', 'window.__experimentalDisableFontLibrary = true', 'before' );
}
);

// Turns off Font Face hooks in Core.
// @since 6.4.0.
remove_action( 'wp_head', 'wp_print_font_faces', 50 );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ function ScreenTypography() {
/>
<div className="edit-site-global-styles-screen-typography">
<VStack spacing={ 6 }>
{ window.__experimentalFontLibrary && <FontFamilies /> }
{ ! window.__experimentalDisableFontLibrary && (
<FontFamilies />
) }
<TypographyElements />
</VStack>
</div>
Expand Down