Skip to content

Instantly share code, notes, and snippets.

@hostz-frank
Created June 18, 2018 15:08
Show Gist options
  • Save hostz-frank/90728618d475dba57b29e79b5076e887 to your computer and use it in GitHub Desktop.
Save hostz-frank/90728618d475dba57b29e79b5076e887 to your computer and use it in GitHub Desktop.
Bloom without Google Webfonts
<?php
/*
Plugin Name: Bloom without Google webfonts
Description: Remove Bloom fonts loaded from Google
Author: Frank
Version: 0.1
*/
defined( 'ABSPATH' ) || die();
add_action( 'wp_enqueue_scripts', function() {
wp_deregister_style( 'et-gf-open-sans' );
}, 11 );
add_action( 'wp_footer', function() {
if( function_exists( 'et_get_google_fonts' ) ) {
$gfonts = et_get_google_fonts();
foreach( $gfonts as $font => $atts ) {
wp_dequeue_style( 'et-gf-' . strtolower( str_replace( ' ', '-', $font ) ) );
}
}
}, 11 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment