_get_widget_id_base
Retrieves the widget ID base value.
Description
(string) _get_widget_id_base( (string) $id );
Returns (string)
Widget ID base.
Parameters (1)
- 0. $id (string)
- Widget ID.
Usage
if ( !function_exists( '_get_widget_id_base' ) ) { require_once ABSPATH . WPINC . '/widgets.php'; } // Widget ID. $id = ''; // NOTICE! Understand what this does before running. $result = _get_widget_id_base($id);
Defined (1)
The function is defined in the following location(s).
- /wp-includes/widgets.php
- function _get_widget_id_base( $id ) {
- return preg_replace( '/-[0-9]+$/', '', $id );
- }