WordPress.org

Make WordPress Core


Ignore:
Timestamp:
01/07/10 00:17:13 (8 years ago)
Author:
ryan
Message:

Move wpmu_menu() logic into menu.php. Props Denis-de-Bernardy. fixes #11763

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/ms.php

    r12613 r12618  
    550550 
    551551function wpmu_menu() { 
    552     global $menu, $submenu, $current_user; 
    553  
    554     $menu_perms = get_site_option( "menu_items" ); 
    555     if( is_array( $menu_perms ) == false ) 
    556         $menu_perms = array(); 
    557     if( $menu_perms[ 'plugins' ] != 1 ) { 
    558         if( !is_site_admin() ) { 
    559             unset( $menu['65'] ); // Plugins 
    560             unset( $submenu[ 'plugins.php' ] ); 
    561         } elseif ( strpos( $_SERVER[ 'PHP_SELF' ], 'wp-admin/plugins.php' ) ) { 
    562             $message = sprintf( __( 'The plugins page is not visible to normal users. It must be activated first. %s' ), '<a href="wpmu-options.php#menu">' . __( 'Activate' ) . '</a>' ); 
    563             $message = str_replace( "'", "\'", "<div class='error'><p>$message</p></div>" ); 
    564             add_action( 'admin_notices', create_function( '', "echo '$message';" ) ); 
    565         } 
    566     } elseif ( !is_site_admin() ) { 
    567         $menu[65] = array( sprintf( __('Plugins %s'), "" ), 'activate_plugins', 'plugins.php', '', 'menu-top', 'menu-plugins', 'div' ); 
    568     } 
    569     if( !get_site_option( 'add_new_users' ) ) { 
    570         if( !is_site_admin() ) { 
    571             unset( $submenu['users.php'][10] ); 
    572         } else { 
    573             $submenu['users.php'][10] = array(__('Add New') . ' <strong>*</strong>', 'create_users', 'wpmu-options.php#addnewusers'); 
    574         } 
    575     } 
    576     unset( $submenu['tools.php'][20] ); // core upgrade 
    577     unset( $submenu['options-general.php'][45] ); // Misc 
    578 } 
    579 add_action( '_admin_menu', 'wpmu_menu' ); 
     552    // deprecated. See #11763 
     553} 
    580554 
    581555function mu_options( $options ) { 
Note: See TracChangeset for help on using the changeset viewer.