HTML stripped from hand-coded select boxes after saving widget options
|Reported by:||sillybean||Owned by:||azaozz|
I've been having problems with some select boxes in widget options. After I save changes, my options are displayed as text rather than option fields, like so:
The values are stored correctly, but you can't make any further changes without reloading the widget admin page. Select boxes generated by WP functions (like wp_dropdown_categories or wp_dropdown_pages) don't seem to be affected, but hand-coded ones are -- although I can't see a difference in their HTML structures.
The ajax return (according to Firebug) looks like:
<p><label for="widget-randompostsfromcategory-3-content">Display:</label> <select id="widget-randompostsfromcategory-3-content" name="widget-randompostsfromcategory[content]" /> <option value="title" >Title Only</option> <option value="excerpt" selected="selected" >Title and Excerpt</option> <option value="content" >Title and Content</option> </select></p>
What actually shows up on the page:
<p><label for="widget-randompostsfromcategory-3-content">Display:</label> <select name="widget-randompostsfromcategory[content]" id="widget-randompostsfromcategory-3-content"/> Title Only Title and Excerpt Title and Content </p>
For some reason the </select> tag is removed along with all the <option></option> tags.
The code above is taken from my Random Posts from Category plugin, but I've seen the same behavior in other widget plugins as well.