'ample-shop-categories-collection', 'description' => esc_html__( 'Add Widget to Display Categories.', 'ample-shop' ) ); parent::__construct( 'Ample_Shop_categories_collection',esc_html__( 'AT: Categories Collection', 'ample-shop' ), $widget_ops, $control_ops ); } function form( $instance ) { $defaults[ 'orderby' ] = ''; for ( $i=0; $i<2; $i++ ) { $var = 'cat_id'.$i; $defaults[$var] = ''; } $instance = wp_parse_args( (array) $instance, $defaults ); ?>

' ', 'name' => $this->get_field_name( 'cat_id'.$i ), 'selected' => $instance['cat_id'.$i], 'taxonomy' => 'product_cat' ) ); ?>

'product_cat', 'orderby' => esc_attr( $orderby), 'hide_empty' => '0', 'include' => $cat_array, ); if ( !empty( $cat_array ) ) { ?>
$term) { $image_size = 'ample-shop-product-collection-medium'; $term_id = $term->term_id; $term_link = get_term_link($term); $thumbnail_id = get_term_meta( $term_id, 'thumbnail_id', true ); $image_url = wp_get_attachment_image($thumbnail_id, $image_size ); ?>