Support Forum
Support › Meta Box Builder › Fields returning as array
Not sure if this is a Builder or Group Plugin problem.
When saving cloned fields the 1st field comes back as an array of the individual fields that were entered before hitting save. Saving just creates a longer array. I have recreated the custom fields with new field names , cleared the fields in phpmyadmin and it still returns the same strange array results. All plugins are the latest version. This is a resent error, since this site has been up and running for a few years now.
$meta_boxes[] = [
'title' => __( 'Home Options New', 'your-text-domain' ),
'id' => 'home-options-new',
'post_types' => ['page'],
'closed' => false,
'show' => [
'relation' => 'OR',
'template' => ['templates/home-page.php'],
],
'fields' => [
[
'name' => __( 'Weekend Mass', 'your-text-domain' ),
'id' => $prefix . 'weekend_mass_new',
'type' => 'group',
'collapsible' => false,
'clone' => false,
'clone_empty_start' => false,
'fields' => [
[
'name' => __( 'Letter', 'your-text-domain' ),
'id' => $prefix . 'weekend_letter_new',
'type' => 'text',
'required' => false,
'disabled' => false,
'readonly' => false,
'clone' => false,
'clone_empty_start' => false,
],
[
'name' => __( 'Title', 'your-text-domain' ),
'id' => $prefix . 'weekend_title_new',
'type' => 'text',
'required' => false,
'disabled' => false,
'readonly' => false,
'clone' => false,
'clone_empty_start' => false,
],
[
'name' => __( 'Day and Time', 'your-text-domain' ),
'id' => $prefix . 'weekend_time_new',
'type' => 'text',
'required' => false,
'disabled' => false,
'readonly' => false,
'clone' => true,
'sort_clone' => false,
'clone_default' => false,
'clone_as_multiple' => false,
'clone_empty_start' => false,
'max_clone' => 5,
'add_button' => __( 'Add Another Day / Time', 'your-text-domain' ),
],
],
],
[
'name' => __( 'Daily Mass', 'your-text-domain' ),
'id' => $prefix . 'daily_mass_new',
'type' => 'group',
'collapsible' => false,
'clone' => false,
'clone_empty_start' => false,
'fields' => [
[
'name' => __( 'Letter', 'your-text-domain' ),
'id' => $prefix . 'daily_letter_new',
'type' => 'text',
'required' => false,
'disabled' => false,
'readonly' => false,
'clone' => false,
'clone_empty_start' => false,
],
[
'name' => __( 'Title', 'your-text-domain' ),
'id' => $prefix . 'daily_title_new',
'type' => 'text',
'required' => false,
'disabled' => false,
'readonly' => false,
'clone' => false,
'clone_empty_start' => false,
],
[
'name' => __( 'Day and Time', 'your-text-domain' ),
'id' => $prefix . 'daily_time_new',
'type' => 'text',
'required' => false,
'disabled' => false,
'readonly' => false,
'clone' => true,
'sort_clone' => false,
'clone_default' => false,
'clone_as_multiple' => false,
'clone_empty_start' => false,
'max_clone' => 5,
'add_button' => __( 'Add Another Day / Time', 'your-text-domain' ),
],
],
],
[
'name' => __( 'Confession Mass', 'your-text-domain' ),
'id' => $prefix . 'confession_mass_new',
'type' => 'group',
'collapsible' => false,
'clone' => false,
'clone_empty_start' => false,
'fields' => [
[
'name' => __( 'Letter', 'your-text-domain' ),
'id' => $prefix . 'confession_letter_new',
'type' => 'text',
'required' => false,
'disabled' => false,
'readonly' => false,
'clone' => false,
'clone_empty_start' => false,
],
[
'name' => __( 'Title', 'your-text-domain' ),
'id' => $prefix . 'confession_title_new',
'type' => 'text',
'required' => false,
'disabled' => false,
'readonly' => false,
'clone' => false,
'clone_empty_start' => false,
],
[
'name' => __( 'Day and Time', 'your-text-domain' ),
'id' => $prefix . 'confession_time_new',
'type' => 'text',
'required' => false,
'disabled' => false,
'readonly' => false,
'clone' => true,
'sort_clone' => false,
'clone_default' => false,
'clone_as_multiple' => false,
'clone_empty_start' => false,
'max_clone' => 5,
'add_button' => __( 'Add Another Day / Time', 'your-text-domain' ),
],
],
],
],
];
Hello,
Thank you for your feedback.
There is an issue with the cloneable fields in the new version of Meta Box 5.10.0 and our development team is working on it. The fix for the issue will be included in the next update of MB plugins.