Filter hook 'customize_dynamic_setting_args'

in WP Core File wp-includes/class-wp-customize-manager.php at line 3837

View Source

customize_dynamic_setting_args

Filter Hook
Description
Filters a dynamic setting's constructor args. For a dynamic setting 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_Setting constructor.

Hook Information

File Location wp-includes/class-wp-customize-manager.php View on GitHub
Hook Type Filter
Line Number 3837

Hook Parameters

Type Name Description
false|array $setting_args The arguments to the WP_Customize_Setting constructor.
string $setting_id ID for dynamic setting, usually coming from `$_POST['customized']`.

Usage Examples

Basic Usage
<?php
// Hook into customize_dynamic_setting_args
add_filter('customize_dynamic_setting_args', 'my_custom_filter', 10, 2);

function my_custom_filter($setting_args, $setting_id) {
    // Your custom filtering logic here
    return $setting_args;
}

Source Code Context

wp-includes/class-wp-customize-manager.php:3837 - How this hook is used in WordPress core
<?php
3832  			 * @since 4.2.0
3833  			 *
3834  			 * @param false|array $setting_args The arguments to the WP_Customize_Setting constructor.
3835  			 * @param string      $setting_id   ID for dynamic setting, usually coming from `$_POST['customized']`.
3836  			 */
3837  			$setting_args = apply_filters( 'customize_dynamic_setting_args', $setting_args, $setting_id );
3838  			if ( false === $setting_args ) {
3839  				continue;
3840  			}
3841  
3842  			/**

PHP Documentation

<?php
/**
			 * Filters a dynamic setting's constructor args.
			 *
			 * For a dynamic setting 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_Setting constructor.
			 *
			 * @since 4.2.0
			 *
			 * @param false|array $setting_args The arguments to the WP_Customize_Setting constructor.
			 * @param string      $setting_id   ID for dynamic setting, usually coming from `$_POST['customized']`.
			 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/class-wp-customize-manager.php
Related Hooks

Related hooks will be displayed here in future updates.