customize_preview_init

The WordPress Core customize preview init hook.

Description

add_action( 'customize_preview_init', (callback) $array ); 

Parameters (1)

0. $array (callback) => array( $this, 'customize_preview_init' )
The array.

Usage

To run the hook, copy the example below.
  1. // run the action 
  2. do_action( 'customize_preview_init', $array ); 
The following example is for adding a hook callback.
  1. // define the customize_preview_init callback 
  2. function action_customize_preview_init( $array ) { 
  3. // make action magic happen here... 
  4. }; 
  5.  
  6. // add the action 
  7. add_action( 'customize_preview_init', 'action_customize_preview_init', 10, 1 ); 
To remove a hook callback, use the example below.
  1. // remove the action 
  2. remove_action( 'customize_preview_init', 'action_customize_preview_init', 10, 1 ); 

Defined (5)

The action is defined in the following location(s).

/wp-includes/class-wp-customize-nav-menus.php  
  1. add_action( 'customize_preview_init', array( $this, 'customize_preview_init' ) ); 
/wp-includes/class-wp-customize-widgets.php  
  1. add_action( 'customize_preview_init', array( $this, 'customize_preview_init' ) ); 
  1. add_action( 'customize_preview_init', array( $this, 'selective_refresh_init' ) ); 
/wp-includes/class-wp-customize-manager.php  
  1. do_action( 'customize_preview_init', $this ); 
/wp-includes/customize/class-wp-customize-selective-refresh.php  
  1. add_action( 'customize_preview_init', array( $this, 'init_preview' ) );