From 53ee45d8d7afb8cd4a2a9755d07bd74468dc48b3 Mon Sep 17 00:00:00 2001 From: Chris Reynolds Date: Fri, 16 Feb 2024 13:41:43 -0700 Subject: [PATCH] remove the filter to override our customization per https://github.com/WordPress/gutenberg/issues/59102#issuecomment-1948436852 it seems like fonts are more likely to be treated like media files, in which case it would be undesirable to commit them to the repository, so we're removing our override. our behavior can still be overridden by removing or changing the font_dir filter at a priority higher than 9 (default is 10). --- inc/fonts.php | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/inc/fonts.php b/inc/fonts.php index c029f69..ba28f0d 100644 --- a/inc/fonts.php +++ b/inc/fonts.php @@ -21,21 +21,8 @@ * Kick off our customizations to the WP_Font_Library. */ function bootstrap() { - /** - * Modify the fonts directory. - * - * By default, this is set to true, so we can override the default fonts directory from wp-content/fonts to wp-content/uploads/fonts. - * - * Use the filter to set to false and use the default WordPress behavior (committing fonts to your repository and pushing from dev -> test -> live). - * - * @param bool $modify_fonts_dir Whether to modify the fonts directory. - */ - $modify_fonts_dir = apply_filters( 'pantheon_modify_fonts_dir', true ); - - if ( $modify_fonts_dir ) { - // Use the new font_dir filter added in WordPress 6.5. See https://github.com/WordPress/gutenberg/pull/57697. - add_filter( 'font_dir', __NAMESPACE__ . '\\pantheon_font_dir', 9 ); - } + // Use the new font_dir filter added in WordPress 6.5. See https://github.com/WordPress/gutenberg/pull/57697. + add_filter( 'font_dir', __NAMESPACE__ . '\\pantheon_font_dir', 9 ); } add_action( 'init', __NAMESPACE__ . '\\bootstrap' );