acf_field_post_object::initialize
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 field post object::initialize ACF 6.4.2
public function initialize() {
$this->name = 'post_object';
$this->label = __( 'Post Object', 'acf' );
$this->category = 'relational';
$this->description = __( 'An interactive and customizable UI for picking one or many posts, pages or post type items with the option to search. ', 'acf' );
$this->preview_image = acf_get_url() . '/assets/images/field-type-previews/field-preview-post-object.png';
$this->doc_url = acf_add_url_utm_tags( 'https://www.advancedcustomfields.com/resources/post-object/', 'docs', 'field-type-selection' );
$this->defaults = array(
'post_type' => array(),
'taxonomy' => array(),
'allow_null' => 0,
'multiple' => 0,
'return_format' => 'object',
'ui' => 1,
'bidirectional_target' => array(),
);
// 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' ) );
add_filter( 'acf/conditional_logic/choices', array( $this, 'render_field_post_object_conditional_choices' ), 10, 3 );
}