acf_field_relationship::initialize()publicACF 5.0.0

__construct

This function will setup the field type data

@type    function

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

Хуков нет.

Возвращает

null. Ничего.

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

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

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

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

Код acf_field_relationship::initialize() ACF 5.10.2

function initialize() {

	// vars
	$this->name     = 'relationship';
	$this->label    = __( 'Relationship', 'acf' );
	$this->category = 'relational';
	$this->defaults = array(
		'post_type'     => array(),
		'taxonomy'      => array(),
		'min'           => 0,
		'max'           => 0,
		'filters'       => array( 'search', 'post_type', 'taxonomy' ),
		'elements'      => array(),
		'return_format' => 'object',
	);

	// extra
	add_action( 'wp_ajax_acf/fields/relationship/query', array( $this, 'ajax_query' ) );
	add_action( 'wp_ajax_nopriv_acf/fields/relationship/query', array( $this, 'ajax_query' ) );

}