Support Forum
Support › Meta Box Tabs › Tabs Doesn't Work
No matter if I use the code or the builder, there is a bug with the display of the tab sub-fields. The first tab works great, but the second one is blank. Sometimes the third tab works, but I am not sure why.
Making the tabs before the sub-fields of the tab DO NOT fix the problem. I have tried this 5 times with the same result.
Additionally, when selecting the dashicons, the icons do not show up; which I can see why because they do not include the 'dashicons-' before the icon name. I can fix that with the code, but I figured you should know.
Attached are 4 screen shots and my php export code.
https://drive.google.com/file/d/1hcEfXENU-Z-DlY8zQ4uBf6XCbJLnrTb4/view?usp=sharing
https://drive.google.com/file/d/1R6K7POWGp89idEv5DXGOaVlBHWlK6UpV/view?usp=sharing
https://drive.google.com/file/d/1VD5cAsgQGAPv3Nx25Pd-t0w2QmcrrbUj/view?usp=sharing
https://drive.google.com/file/d/1ZiUBOVlnTVVPG7-gcsAWR6ApvmAjOQXz/view?usp=sharing
<?php
add_filter( 'rwmb_meta_boxes', 'monitor_fields_php_export' );
function monitor_fields_php_export( $meta_boxes ) {
$prefix = '';
$meta_boxes[] = [
'title' => __( 'Monitor Fields', 'Monitor Fields' ),
'id' => 'monitor-fields',
'post_types' => ['monitor'],
'tab_default_active' => 'monitor_details',
'storage_type' => 'custom_table',
'table' => 'wp_monitor_table',
'tabs' => [
'monitor_details' => [
'label' => 'Monitor Details',
'icon' => 'chart-bar',
],
'tank_configuration' => [
'label' => 'Tank Configuration',
'icon' => 'category',
],
],
'fields' => [
[
'name' => __( 'Active', 'monitor_status' ),
'id' => $prefix . 'active',
'type' => 'switch',
'style' => 'rounded',
'on_label' => 'Active',
'off_label' => 'Inactive',
'std' => true,
'columns' => 2,
'tab' => 'monitor_details',
],
[
'name' => __( 'Total Gallons', 'total_gallons' ),
'id' => $prefix . 'total_gallons',
'type' => 'number',
'columns' => 3,
'tab' => 'tank_configuration',
],
],
];
return $meta_boxes;
}
Hi,
Total columns under each tab should be 12, like this
'fields' => [
[
'name' => __( 'Active', 'monitor_status' ),
'id' => $prefix . 'active',
'type' => 'switch',
'style' => 'rounded',
'on_label' => 'Active',
'off_label' => 'Inactive',
'std' => true,
'columns' => 12,
'tab' => 'monitor_details',
],
[
'name' => __( 'Total Gallons', 'total_gallons' ),
'id' => $prefix . 'total_gallons',
'type' => 'number',
'columns' => 12,
'tab' => 'tank_configuration',
],
]
Get more details on the documentation https://docs.metabox.io/extensions/meta-box-columns/
Are you guys still working on the dashicons bug?
Hi,
Yes, that issue is in our development queue. It will be fixed and included in future updates.
Any update on fixing the icons for the tabs?