On this page
WP_Customize_Manager::wp_loaded()
Registers styles/scripts and initialize the preview of each setting
Source
File: wp-includes/class-wp-customize-manager.php. View all references
public function wp_loaded() {
// Unconditionally register core types for panels, sections, and controls
// in case plugin unhooks all customize_register actions.
$this->register_panel_type( 'WP_Customize_Panel' );
$this->register_panel_type( 'WP_Customize_Themes_Panel' );
$this->register_section_type( 'WP_Customize_Section' );
$this->register_section_type( 'WP_Customize_Sidebar_Section' );
$this->register_section_type( 'WP_Customize_Themes_Section' );
$this->register_control_type( 'WP_Customize_Color_Control' );
$this->register_control_type( 'WP_Customize_Media_Control' );
$this->register_control_type( 'WP_Customize_Upload_Control' );
$this->register_control_type( 'WP_Customize_Image_Control' );
$this->register_control_type( 'WP_Customize_Background_Image_Control' );
$this->register_control_type( 'WP_Customize_Background_Position_Control' );
$this->register_control_type( 'WP_Customize_Cropped_Image_Control' );
$this->register_control_type( 'WP_Customize_Site_Icon_Control' );
$this->register_control_type( 'WP_Customize_Theme_Control' );
$this->register_control_type( 'WP_Customize_Code_Editor_Control' );
$this->register_control_type( 'WP_Customize_Date_Time_Control' );
/**
* Fires once WordPress has loaded, allowing scripts and styles to be initialized.
*
* @since 3.4.0
*
* @param WP_Customize_Manager $manager WP_Customize_Manager instance.
*/
do_action( 'customize_register', $this );
if ( $this->settings_previewed() ) {
foreach ( $this->settings as $setting ) {
$setting->preview();
}
}
if ( $this->is_preview() && ! is_admin() ) {
$this->customize_preview_init();
}
}
Hooks
- do_action( 'customize_register',
WP_Customize_Manager $manager ) -
Fires once WordPress has loaded, allowing scripts and styles to be initialized.
Related
Uses
| Uses | Description |
|---|---|
| WP_Customize_Manager::settings_previewed() wp-includes/class-wp-customize-manager.php | Gets whether settings are or will be previewed. |
| WP_Customize_Manager::register_panel_type() wp-includes/class-wp-customize-manager.php | Registers a customize panel type. |
| WP_Customize_Manager::register_section_type() wp-includes/class-wp-customize-manager.php | Registers a customize section type. |
| WP_Customize_Manager::register_control_type() wp-includes/class-wp-customize-manager.php | Registers a customize control type. |
| WP_Customize_Manager::is_preview() wp-includes/class-wp-customize-manager.php | Determines whether it is a theme preview or not. |
| WP_Customize_Manager::customize_preview_init() wp-includes/class-wp-customize-manager.php | Prints JavaScript settings. |
| is_admin() wp-includes/load.php | Determines whether the current request is for an administrative interface page. |
| do_action() wp-includes/plugin.php | Calls the callback functions that have been added to an action hook. |
Changelog
| Version | Description |
|---|---|
| 3.4.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_customize_manager/wp_loaded