WP_Duotone::is_preset()private staticWP 6.3.0

Checks if we have a valid duotone preset.

Valid presets are defined in the $global_styles_presets array.

Method of the class: WP_Duotone{}

No Hooks.

Return

true|false. True if the duotone preset present and valid.

Usage

$result = WP_Duotone::is_preset( $duotone_attr );
$duotone_attr(string) (required)
The duotone attribute from a block.

Changelog

Since 6.3.0 Introduced.

WP_Duotone::is_preset() code WP 6.5.3

private static function is_preset( $duotone_attr ) {
	$slug      = self::get_slug_from_attribute( $duotone_attr );
	$filter_id = self::get_filter_id( $slug );

	return array_key_exists( $filter_id, self::get_all_global_styles_presets() );
}