WP_Theme_JSON::get_svg_filters( array $origins ): string

In this article

Converts all filter (duotone) presets into SVGs.

Parameters

$originsarrayrequired
List of origins to process.

Return

string SVG filters.

Source

			}
		}
	}
}

/**
 * Converts all filter (duotone) presets into SVGs.
 *
 * @since 5.9.1
 *
 * @param array $origins List of origins to process.
 * @return string SVG filters.
 */
public function get_svg_filters( $origins ) {
	$blocks_metadata = static::get_blocks_metadata();
	$setting_nodes   = static::get_setting_nodes( $this->theme_json, $blocks_metadata );

	$filters = '';
	foreach ( $setting_nodes as $metadata ) {
		$node = _wp_array_get( $this->theme_json, $metadata['path'], array() );
		if ( empty( $node['color']['duotone'] ) ) {
			continue;
		}

		$duotone_presets = $node['color']['duotone'];

Changelog

VersionDescription
5.9.1Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.