WordPress at Your Fingertips
function is not described

WC_Widget::__construct() public WC 1.0

Constructor.

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

No Hooks.

Return

null. Nothing.

Usage

$WC_Widget = new WC_Widget();
$WC_Widget->__construct();

Code of WC_Widget::__construct() WC 5.5.2

<?php
public function __construct() {
	$widget_ops = array(
		'classname'                   => $this->widget_cssclass,
		'description'                 => $this->widget_description,
		'customize_selective_refresh' => true,
		'show_instance_in_rest'       => true,
	);

	parent::__construct( $this->widget_id, $this->widget_name, $widget_ops );

	add_action( 'save_post', array( $this, 'flush_widget_cache' ) );
	add_action( 'deleted_post', array( $this, 'flush_widget_cache' ) );
	add_action( 'switch_theme', array( $this, 'flush_widget_cache' ) );
}