Noptin_Automation_Rule::make_bool( mixed $val )

Converts bool strings to their bool counterparts.


Parameters Parameters

$val

(mixed) (Required) The val to make boolean.


Top ↑

Source Source

File: includes/automation-rules/class-noptin-automation-rule.php

	public function make_bool( $val ) {

        if ( is_scalar( $val ) ) {

            // Make true.
            if ( 'true' === $val ) {
                $val = true;
            }

            // Make false.
            if ( 'false' === $val ) {
                $val = false;
            }

            return $val;

        }

        if ( is_array( $val ) ) {
            return map_deep( $val, array( $this, 'make_bool' ) );
        }

        return $val;

    }


Top ↑

Changelog Changelog

Changelog
VersionDescription
1.3.0Introduced.

Top ↑

User Contributed Notes User Contributed Notes

30 day money back guarantee
Safe & Secure online payment
Custom CSS Slide Example
Custom Animation Example
Default Animation