Enqueue custom filter assets for the page.
Description
Includes an SVG filter and block CSS declaration.
Parameters
$filter_id
stringrequired- The filter ID. e.g.
'wp-duotone-000000-ffffff-2'
. $duotone_selector
stringrequired- The block’s duotone selector. e.g. ‘.wp-block-image img’.
$filter_value
stringrequired- The filter CSS value. e.g.
'url(#wp-duotone-000000-ffffff-2)'
or'unset'
. $filter_data
arrayrequired- Duotone filter data with
'slug'
and'colors'
keys.
Source
private static function enqueue_custom_filter( $filter_id, $duotone_selector, $filter_value, $filter_data ) {
self::$used_svg_filter_data[ $filter_id ] = $filter_data;
self::enqueue_block_css( $filter_id, $duotone_selector, $filter_value );
}
Changelog
Version | Description |
---|---|
6.3.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.