W3cubDocs

/WordPress

_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 );
}

Changelog

Version Description
2.8.0 Introduced.

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/_get_widget_id_base