WordPress at Your Fingertips
function is not described

WP_Widget_Factory::get_widget_key() public WP 5.8.0

Returns the registered key for the given widget type.

{} It's a method of the class: WP_Widget_Factory{}

No Hooks.

Return

String.

Usage

$WP_Widget_Factory = new WP_Widget_Factory();
$WP_Widget_Factory->get_widget_key( $id_base );
$id_base(string) (required)
Widget type ID.

Changelog

Since 5.8.0 Introduced.

Code of WP_Widget_Factory::get_widget_key() WP 5.8.2

public function get_widget_key( $id_base ) {
	foreach ( $this->widgets as $key => $widget_object ) {
		if ( $widget_object->id_base === $id_base ) {
			return $key;
		}
	}

	return '';
}