Allow only super admins to see plugins.php if the Plugins menu is not exposed. Props ocean90. fixes #13944
git-svn-id: http://svn.automattic.com/wordpress/trunk@15271 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
6ac19c2928
commit
ec0b1234a9
|
@ -8,6 +8,14 @@
|
|||
|
||||
/** WordPress Administration Bootstrap */
|
||||
require_once('./admin.php');
|
||||
if ( is_multisite() ) {
|
||||
$menu_perms = get_site_option( 'menu_items', array() );
|
||||
|
||||
if ( empty($menu_perms['plugins']) && ! is_super_admin() )
|
||||
wp_die( __( 'Cheatin’ uh?' ) );
|
||||
else if ( $menu_perms['plugins'] != 1 && is_super_admin() )
|
||||
add_action( 'admin_notices', '_admin_notice_multisite_activate_plugins_page' );
|
||||
}
|
||||
|
||||
if ( ! current_user_can( 'activate_plugins' ) )
|
||||
wp_die( __( 'You do not have sufficient permissions to manage plugins for this site.' ) );
|
||||
|
@ -315,13 +323,6 @@ add_contextual_help($current_screen,
|
|||
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
|
||||
);
|
||||
|
||||
if ( is_multisite() && is_super_admin() ) {
|
||||
$menu_perms = get_site_option('menu_items', array());
|
||||
if ( empty($menu_perms['plugins']) )
|
||||
add_action( 'admin_notices', '_admin_notice_multisite_activate_plugins_page' );
|
||||
unset($menu_perms);
|
||||
}
|
||||
|
||||
$title = __('Plugins');
|
||||
|
||||
require_once('./admin-header.php');
|
||||
|
|
Loading…
Reference in New Issue