WC_Widget_Products::__construct()
Constructor.
Метод класса: WC_Widget_Products{}
Хуков нет.
Возвращает
null
. Ничего (null).
Использование
$WC_Widget_Products = new WC_Widget_Products(); $WC_Widget_Products->__construct();
Код WC_Widget_Products::__construct() WC Widget Products:: construct WC 9.6.0
public function __construct() { $this->widget_cssclass = 'woocommerce widget_products'; $this->widget_description = __( "A list of your store's products.", 'woocommerce' ); $this->widget_id = 'woocommerce_products'; $this->widget_name = __( 'Products list', 'woocommerce' ); $this->settings = array( 'title' => array( 'type' => 'text', 'std' => __( 'Products', 'woocommerce' ), 'label' => __( 'Title', 'woocommerce' ), ), 'number' => array( 'type' => 'number', 'step' => 1, 'min' => 1, 'max' => '', 'std' => 5, 'label' => __( 'Number of products to show', 'woocommerce' ), ), 'show' => array( 'type' => 'select', 'std' => '', 'label' => __( 'Show', 'woocommerce' ), 'options' => array( '' => __( 'All products', 'woocommerce' ), 'featured' => __( 'Featured products', 'woocommerce' ), 'onsale' => __( 'On-sale products', 'woocommerce' ), ), ), 'orderby' => array( 'type' => 'select', 'std' => 'date', 'label' => __( 'Order by', 'woocommerce' ), 'options' => array( 'menu_order' => __( 'Menu order', 'woocommerce' ), 'date' => __( 'Date', 'woocommerce' ), 'price' => __( 'Price', 'woocommerce' ), 'rand' => __( 'Random', 'woocommerce' ), 'sales' => __( 'Sales', 'woocommerce' ), ), ), 'order' => array( 'type' => 'select', 'std' => 'desc', 'label' => _x( 'Order', 'Sorting order', 'woocommerce' ), 'options' => array( 'asc' => __( 'ASC', 'woocommerce' ), 'desc' => __( 'DESC', 'woocommerce' ), ), ), 'hide_free' => array( 'type' => 'checkbox', 'std' => 0, 'label' => __( 'Hide free products', 'woocommerce' ), ), 'show_hidden' => array( 'type' => 'checkbox', 'std' => 0, 'label' => __( 'Show hidden products', 'woocommerce' ), ), ); parent::__construct(); }