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