customize_preview_init WordPress Action Hook

The customize_preview_init hook is used to initialize the customizer preview. This hook is called after the theme is loaded and the customizer is set up.

do_action( 'customize_preview_init', WP_Customize_Manager $manager ) #

Fires once the Customizer preview has initialized and JavaScript settings have been printed.


Parameters

$manager

(WP_Customize_Manager)WP_Customize_Manager instance.


Top ↑

More Information

This action hook allows you to enqueue assets (such as javascript files) directly in the Theme Customizer only. To output saved settings onto your live site, you still need to output generated CSS using the wp_head hook.

Generally, this hook is used almost exclusively to enqueue a theme-customizer.js file for controlling live previews in WordPress’s Theme Customizer.

For more information, see the Theme Handbook article on the Theme_Customization_API.


Top ↑

Source

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

View on Trac



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