WordPress.org

Make WordPress Core

Ticket #31183: 31183.2.diff

File 31183.2.diff, 1.5 KB (added by prasoon2211, 6 years ago)

Version 2

  • src/wp-admin/menu.php

    diff --git src/wp-admin/menu.php src/wp-admin/menu.php
    index ba14a09..38bc36b 100644
    $submenu['plugins.php'][5] = array( __('Installed Plugins'), 'activate_plugins' 
    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' );
    196                 $submenu['plugins.php'][15] = array( _x('Editor', 'plugin editor'), 'edit_plugins', 'plugin-editor.php' );
     195                $submenu['plugins.php'][10] = array( _x('Add New', 'plugin'), 'update_plugins', 'plugin-install.php' );
     196                $submenu['plugins.php'][15] = array( _x('Editor', 'plugin editor'), 'update_plugins', 'plugin-editor.php' );
    197197        }
    198198
    199199unset( $update_data );
  • src/wp-admin/plugin-install.php

    diff --git src/wp-admin/plugin-install.php src/wp-admin/plugin-install.php
    index 03085c7..a124221 100644
    if ( !defined( 'IFRAME_REQUEST' ) && isset( $_GET['tab'] ) && ( 'plugin-informat 
    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' ) );