acf_get_grouped_field_types()ACF 5.0.0

Returns an multi-dimentional array of field types "name => label" grouped by category

Хуки из функции

Возвращает

Массив.

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

acf_get_grouped_field_types();

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

С версии 5.0.0 Введена.

Код acf_get_grouped_field_types() ACF 6.4.2

function acf_get_grouped_field_types() {

	// vars
	$types  = acf_get_field_types();
	$groups = array();
	$l10n   = acf_get_field_categories_i18n();

	// loop
	foreach ( $types as $type ) {

		// translate
		$cat = $type->category;
		$cat = isset( $l10n[ $cat ] ) ? $l10n[ $cat ] : $cat;

		// append
		$groups[ $cat ][ $type->name ] = $type->label;
	}

	// filter
	$groups = apply_filters( 'acf/get_field_types', $groups );

	// return
	return $groups;
}