Custom Fields
Re-Envisioned
Support Meta Box Group Max clone does not work if I have subgroup

This topic contains 3 replies, has 2 voices, and was last updated by  Anh Tran 2 years, 6 months ago.

  • Creator
    Topic
  • #3703

    Infolu
    Participant

    Hello I am having a problem, I not find anything related.

    If I have a subgroup with Group enabled to clone, I can not use the max_cloner. (The button clone the main group disappears)

    If I do not have a Subgroup and use max_cloner works perfectly.

    add_filter( 'rwmb_meta_boxes', 'demo_nested_groups' );
    function demo_nested_groups( $meta_boxes ) {
    	$meta_boxes[] = array(
    		'title'  => __( 'Multi-level nested groups', 'textdomain' ),
    		'fields' => array(
    			array(
    				'id'     => 'group',
    				'type'   => 'group',
    				'clone'  => true,
                                    'max_clone' => 5,
    				'fields' => array(
    					// Normal field (cloned)
    					array(
    						'name'  => __( 'Text', 'textdomain' ),
    						'id'    => 'text',
    						'type'  => 'text',
    						'clone' => true,
    					),
    					// Nested group level 2
    					array(
    						'name'   => __( 'Sub group', 'textdomain' ),
    						'id'     => 'sub_group',
    						'type'   => 'group',
    						'clone'  => true,
    						'fields' => array(
    							// Normal field (cloned)
    							array(
    								'name'  => __( 'Sub text', 'textdomain' ),
    								'id'    => 'sub_text',
    								'type'  => 'text',
    								'clone' => true,
    							),
    						),
    					),
    				),
    			),
    		),
    	);
    	return $meta_boxes;
    }
Viewing 3 replies - 1 through 3 (of 3 total)
  • Author
    Replies
  • #3710

    Anh Tran
    Keymaster

    Thanks for reporting. I will check it.

    #3803

    Infolu
    Participant

    Hello any news on this?

    I realized that in the above example if I almentar the max clone 10 then he allows me to clone 5.

    #3806

    Anh Tran
    Keymaster

    It’s a JS bug and I have a little difficulty with it. I will let you know when it’s fixed.

Viewing 3 replies - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.