WordPress.org

Make WordPress Core

Changeset 4988


Ignore:
Timestamp:
03/07/07 05:04:37 (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
  • branches/2.1/wp-admin/admin-functions.php

    r4889 r4988  
    15321532function add_theme_page( $page_title, $menu_title, $access_level, $file, $function = '' ) { 
    15331533    return add_submenu_page( 'themes.php', $page_title, $menu_title, $access_level, $file, $function ); 
     1534} 
     1535 
     1536function add_users_page( $page_title, $menu_title, $access_level, $file, $function = '' ) { 
     1537    if ( current_user_can('edit_users') ) 
     1538        $parent = 'users.php'; 
     1539    else 
     1540        $parent = 'profile.php'; 
     1541    return add_submenu_page( $parent, $page_title, $menu_title, $access_level, $file, $function ); 
    15341542} 
    15351543 
Note: See TracChangeset for help on using the changeset viewer.