wp-shortcake / shortcake

Shortcake makes using WordPress shortcodes a piece of cake.
GNU General Public License v2.0
664 stars 143 forks source link

646 update to select2 4 bugs #655

Closed mattheu closed 7 years ago

mattheu commented 7 years ago

Ran into a couple of bugs in the new Select2 4 implementation

goldenapples commented 7 years ago

Ah, javascript. I never knew how to test specifically for a array, since it doesn't return a unique value with typeof. Array.isArray() is nice to know, filing that away for the future.

Also returning a structured empty array when there are no results seems like a good catch. I didn't notice any errors coming from returning null, but it seems better to be conservative with the return values there....