Custom Fields
Re-Envisioned
Support Meta Box Tabs Tabs Doesn't Work

  • Creator
    Topic
  • #29942
    Jeremy Parrott
    Participant

    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;
    }
Viewing 3 replies - 1 through 3 (of 3 total)
  • Author
    Replies
  • #29966
    Long Nguyen
    Moderator

    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/

    #29968
    Jeremy Parrott
    Participant

    Are you guys still working on the dashicons bug?

    #29970
    Long Nguyen
    Moderator

    Hi,

    Yes, that issue is in our development queue. It will be fixed and included in future updates.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.