Last active
August 29, 2015 14:02
-
-
Save topdown/cb64adaa61a6361120ac to your computer and use it in GitHub Desktop.
WordPress - Blocks Admin Panel from loading Google Fonts - Open Sans, mainly for work offline. I hate the lag when there is no internet.
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 | |
/** | |
* Blocks Admin Panel from loading Google Fonts - Open Sans, mainly for work offline. I hate the lag when there is no internet. | |
* | |
* Created 6/21/14, 12:57 PM | |
* | |
* @category WordPress Plugin | |
* @package Block External Scripts - block_external_scripts.php | |
* @author Jeff Behnke <code@validwebs.com> | |
* @copyright 2009-14 ValidWebs.com | |
* @license GPL | |
* @version 0.0.1 | |
*/ | |
/* | |
Plugin Name: Block External Scripts | |
Plugin URI: http://validwebs.com | |
Description: Blocks Admin Panel from loading Google Fonts - Open Sans, mainly for work offline. I hate the lag when there is no internet. | |
Version: 0.0.1 | |
Author: Jeff Behnke <code@validwebs.com> | |
Author URI: http://validwebs.com | |
License: GPL | |
*/ | |
/* Copyright (c) 2009 - 2014 Jeff Behnke (email : code@validwebs.com) | |
This program is free software; you can redistribute it and/or modify | |
it under the terms of the GNU General Public License, version 2, as | |
published by the Free Software Foundation. | |
This program is distributed in the hope that it will be useful, | |
but WITHOUT ANY WARRANTY; without even the implied warranty of | |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
GNU General Public License for more details. | |
You should have received a copy of the GNU General Public License | |
along with this program; if not, write to the Free Software | |
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
*/ | |
if ( ! defined( 'ABSPATH' ) ) exit; | |
/** | |
* Blocks Admin Panel from loading Google Fonts - Open Sans, mainly for work offline. I hate the lag when there is no internet. | |
* | |
* @author Jeff Behnke <code@validwebs.com> | |
* @copyright (c) 2014 ValidWebs.com | |
* | |
* Created: 6/21/14, 1:14 PM | |
* | |
* @param object WP_Styles $styles | |
*/ | |
function vw_block_open_sans ($styles) { | |
$open_sans = $styles->registered{'open-sans'}; | |
$open_sans->src = null; | |
return $styles; | |
} | |
add_action( 'wp_default_styles', 'vw_block_open_sans', 100); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Not sure if this is the correct way, but it works cleanly.