Action hook 'customize_preview_init'

in WP Core File wp-includes/class-wp-customize-manager.php at line 1960

View Source

customize_preview_init

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

Hook Information

File Location wp-includes/class-wp-customize-manager.php View on GitHub
Hook Type Action
Line Number 1960

Hook Parameters

Type Name Description
WP_Customize_Manager $manager WP_Customize_Manager instance.

Usage Examples

Basic Usage
<?php
// Hook into customize_preview_init
add_action('customize_preview_init', 'my_custom_function', 10, 1);

function my_custom_function($manager) {
    // Your custom code here
}

Source Code Context

wp-includes/class-wp-customize-manager.php:1960 - How this hook is used in WordPress core
<?php
1955  		 *
1956  		 * @since 3.4.0
1957  		 *
1958  		 * @param WP_Customize_Manager $manager WP_Customize_Manager instance.
1959  		 */
1960  		do_action( 'customize_preview_init', $this );
1961  	}
1962  
1963  	/**
1964  	 * Filters the X-Frame-Options and Content-Security-Policy headers to ensure frontend can load in customizer.
1965  	 *

PHP Documentation

<?php
/**
		 * Fires once the Customizer preview has initialized and JavaScript
		 * settings have been printed.
		 *
		 * @since 3.4.0
		 *
		 * @param WP_Customize_Manager $manager WP_Customize_Manager instance.
		 */
Quick Info
  • Hook Type: Action
  • Parameters: 1
  • File: wp-includes/class-wp-customize-manager.php
Related Hooks

Related hooks will be displayed here in future updates.