wp_get_duotone_filter_property

The timeline below displays how wordpress function wp_get_duotone_filter_property has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.3

/**
 * Returns the CSS filter property url to reference the rendered SVG.
 *
 * @since 5.9.0
 * @since 6.1.0 Allow unset for preset colors.
 * @deprecated 6.3.0
 *
 * @access private
 *
 * @param array $preset Duotone preset value as seen in theme.json.
 * @return string Duotone CSS filter property url value.
 */
function wp_get_duotone_filter_property($preset)
{
    _deprecated_function(__FUNCTION__, '6.3.0');
    return WP_Duotone::get_filter_css_property_value_from_preset($preset);
}

WordPress Version: 6.1

/**
 * Returns the CSS filter property url to reference the rendered SVG.
 *
 * @since 5.9.0
 * @since 6.1.0 Allow unset for preset colors.
 * @access private
 *
 * @param array $preset Duotone preset value as seen in theme.json.
 * @return string Duotone CSS filter property url value.
 */
function wp_get_duotone_filter_property($preset)
{
    if (isset($preset['colors']) && 'unset' === $preset['colors']) {
        return 'none';
    }
    $filter_id = wp_get_duotone_filter_id($preset);
    return "url('#" . $filter_id . "')";
}

WordPress Version: 9.1

/**
 * Returns the CSS filter property url to reference the rendered SVG.
 *
 * @since 5.9.0
 * @access private
 *
 * @param array $preset Duotone preset value as seen in theme.json.
 * @return string Duotone CSS filter property url value.
 */
function wp_get_duotone_filter_property($preset)
{
    $filter_id = wp_get_duotone_filter_id($preset);
    return "url('#" . $filter_id . "')";
}