Created
June 18, 2018 15:08
-
-
Save hostz-frank/90728618d475dba57b29e79b5076e887 to your computer and use it in GitHub Desktop.
Bloom without Google Webfonts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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