Create an array of tabs you would like to create on your admin page. This would most likely contain your menu pages added by your plugin. The array keys would be the page slug, and the array values would be the tab text.
Echo the function where you want the tabs to display within your plugin.
<?php
// Create WP Admin Tabs on-the-fly.
function admin_tabs($tabs, $current=NULL){
if(is_null($current)){
if(isset($_GET['page'])){
$current = $_GET['page'];
}
}
$content = '';
$content .= '<h2 class="nav-tab-wrapper">';
foreach($tabs as $location => $tabname){
if($current == $location){
$class = ' nav-tab-active';
} else{
$class = '';
}
$content .= '<a class="nav-tab'.$class.'" href="?page='.$location.'">'.$tabname.'</a>';
}
$content .= '</h2>';
return $content;
}
$my_plugin_tabs = array(
'my-plugin-overview' => 'Overview',
'my-plugin-settings' => 'Settings',
'my-plugin-uninstall' => 'Uninstall'
);
echo admin_tabs($my_plugin_tabs);
?>