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

git-svn-id: https://develop.svn.wordpress.org/trunk@4987 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Mark Jaquith 2007-03-07 05:03:32 +00:00
parent 27229f0110
commit 5b1ff4fbd5
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;