In inc/functions.php, there's no need for the ternary:
function mesmerize_sanitize_checkbox($val)
{
return (isset($val) && $val == true ? true : false);
}
That can simply be written as:
function mesmerize_sanitize_checkbox( $val ) {
return isset( $val ) && $val;
}
Or:
function mesmerize_sanitize_checkbox( $val ) {
return ! empty( $val );
}
The return value of the expression in either case will be true or false.
Just keep this in mind anytime you're returning true or false with a ternary. You almost never need it.
In
inc/functions.php, there's no need for the ternary:That can simply be written as:
Or:
The return value of the expression in either case will be
trueorfalse.Just keep this in mind anytime you're returning
trueorfalsewith a ternary. You almost never need it.