Skip to content

Commit

Permalink
fix link in network admin
Browse files Browse the repository at this point in the history
  • Loading branch information
davidperezgar committed Oct 2, 2024
1 parent 5212be0 commit ae9f280
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions includes/Admin/Admin_Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' ) );
Expand Down Expand Up @@ -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(
'<a href="%1$s">%2$s</a>',
esc_url( network_admin_url( "settings.php?page=plugin-check&plugin={$plugin_file}" ) ),
esc_html__( 'Check this plugin', 'plugin-check' )

Check warning on line 329 in includes/Admin/Admin_Page.php

View check run for this annotation

Codecov / codecov/patch

includes/Admin/Admin_Page.php#L325-L329

Added lines #L325 - L329 were not covered by tests
);
} elseif ( current_user_can( 'activate_plugins' ) ) {

Check warning on line 331 in includes/Admin/Admin_Page.php

View check run for this annotation

Codecov / codecov/patch

includes/Admin/Admin_Page.php#L331

Added line #L331 was not covered by tests
$actions[] = sprintf(
'<a href="%1$s">%2$s</a>',
esc_url( admin_url( "tools.php?page=plugin-check&plugin={$plugin_file}" ) ),
Expand Down

0 comments on commit ae9f280

Please sign in to comment.