Skip to content

Select field without 'first_empty' in a repeatable group adds iteration with each save #150

@mboynes

Description

@mboynes

Using the following code:

$fm = new Fieldmanager_Group( array(
    'name'           => 'repeatable_select',
    'limit'          => 0,
    'add_more_label' => 'Add another field',
    'label'          => 'Field',
    'children'       => array(
        'select_field' => new Fieldmanager_Select( 'Repeatable Field', array( 'options' => array( 'One', 'Two', 'Three' ) ) )
    )
) );
$fm->add_meta_box( 'Repeatable Select Fields', 'post' );

Every time you save a post, it will add another iteration of repeatable_select because select_field will never be empty.

Not sure what the solution is here. Perhaps force first_empty on repeatable select fields?

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions