customize_dynamic_partial_class filter-hookWP 4.5.0

Filters the class used to construct partials.

Allow non-statically created partials to be constructed with custom WP_Customize_Partial subclass.

Usage

add_filter( 'customize_dynamic_partial_class', 'wp_kama_customize_dynamic_partial_class_filter', 10, 3 );

/**
 * Function for `customize_dynamic_partial_class` filter-hook.
 * 
 * @param string $partial_class WP_Customize_Partial or a subclass.
 * @param string $partial_id    ID for dynamic partial.
 * @param array  $partial_args  The arguments to the WP_Customize_Partial constructor.
 *
 * @return string
 */
function wp_kama_customize_dynamic_partial_class_filter( $partial_class, $partial_id, $partial_args ){

	// filter...
	return $partial_class;
}
$partial_class(string)
WP_Customize_Partial or a subclass.
$partial_id(string)
ID for dynamic partial.
$partial_args(array)
The arguments to the WP_Customize_Partial constructor.

Changelog

Since 4.5.0 Introduced.

Where the hook is called

WP_Customize_Selective_Refresh::add_dynamic_partials()
customize_dynamic_partial_class
WP_Customize_Selective_Refresh::add_partial()
customize_dynamic_partial_class
wp-includes/customize/class-wp-customize-selective-refresh.php 250
$partial_class = apply_filters( 'customize_dynamic_partial_class', $partial_class, $partial_id, $partial_args );
wp-includes/customize/class-wp-customize-selective-refresh.php 104
$class = apply_filters( 'customize_dynamic_partial_class', $class, $id, $args );

Where the hook is used in WordPress

Usage not found.