customize_dynamic_setting_class хук-фильтрWP 4.2.0

Allow non-statically created settings to be constructed with custom WP_Customize_Setting subclass.

Использование

add_filter( 'customize_dynamic_setting_class', 'wp_kama_customize_dynamic_setting_class_filter', 10, 3 );

/**
 * Function for `customize_dynamic_setting_class` filter-hook.
 * 
 * @param string $setting_class WP_Customize_Setting or a subclass.
 * @param string $setting_id    ID for dynamic setting, usually coming from `$_POST['customized']`.
 * @param array  $setting_args  WP_Customize_Setting or a subclass.
 *
 * @return string
 */
function wp_kama_customize_dynamic_setting_class_filter( $setting_class, $setting_id, $setting_args ){

	// filter...
	return $setting_class;
}
$setting_class(строка)
WP_Customize_Setting or a subclass.
$setting_id(строка)
ID for dynamic setting, usually coming from $_POST['customized'].
$setting_args(массив)
WP_Customize_Setting or a subclass.

Список изменений

С версии 4.2.0 Введена.

Где вызывается хук

WP_Customize_Manager::add_dynamic_settings()
customize_dynamic_setting_class
WP_Customize_Manager::add_setting()
customize_dynamic_setting_class
wp-includes/class-wp-customize-manager.php 3836
$setting_class = apply_filters( 'customize_dynamic_setting_class', $setting_class, $setting_id, $setting_args );
wp-includes/class-wp-customize-manager.php 3776
$class = apply_filters( 'customize_dynamic_setting_class', $class, $id, $args );

Где используется хук в WordPress

wp-includes/class-wp-customize-nav-menus.php 52
add_filter( 'customize_dynamic_setting_class', array( $this, 'filter_dynamic_setting_class' ), 10, 3 );