WC_Widget_Product_Categories::__construct()

Constructor.


Description Description


Source Source

File: includes/widgets/class-wc-widget-product-categories.php

35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
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();
}


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.