Skip to content

Commit

Permalink
less strings
Browse files Browse the repository at this point in the history
  • Loading branch information
davidperezgar committed Oct 2, 2024
1 parent ae9f280 commit e8c8f82
Showing 1 changed file with 11 additions and 18 deletions.
29 changes: 11 additions & 18 deletions includes/Admin/Admin_Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,24 +71,17 @@ public function add_hooks() {
* @since 1.0.0
*/
public function add_page() {
if ( is_multisite() ) {
$this->hook_suffix = add_submenu_page(
'settings.php',
__( 'Plugin Check', 'plugin-check' ),
__( 'Plugin Check', 'plugin-check' ),
'manage_network_plugins',
'plugin-check',
array( $this, 'render_page' )
);
} else {
$this->hook_suffix = add_management_page(
__( 'Plugin Check', 'plugin-check' ),
__( 'Plugin Check', 'plugin-check' ),
'activate_plugins',
'plugin-check',
array( $this, 'render_page' )
);
}
$admin_parent_page = is_multisite() ? 'settings.php' : 'tools.php';
$capabilities = is_multisite() ? 'manage_network_plugins' : 'activate_plugins';

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

View check run for this annotation

Codecov / codecov/patch

includes/Admin/Admin_Page.php#L74-L75

Added lines #L74 - L75 were not covered by tests

$this->hook_suffix = add_submenu_page(
$admin_parent_page,

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

View check run for this annotation

Codecov / codecov/patch

includes/Admin/Admin_Page.php#L77-L78

Added lines #L77 - L78 were not covered by tests
__( 'Plugin Check', 'plugin-check' ),
__( 'Plugin Check', 'plugin-check' ),
$capabilities,

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

View check run for this annotation

Codecov / codecov/patch

includes/Admin/Admin_Page.php#L81

Added line #L81 was not covered by tests
'plugin-check',
array( $this, 'render_page' )
);
}

/**
Expand Down

0 comments on commit e8c8f82

Please sign in to comment.