WC_Log_Levels::is_valid_level()public staticWC 1.0

Validate a level string.

Method of the class: WC_Log_Levels{}

No Hooks.

Return

true|false. True if $level is a valid level.

Usage

$result = WC_Log_Levels::is_valid_level( $level );
$level(string) (required)
Log level.

WC_Log_Levels::is_valid_level() code WC 9.4.2

public static function is_valid_level( $level ) {
	return is_string( $level ) && array_key_exists( strtolower( $level ), self::$level_to_severity );
}