WP_Customize_Nav_Menus::filter_dynamic_setting_class( string $setting_class, string $setting_id, array $setting_args )

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


Parameters Parameters

$setting_class

(string) (Required) WP_Customize_Setting or a subclass.

$setting_id

(string) (Required) ID for dynamic setting, usually coming from $_POST['customized'].

$setting_args

(array) (Required) WP_Customize_Setting or a subclass.


Top ↑

Return Return

(string)


Top ↑

Source Source

File: wp-includes/class-wp-customize-nav-menus.php

	public function filter_dynamic_setting_class( $setting_class, $setting_id, $setting_args ) {
		unset( $setting_id );

		if ( ! empty( $setting_args['type'] ) && WP_Customize_Nav_Menu_Setting::TYPE === $setting_args['type'] ) {
			$setting_class = 'WP_Customize_Nav_Menu_Setting';
		} elseif ( ! empty( $setting_args['type'] ) && WP_Customize_Nav_Menu_Item_Setting::TYPE === $setting_args['type'] ) {
			$setting_class = 'WP_Customize_Nav_Menu_Item_Setting';
		}
		return $setting_class;
	}

Top ↑

Changelog Changelog

Changelog
Version Description
4.3.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.