rilwis/meta-box — Issue #6: Unchecked checkboxes get checked again at next page load
Author: lmeurs
Created: 2011-11-07 16:18:13+00:00
State: open

In version 3.2.2 at line 226 the function show() checks if a custom field has any value: if not, it declares the default value. See:
$meta = ($meta !== ”) ? $meta : $field['std'];

But when a checkbox is unchecked, no data is saved and the next time the field gets loaded, it gets the standard value. If the default value is 1, true, ‘on’ or ‘checked’ an unchecked checkbox always automatically gets checked again!

A solution might be to always save a value, also when a checkbox is unchecked. Like FALSE, 0 or ‘off’…