I successfully managed to create admin bar item using this:
add_action('admin_bar_menu', 'toolbar_link_to_mypage', 999);
function toolbar_link_to_mypage($wp_admin_bar){
global $wp_admin_bar;
$theme_menu = array(
'id' => 'theme_page',
'title' => __('test', 'test'),
'href' => 'http://mysite.com/my-page/',
'meta' => array('class' => 'test')
);
$wp_admin_bar->add_node($theme_menu);
}
But I can't figure out what is the correct way to create an admin panel OPTIONS PAGE (not sub-menu item! Two answers are about sub-menus already) for 'href' => '',
parameter. I can't simply use add_menu_page();
because that would attach it to left navigation as well. Any help would be great!