acf_field_repeater::delete_field()publicACF 5.0.0

Deletes any subfields after the field has been deleted.

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

Хуков нет.

Возвращает

null. Ничего (null).

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

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

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

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

Код acf_field_repeater::delete_field() ACF 6.0.4

function delete_field( $field ) {
	// Bail early if no subfields.
	if ( empty( $field['sub_fields'] ) ) {
		return;
	}

	// Delete any subfields.
	foreach ( $field['sub_fields'] as $sub_field ) {
		acf_delete_field( $sub_field['ID'] );
	}
}