Make WordPress Core


Ignore:
Timestamp:
04/29/2010 05:34:24 AM (14 years ago)
Author:
nacin
Message:

Don't show plugin editor when there are no plugins. props solarissmoke, fixes #13117.

File:
1 edited

Legend:

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

    r14189 r14290  
    169169        /* translators: add new plugin */
    170170        $submenu['plugins.php'][10] = array(_x('Add New', 'plugin'), 'install_plugins', 'plugin-install.php');
    171         $submenu['plugins.php'][15] = array( _x('Editor', 'plugin editor'), 'edit_plugins', 'plugin-editor.php' );
    172 }
    173 unset($menu_perms, $update_plugins, $update_count);
     171        $plugins = get_plugins();
     172        if( !empty($plugins) )
     173            $submenu['plugins.php'][15] = array( _x('Editor', 'plugin editor'), 'edit_plugins', 'plugin-editor.php' );
     174}
     175unset($menu_perms, $update_plugins, $update_count, $plugins);
    174176
    175177if ( current_user_can('list_users') )
Note: See TracChangeset for help on using the changeset viewer.