WP_Customize_Widgets::get_setting_type() WordPress Method
The WP_Customize_Widgets::get_setting_type() method is used to get the setting type for a given widget setting.
WP_Customize_Widgets::get_setting_type( string $setting_id ) #
Retrieves the widget setting type given a setting ID.
Parameters
- $setting_id
(string)(Required)Setting ID.
Return
(string|void) Setting type.
Source
File: wp-includes/class-wp-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; } } }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
4.2.0 | Introduced. |