HTTP/2 301
server: nginx
date: Sat, 11 Oct 2025 19:15:59 GMT
content-type: text/html; charset=UTF-8
x-olaf: ⛄
vary: accept, content-type
x-redirect-by: WordPress
location: https://developer.wordpress.org/reference/classes/wp_customize_widgets/get_setting_type/
x-frame-options: SAMEORIGIN
alt-svc: h3=":443"; ma=86400
x-nc: MISS ord 1
HTTP/2 200
server: nginx
date: Sat, 11 Oct 2025 19:16:00 GMT
content-type: text/html; charset=UTF-8
vary: Accept-Encoding
x-olaf: ⛄
vary: accept, content-type
link:
; rel="https://api.w.org/"
link:
; rel="alternate"; title="JSON"; type="application/json"
link: ; rel=shortlink
x-frame-options: SAMEORIGIN
content-encoding: gzip
alt-svc: h3=":443"; ma=86400
x-nc: MISS ord 1
WP_Customize_Widgets::get_setting_type() – Method | Developer.WordPress.org
WordPress Developer Resources
WP_Customize_Widgets::get_setting_type()
WP_Customize_Widgets::get_setting_type( string $setting_id ): string|void
Retrieves the widget setting type given a setting ID.
$setting_id
stringrequiredSetting ID.
string|void Setting type.
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;
}
}
}
View all references View on Trac View on GitHub
Version | Description |
---|
4.2.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.