On this page
_get_widget_id_base( string $id ): string
Retrieves the widget ID base value.
Parameters
$idstring Required-
Widget ID.
Return
string Widget ID base.
Source
File: wp-includes/widgets.php. View all references
function _get_widget_id_base( $id ) {
return preg_replace( '/-[0-9]+$/', '', $id );
}
Related
Used By
| Used By | Description |
|---|---|
| is_active_widget() wp-includes/widgets.php | Determines whether a given widget is displayed on the front end. |
| wp_register_sidebar_widget() wp-includes/widgets.php | Register an instance of a widget. |
| wp_register_widget_control() wp-includes/widgets.php | Registers widget control callback for customizing options. |
Changelog
| Version | Description |
|---|---|
| 2.8.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/_get_widget_id_base