Skip to content

Commit

Permalink
added a check to avoid the script_loader_tag filter in admin where is…
Browse files Browse the repository at this point in the history
… not needed
  • Loading branch information
geckod22 committed Jan 21, 2025
1 parent cc37a3d commit e67670a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion includes/LinkPrefetch.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ public function __construct( Container $container ) {
add_filter( 'newfold-runtime', array( $this, 'add_to_runtime' ) );

add_action( 'wp_enqueue_scripts', array( $this, 'enqueueScripts' ) );
add_filter( 'script_loader_tag', array( $this, 'addDefer' ), 10, 2 );
if ( ! is_admin() ) {
add_filter( 'script_loader_tag', array( $this, 'addDefer' ), 10, 2 );
}
}

/**
Expand Down

0 comments on commit e67670a

Please sign in to comment.