WP_Duotone::get_filter_id_from_preset()public staticWP 6.3.0

Deprecated from version 6.3.0. It is no longer supported and can be removed in future releases. It is recommended to replace this function with the same one.

Returns the prefixed id for the duotone filter for use as a CSS id.

Exported for the deprecated function wp_get_duotone_filter_id().

Method of the class: WP_Duotone{}

No Hooks.


String. Duotone filter CSS id.


$result = WP_Duotone::get_filter_id_from_preset( $preset );
$preset(array) (required)
Duotone preset value as seen in theme.json.


Since 6.3.0 Introduced.
Deprecated since 6.3.0

WP_Duotone::get_filter_id_from_preset() code WP 6.5.4

public static function get_filter_id_from_preset( $preset ) {
	_deprecated_function( __FUNCTION__, '6.3.0' );

	$filter_id = '';
	if ( isset( $preset['slug'] ) ) {
		$filter_id = self::get_filter_id( $preset['slug'] );
	return $filter_id;