WordPress at Your Fingertips
function is not described

WP_Customize_Nav_Menus::filter_dynamic_setting_args() public WP 4.3.0

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.

{} It's a method of the class: WP_Customize_Nav_Menus{}

No Hooks.




$WP_Customize_Nav_Menus = new WP_Customize_Nav_Menus();
$WP_Customize_Nav_Menus->filter_dynamic_setting_args( $setting_args, $setting_id );
$setting_args(false|array) (required)
The arguments to the WP_Customize_Setting constructor.
$setting_id(string) (required)
ID for dynamic setting, usually coming from $_POST['customized'].


Since 4.3.0 Introduced.

Code of WP_Customize_Nav_Menus::filter_dynamic_setting_args() WP 5.8.2

public function filter_dynamic_setting_args( $setting_args, $setting_id ) {
	if ( preg_match( WP_Customize_Nav_Menu_Setting::ID_PATTERN, $setting_id ) ) {
		$setting_args = array(
			'type'      => WP_Customize_Nav_Menu_Setting::TYPE,
			'transport' => 'postMessage',
	} elseif ( preg_match( WP_Customize_Nav_Menu_Item_Setting::ID_PATTERN, $setting_id ) ) {
		$setting_args = array(
			'type'      => WP_Customize_Nav_Menu_Item_Setting::TYPE,
			'transport' => 'postMessage',
	return $setting_args;