WP_Customize_Manager::enqueue_control_scripts() WordPress Method

The WordPress Customize Manager enables theme developers to add settings to the WordPress Customizer and live preview them on the frontend of the site. In addition to settings, controls can also be added to the Customizer. Controls are responsible for rendering the UI for a setting, and they can be modified to support different types of input, such as text, checkboxes, radio buttons, select lists, or even custom code. The enqueue_control_scripts() method is used to load the scripts for a control. This method should be called from the control's constructor.

WP_Customize_Manager::enqueue_control_scripts() #

Enqueues scripts for customize controls.


Source

File: wp-includes/class-wp-customize-manager.php

	public function enqueue_control_scripts() {
		foreach ( $this->controls as $control ) {
			$control->enqueue();
		}

		if ( ! is_multisite() && ( current_user_can( 'install_themes' ) || current_user_can( 'update_themes' ) || current_user_can( 'delete_themes' ) ) ) {
			wp_enqueue_script( 'updates' );
			wp_localize_script(
				'updates',
				'_wpUpdatesItemCounts',
				array(
					'totals' => wp_get_update_data(),
				)
			);
		}
	}


Top ↑

Changelog

Changelog
VersionDescription
3.4.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More