How to save the values of checkbox to the register setting?

The settings framework can’t detect data that is not posted, so either use a call to update_option or (what I sometimes do) use a yes/no radio button rather than a checkbox. With a radio button where the default value is 0 (no) and the alternative is 1 (yes), the user is setting the post value either way. You’re just making the user make an explicit choice.

Leave a Comment