acf_field_post_object::initialize()publicACF 5.0.0

__construct

This function will setup the field type data

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

Хуков нет.

Возвращает

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

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

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

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

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

Код acf_field_post_object::initialize() ACF 6.0.4

function initialize() {

	// vars
	$this->name     = 'post_object';
	$this->label    = __( 'Post Object', 'acf' );
	$this->category = 'relational';
	$this->defaults = array(
		'post_type'     => array(),
		'taxonomy'      => array(),
		'allow_null'    => 0,
		'multiple'      => 0,
		'return_format' => 'object',
		'ui'            => 1,
	);

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

}