how to add sub-menu in the sidebar admin profile menu for simple users
-
Hi,
I need to add my own submenu just below the “your profile” submenu and I succeeded for admin users but not for simple users.
for admin, the following naturally works
add_submenu_page('users.php','biographie', 'bio', 10, __FILE__, 'get_bio_link');
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: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'); }
therefore I try to use
add_submenu_page('profile.php','biographie', 'bio', 10, __FILE__, 'get_bio_link');
but this doesn’t work: My submenu does not appear anywhere ! ??any ideas ??
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘how to add sub-menu in the sidebar admin profile menu for simple users’ is closed to new replies.