acf_field_clone::initialize()publicACF 5.0.0

__construct

This function will setup the field type data

@type    function

{} Это метод класса: acf_field_clone{}

Хуков нет.

Возвращает

null. Ничего.

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

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

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

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

Код acf_field_clone::initialize() ACF 5.10.2

function initialize() {

	// vars
	$this->name      = 'clone';
	$this->label     = _x( 'Clone', 'noun', 'acf' );
	$this->category  = 'layout';
	$this->defaults  = array(
		'clone'        => '',
		'prefix_label' => 0,
		'prefix_name'  => 0,
		'display'      => 'seamless',
		'layout'       => 'block',
	);
	$this->cloning   = array();
	$this->have_rows = 'single';

	// register filter
	acf_enable_filter( 'clone' );

	// ajax
	add_action( 'wp_ajax_acf/fields/clone/query', array( $this, 'ajax_query' ) );

	// filters
	add_filter( 'acf/get_fields', array( $this, 'acf_get_fields' ), 5, 2 );
	add_filter( 'acf/prepare_field', array( $this, 'acf_prepare_field' ), 10, 1 );
	add_filter( 'acf/clone_field', array( $this, 'acf_clone_field' ), 10, 2 );

}