mustardBees / cmb-field-select2

Select2 field type for Custom Metaboxes and Fields for WordPress
93 stars 46 forks source link

Sortable not being saved #43

Closed allysonsouza closed 7 years ago

allysonsouza commented 7 years ago

Hi, firstly, thanks for the great additional field for CMB!

I'm just having problem with the sortable feature of Select2, it's not being saved. When I save as a draft the options come back to their original order. Can you help me with this?

mustardBees commented 7 years ago

@allysonsouza Can you confirm the version of CMB2 and of this field?

allysonsouza commented 7 years ago

@mustardBees I'm using CMB2 2.2.5.3, and the latest release of CMB2 Field Select2 (downloaded yesterday).

mustardBees commented 7 years ago

Just tested that combination. I have a meta box associated with a post type. I tried adding a new post and selected a number of items, reordered the list and hit Save Draft.

Seems to be working over here. Possibly you have a different meta box setup? Or a conflict somewhere, do you have any console errors?

allysonsouza commented 7 years ago

Sorry man, your plugin is working really well, my bad code that is broken. I was putting a whitespace before the options array keys (I don't know why) and that's the problem.

Thanks for the fast reply and for the great job!

mustardBees commented 7 years ago

@allysonsouza No worries. Enjoy!