WordPress.org

Make WordPress Core

Ticket #31183: 31183.diff

File 31183.diff, 1.3 KB (added by prasoon2211, 6 years ago)

Version 1

  • wp-admin/menu.php

     
    192192
    193193        if ( ! is_multisite() ) {
    194194                /* translators: add new plugin */
    195                 $submenu['plugins.php'][10] = array( _x('Add New', 'plugin'), 'install_plugins', 'plugin-install.php' );
     195                $submenu['plugins.php'][10] = array( _x('Add New', 'plugin'), 'update_plugins', 'plugin-install.php' );
    196196                $submenu['plugins.php'][15] = array( _x('Editor', 'plugin editor'), 'edit_plugins', 'plugin-editor.php' );
    197197        }
    198198
  • wp-admin/plugin-install.php

     
    1414 */
    1515require_once( dirname( __FILE__ ) . '/admin.php' );
    1616
    17 if ( ! current_user_can('install_plugins') )
    18         wp_die(__('You do not have sufficient permissions to install plugins on this site.'));
     17if ( ! ( isset( $_GET['tab'] ) && $_GET['tab'] == 'plugin-information' ) ) {
     18        if ( ! current_user_can('install_plugins') )
     19                wp_die(__('You do not have sufficient permissions to install plugins on this site.'));
     20}
    1921
    2022if ( is_multisite() && ! is_network_admin() ) {
    2123        wp_redirect( network_admin_url( 'plugin-install.php' ) );