WP_Widget_Factory::get_widget_object( string $id_base )

Returns the registered WP_Widget object for the given widget type.

Parameters

$id_base

(string) (Required) Widget type ID.

Return

(WP_Widget|null)

Source

File: wp-includes/class-wp-widget-factory.php

public function get_widget_object( $id_base ) {
		$key = $this->get_widget_key( $id_base );
		if ( '' === $key ) {
			return null;
		}

		return $this->widgets[ $key ];
	}

Changelog

Version Description
5.8.0 Introduced.

© 2003–2021 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_widget_factory/get_widget_object