From ae9f28094607a6fa95f753a317f3e782c2dad4df Mon Sep 17 00:00:00 2001 From: davidperezgar Date: Wed, 2 Oct 2024 20:27:03 +0200 Subject: [PATCH] fix link in network admin --- includes/Admin/Admin_Page.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/includes/Admin/Admin_Page.php b/includes/Admin/Admin_Page.php index 28b7b4c79..77501a5e5 100644 --- a/includes/Admin/Admin_Page.php +++ b/includes/Admin/Admin_Page.php @@ -54,7 +54,7 @@ public function __construct( Admin_AJAX $admin_ajax ) { * @since 1.0.0 */ public function add_hooks() { - $admin_menu_hook = is_multisite() ? 'network_admin_menu' : 'admin_menu'; + $admin_menu_hook = is_multisite() ? 'network_admin_menu' : 'admin_menu'; $plugin_action_link_hook = is_multisite() ? 'network_admin_plugin_action_links' : 'plugin_action_links'; add_action( $admin_menu_hook, array( $this, 'add_and_initialize_page' ) ); @@ -322,7 +322,13 @@ public function filter_plugin_action_links( $actions, $plugin_file, $plugin_data return $actions; } - if ( ( is_multisite() && current_user_can( 'manage_network_plugins' ) ) || current_user_can( 'activate_plugins' ) ) { + if ( is_multisite() && current_user_can( 'manage_network_plugins' ) ) { + $actions[] = sprintf( + '%2$s', + esc_url( network_admin_url( "settings.php?page=plugin-check&plugin={$plugin_file}" ) ), + esc_html__( 'Check this plugin', 'plugin-check' ) + ); + } elseif ( current_user_can( 'activate_plugins' ) ) { $actions[] = sprintf( '%2$s', esc_url( admin_url( "tools.php?page=plugin-check&plugin={$plugin_file}" ) ),