Disable Google Fonts - Version 1.1

Version Description

  • Released on 29th December 2014
  • Remove fonts used in Twenty Fifteen.
Download this release

Release Info

Developer dimadin
Plugin Icon wp plugin Disable Google Fonts
Version 1.1
Comparing to
See all releases

Code changes from version 1.0 to 1.1

Files changed (2) hide show
  1. disable-google-fonts.php +66 -1
  2. readme.txt +9 -3
disable-google-fonts.php CHANGED
@@ -15,7 +15,7 @@
15
  * Description: Disable enqueuing of Open Sans and other fonts used by WordPress from Google.
16
  * Author: Milan Dinić
17
  * Author URI: http://blog.milandinic.com/
18
- * Version: 1.0
19
  * License: GPL
20
  */
21
 
@@ -114,6 +114,66 @@ class Disable_Google_Fonts {
114
  return $translations;
115
  }
116
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
117
  /**
118
  * Register filters that disable fonts for bundled themes.
119
  *
@@ -137,6 +197,11 @@ class Disable_Google_Fonts {
137
  $template = get_template();
138
 
139
  switch ( $template ) {
 
 
 
 
 
140
  case 'twentyfourteen' :
141
  add_filter( 'gettext_with_context', array( $this, 'disable_lato' ), 888, 4 );
142
  break;
15
  * Description: Disable enqueuing of Open Sans and other fonts used by WordPress from Google.
16
  * Author: Milan Dinić
17
  * Author URI: http://blog.milandinic.com/
18
+ * Version: 1.1
19
  * License: GPL
20
  */
21
 
114
  return $translations;
115
  }
116
 
117
+ /**
118
+ * Force 'off' as a result of Noto Sans font toggler string translation.
119
+ *
120
+ * @since 1.1
121
+ * @access public
122
+ *
123
+ * @param string $translations Translated text.
124
+ * @param string $text Text to translate.
125
+ * @param string $context Context information for the translators.
126
+ * @param string $domain Text domain. Unique identifier for retrieving translated strings.
127
+ * @return string $translations Translated text.
128
+ */
129
+ public function disable_noto_sans( $translations, $text, $context, $domain ) {
130
+ if ( 'Noto Sans font: on or off' == $context && 'on' == $text ) {
131
+ $translations = 'off';
132
+ }
133
+
134
+ return $translations;
135
+ }
136
+
137
+ /**
138
+ * Force 'off' as a result of Noto Serif font toggler string translation.
139
+ *
140
+ * @since 1.1
141
+ * @access public
142
+ *
143
+ * @param string $translations Translated text.
144
+ * @param string $text Text to translate.
145
+ * @param string $context Context information for the translators.
146
+ * @param string $domain Text domain. Unique identifier for retrieving translated strings.
147
+ * @return string $translations Translated text.
148
+ */
149
+ public function disable_noto_serif( $translations, $text, $context, $domain ) {
150
+ if ( 'Noto Serif font: on or off' == $context && 'on' == $text ) {
151
+ $translations = 'off';
152
+ }
153
+
154
+ return $translations;
155
+ }
156
+
157
+ /**
158
+ * Force 'off' as a result of Inconsolata font toggler string translation.
159
+ *
160
+ * @since 1.1
161
+ * @access public
162
+ *
163
+ * @param string $translations Translated text.
164
+ * @param string $text Text to translate.
165
+ * @param string $context Context information for the translators.
166
+ * @param string $domain Text domain. Unique identifier for retrieving translated strings.
167
+ * @return string $translations Translated text.
168
+ */
169
+ public function disable_inconsolata( $translations, $text, $context, $domain ) {
170
+ if ( 'Inconsolata font: on or off' == $context && 'on' == $text ) {
171
+ $translations = 'off';
172
+ }
173
+
174
+ return $translations;
175
+ }
176
+
177
  /**
178
  * Register filters that disable fonts for bundled themes.
179
  *
197
  $template = get_template();
198
 
199
  switch ( $template ) {
200
+ case 'twentyfifteen' :
201
+ add_filter( 'gettext_with_context', array( $this, 'disable_noto_sans' ), 888, 4 );
202
+ add_filter( 'gettext_with_context', array( $this, 'disable_noto_serif' ), 888, 4 );
203
+ add_filter( 'gettext_with_context', array( $this, 'disable_inconsolata' ), 888, 4 );
204
+ break;
205
  case 'twentyfourteen' :
206
  add_filter( 'gettext_with_context', array( $this, 'disable_lato' ), 888, 4 );
207
  break;
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: dimadin
3
  Donate link: http://blog.milandinic.com/donate/
4
  Tags: Open Sans, Google Fonts, Google Web Fonts
5
  Requires at least: 3.5
6
- Tested up to: 3.8
7
- Stable tag: 1.0
8
 
9
  Disable enqueuing of Open Sans and other fonts used by WordPress from Google.
10
 
@@ -12,7 +12,7 @@ Disable enqueuing of Open Sans and other fonts used by WordPress from Google.
12
 
13
  [Plugin homepage](http://blog.milandinic.com/wordpress/plugins/disable-google-fonts/) | [Plugin author](http://blog.milandinic.com/) | [Donate](http://blog.milandinic.com/donate/)
14
 
15
- This plugin stops loading of Open Sans and other fonts used by WordPress and bundled themes (Twenty Twelve, Twenty Thirteen, Twenty Fourteen) from Google Fonts.
16
 
17
  Reasons for not using Google Fonts might be privacy and security, local development or production, blocking of Google's servers, characters not supported by font, performance.
18
 
@@ -24,3 +24,9 @@ And it's on [GitHub](https://github.com/dimadin/disable-google-fonts).
24
 
25
  1. Upload `disable-google-fonts` folder to the `/wp-content/plugins/` directory
26
  2. Activate the plugin through the 'Plugins' menu in WordPress
 
 
 
 
 
 
3
  Donate link: http://blog.milandinic.com/donate/
4
  Tags: Open Sans, Google Fonts, Google Web Fonts
5
  Requires at least: 3.5
6
+ Tested up to: 4.1
7
+ Stable tag: 1.1
8
 
9
  Disable enqueuing of Open Sans and other fonts used by WordPress from Google.
10
 
12
 
13
  [Plugin homepage](http://blog.milandinic.com/wordpress/plugins/disable-google-fonts/) | [Plugin author](http://blog.milandinic.com/) | [Donate](http://blog.milandinic.com/donate/)
14
 
15
+ This plugin stops loading of Open Sans and other fonts used by WordPress and bundled themes (Twenty Twelve, Twenty Thirteen, Twenty Fourteen, Twenty Fifteen) from Google Fonts.
16
 
17
  Reasons for not using Google Fonts might be privacy and security, local development or production, blocking of Google's servers, characters not supported by font, performance.
18
 
24
 
25
  1. Upload `disable-google-fonts` folder to the `/wp-content/plugins/` directory
26
  2. Activate the plugin through the 'Plugins' menu in WordPress
27
+
28
+ == Changelog ==
29
+
30
+ = 1.1 =
31
+ * Released on 29th December 2014
32
+ * Remove fonts used in Twenty Fifteen.