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
- $setting_class
-
(Required) WP_Customize_Setting or a subclass.
- $setting_id
-
(Required) ID for dynamic setting, usually coming from
$_POST['customized']
. - $setting_args
-
(Required) WP_Customize_Setting or a subclass.
Return
(string)
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;
}
Changelog
Version | Description |
---|---|
WP-4.3.0 | Introduced. |