WP_Icons_Registry::unregister( string $icon_name ): bool

In this article

Unregisters an icon.

Parameters

$icon_namestringrequired
Namespaced icon name in the form "collection/icon-name" (e.g. "core/arrow-left").

Return

bool True if the icon was unregistered successfully, false otherwise.

Source

public function unregister( $icon_name ) {
	if ( ! $this->is_registered( $icon_name ) ) {
		_doing_it_wrong(
			__METHOD__,
			sprintf(
				/* translators: %s: Icon name. */
				__( 'Icon "%s" is not registered.' ),
				$icon_name
			),
			'7.1.0'
		);
		return false;
	}

	unset( $this->registered_icons[ $icon_name ] );
	return true;
}

Changelog

VersionDescription
7.1.0Introduced.

User Contributed Notes

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