PHP Class Disable_Google_Fonts

Mostrar archivo Open project: dimadin/disable-google-fonts

Public Methods

Method Description
__construct ( ) Hook actions and filters.
action_links ( array $links, string $plugin_file ) : array Add action links to plugins page.
disable_bitter ( string $translations, string $text, string $context, string $domain ) : string Force 'off' as a result of Bitter font toggler string translation.
disable_inconsolata ( string $translations, string $text, string $context, string $domain ) : string Force 'off' as a result of Inconsolata font toggler string translation.
disable_lato ( string $translations, string $text, string $context, string $domain ) : string Force 'off' as a result of Lato font toggler string translation.
disable_libre_franklin ( string $translations, string $text, string $context, string $domain ) : string Force 'off' as a result of Libre Franklin font toggler string translation.
disable_merriweather ( string $translations, string $text, string $context, string $domain ) : string Force 'off' as a result of Merriweather font toggler string translation.
disable_montserrat ( string $translations, string $text, string $context, string $domain ) : string Force 'off' as a result of Montserrat font toggler string translation.
disable_noto_sans ( string $translations, string $text, string $context, string $domain ) : string Force 'off' as a result of Noto Sans font toggler string translation.
disable_noto_serif ( string $translations, string $text, string $context, string $domain ) : string Force 'off' as a result of Noto Serif font toggler string translation.
disable_open_sans ( string $translations, string $text, string $context, string $domain ) : string Force 'off' as a result of Open Sans font toggler string translation.
disable_source_sans_pro ( string $translations, string $text, string $context, string $domain ) : string Force 'off' as a result of Source Sans Pro font toggler string translation.
register_theme_fonts_disabler ( ) Register filters that disable fonts for bundled themes.

Method Details

__construct() public method

Hook actions and filters.
Since: 1.0
public __construct ( )

disable_bitter() public method

Force 'off' as a result of Bitter font toggler string translation.
Since: 1.0
public disable_bitter ( string $translations, string $text, string $context, string $domain ) : string
$translations string Translated text.
$text string Text to translate.
$context string Context information for the translators.
$domain string Text domain. Unique identifier for retrieving translated strings.
return string $translations Translated text.

disable_inconsolata() public method

Force 'off' as a result of Inconsolata font toggler string translation.
Since: 1.1
public disable_inconsolata ( string $translations, string $text, string $context, string $domain ) : string
$translations string Translated text.
$text string Text to translate.
$context string Context information for the translators.
$domain string Text domain. Unique identifier for retrieving translated strings.
return string $translations Translated text.

disable_lato() public method

Force 'off' as a result of Lato font toggler string translation.
Since: 1.0
public disable_lato ( string $translations, string $text, string $context, string $domain ) : string
$translations string Translated text.
$text string Text to translate.
$context string Context information for the translators.
$domain string Text domain. Unique identifier for retrieving translated strings.
return string $translations Translated text.

disable_libre_franklin() public method

Force 'off' as a result of Libre Franklin font toggler string translation.
Since: 1.3
public disable_libre_franklin ( string $translations, string $text, string $context, string $domain ) : string
$translations string Translated text.
$text string Text to translate.
$context string Context information for the translators.
$domain string Text domain. Unique identifier for retrieving translated strings.
return string $translations Translated text.

disable_merriweather() public method

Force 'off' as a result of Merriweather font toggler string translation.
Since: 1.2
public disable_merriweather ( string $translations, string $text, string $context, string $domain ) : string
$translations string Translated text.
$text string Text to translate.
$context string Context information for the translators.
$domain string Text domain. Unique identifier for retrieving translated strings.
return string $translations Translated text.

disable_montserrat() public method

Force 'off' as a result of Montserrat font toggler string translation.
Since: 1.2
public disable_montserrat ( string $translations, string $text, string $context, string $domain ) : string
$translations string Translated text.
$text string Text to translate.
$context string Context information for the translators.
$domain string Text domain. Unique identifier for retrieving translated strings.
return string $translations Translated text.

disable_noto_sans() public method

Force 'off' as a result of Noto Sans font toggler string translation.
Since: 1.1
public disable_noto_sans ( string $translations, string $text, string $context, string $domain ) : string
$translations string Translated text.
$text string Text to translate.
$context string Context information for the translators.
$domain string Text domain. Unique identifier for retrieving translated strings.
return string $translations Translated text.

disable_noto_serif() public method

Force 'off' as a result of Noto Serif font toggler string translation.
Since: 1.1
public disable_noto_serif ( string $translations, string $text, string $context, string $domain ) : string
$translations string Translated text.
$text string Text to translate.
$context string Context information for the translators.
$domain string Text domain. Unique identifier for retrieving translated strings.
return string $translations Translated text.

disable_open_sans() public method

Force 'off' as a result of Open Sans font toggler string translation.
Since: 1.0
public disable_open_sans ( string $translations, string $text, string $context, string $domain ) : string
$translations string Translated text.
$text string Text to translate.
$context string Context information for the translators.
$domain string Text domain. Unique identifier for retrieving translated strings.
return string $translations Translated text.

disable_source_sans_pro() public method

Force 'off' as a result of Source Sans Pro font toggler string translation.
Since: 1.0
public disable_source_sans_pro ( string $translations, string $text, string $context, string $domain ) : string
$translations string Translated text.
$text string Text to translate.
$context string Context information for the translators.
$domain string Text domain. Unique identifier for retrieving translated strings.
return string $translations Translated text.

register_theme_fonts_disabler() public method

This filters can be directly hooked as Disable_Google_Fonts::disable_open_sans() but that would mean that comparison is done on each string for each font which creates performance issues. Instead we check active template's name very late and just once and hook appropriate filters. Note that Open Sans disabler is used for both WordPress core and for Twenty Twelve theme.
Since: 1.0