Skip to content

Commit

Permalink
Use null === vs is_null for consitency and removing marginal function…
Browse files Browse the repository at this point in the history
… call overhead
  • Loading branch information
jtsternberg committed Oct 30, 2015
1 parent 8e06a2f commit 78ceace
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion includes/CMB2_Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -1042,7 +1042,7 @@ public function _set_field_defaults( $args ) {
$args['show_option_none'] = isset( $args['show_option_none'] ) ? $args['show_option_none'] : null;
$args['show_option_none'] = true === $args['show_option_none'] ? __( 'None', 'cmb2' ) : $args['show_option_none'];

if ( is_null( $args['show_option_none'] ) ) {
if ( null === $args['show_option_none'] ) {
$off_by_default = in_array( $args['type'], array( 'select', 'radio', 'radio_inline' ), true );
$args['show_option_none'] = $off_by_default ? false : __( 'None', 'cmb2' );
}
Expand Down
2 changes: 1 addition & 1 deletion includes/CMB2_Types.php
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ public function checkbox( $args = array(), $is_checked = null ) {

$meta_value = $this->field->escaped_value();

$is_checked = is_null( $is_checked )
$is_checked = null === $is_checked
? ! empty( $meta_value )
: $is_checked;

Expand Down

0 comments on commit 78ceace

Please sign in to comment.