Sources and collectionseasy_svg_pro_collection_icons

easy_svg_pro_collection_icons

Filters the icons of one source collection (theme, drop-in or registered in code) just before it is added to the registry.

Filter · Easy SVG Pro · Status: Internal · Defined in includes/sources/sources.php

Internal: not part of the promised public surface. It may change without notice.

Usage

apply_filters( 'easy_svg_pro_collection_icons', array $icons, string $slug, string $source )

Example

add_filter( 'easy_svg_pro_collection_icons', function ( $icons, $slug ) {
	if ( 'theme' === $slug ) {
		unset( $icons['old-logo'] );
	}
	return $icons;
}, 10, 2 );

Description

Runs for every source collection on each request where the sources feature is on, including calls to easy_svg_register_icon_collection(). Icon sets are not sources and do not pass through here. Problems found while scanning are recorded before this filter, so they are reported even if you empty the list.

Parameters

body
$iconsarray<string,string>

Icon slug => sanitized and hardened markup.

body
$slugstring

The collection slug being registered.

body
$sourcestring

The folder the icons came from, or '' for an array passed in code.

Return value

returnarray<string,string>

The icons to register. An empty array registers no collection.

Default: The scanned icons

Markup you add or change here is registered as it stands, without another sanitizer pass. Only return markup you trust.