acf_field_gallery::initialize
This function will setup the field type data
Метод класса: acf_field_gallery{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$acf_field_gallery = new acf_field_gallery(); $acf_field_gallery->initialize();
Список изменений
| С версии 5.0.0 | Введена. |
Код acf_field_gallery::initialize() acf field gallery::initialize ACF 6.4.2
function initialize() {
// vars
$this->name = 'gallery';
$this->label = __( 'Gallery', 'acf' );
$this->category = 'content';
$this->description = __( 'An interactive interface for managing a collection of attachments, such as images.', 'acf' );
$this->preview_image = acf_get_url() . '/assets/images/field-type-previews/field-preview-gallery.png';
$this->doc_url = acf_add_url_utm_tags( 'https://www.advancedcustomfields.com/resources/gallery/', 'docs', 'field-type-selection' );
$this->tutorial_url = acf_add_url_utm_tags( 'https://www.advancedcustomfields.com/resources/how-to-use-the-gallery-field/', 'docs', 'field-type-selection' );
$this->pro = true;
$this->supports = array( 'bindings' => false );
$this->defaults = array(
'return_format' => 'array',
'preview_size' => 'medium',
'insert' => 'append',
'library' => 'all',
'min' => 0,
'max' => 0,
'min_width' => 0,
'min_height' => 0,
'min_size' => 0,
'max_width' => 0,
'max_height' => 0,
'max_size' => 0,
'mime_types' => '',
);
// actions
add_action( 'wp_ajax_acf/fields/gallery/get_attachment', array( $this, 'ajax_get_attachment' ) );
add_action( 'wp_ajax_nopriv_acf/fields/gallery/get_attachment', array( $this, 'ajax_get_attachment' ) );
add_action( 'wp_ajax_acf/fields/gallery/update_attachment', array( $this, 'ajax_update_attachment' ) );
add_action( 'wp_ajax_nopriv_acf/fields/gallery/update_attachment', array( $this, 'ajax_update_attachment' ) );
add_action( 'wp_ajax_acf/fields/gallery/get_sort_order', array( $this, 'ajax_get_sort_order' ) );
add_action( 'wp_ajax_nopriv_acf/fields/gallery/get_sort_order', array( $this, 'ajax_get_sort_order' ) );
}