acf_field_post_object::initialize
__construct
This function will setup the field type data
Method of the class: acf_field_post_object{}
No Hooks.
Returns
null. Nothing (null).
Usage
$acf_field_post_object = new acf_field_post_object(); $acf_field_post_object->initialize();
Changelog
| Since 5.0.0 | Introduced. |
acf_field_post_object::initialize() acf field post object::initialize code 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' ) );
}