Skip to content

Commit

Permalink
Fix checkbox checker to not fallback to alternate array keys
Browse files Browse the repository at this point in the history
  • Loading branch information
joedolson committed Nov 24, 2023
1 parent 4a40a26 commit d60e982
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/wpt-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ function wpt_checkbox( $field, $sub1 = false, $sub2 = '' ) {
} else {
$value = 0;
}
if ( 1 === (int) $value ) {
if ( $value && 1 === (int) $value ) {
return 'checked="checked"';
} else {
return '';
}
}
if ( 1 === (int) get_option( $field ) ) {
Expand Down

0 comments on commit d60e982

Please sign in to comment.