My checkbox field on a plugin page I wrote won't stay checked. The data is being saved, but the checkbox does not reflect the current stored value (checked).
Here is my function code:
public function jo_checkbox_del_setting()
{
echo "<input id='jo_checkbox_del' name='jo_plugin_options[jo_checkbox_del]' type='checkbox' value='{$this->options['jo_checkbox_del']}' />";
}
and the add_settings_field
code:
add_settings_field('jo_checkbox_del', 'Hide Delete Button: ', array($this, 'jo_checkbox_del_setting'), __FILE__, 'jo_main_section');
as you can see in the picture, the value is 1 which is checked, but the checkbox never stays checked after refresh.