wp_unregister_icon_collection()WP 7.1.0

Unregisters an SVG icon collection, together with all its icons.

Call this function after registering the collection. It is usually hooked to init at a later priority than wp_register_icon_collection().

No Hooks.

Returns

true|false.

  • true - the collection and its icons were successfully removed from the registry.
  • false - no collection with the specified slug is registered. WordPress also generates an _doing_it_wrong() notice.

Usage

wp_unregister_icon_collection( $slug );
$slug(string) (required)
Slug of the registered icon collection. For example, my-plugin.

Examples

#1 Removing an icon collection

Remove the collection on the init action after it has been registered.

add_action( 'init', 'my_plugin_unregister_icon_collection', 99 );

function my_plugin_unregister_icon_collection() {
	wp_unregister_icon_collection( 'my-plugin' );
}

Changelog

Since 7.1.0 Introduced.

wp_unregister_icon_collection() code WP 7.1

function wp_unregister_icon_collection( $slug ) {
	return WP_Icon_Collections_Registry::get_instance()->unregister( $slug );
}