Hi
I have searched the documentation and read dozens of posts on the forum but cannot find out if there is a way to successfully control the visibility of tabs on a settings page.
I should state at the outset that the settings page is being used within a plugin that I am developing. Ideally I would like the first tab to act as a 'control panel' for those that follow.
I thought that I had found a potential solution with this tutorial https://docs.metabox.io/hide-tabs-with-conditional-logic/ but the classes that MetaBox produces in the output HTML do not seem to match expectations.
For example this code defines the tabs;
add_filter(
'mb_settings_pages',
function ($settings_pages) {
$settings_pages[] = array(
'id' => 'vtl_site_options',
'option_name' => 'vtl_site_options',
'menu_title' => 'Site Options',
'position' => 1,
'icon_url' => 'data:image/svg',
'tabs' => array(
'site_colours' => 'Site Colours',
'backup_site_settings' => 'Backup',
),
'tab_style' => 'left',
);
return $settings_pages;
}
);
And the output HTML looks like this,
<h2 class="nav-tab-wrapper>
<a href="#tab-site_colours">Site Colours></a>
<a href="#tab-backup_site_settings">Backup</a>
::after
</h2>
So unless I've missed something it's not producing meaningful class names we can use in any conditional logic.
I'm getting the impression that what I'd like to do isn't doable, but if it is could you possibly provide an example please.
Many/h2> thanks.