Skip to content
This repository was archived by the owner on Feb 17, 2025. It is now read-only.
Merged
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
18 changes: 4 additions & 14 deletions blockbase/inc/fonts/custom-fonts.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,20 +207,10 @@ function enqueue_block_fonts( $content, $parsed_block ) {

/**
* Jetpack may attempt to register fonts for the Google Font Provider.
* This filters out all of the fonts Blockbase has already registered.
* If that happens on a child theme then ONLY Jetpack fonts are registered.
* This 'filter' filters out all of the fonts Jetpack should register
* so that we depend exclusively on those provided by Blockbase.
*/
function blockbase_filter_jetpack_google_fonts_list( $list_to_filter ) {
$font_families = array();
$filtered_list = array();
$fonts = collect_fonts_from_blockbase();
foreach ( $fonts as $font ) {
$font_families[] = $font['name'];
}
foreach ( $list_to_filter as $jetpack_font_family ) {
if ( ! in_array( $jetpack_font_family, $font_families, true ) ) {
$filtered_list[] = $jetpack_font_family;
}
}
return $filtered_list;
return array();
}