Support Forum
Support › Meta Box Group › Nested Clones Break
Hi,
I have created a group of inputs that are clonable and within this group there is another clonable input. I can only see the nested cloneable inputs add button but I can see the parent one for the group in the html given the display none style.
Neither have reached there maximum clones specified. Any ideas?
array(
'name' => 'Create Feature Banners',
'id' => $prefix .'home_banner_features',
'type' => 'group',
'clone' => true,
'max_clone' => 2,
'sort_clone' => true,
'add_button' => 'Add Bannner',
'fields' => array (
array(
'name' => 'Banner Title',
'desc' => 'Enter title for banner',
'id' => $prefix . 'feature_banner_title',
'type' => 'text',
'size' => 60,
),
array(
'name' => 'Banner Description',
'desc' => 'Enter description text for banner',
'id' => $prefix . 'feature_banner_desc',
'type' => 'textarea',
),
array(
'name' => 'Banner Background Image',
'desc' => 'Select an image for the background',
'id' => $prefix . 'feature_banner_bg',
'type' => 'file_input',
'max_file_uploads' => 1,
),
array(
'name' => 'Banner links/buttons',
'id' => $prefix .'feature_banner_links',
'type' => 'post',
'clone' => true,
'max_clone' => 4,
'add_button' => 'Add Button',
'sort_clone' => 'true',
// Post type.
'post_type' => array('page', 'post','event', 'course'),
// Field type.
'field_type' => 'select_advanced',
// Placeholder, inherited from <code>select_advanced</code> field.
'placeholder' => 'Select an item to link',
// Query arguments. See https://codex.wordpress.org/Class_Reference/WP_Query
'query_args' => array(
'post_status' => 'publish',
'posts_per_page' => - 1,
)
)
)
)
Here is the code in question.
I seem to be able to get the button to appear if I increase the group max_clone value to 5 so I think it is due to a counter that is keeping track. On the face maybe the child clone options are increasing the parent clone as well rather than being independent.
Any ideas?
Hi Adam,
I'm working on it. Please wait.
Thanks Anh! Really appreciate it and thanks for keeping me updated.
Hi Adam, I've just fixed it on Github. Can you test it?
Thanks Anh.
I will download and test right now for you.
Regards
That's worked great thank you ?