WC_Widget_Product_Categories::__construct()publicWC 1.0

Constructor.

Method of the class: WC_Widget_Product_Categories{}

No Hooks.

Return

null. Nothing (null).

Usage

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

WC_Widget_Product_Categories::__construct() code WC 8.6.1

public function __construct() {
	$this->widget_cssclass    = 'woocommerce widget_product_categories';
	$this->widget_description = __( 'A list or dropdown of product categories.', 'woocommerce' );
	$this->widget_id          = 'woocommerce_product_categories';
	$this->widget_name        = __( 'Product Categories', 'woocommerce' );
	$this->settings           = array(
		'title'              => array(
			'type'  => 'text',
			'std'   => __( 'Product categories', 'woocommerce' ),
			'label' => __( 'Title', 'woocommerce' ),
		),
		'orderby'            => array(
			'type'    => 'select',
			'std'     => 'name',
			'label'   => __( 'Order by', 'woocommerce' ),
			'options' => array(
				'order' => __( 'Category order', 'woocommerce' ),
				'name'  => __( 'Name', 'woocommerce' ),
			),
		),
		'dropdown'           => array(
			'type'  => 'checkbox',
			'std'   => 0,
			'label' => __( 'Show as dropdown', 'woocommerce' ),
		),
		'count'              => array(
			'type'  => 'checkbox',
			'std'   => 0,
			'label' => __( 'Show product counts', 'woocommerce' ),
		),
		'hierarchical'       => array(
			'type'  => 'checkbox',
			'std'   => 1,
			'label' => __( 'Show hierarchy', 'woocommerce' ),
		),
		'show_children_only' => array(
			'type'  => 'checkbox',
			'std'   => 0,
			'label' => __( 'Only show children of the current category', 'woocommerce' ),
		),
		'hide_empty'         => array(
			'type'  => 'checkbox',
			'std'   => 0,
			'label' => __( 'Hide empty categories', 'woocommerce' ),
		),
		'max_depth'          => array(
			'type'  => 'text',
			'std'   => '',
			'label' => __( 'Maximum depth', 'woocommerce' ),
		),
	);

	parent::__construct();
}