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:
parent
27229f0110
commit
5b1ff4fbd5
@ -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 );
|
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 = '' ) {
|
function validate_file( $file, $allowed_files = '' ) {
|
||||||
if ( false !== strpos( $file, './' ))
|
if ( false !== strpos( $file, './' ))
|
||||||
return 1;
|
return 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user