Skip to content

Commit

Permalink
Connection: initialize assets in wp-admin only (#39604)
Browse files Browse the repository at this point in the history
Only initialize Connection assets in the admin area.
  • Loading branch information
sergeymitr authored Oct 2, 2024
1 parent 22b7239 commit 43bb3b3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions projects/packages/connection/actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
* @package automattic/jetpack-connection
*/

if ( function_exists( 'is_admin' ) && ! is_admin() && ( ! defined( 'IS_WPCOM' ) || ! IS_WPCOM ) ) {
// Don't initialize the assets in the frontend on self-hosted and WoA.
return;
}

// If WordPress's plugin API is available already, use it. If not,
// drop data into `$wp_filter` for `WP_Hook::build_preinitialized_hooks()`.
if ( function_exists( 'add_action' ) ) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

Initialize assets in wp-admin only.

0 comments on commit 43bb3b3

Please sign in to comment.