wppaste
WordPress

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

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.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 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 source
4.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.