Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Fist you need to specify tabs
- function pn_get_settings_page_tabs() {
- $tabs = array(
- 'general' => 'General',
- 'user_manual' => 'User Manual'
- );
- return $tabs;
- }
- // Then, you can generate tabs
- function pn_admin_options_page_tabs( $current = 'general' ) {
- if ( isset ( $_GET['tab'] ) ) :
- $current = $_GET['tab'];
- else:
- $current = 'general';
- endif;
- $tabs = pn_get_settings_page_tabs();
- $links = array();
- foreach( $tabs as $tab => $name ) :
- if ( $tab == $current ) :
- $links[] = '<a class="nav-tab nav-tab-active" href="?page=settings_page&tab='.$tab.'">'.$name.'</a>';
- else :
- $links[] = '<a class="nav-tab" href="?page=setting_page&tab='.$tab.'">'.$name.'</a>';
- endif;
- endforeach;
- echo '<div id="icon-themes" class="icon32"><br /></div>';
- echo '<h2 class="nav-tab-wrapper">';
- foreach ( $links as $link )
- echo $link;
- echo '</h2>';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement