customize_dynamic_partial_args filter-hookWP 4.5.0

Filters a dynamic partial's constructor arguments.

For a dynamic partial to be registered, this filter must be employed to override the default false value with an array of args to pass to the WP_Customize_Partial constructor.

Usage

add_filter( 'customize_dynamic_partial_args', 'wp_kama_customize_dynamic_partial_args_filter', 10, 2 );

/**
 * Function for `customize_dynamic_partial_args` filter-hook.
 * 
 * @param false|array $partial_args The arguments to the WP_Customize_Partial constructor.
 * @param string      $partial_id   ID for dynamic partial.
 *
 * @return false|array
 */
function wp_kama_customize_dynamic_partial_args_filter( $partial_args, $partial_id ){

	// filter...
	return $partial_args;
}
$partial_args(false|array)
The arguments to the WP_Customize_Partial constructor.
$partial_id(string)
ID for dynamic partial.

Changelog

Since 4.5.0 Introduced.

Where the hook is called

WP_Customize_Selective_Refresh::add_dynamic_partials()
customize_dynamic_partial_args
WP_Customize_Selective_Refresh::add_partial()
customize_dynamic_partial_args
wp-includes/customize/class-wp-customize-selective-refresh.php 234
$partial_args = apply_filters( 'customize_dynamic_partial_args', $partial_args, $partial_id );
wp-includes/customize/class-wp-customize-selective-refresh.php 101
$args = apply_filters( 'customize_dynamic_partial_args', $args, $id );

Where the hook is used in WordPress

wp-includes/class-wp-customize-nav-menus.php 70
add_filter( 'customize_dynamic_partial_args', array( $this, 'customize_dynamic_partial_args' ), 10, 2 );
wp-includes/class-wp-customize-widgets.php 128
add_filter( 'customize_dynamic_partial_args', array( $this, 'customize_dynamic_partial_args' ), 10, 2 );