Hi I am building a plugin options page. What I’d really like to do is implement repeatable tabs (which I know is possible with the Settings API), but with a twist I haven’t seen in any options panel till now. I’d like to create new tabs on the fly, exactly like the ‘Menus’ section in the admin UI works.

Is there any standard way to do this?

3 s
3

WordPress Tabs are non-standard, static html markup. You can only add the markup within your functions.php theme file or inside your plugin.

<h2 class="nav-tab-wrapper">
    <a href="#" class="nav-tab">Tab #1</a>
    <a href="#" class="nav-tab nav-tab-active">Tab #2</a>
    <a href="#" class="nav-tab">Tab #2</a>
</h2>

WP Tabs


In this helper plugin (WordPress Admin Style) you’ll find the class references for the default markup of the admin area.
Full plugin snapshot. The previous snapshot is a detail located at the bottom of this one.
Click to enlarge:

full plugin snapshot wordpress-admin-style

Leave a Reply

Your email address will not be published. Required fields are marked *