Still looking for a solution on this one
You’re self-closing the select tag, here..
<select class="widefat" id="'.$field_id.'" name="'.$field_name.'" />';
Which is causing the select to close premature when it tries to re-render..
It should read..
<select class="widefat" id="'.$field_id.'" name="'.$field_name.'">';
Tags that have a closing element(li,ul,select,option…etc..), shouldn’t be self-closed, the only elements that need to be self-closed are hr, br and img.. (possibly might be one or two more, but they’re the common ones)..
Issue resolved, thank you Mark.
You’re welcome, and thanks for posting back to let us know.. 🙂