Clone group not working ?

Support MB Group Clone group not working ?Resolved

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #24741
    Martin RybosMartin Rybos
    Participant

    Hi.
    I have created a group. Shouldn't I be able to clone?

    
     $meta_boxes[] = array(
            'title'  => 'Divart Slider',
            'post_types' => ['divart_slider'],
            
                 'columns' => array(
                'column-1' => 8,                   // Simply define the size of the column (from 1 to 12)
                'column-2' => 4,               
                   
                
                
            ),
                    
            'fields' => array(
                array(
                    'id'     => 'disliders',
                    // Group field
                    'type'   => 'group',
                    // Clone whole group?
                    'clone'  => true,
                    // Drag and drop clones to reorder them?
                    'sort_clone' => true,
                    // Sub-fields
                    'collapsible' => true,
                    'group_title' => 'Slide {#}', // ID of the subfield
                    'save_state' => true,
                    
                    'fields' => array(
                    
                    
                        
                         array(
                         'placeholder' => 'Background Image',
                         
                          'id'               => 'bgimg',
                          'type' => 'file_input',
                           'column'  => 'column-1',
            
                    ),  
                    array(
                            'placeholder' => 'Gradient Rotate (0 - 360max)',  
                            'id'   => 'grrotate',
                            'type' => 'text',
                            'column'  => 'column-2',
                        ),  
                     array(
                         
                          'id'               => 'bgcolor',  
                          'type'             => 'color',
                          'alpha_channel' => true,       
                        'column'  => 'column-1',                   
            
                    ),  
    //etc
    
    

    clone?

    #24744
    Long NguyenLong Nguyen
    Moderator

    Hi,

    We can add more clone groups by clicking the "Add More" button, screenshot https://share.getcloudapp.com/jkuejERk.

    It creates a new group from the default settings (when registering the meta box), not create a new one from your current (clone) group.

    Get more details here https://docs.metabox.io/cloning-fields/.

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