WP_Icons_Registry::get_registered_icons │ public │ WP 7.0.0

Retrieves all registered icons.

Метод класса: WP_Icons_Registry{}

Хуков нет.

Возвращает

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

Использование

$WP_Icons_Registry = new WP_Icons_Registry();
$WP_Icons_Registry->get_registered_icons( $search );
$search(строка)
Search term by which to filter the icons.
По умолчанию: ''

Список изменений

С версии 7.0.0 Введена.
С версии 7.1.0 Search also matches icon labels.

Код WP_Icons_Registry::get_registered_icons() WP 7.1.2

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

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

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

	return $icons;
}