Skip to content

Commit

Permalink
remove the filter to override our customization
Browse files Browse the repository at this point in the history
per WordPress/gutenberg#59102 (comment) 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).
  • Loading branch information
jazzsequence committed Feb 16, 2024
1 parent dbe012b commit 53ee45d
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions inc/fonts.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' );

Expand Down

0 comments on commit 53ee45d

Please sign in to comment.