acf_prepare_field_group_for_import()ACF 5.8.8

acf_prepare_field_group_for_import

Prepares a field group for the import process.

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

Возвращает

Массив.

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

acf_prepare_field_group_for_import( $field_group );
$field_group(массив) (обязательный)
The field group array.

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

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

Код acf_prepare_field_group_for_import() ACF 6.0.4

function acf_prepare_field_group_for_import( $field_group ) {

	// Update parent and menu_order properties for all fields.
	if ( $field_group['fields'] ) {
		foreach ( $field_group['fields'] as $i => &$field ) {
			$field['parent']     = $field_group['key'];
			$field['menu_order'] = $i;
		}
	}

	/**
	 * Filters the $field_group array before being returned to the import tool.
	 *
	 * @date    21/11/19
	 * @since   5.8.8
	 *
	 * @param   array $field_group The field group array.
	 */
	return apply_filters( 'acf/prepare_field_group_for_import', $field_group );
}