GC_Customize_Widgets::get_setting_type()
最后更新于:2021-11-27 10:59:24
GC_Customize_Widgets::get_setting_type( string$setting_id)Retrieves the widget setting type given a setting ID.
参数
- $setting_id
-
(string) (Required) Setting ID.
响应
(string|void) Setting type.
源文件
文件: gc-includes/class-gc-customize-widgets.php
protected function get_setting_type( $setting_id ) {
static $cache = array();
if ( isset( $cache[ $setting_id ] ) ) {
return $cache[ $setting_id ];
}
foreach ( $this->setting_id_patterns as $type => $pattern ) {
if ( preg_match( $pattern, $setting_id ) ) {
$cache[ $setting_id ] = $type;
return $type;
}
}
}