I’m designing a widget where I would like to display the categories available for a custom post type, and then allow the end user to select multiple categories that they would like to include in the query for this widget.
The widget options form displays just fine (before a user has save any settings, but after the instance’s options have been saved, the multi-select widget goes wonky and only displays the “Use All Groups” default option.
Can someone please have a look at my current form() and update() functions from my widget? I’ve pasted the entire widget code here:
I managed to kill the error that was coming up by changing the <select> box name attribute to <?php $this->get_field_name( 'use_groups'); ?> however, only the last element in the array of selected options is getting saved to the database. So that no matter how many options I select, the last one is the only one being saved.