wp_get_duotone_filter_property()
Returns the CSS filter property url to reference the rendered SVG.
Эта функция считается внутренней для использования самим ядром. Не рекомендуется использовать эту функцию в своем коде.
Хуков нет.
Возвращает
Строку
. Duotone CSS filter property url value.
Использование
wp_get_duotone_filter_property( $preset );
- $preset(массив) (обязательный)
- Duotone preset value as seen in theme.json.
Список изменений
С версии 5.9.0 | Введена. |
С версии 6.1.0 | Allow unset for preset colors. |
Код wp_get_duotone_filter_property() wp get duotone filter property WP 6.1.1
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 . "')"; }