Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save generatepress/2bb2667c9413e29579288687add966de to your computer and use it in GitHub Desktop.
Save generatepress/2bb2667c9413e29579288687add966de to your computer and use it in GitHub Desktop.
Integrate the Custom Fonts (https://wordpress.org/plugins/custom-fonts/) plugin with the GP Customizer.
add_filter( 'generate_typography_default_fonts', function( $fonts ) {
if ( ! class_exists( 'Bsf_Custom_Fonts_Taxonomy' ) ) {
return $fonts;
}
$all_fonts = Bsf_Custom_Fonts_Taxonomy::get_fonts();
if ( ! empty( $all_fonts ) ) {
foreach ( $all_fonts as $font_family_name => $fonts_url ) {
$fonts[] = $font_family_name;
}
}
return $fonts;
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment