Follow us on

Codestar Support Forum » WordPress Plugins » Codestar Framework

Nav menu missing in taxonomy options

  1. I create a meta box with two sections for post type working well ( please check the first screenshot ). but when creating a taxonomy option with two sections there is navigation menu missing ( please check the second screenshot ).

    Can we create a single meta box that works for post & taxonomy?

    Screenshot:

    https://prnt.sc/NGeYEyxcpFjP

    https://prnt.sc/vxePEKdoJ7sC

    My code is below:

    <?php
    // Control core classes for avoid errors
    if (class_exists('CSF')) {
    
        //
        // Set a unique slug-like ID
        $prefix = 'test_metabox';
    
        //
        // Create a metabox
        CSF::createMetabox($prefix, array(
            'title'     => __('Meta Box', 'test'),
            'post_type' => array('post'),
            'context'   => 'normal', // The context within the screen where the boxes should display. `normal`, `side`, `advanced`
            'nav'       =>  'inline',
            'theme'     => 'light',
        ));
    
        //
        // Create a section
        CSF::createSection($prefix, array(
            'title'     =>  __( 'TEST', 'test' ),
            'fields' => array(
                //
                // A text field
                array(
                    'id'    => 'title',
                    'type'  => 'text',
                    'title' => __('Title', 'test'),
                ),
    
                array(
                    'id'    => 'description',
                    'type'  => 'textarea',
                    'title' => __('Description', 'test'),
                ),
    
            )
        ));
    
        //
        // Create a section
        CSF::createSection($prefix, array(
            'title'     =>  __( 'WP', 'test' ),
            'fields' => array(
                //
                // A text field
                array(
                    'id'    => 'title-1',
                    'type'  => 'text',
                    'title' => __('Title', 'test'),
                ),
    
                array(
                    'id'    => 'description-1',
                    'type'  => 'textarea',
                    'title' => __('Description', 'test'),
                ),
    
            )
        ));
    
        //
        // Set a unique slug-like ID
        $prefix = 'test_metabox_tax';
    
        // Create taxonomy options
        CSF::createTaxonomyOptions( $prefix, array(
            'title'     => __('META BOX', 'test'),
            'taxonomy'  => array( 'category'),
            'data_type' => 'serialize', // The type of the database save options. `serialize` or `unserialize`
            'nav'       =>  'inline',
            'theme'     => 'light',
        ) );
    
        //
        // Create a section
        CSF::createSection($prefix, array(
            'title'     =>  __( 'TEST', 'test' ),
            'fields' => array(
                //
                // A text field
                array(
                    'id'    => 'title',
                    'type'  => 'text',
                    'title' => __('Meta Title', 'test'),
                ),
    
                array(
                    'id'    => 'description',
                    'type'  => 'textarea',
                    'title' => __('Meta Description', 'test'),
                ),
    
            )
        ));
    
        //
        // Create a section
        CSF::createSection($prefix, array(
            'title'     =>  __( 'WP', 'test' ),
            'fields' => array(
                //
                // A text field
                array(
                    'id'    => 'title-1',
                    'type'  => 'text',
                    'title' => __('Title', 'test'),
                ),
    
                array(
                    'id'    => 'description-1',
                    'type'  => 'textarea',
                    'title' => __('Description', 'test'),
                ),
    
            )
        ));
    
    }CopyCopied!

    Another question, can we create a meta box via action hook?

    Posted 10 months ago #

  2. Posted 10 months ago #

  3. Codestar
    Admin

    Hi,

    Welcome to support forum and thanks for purchasing.

    Oh, Unfortunately it doesn't support tabs. Only admin and metabox framework support that.

    Maybe you can use "tab or accordion" fields there.

    btw, I noted this for next updates. when I have free time will try to add.

    Regards, Codestar

    Posted 10 months ago #