Make WordPress Core


Ignore:
Timestamp:
05/12/2010 07:19:57 PM (15 years ago)
Author:
nacin
Message:

Use the edit_theme_options capability. fixes #13290.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/menu.php

    r14571 r14581  
    146146$menu[59] = array( '', 'read', 'separator2', '', 'wp-menu-separator' );
    147147
    148 $menu[60] = array( __('Appearance'), 'switch_themes', 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'div' );
    149     $submenu['themes.php'][5]  = array(__('Themes'), 'switch_themes', 'themes.php');
    150     $submenu['themes.php'][10] = array(__('Menus'), 'switch_themes', 'nav-menus.php');
     148if ( current_user_can( 'switch_themes') ) {
     149    $menu[60] = array( __('Appearance'), 'switch_themes', 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'div' );
     150        $submenu['themes.php'][5]  = array(__('Themes'), 'switch_themes', 'themes.php');
     151        $submenu['themes.php'][10] = array(__('Menus'), 'edit_theme_options', 'nav-menus.php');
     152} else {
     153    $menu[60] = array( __('Appearance'), 'edit_theme_options', 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'div' );
     154        $submenu['themes.php'][5]  = array(__('Themes'), 'edit_theme_options', 'themes.php');
     155        $submenu['themes.php'][10] = array(__('Menus'), 'edit_theme_options', 'nav-menus.php' );
     156}
    151157
    152158// Add 'Editor' to the bottom of the Appearence menu.
     
    282288
    283289// Loop over the top-level menu.
    284 // Menus for which the original parent is not acessible due to lack of privs will have the next
     290// Menus for which the original parent is not accessible due to lack of privs will have the next
    285291// submenu in line be assigned as the new menu parent.
    286292foreach ( $menu as $id => $data ) {
Note: See TracChangeset for help on using the changeset viewer.