WP_Duotone::is_preset( string $duotone_attr ): bool

This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

Checks if we have a valid duotone preset.

Description

Valid presets are defined in the $global_styles_presets array.

Parameters

$duotone_attrstringrequired
The duotone attribute from a block.

Return

bool True if the duotone preset present and valid.

Source

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() );
}

Changelog

VersionDescription
6.3.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.