WC_Widget::__construct()publicWC 1.0

Constructor.

Method of the class: WC_Widget{}

No Hooks.

Return

null. Nothing (null).

Usage

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

WC_Widget::__construct() code WC 9.7.1

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