esc_html__('This Widget show product category Slider', 'buzstores') ) ); } /** * Helper function that holds widget fields * Array is used in update and form functions */ private function widget_fields() { $bs_woo_pro_categories = array(); $bs_woo_pro_categories_obj = get_categories(array( 'taxonomy' => 'product_cat', 'pad_counts' => 0, 'show_count' => 0,'title_li' => '','hierarchical' => 1,'hide_empty' => 1)); foreach ($bs_woo_pro_categories_obj as $bs_woo_pro_category) { $bs_woo_pro_categories[$bs_woo_pro_category->term_id] = $bs_woo_pro_category->name; } $fields = array( 'product_category' => array( 'buzstores_widgets_name' => 'product_category', 'buzstores_widgets_title' => esc_html__('Select Products Categorys', 'buzstores'), 'buzstores_widgets_field_type' => 'multicheckboxes', 'buzstores_widgets_field_options' => $bs_woo_pro_categories ), ); return $fields; } /** * Front-end display of widget. * * @see WP_Widget::widget() * * @param array $args Widget arguments. * @param array $instance Saved values from database. */ public function widget($args, $instance) { extract($args); $product_categories = isset( $instance['product_category'] ) ? $instance['product_category'] : '' ; echo $before_widget; ?>