customize_dynamic_setting_class
Filter HookDescription
Allow non-statically created settings to be constructed with custom WP_Customize_Setting subclass.Hook Information
File Location |
wp-includes/class-wp-customize-manager.php
View on GitHub
|
Hook Type | Filter |
Line Number | 3851 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$setting_class
|
WP_Customize_Setting or a subclass. |
string
|
$setting_id
|
ID for dynamic setting, usually coming from `$_POST['customized']`. |
array
|
$setting_args
|
WP_Customize_Setting or a subclass. |
Usage Examples
Basic Usage
<?php
// Hook into customize_dynamic_setting_class
add_filter('customize_dynamic_setting_class', 'my_custom_filter', 10, 3);
function my_custom_filter($setting_class, $setting_id, $setting_args) {
// Your custom filtering logic here
return $setting_class;
}
Source Code Context
wp-includes/class-wp-customize-manager.php:3851
- How this hook is used in WordPress core
<?php
3846 *
3847 * @param string $setting_class WP_Customize_Setting or a subclass.
3848 * @param string $setting_id ID for dynamic setting, usually coming from `$_POST['customized']`.
3849 * @param array $setting_args WP_Customize_Setting or a subclass.
3850 */
3851 $setting_class = apply_filters( 'customize_dynamic_setting_class', $setting_class, $setting_id, $setting_args );
3852
3853 $setting = new $setting_class( $this, $setting_id, $setting_args );
3854
3855 $this->add_setting( $setting );
3856 $new_settings[] = $setting;
PHP Documentation
<?php
/**
* Allow non-statically created settings to be constructed with custom WP_Customize_Setting subclass.
*
* @since 4.2.0
*
* @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.
*/
Quick Info
- Hook Type: Filter
- Parameters: 3
- File: wp-includes/class-wp-customize-manager.php
Related Hooks
Related hooks will be displayed here in future updates.