Uses
Uses | Description |
---|---|
wp-includes/class-wp-customize-widgets.php: WP_Customize_Widgets::parse_widget_id() | Converts a widget ID into its id_base and number components. |
Converts a widget_id into its corresponding Customizer setting ID (option name).
(string) (Required) Widget ID.
(string) Maybe-parsed widget ID.
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; }
Version | Description |
---|---|
3.9.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_customize_widgets/get_setting_id