customize_partial_render

Filters partial rendering.

Description

apply_filters( 'customize_partial_render', (string|array|false) $rendered, (WP_Customize_Partial) $partial, (array) $container_context ); 

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', $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 callback 
  2. function filter_customize_partial_render( $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', 'filter_customize_partial_render', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'customize_partial_render', 'filter_customize_partial_render', 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', $rendered, $partial, $container_context );