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

git-svn-id: http://svn.automattic.com/wordpress/trunk@4987 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
markjaquith 2007-03-07 05:03:32 +00:00
parent 8338d6c203
commit 00f7071af4
1 changed files with 8 additions and 0 deletions

View File

@ -1545,6 +1545,14 @@ function add_theme_page( $page_title, $menu_title, $access_level, $file, $functi
return add_submenu_page( 'themes.php', $page_title, $menu_title, $access_level, $file, $function );
}
function add_users_page( $page_title, $menu_title, $access_level, $file, $function = '' ) {
if ( current_user_can('edit_users') )
$parent = 'users.php';
else
$parent = 'profile.php';
return add_submenu_page( $parent, $page_title, $menu_title, $access_level, $file, $function );
}
function validate_file( $file, $allowed_files = '' ) {
if ( false !== strpos( $file, './' ))
return 1;