customize_partial_render_<id>

Filters partial rendering for a specific partial.

Description

apply_filters( 'customize_partial_render_<id>', (string|array|false) $rendered, (WP_Customize_Partial) $partial, (array) $container_context ); 

The dynamic portion(s) of the hook name, $partial->ID refers to the partial ID.

Parameters (3)

0. $rendered (string|array|false)
The partial value. Default false.
1. $partial (WP_Customize_Partial)
WP_Customize_Setting instance.
2. $container_context — Optional. (array)
Array of context data associated with the target container.

Usage

To run the hook, copy the example below.
  1. $rendered = apply_filters( 'customize_partial_render_{$id}', $rendered, $partial, $container_context ); 
  2.  
  3. if ( !empty( $rendered ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the customize_partial_render_<id> callback 
  2. function filter_customize_partial_render_id( $rendered, $partial, $container_context ) { 
  3. // make filter magic happen here... 
  4. return $rendered
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( "customize_partial_render_{$id}", 'filter_customize_partial_render_id', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( "customize_partial_render_{$id}", 'filter_customize_partial_render_id', 10, 3 ); 

Defined (1)

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

/wp-includes/customize/class-wp-customize-partial.php  
  1. $rendered = apply_filters( "customize_partial_render_{$partial->id}", $rendered, $partial, $container_context );