_get_widget_id_base()WP 2.8.0

Retrieves the widget ID base value.

Internal function — this function is designed to be used by the kernel itself. It is not recommended to use this function in your code.

No Hooks.

Return

String. Widget ID base.

Usage

_get_widget_id_base( $id );
$id(string) (required)
Widget ID.

Changelog

Since 2.8.0 Introduced.

_get_widget_id_base() code WP 6.6.2

function _get_widget_id_base( $id ) {
	return preg_replace( '/-[0-9]+$/', '', $id );
}