WP_Icons_Registry::get_registered_icons( string $search = '' ): array[]

In this article

Retrieves all registered icons.

Parameters

$searchstringoptional
Search term by which to filter the icons.

Default:''

Return

array[] Array of arrays containing the registered icon properties.

Source

public function get_registered_icons( $search = '' ) {
	$icons = array();

	foreach ( $this->registered_icons as $icon ) {
		if ( ! empty( $search ) && false === stripos( $icon['name'], $search ) ) {
			continue;
		}

		$icon['content'] = $icon['content'] ?? $this->get_content( $icon['name'] );
		$icons[]         = $icon;
	}

	return $icons;
}

User Contributed Notes

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