Hi, I am trying to add a new tab right next to "Your profile" for people without a blog.
For people with blogs, I am able to do this through adding a submenu under "users.php"
How do you do something similar to that for users without a blog?
thanks for your help.
Looks like today I am answering all my questions.. ;)
I am now using add_menu_page, instead of add_submenu_page.
function addPluginToSubMenu(){
add_menu_page('More Profile', 'More Profile', 0, __FILE__, 'more_intro_adminPage');
}
add_action('admin_menu', 'addPluginToSubMenu');
Thanks horror:) Useful info. I would like to add more fields inside My Profile menu. For example, I would like for members to be able to add Google Maps address. Any ideas?
Boonika: Would this help? Use the 'profile_personal_options' plugin hook from edit-users.php:
Example:
<?php function more_profile ($blah) {
echo "Google Maps Form";
return $blah;
}
add_action ('profile_personal_options', 'more_profile');
?>
Thanks Dsader. I'll try that.
FYI, in 1.5.1, the code that I've posted as a sample above doesn't work. You do get the top-level menu, but you'll get an error when click on it.
I've resorted to going back to a sub-menu. Not as easy for the users to find it, but at least it's working.
Horrorshow,
global $submenu;
if ( !current_user_can('edit_users') ) {
$submenu['profile.php'][55] = array(__('New Profile Menu'), 'read', 'new_profile_page');
}