how to add sub-menu in the sidebar admin profile menu for simple users
-
Using WP¨2.85
I need to add my own submenu just below the “your profile” submenu and I succeeded for admin but not for simple users.
for admin, this works perfectly
[code]add_submenu_page('users.php','biographie', 'bio', 10, __FILE__, 'get_bio_link');[/code]
bu not for simple users because their “your profile” submenu is not under the “users” menu but under a “profile” menu as shown in the menu.php in the admin folder of WP
ligne 91:[code]if ( current_user_can('edit_users') ) {
$_wp_real_parent_file['profile.php'] = 'users.php'; // Back-compat for plugins adding submenus to profile.php.
$submenu['users.php'][5] = array(__('Authors & Users'), 'edit_users', 'users.php');
$submenu['users.php'][10] = array(__('Add New'), 'create_users', 'user-new.php');
$submenu['users.php'][15] = array(__('Your Profile'), 'read', 'profile.php');
} else {
$_wp_real_parent_file['users.php'] = 'profile.php';
$submenu['profile.php'][5] = array(__('Your Profile'), 'read', 'profile.php');
}[/code]
therefore I try to use [code]add_submenu_page('profile.php','biographie', 'bio', 10, __FILE__, 'get_bio_link');[/code]
but this doesn’t work: My submenu does not appear anywhere ! :(any ideas ??
-
You did not specify a blog address or reason for posting when you created this topic.
This support forum is for blogs hosted at WordPress.com. If your question is about a self-hosted WordPress blog then you’ll find help at the WordPress.org forums.
If you don’t understand the difference between WordPress.com and WordPress.org, you may find this information helpful.
If you forgot to include a link to your blog, you can reply and include it below. It’ll help people to answer your question.
This is an automated message.
- The topic ‘how to add sub-menu in the sidebar admin profile menu for simple users’ is closed to new replies.