Skip to content

Instantly share code, notes, and snippets.

@topdown
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save topdown/cb64adaa61a6361120ac to your computer and use it in GitHub Desktop.
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.
<?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);
@topdown
Copy link
Author

topdown commented Jun 21, 2014

Not sure if this is the correct way, but it works cleanly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment