WC_Widget_Product_Categories::__construct()publicWC 1.0

Constructor.

Метод класса: WC_Widget_Product_Categories{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

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

Код WC_Widget_Product_Categories::__construct() WC 9.4.2

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