WP_Customize_Widgets::get_setting_type( string $setting_id ): string|null
- Since
- 4.2.0
- Source
wp-includes/class-wp-customize-widgets.php:181
Retrieves the widget setting type given a setting ID.
Parameters
$setting_idstring- Setting ID.
Return
string|null- Setting type.
Used by · 2
- WP_Customize_Widgets::filter_customize_dynamic_setting_args()Determines the arguments for a dynamically-created setting.
- WP_Customize_Widgets::register_settings()Inspects the incoming customized data for any widget settings, and dynamically adds them up-front so widgets will be initialized properly.
Source
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; } } }History
Introduced in 4.2.0. One change between 6.7.7 and 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
7.0.4
Return type changed from
string|void to string|null.verified against source4.2.0
Introduced.from the docblock
About this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, from
src/wp-includes/class-wp-customize-widgets.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. - Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.