I did spot one problem in your case
clause for radio buttons: In your <label>
tag, you use $val
, but I think you meant $option['id']
.
I don’t see how it could be related to the foreach
error you’re getting, but it won’t hurt to fix it.
The odd thing is that the real error is coming from core code: wp-admin/includes/post.php
, line 197. It looks like you’re passing in some post meta, but you aren’t passing in an array, like it wants. Does that help you narrow things down?