GC_Customize_Widgets::get_setting_id()
最后更新于:2021-11-27 10:56:27
GC_Customize_Widgets::get_setting_id( string$widget_id)Converts a widget_id into its corresponding Customizer setting ID (option name).
参数
- $widget_id
-
(string) (Required) Widget ID.
响应
(string) Maybe-parsed widget ID.
源文件
文件: gc-includes/class-gc-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;
}