acf_field_gallery::initialize
__construct
This function will setup the field type data
Method of the class: acf_field_gallery{}
No Hooks.
Returns
null. Nothing (null).
Usage
$acf_field_gallery = new acf_field_gallery(); $acf_field_gallery->initialize();
Changelog
| Since 5.0.0 | Introduced. |
acf_field_gallery::initialize() acf field gallery::initialize code ACF 6.0.4
function initialize() {
// vars
$this->name = 'gallery';
$this->label = __( 'Gallery', 'acf' );
$this->category = 'content';
$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' ) );
}