Action hook 'customize_render_partials_before'

in WP Core File wp-includes/customize/class-wp-customize-selective-refresh.php at line 344

View Source

customize_render_partials_before

Action Hook
Description
Fires immediately before partials are rendered. 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.

Hook Information

File Location wp-includes/customize/class-wp-customize-selective-refresh.php View on GitHub
Hook Type Action
Line Number 344

Hook Parameters

Type Name Description
WP_Customize_Selective_Refresh $refresh Selective refresh component.
array $partials 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 Examples

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

function my_custom_function($refresh, $partials) {
    // Your custom code here
}

Source Code Context

wp-includes/customize/class-wp-customize-selective-refresh.php:344 - How this hook is used in WordPress core
<?php
 339  		 * @param WP_Customize_Selective_Refresh $refresh  Selective refresh component.
 340  		 * @param array                          $partials Placements' context data for the partials rendered in the request.
 341  		 *                                                 The array is keyed by partial ID, with each item being an array of
 342  		 *                                                 the placements' context data.
 343  		 */
 344  		do_action( 'customize_render_partials_before', $this, $partials );
 345  
 346  		set_error_handler( array( $this, 'handle_error' ), error_reporting() );
 347  
 348  		$contents = array();
 349  

PHP Documentation

<?php
/**
		 * Fires immediately before partials are rendered.
		 *
		 * 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.
		 *
		 * @since 4.5.0
		 *
		 * @param WP_Customize_Selective_Refresh $refresh  Selective refresh component.
		 * @param array                          $partials 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.
		 */
Quick Info
  • Hook Type: Action
  • Parameters: 2
  • File: wp-includes/customize/class-wp-customize-selective-refresh.php
Related Hooks

Related hooks will be displayed here in future updates.