I made a widget with multiple checkbox but it didn't save.
the code of my checkbox
<input type="checkbox" id="post-'.get_the_id().'" value="'.get_the_id().'" name="include[]" />
and I save it like this:
//save the widget
function update( $new_instance, $old_instance ) {
$instance = $old_instance;
$instance['include'] = $new_instance['include'];
return $instance;
}
thanks in advance.
Aucun commentaire:
Enregistrer un commentaire