From 297f4a3e1e6405e01f9c901fd9b2334cc5906fff Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Thu, 7 Mar 2024 01:07:00 +0000 Subject: [PATCH] Only show the Audit Log admin bar menu if the user can view Stream logs --- inc/stream/namespace.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/inc/stream/namespace.php b/inc/stream/namespace.php index 4b0cf71..2a7ad6c 100644 --- a/inc/stream/namespace.php +++ b/inc/stream/namespace.php @@ -96,6 +96,11 @@ function override_network_admin_bar_menu( WP_Admin_Bar $wp_admin_bar ) { } $wp_admin_bar->remove_menu( 'network-admin-stream' ); + + if ( ! current_user_can( wp_stream_get_instance()->admin->view_cap ) ) { + return; + } + $href = add_query_arg( [ 'page' => wp_stream_get_instance()->admin->records_page_slug,