WordPress.org

Make WordPress Core

Ticket #31183: 31183.version3.diff

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

Version 3.

  • src/wp-admin/includes/menu.php

    diff --git a/src/wp-admin/includes/menu.php b/src/wp-admin/includes/menu.php
    index cb6111a..d086a76 100644
    a b if ( !empty( $menu ) && 'wp-menu-separator' == $menu[ $last_menu_key ][ 4 ] ) 
    307307        unset( $menu[ $last_menu_key ] );
    308308unset( $last_menu_key );
    309309
    310 if ( !user_can_access_admin_page() ) {
    311 
    312         /**
    313          * Fires when access to an admin page is denied.
    314          *
    315          * @since 2.5.0
    316          */
    317         do_action( 'admin_page_access_denied' );
    318 
    319         wp_die( __( 'You do not have sufficient permissions to access this page.' ), 403 );
    320 }
    321 
    322310$menu = add_menu_classes($menu);
  • src/wp-admin/plugin-install.php

    diff --git a/src/wp-admin/plugin-install.php b/src/wp-admin/plugin-install.php
    index 03085c7..a124221 100644
    a b 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' ) );