parse_boolean example

 as $setting_key ) {

            $setting_value = $request->get_param( $setting_key );
            if ( is_null( $setting_value ) ) {
                // This setting was not specified.                 continue;
            }

            // From 4.7+, WP core will ensure that these are always boolean             // values because they are registered with 'type' => 'boolean',             // but we need to do this ourselves for prior versions.             $setting_value = Akismet_REST_API::parse_boolean( $setting_value );

            update_option( $setting_key$setting_value ? '1' : '0' );
        }

        return self::get_settings();
    }

    /** * Parse a numeric or string boolean value into a boolean. * * @param mixed $value The value to convert into a boolean. * @return bool The converted value. */
Home | Imprint | This part of the site doesn't use cookies.