Created
April 1, 2015 16:56
-
-
Save thefuxia/8593e494109efe8a0373 to your computer and use it in GitHub Desktop.
T5 Disable Open Sans
This file contains hidden or 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 # -*- 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