Clonable Group inherits previous conditional fields

Support MB Group Clonable Group inherits previous conditional fieldsResolved

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #5960
    InternativeInternative
    Participant

    Hi,

    When I clone a group it automatically inherits the conditional field chosen in the previous group.
    Is there a way to reset a group upon cloning or is this a bug?

    #5983
    Tan NguyenTan Nguyen
    Participant

    Dear Internative,

    I've double checked the plugin and see that it works properly. Here is my code from the group example:

    
    add_filter( 'rwmb_meta_boxes', 'meta_box_group_demo_register' );
    function meta_box_group_demo_register( $meta_boxes ) {
    	$meta_boxes[] = array(
    		'title'  => __( 'Album Tracks' ),
    		'fields' => array(
    			array(
    				'id'     => 'standard',
    				// Group field
    				'type'   => 'group',
    				// Clone whole group?
    				'clone'  => true,
    				// Drag and drop clones to reorder them?
    				'sort_clone' => true,
    				// Sub-fields
    				'fields' => array(
                        array(
    						'name'    => __( 'Genre', 'rwmb' ),
    						'id'      => 'genre',
    						'type'    => 'select_advanced',
    						'options' => array(
    							'pop'  => __( 'Pop', 'rwmb' ),
    							'rock' => __( 'Rock', 'rwmb' ),
    						),
    					),
    					array(
    						'name' => __( 'Track name', 'rwmb' ),
    						'id'   => 'text',
    						'type' => 'text',
                            'visible' => ['genre', '!=', '']
    					),
    					array(
    						'name' => __( 'Release Date', 'rwmb' ),
    						'id'   => 'date',
    						'type' => 'date',
                            'visible' => ['genre', '!=', '']
    					),
    				),
    			),
    		),
    	);
    	return $meta_boxes;
    }
    

    Can you please paste your code here so I can check?

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