Open richardsweeney opened 10 years ago
You should be able to use $checkboxes->set_default_value(array('something'));
, just as you do with select boxes. But quickly skimming the code in WP_Form_View_Checkboxes
, it looks like I haven't yet implemented that. I'll add it in as soon as I can (but I'm a little overwhelmed right now, so pull requests are always welcome).
Cool. I'll take a look and see if I can fix this myself. It's such a fantastic project I'd love to contribute if I can :)
Richard - THANK YOU for the update! I was pulling my hair out for a bit.
In case anyone else needs this fixed - see Richard's pull request:
Oh. I tried to solved this on the past week but can't create a pretty working solution and now I find this. You rock @richardsweeney. Thank you.
I can create a checkbox group like so:
Cool.
But if I'm grabbing data from the database (after the form has been submitted), how do I show which options have been selected.
Will sets all the attributes to checked. There doesn't seem to be anything I can find in the docs about this. Any tips!?