Skip to content

Commit

Permalink
optimize gather_google_fonts by only using it in the frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Apr 26, 2024
1 parent 7e55dc4 commit 44f882c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/fonts.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ class Stackable_Google_Fonts {
public static $google_fonts = [];

function __construct() {
add_filter( 'render_block', array( $this, 'gather_google_fonts' ), 10, 2 );
if ( ! is_admin() ) {
add_filter( 'render_block', array( $this, 'gather_google_fonts' ), 10, 2 );
}
}

public function gather_google_fonts( $block_content, $block ) {
Expand Down

0 comments on commit 44f882c

Please sign in to comment.