Skip to content

Instantly share code, notes, and snippets.

@hostz-frank
Created June 18, 2018 15:08
Show Gist options
  • Select an option

  • Save hostz-frank/90728618d475dba57b29e79b5076e887 to your computer and use it in GitHub Desktop.

Select an option

Save hostz-frank/90728618d475dba57b29e79b5076e887 to your computer and use it in GitHub Desktop.

Revisions

  1. hostz-frank created this gist Jun 18, 2018.
    24 changes: 24 additions & 0 deletions bloom-no-external-fonts.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,24 @@
    <?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 );