Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

text_list fields not saving correctly #1117

Closed
bucketpress opened this issue May 18, 2017 · 2 comments
Closed

text_list fields not saving correctly #1117

bucketpress opened this issue May 18, 2017 · 2 comments
Assignees

Comments

@bucketpress
Copy link

bucketpress commented May 18, 2017

I have the following:

array(
  'name'    => esc_html__( 'Duration', $prefix ),
    'id'      => "{$prefix}duration",
    'type'    => 'text_list',
    'options' => array(
      'Duration' => 'Duration',
      'Unit' => 'Unit',
    ),
)

The fields are saving wrongly/in an unexpected manner.
Scenario: When I edit only the first field 'Duration' and update, the field gets saved to array[1], when it originally should be array[0].

Seems like text_list always removes and saves the changed fields to the end of the array instead of updating the same array item. This poses a problem if we are retrieving the fields in the order that we have specified when registering them.

@truongwp
Copy link
Contributor

Hi there,
Thank you for your report. I have just fixed it.

@bucketpress
Copy link
Author

@truongwp
Thanks! When will the next version be pushed to WordPress repository that includes this fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants