WordPress.org

Make WordPress Core

Changeset 4987


Ignore:
Timestamp:
03/07/07 05:03:32 (8 years ago)
Author:
markjaquith
Message:

add_users_page() to address changing top-level menu item. fixes #3706

File:
1 edited

Legend:

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

    r4953 r4987  
    15441544function add_theme_page( $page_title, $menu_title, $access_level, $file, $function = '' ) { 
    15451545    return add_submenu_page( 'themes.php', $page_title, $menu_title, $access_level, $file, $function ); 
     1546} 
     1547 
     1548function add_users_page( $page_title, $menu_title, $access_level, $file, $function = '' ) { 
     1549    if ( current_user_can('edit_users') ) 
     1550        $parent = 'users.php'; 
     1551    else 
     1552        $parent = 'profile.php'; 
     1553    return add_submenu_page( $parent, $page_title, $menu_title, $access_level, $file, $function ); 
    15461554} 
    15471555 
Note: See TracChangeset for help on using the changeset viewer.