WP_Customize_Header_Image_Control::enqueue()
- Source
wp-includes/customize/class-wp-customize-header-image-control.php:69
Uses · 9
- wp_enqueue_media()Enqueues all scripts, styles, settings, and templates necessary to use all media JS APIs.
- wp_enqueue_script()Enqueues a script.
- wp_localize_script()Localizes a script.
- absint()Converts a value to non-negative integer.
- get_theme_support()Gets the theme support arguments passed when registering that support.
- wp_create_nonce()Creates a cryptographic token tied to a specific action, user, user session, and window of time.
- WP_Customize_Header_Image_Control::prepare_control()
- WP_Customize_Header_Image_Control::get_current_image_src()
- WP_Customize_Image_Control::enqueue()
Source
public function enqueue() { wp_enqueue_media(); wp_enqueue_script( 'customize-views' ); $this->prepare_control(); wp_localize_script( 'customize-views', '_wpCustomizeHeader', 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' => wp_create_nonce( 'header-add' ), 'remove' => wp_create_nonce( 'header-remove' ), ), 'uploads' => $this->uploaded_headers, 'defaults' => $this->default_headers, ) ); parent::enqueue(); }History
Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 6.7.7 tag, from
src/wp-includes/customize/class-wp-customize-header-image-control.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. - Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.