From 7f710b0e490216e4b0e42f70e31ec20c96d8780f Mon Sep 17 00:00:00 2001 From: David Stone Date: Fri, 10 Apr 2026 15:39:33 -0600 Subject: [PATCH] fix: skip activity-stream assets on non-network admin dashboard The enqueue_scripts() method only checked $pagenow === 'index.php', which matches both /wp-admin/index.php (per-site dashboard) and /wp-admin/network/index.php (network dashboard). The activity-stream Vue app and its #activity-stream-content mount point are only rendered on the network dashboard via wp_network_dashboard_setup, so loading the script on the per-site dashboard caused: [Vue warn]: Cannot find element: #activity-stream-content Add an is_network_admin() guard to bail early on the per-site dashboard. --- inc/class-dashboard-widgets.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/inc/class-dashboard-widgets.php b/inc/class-dashboard-widgets.php index 84385fe90..05825c014 100644 --- a/inc/class-dashboard-widgets.php +++ b/inc/class-dashboard-widgets.php @@ -74,6 +74,16 @@ public function enqueue_scripts(): void { return; } + /* + * The activity-stream widget is only registered on the network dashboard + * (wp_network_dashboard_setup). Skip enqueueing its assets on the regular + * per-site dashboard to avoid the Vue "Cannot find element: #activity-stream-content" + * console error. + */ + if ( ! is_network_admin()) { + return; + } + /* * The activity-stream widget view wraps its output in
, * which requires framework.css (registered as 'wu-styling'). The network admin