WC_Widget::__construct
Constructor.
Method of the class: WC_Widget{}
No Hooks.
Returns
null. Nothing (null).
Usage
$WC_Widget = new WC_Widget(); $WC_Widget->__construct();
WC_Widget::__construct() WC Widget:: construct code WC 10.5.0
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' ) );
}