acf_field_repeater::duplicate_field()publicACF 3.6

This filter is applied to the $field before it is duplicated and saved to the database.

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

Хуков нет.




$acf_field_repeater = new acf_field_repeater();
$acf_field_repeater->duplicate_field( $field );
$field(массив) (обязательный)
The field array holding all the field options.

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

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

Код acf_field_repeater::duplicate_field() ACF 6.0.4

function duplicate_field( $field ) {
	// get sub fields
	$sub_fields = acf_extract_var( $field, 'sub_fields' );

	// save field to get ID
	$field = acf_update_field( $field );

	// duplicate sub fields
	acf_duplicate_fields( $sub_fields, $field['ID'] );

	return $field;