Disable and Remove Google Fonts - Version 1.3.4

Version Description

Download this release

Release Info

Developer DannyCooper
Plugin Icon wp plugin Disable and Remove Google Fonts
Version 1.3.4
Comparing to
See all releases

Code changes from version 1.3.3 to 1.3.4

Files changed (1) hide show
  1. disable-remove-google-fonts.php +12 -12
disable-remove-google-fonts.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: Optimize frontend performance by disabling Google Fonts. GDPR-friendly.
6
  * Author: Fonts Plugin
7
  * Author URI: https://fontsplugin.com
8
- * Version: 1.3.3
9
  * License: GPLv2 or later
10
  * License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
11
  *
@@ -32,6 +32,17 @@ function drgf_dequeueu_fonts() {
32
  [ 'olympus-google-fonts' ]
33
  );
34
 
 
 
 
 
 
 
 
 
 
 
 
35
  /**
36
  * Some themes set the Google Fonts URL as a dependency, so we need to replace
37
  * it with a blank value rather than removing it entirely. As that would
@@ -46,17 +57,6 @@ function drgf_dequeueu_fonts() {
46
  }
47
  }
48
 
49
- foreach ( $wp_styles->registered as $style ) {
50
- $handle = $style->handle;
51
- $src = $style->src;
52
-
53
- if ( strpos( $src, 'fonts.googleapis' !== false ) ) {
54
- if ( ! array_key_exists( $handle, array_flip( $allowed ) ) ) {
55
- wp_dequeue_style( $handle );
56
- }
57
- }
58
- }
59
-
60
  // Remove fonts added by the Divi Extra theme
61
  remove_action( 'wp_footer', 'et_builder_print_font' );
62
 
5
  * Description: Optimize frontend performance by disabling Google Fonts. GDPR-friendly.
6
  * Author: Fonts Plugin
7
  * Author URI: https://fontsplugin.com
8
+ * Version: 1.3.4
9
  * License: GPLv2 or later
10
  * License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
11
  *
32
  [ 'olympus-google-fonts' ]
33
  );
34
 
35
+ foreach ( $wp_styles->registered as $style ) {
36
+ $handle = $style->handle;
37
+ $src = $style->src;
38
+
39
+ if ( strpos( $src, 'fonts.googleapis' ) !== false ) {
40
+ if ( ! array_key_exists( $handle, array_flip( $allowed ) ) ) {
41
+ wp_dequeue_style( $handle );
42
+ }
43
+ }
44
+ }
45
+
46
  /**
47
  * Some themes set the Google Fonts URL as a dependency, so we need to replace
48
  * it with a blank value rather than removing it entirely. As that would
57
  }
58
  }
59
 
 
 
 
 
 
 
 
 
 
 
 
60
  // Remove fonts added by the Divi Extra theme
61
  remove_action( 'wp_footer', 'et_builder_print_font' );
62