Before installing the extension, you need to install Meta Box plugin first.
- Go to Plugins → Add New and search for Meta Box
- Click Install Now button to install the plugin
- After installing, click Activate Plugin to activate the plugin
The extension is just a WordPress plugin, you can install it like a normal WordPress plugin.
- Go to Plugins, click Add new, then click Upload plugin.
- Choose the
.zipfile you downloaded and click Install now
- After finishing upload, click Activate to finish.
To create tabs for your meta box, you need to add 2 parameters to your meta box configuration:
tab_style: Tab style. There are 3 styles available:
default(like tabs for Categories),
box(like tabs for Visual and Text modes of the main editor) or
left(like tabs in Help screen). Optional. Default is
tab_wrapper: Whether or not show the meta box wrapper around tabs. Default is
true. If set to
false, then the wrapper will be hidden.
tabs: List of tabs, in one of the following formats:
'tab-id' => 'Tab label'
'tab-id' => array( 'label' => 'Tab label', 'icon' => 'Tab icon' )
tab-id will be used in fields (below) to put fields under a tab.
If use the 2nd format, then
icon is the tab icon. Icons are taken from Dashicons. The value of
icon is the class name of Dashicons, e.g.
If you want to use another icon (not Dashicons), either:
iconto the font icon class name. For example, if you want to use Font Awesome, set
'icon' => 'fa fa-home'. Note that you have to enqueue the CSS for your custom font icon yourself. The plugin only supports Dashicons by default.
iconto URL of icon image, in case you want to use a custom image for tab icon
(Take a look at demo code to see how to implement)
Then for each field in the meta box, you need to specify which tab it belongs to by adding a parameter
'tab' => 'tab-id' where
tab-id is one of the tab IDs you have registered above.
The sample code looks like this: