Skip to content

Radio button input isn't saved when adding page to repeatable group #150

Closed

Description

With the metabox below I have a problem saving the radio button. To repeat the issue:

  1. Create a new post
  2. Choose "template 1"
  3. Add Page (add Row)
  4. Choose "template 2"
  5. Publish
  6. The 2nd page doesn't even save. It's missing.
  7. Add Page (add Row)
  8. Choose "template 2"
  9. Update
  10. The 2nd page is still missing.

Note that if I have another field in there, say a text input, the 2nd page will save, but the radio button value doesn't get set.

Any thoughts on how I can fix this problem? I think it's the root to some other issues I'm having with adding rows/pages and then sorting...

    $meta_boxes[] = array(
        'id'         => CMB_PREFIX.'lb_settings',
        'title'      => 'Settings',
        CMB_POST_TYPE_KEY => array('lookbook'),
        'context'    => 'normal',
        'priority'   => 'high',
        'show_names' => true, 
        'fields'     => array(
            array(
                'id' => CMB_PREFIX.'lb_pages',
                'type' => 'group',
                //'description' => '',
                'options' => array(
                    'group_title' => 'Page {#}',
                    'add_button' => 'Add Page',
                    'remove_button' => 'Remove Page',
                    'sortable' => true,
                ),
                'fields' => array(
                    array(
                        'name' => 'Template',
                        'id' => CMB_PREFIX.'lb_page_template',
                        'type' => 'radio_inline',
                        'options' => array(
                            'template1' => 'Template 1',
                            'template2' => 'Template 2',
                            'template3' => 'Template 3',
                        )
                    ),
                )
            ),
        )
    );

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions