WP_Duotone::get_svg_definitions()private staticWP 6.3.0

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.

Return

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() code WP 6.6.2

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;
}