GC_Customize_Header_Image_Control::enqueue()
最后更新于:2021-11-27 00:18:09
GC_Customize_Header_Image_Control::enqueue()源文件
文件: gc-includes/customize/class-gc-customize-header-image-control.php
public function enqueue() {
gc_enqueue_media();
gc_enqueue_script( 'customize-views' );
$this->prepare_control();
gc_localize_script(
'customize-views',
'_gcCustomizeHeader',
array(
'data' => array(
'width' => absint( get_theme_support( 'custom-header', 'width' ) ),
'height' => absint( get_theme_support( 'custom-header', 'height' ) ),
'flex-width' => absint( get_theme_support( 'custom-header', 'flex-width' ) ),
'flex-height' => absint( get_theme_support( 'custom-header', 'flex-height' ) ),
'currentImgSrc' => $this->get_current_image_src(),
),
'nonces' => array(
'add' => gc_create_nonce( 'header-add' ),
'remove' => gc_create_nonce( 'header-remove' ),
),
'uploads' => $this->uploaded_headers,
'defaults' => $this->default_headers,
)
);
parent::enqueue();
}