Layout Tabs

If you use the theme options plugin you will notice that there is a tabbed layout. You can create tabbed layouts with TypeRocket using the tr_tabs() function.

This function creates an instance of TypeRocket\Tabs so you can easily create tabbed layouts.

$tabs = tr_tabs();

$tabContentOne = "<p>Main content 1.</p>";
$tabContentTwo = "<p>Main content 2.</p>";

$tabs->addTab('Tab 1', $tabContentOne);
$tabs->addTab('Tab 2', $tabContentTwo);

$tabs->render();

Meta box tabs

When tabs are added to a meta box they will have this style.

Tabs meta box

Main content tabs

When tabs are added in the main content area of the admin they will have this style.

Tabs main content

Main content box tabs

When you set the render mode to box tabs will have this style.

$tabs->render( 'box' );

Tabs main content box

Sidebars

You can add a sidebar to main content tabs using the setSidebar() method.

$tabs = tr_tabs();

$sidebar = "<p>Sidebar content.</p>";

$tabs->setSidebar( $sidebar );

$tabContentOne = "<p>Main content 1.</p>";
$tabContentTwo = "<p>Main content 2.</p>";

$tabs->addTab('Tab 1', $tabContentOne);
$tabs->addTab('Tab 2', $tabContentTwo);

$tabs->render('box');