customize_render_partials_before

Fires immediately before partials are rendered.

Description

do_action( 'customize_render_partials_before', (WP_Customize_Selective_Refresh) $instance, (array) $partials ); 

Plugins may do things like call wp_enqueue_scripts() and gather a list of the scripts and styles which may get enqueued in the response.

Parameters (2)

0. $instance (WP_Customize_Selective_Refresh)
Selective refresh component.
1. $partials (array)
Placements' context data for the partials rendered in the request. The array is keyed by partial ID, with each item being an array of the placements' context data.

Usage

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

Defined (1)

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

/wp-includes/customize/class-wp-customize-selective-refresh.php  
  1. do_action( 'customize_render_partials_before', $this, $partials );