Skip to content

Instantly share code, notes, and snippets.

@thefuxia
Created April 1, 2015 16:56
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thefuxia/8593e494109efe8a0373 to your computer and use it in GitHub Desktop.
Save thefuxia/8593e494109efe8a0373 to your computer and use it in GitHub Desktop.
T5 Disable Open Sans
<?php # -*- coding: utf-8 -*-
/**
* Plugin Name: T5 Disable Open Sans
* Version: 2015.04.01
* Author: toscho
* License: MIT
*/
add_filter( 'gettext_with_context', 'disable_open_sans', 10, 4 );
/**
* Filter the translation string for Open Sans
*
* @wp-hook gettext_with_context
* @param string $translations
* @param string $text
* @param string $context
* @param string $domain
* @return string
*/
function disable_open_sans( $translations, $text, $context, $domain ) {
if ( 'default' !== $domain )
return $translations;
if ( 'on' !== $text )
return $translations;
if ( 'Open Sans font: on or off' !== $context )
return $translations;
remove_filter( current_filter(), __FUNCTION__ );
return 'off';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment