acf_field_page_link::initialize
This function will setup the field type data
Метод класса: acf_field_page_link{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$acf_field_page_link = new acf_field_page_link(); $acf_field_page_link->initialize();
Список изменений
| С версии 5.0.0 | Введена. |
Код acf_field_page_link::initialize() acf field page link::initialize ACF 6.4.2
function initialize() {
// vars
$this->name = 'page_link';
$this->label = __( 'Page Link', 'acf' );
$this->category = 'relational';
$this->description = __( 'An interactive dropdown to select one or more posts, pages, custom post type items or archive URLs, with the option to search.', 'acf' );
$this->preview_image = acf_get_url() . '/assets/images/field-type-previews/field-preview-page-link.png';
$this->doc_url = acf_add_url_utm_tags( 'https://www.advancedcustomfields.com/resources/page-link/', 'docs', 'field-type-selection' );
$this->defaults = array(
'post_type' => array(),
'taxonomy' => array(),
'allow_null' => 0,
'multiple' => 0,
'allow_archives' => 1,
);
// extra
add_action( 'wp_ajax_acf/fields/page_link/query', array( $this, 'ajax_query' ) );
add_action( 'wp_ajax_nopriv_acf/fields/page_link/query', array( $this, 'ajax_query' ) );
add_filter( 'acf/conditional_logic/choices', array( $this, 'render_field_page_link_conditional_choices' ), 10, 3 );
}