acf_field_repeater::initialize()publicACF 5.0.0

This function will set up the field type data

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

Хуков нет.

Возвращает

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

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

$acf_field_repeater = new acf_field_repeater();
$acf_field_repeater->initialize();

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

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

Код acf_field_repeater::initialize() ACF 6.0.4

public function initialize() {
	$this->name     = 'repeater';
	$this->label    = __( 'Repeater', 'acf' );
	$this->category = 'layout';
	$this->defaults = array(
		'sub_fields'    => array(),
		'min'           => 0,
		'max'           => 0,
		'rows_per_page' => 20,
		'layout'        => 'table',
		'button_label'  => '',
		'collapsed'     => '',
	);

	// field filters
	$this->add_field_filter( 'acf/prepare_field_for_export', array( $this, 'prepare_field_for_export' ) );
	$this->add_field_filter( 'acf/prepare_field_for_import', array( $this, 'prepare_field_for_import' ) );

	// filters
	$this->add_filter( 'acf/validate_field', array( $this, 'validate_any_field' ) );
	$this->add_filter( 'acf/pre_render_fields', array( $this, 'pre_render_fields' ), 10, 2 );

	add_action( 'wp_ajax_acf/ajax/query_repeater', array( $this, 'ajax_get_rows' ) );
}