_get_widget_id_base() WordPress Function
The get_widget_id_base() function is used to retrieve the base ID for a given widget. This function is typically used in the context of creating a new widget instance.
_get_widget_id_base( string $id ) #
Retrieves the widget ID base value.
Parameters
- $id
(string)(Required)Widget ID.
Return
(string) Widget ID base.
Source
File: wp-includes/widgets.php
function _get_widget_id_base( $id ) { return preg_replace( '/-[0-9]+$/', '', $id ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
2.8.0 | Introduced. |