Skip to content

Commit

Permalink
check if the file exists first
Browse files Browse the repository at this point in the history
  • Loading branch information
jazzsequence committed Feb 6, 2024
1 parent 26f03b9 commit 6ea1258
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/phpunit/test-fonts.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,9 @@ public function test_disable_pantheon_font_dir_mods() {
* Get the font library from Gutenberg if it's not available.
*/
private function maybe_get_font_library() {
if ( ! function_exists( 'wp_get_font_dir' ) ) {
require_once WP_PLUGIN_DIR . '/gutenberg/lib/compat/wordpress-6.5/fonts/fonts.php';
$fonts_php = WP_PLUGIN_DIR . '/gutenberg/lib/compat/wordpress-6.5/fonts/fonts.php';
if ( ! function_exists( 'wp_get_font_dir' ) && file_exists( $fonts_php ) ) {
require_once $fonts_php;
}
}
}

0 comments on commit 6ea1258

Please sign in to comment.