WP_Customize_Widgets::get_setting_id( string $widget_id )

Converts a widget_id into its corresponding Customizer setting ID (option name).


Parameters Parameters

$widget_id

(string) (Required) Widget ID.


Top ↑

Return Return

(string) Maybe-parsed widget ID.


Top ↑

Source Source

File: wp-includes/class-wp-customize-widgets.php

	public function get_setting_id( $widget_id ) {
		$parsed_widget_id = $this->parse_widget_id( $widget_id );
		$setting_id       = sprintf( 'widget_%s', $parsed_widget_id['id_base'] );

		if ( ! is_null( $parsed_widget_id['number'] ) ) {
			$setting_id .= sprintf( '[%d]', $parsed_widget_id['number'] );
		}
		return $setting_id;
	}


Top ↑

Changelog Changelog

Changelog
Version Description
3.9.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.