WP_Customize_Widgets::get_setting_type
Retrieves the widget setting type given a setting ID.
Method of the class: WP_Customize_Widgets{}
No Hooks.
Returns
String|null. Setting type.
Usage
// protected - for code of main (parent) or child class $result = $this->get_setting_type( $setting_id );
- $setting_id(string) (required)
- Setting ID.
Changelog
| Since 4.2.0 | Introduced. |
WP_Customize_Widgets::get_setting_type() WP Customize Widgets::get setting type code WP 6.9
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;
}
}
}