Use empty instead of null

Closes #10944
This commit is contained in:
Mike Jolley 2016-05-19 11:47:05 +01:00
parent d3a519f6e4
commit c22d9a3c14
1 changed files with 1 additions and 1 deletions

View File

@ -166,7 +166,7 @@ abstract class WC_Widget extends WP_Widget {
$instance[ $key ] = wp_kses( trim( wp_unslash( $new_instance[ $key ] ) ), wp_kses_allowed_html( 'post' ) );
break;
case 'checkbox' :
$instance[ $key ] = is_null( $new_instance[ $key ] ) ? 0 : 1;
$instance[ $key ] = empty( $new_instance[ $key ] ) ? 0 : 1;
break;
default:
$instance[ $key ] = sanitize_text_field( $new_instance[ $key ] );