taxonomy field in MB Blocks - saved value disappears when clicking on block

Support MB Blocks taxonomy field in MB Blocks - saved value disappears when clicking on blockResolved

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #28319
    gerdagerda
    Participant

    Hey there!

    First of all, I really love your plugin, thanks for creating it!
    I have a problem that occurred recently with the taxonomy field in MB Blocks:

    I have created a Block with MB Blocks.
    I added a cloneable group that includes a toxonomy field so that in the block settings, users can select taxonomies (menu categories from the menu custom post type to display menu items from this menu category).

    This works and the taxonomy values save and the menu items display fine.

    But then, once you click on the block again to edit it, all taxonomy (Menu Category) fields show the placeholder text "Select a menu category" instead of the former selected taxonomies and if you don't re-select all taxonomies, the content disappears as soon as you click outside the block.

    I am using the latest version of Meta Box. I used version 1.2.3 of MB Block, then today updated to the latest version but the problem remains.

    Please know that this used to worked without problem for a very long time (for about the past half year when I created it), the problem started to occur just recently.

    Here is my code (a bit shortened):

    $meta_boxes[] = [
        'title'           => 'Menu',
        'id'              => 'menu',
        'description'     => 'Display drink and food menu items',
        'type'            => 'block',
        'icon'            => 'fas fa-mug-hot',
        'category'        => 'rsblocks',
        'context'         => 'side',
        'render_callback' => 'menu_callback',
        'fields'          => [
            array(
                        'name' => 'Menu categories',
                        'id'   => 'menu-category',
                        'type' => 'group',
                        'clone' => true,
                        'sort_clone' => true,
                        'collapsible' => true,
                        'group_title' => '{menucat}',
                        'fields' => array(
                        array(
                        'name'    => 'Menu Category', 
                        'id'      => 'menucat',
                        'type'    => 'taxonomy',
                                    'multiple' => false,
                                    'taxonomy' => 'menu_category',
                                    'field_type' => 'select',
                        ), 
                        ),
            ),
            
    
        ],
    ];
    

    I hope you can help!
    Thank you!

    #28324
    Long NguyenLong Nguyen
    Moderator

    Hi Gerda,

    Thank you for getting in touch.

    Please follow this topic https://support.metabox.io/topic/not-show-taxonomy-field-values-in-mb-blocks/
    and let me know if it helped.

    #28352
    gerdagerda
    Participant

    Wow, what an easy fix! That worked. Thank you so much for your help!

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