lp__init_bool( $value, $filter_value_on_success=true, $filter_value_on_failure=false )
This function allows you to retrieve the value of a property from an object. If the property exists in the object, the corresponding value is returned; otherwise, the default value is returned.
Plugin
Namespace
Launchpad
Parameters
string
$property
The object property.
object
$object
The object.
mixed
$default
Default value to return if the property does not exist (default: null).
mixed
$static
Object property static access type (default: false).
Return
mixed
The value of the property, or the default value if the property does not exist.
Source
File: \includes\lp-utility-functions.php
function lp__init_bool( $value, $filter_value_on_success=true, $filter_value_on_failure=false ){
return filter_var($value, FILTER_VALIDATE_BOOLEAN) ? $filter_value_on_success : $filter_value_on_failure;
}