GC_Customize_Nav_Menus::filter_dynamic_setting_class()
最后更新于:2021-11-27 04:07:11
GC_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 GC_Customize_Setting subclass.
参数
- $setting_class
-
(string) (Required) GC_Customize_Setting or a subclass.
- $setting_id
-
(string) (Required) ID for dynamic setting, usually coming from
$_POST['customized']
. - $setting_args
-
(array) (Required) GC_Customize_Setting or a subclass.
响应
(string)
源文件
文件: gc-includes/class-gc-customize-nav-menus.php
public function filter_dynamic_setting_class( $setting_class, $setting_id, $setting_args ) {
unset( $setting_id );
if ( ! empty( $setting_args['type'] ) && GC_Customize_Nav_Menu_Setting::TYPE === $setting_args['type'] ) {
$setting_class = 'GC_Customize_Nav_Menu_Setting';
} elseif ( ! empty( $setting_args['type'] ) && GC_Customize_Nav_Menu_Item_Setting::TYPE === $setting_args['type'] ) {
$setting_class = 'GC_Customize_Nav_Menu_Item_Setting';
}
return $setting_class;
}