WP_Duotone::get_svg_definitions
Get the SVGs for the duotone filters.
Example output: <svg><defs><filter id="wp-duotone-blue-orange">…</filter></defs></svg><svg>…</svg>
Method of the class: WP_Duotone{}
No Hooks.
Returns
String. The SVGs for the duotone filters.
Usage
$result = WP_Duotone::get_svg_definitions( $sources );
- $sources(array) (required)
- The duotone presets.
Changelog
| Since 6.3.0 | Introduced. |
WP_Duotone::get_svg_definitions() WP Duotone::get svg definitions code WP 6.9.1
private static function get_svg_definitions( $sources ) {
$svgs = '';
foreach ( $sources as $filter_id => $filter_data ) {
$colors = $filter_data['colors'];
$svgs .= self::get_filter_svg( $filter_id, $colors );
}
return $svgs;
}