Skip to content

Commit b203fbc

Browse files
committed
Fix saving empty multicheck section
By adding an empty value we make sure http post will add the checkbox id so get_option will see something is set and not return us the default. Fixes #63 Signed-off-by: Roi Dayan <roi.dayan@gmail.com>
1 parent 8987165 commit b203fbc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/class.settings-api.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ function callback_multicheck( $args ) {
222222

223223
$value = $this->get_option( $args['id'], $args['section'], $args['std'] );
224224
$html = '<fieldset>';
225-
225+
$html .= sprintf( '<input type="hidden" name="%1$s[%2$s]" value="" />', $args['section'], $args['id'] );
226226
foreach ( $args['options'] as $key => $label ) {
227227
$checked = isset( $value[$key] ) ? $value[$key] : '0';
228228
$html .= sprintf( '<label for="wpuf-%1$s[%2$s][%3$s]">', $args['section'], $args['id'], $key );

0 commit comments

Comments
 (0)