customize_render_partials_before
Fires immediately before partials are rendered.
Description
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.
- // run the action
- do_action( 'customize_render_partials_before', $instance, $partials );
- The following example is for adding a hook callback.
- // define the customize_render_partials_before callback
- function action_customize_render_partials_before( $instance, $partials ) {
- // make action magic happen here...
- };
- // add the action
- add_action( 'customize_render_partials_before', 'action_customize_render_partials_before', 10, 2 );
- To remove a hook callback, use the example below.
- // remove the action
- 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
- do_action( 'customize_render_partials_before', $this, $partials );