W3cubDocs

/WordPress

WP_Duotone::get_svg_definitions( array $sources ): string

Get the SVGs for the duotone filters.

Description

Example output:

……

Parameters

$sourcesarrayrequired
The duotone presets.

Return

string The SVGs for the duotone filters.

Source

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

Changelog

Version Description
6.3.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_duotone/get_svg_definitions