How do we manage tabs within WP admin?
Answer:
At the beginning of custom-dashboard.php add the following code snippet:
<?php $active_tab = isset( $_GET[ 'tab' ] ) ? $_GET[ 'tab' ] : 'Step1_options'; ?>
Then replace the following code with the existing code:
<h2 class="nav-tab-wrapper">
<a href="?page=custom-dashboard&tab=Step1_options" class="nav-tab <?php echo $active_tab == 'Step1_options' ? 'nav-tab-active' : ''; ?>">
<?php _e( 'Step 1' ); ?>
</a><a href="?page=custom-dashboard&tab=Step2_options" class="nav-tab <?php echo $active_tab == 'Step2_options' ? 'nav-tab-active' : ''; ?>">
<?php _e( 'Step 2' ); ?>
</a><a href="?page=custom-dashboard&tab=Step3_options" class="nav-tab <?php echo $active_tab == 'Step3_options' ? 'nav-tab-active' : ''; ?>">
<?php _e( 'Step 3' ); ?>
</a>
</h2>
Finally, give a condition as follow:
<?php if( $active_tab == 'Step1_options' ) { ?>
<div class="changelog">
//First tab options
</div>
<?php } elseif( $active_tab == 'Step2_options' ) { ?>
<div class="changelog">
//Second tab options
</div>
<?php } else { ?>
<div class="changelog">
//Third tab options
</div>
<?php } ?>
And you r done!