WP_Duotone::is_preset
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.
Returns
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() WP Duotone::is preset code WP 6.9
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() );
}