Skip to content

Commit 1a87da3

Browse files
committed
* 1.0.12 - Introduce 'image_class' atts, default 'brand-image'. Accepts any valid CSS class name.
1 parent 7c17e21 commit 1a87da3

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

includes/class-product-brand-shortcode.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ public function product_brand_list_shortcode($atts)
1616
'order' => 'asc',
1717
'scroll' => 'true',
1818
'limit' => '12',
19-
'width' => '200px'
19+
'width' => '200px',
20+
'image_class' => 'brand-image'
2021
), $atts, 'product_brand_list');
2122

2223
$brands = get_terms('product_brand', array(
@@ -46,7 +47,7 @@ public function product_brand_list_shortcode($atts)
4647

4748
$output .= '<div class="brand-item carousel-cell">';
4849
$output .= '<a href="' . esc_url(add_query_arg('product_brand', $brand_slug, get_permalink(wc_get_page_id('shop')))) . '">';
49-
$output .= '<img src="' . $brand_image_url . '" alt="' . $brand_name . '" style="max-width: '. $atts['width'] .';" />';
50+
$output .= '<img '. $atts['image_class'] . 'src="' . $brand_image_url . '" alt="' . $brand_name . '" style="max-width: '. $atts['width'] .';" />';
5051
$output .= '</a>';
5152
$output .= '</div>';
5253
}

product-brands.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Plugin Name: WooCommerce Product Brand
44
Plugin URI: https://frydigital.com/plugins/fd-product-brands/
55
Description: A WooCommerce plugin that adds a custom taxonomy 'product_brand' to products and allows the attachment of images to the product_brand. Each image links to a search result for that taxonomy.
6-
Version: 1.0.11
6+
Version: 1.0.12
77
Author: Fry Digital
88
Author URI: https://frydigital.com/
99
License: GPLv3

readme.md

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ To use this shortcode, you can simply add `[product_brand_list]` to any post or
1919
* 1.0.9 - Updated CSS rules to isolate styling to product brands only.
2020
* 1.0.10 - Added shortcode attributes for limit and scroll. Scroll=0 disables flickity functionality & scripts. Limit=12 sets the number of brands to display (default 12).
2121
* 1.0.11 - Introduce 'width' atts, default 200px. Accepts any valid CSS width value.
22+
* 1.0.12 - Introduce 'image_class' atts, default 'brand-image'. Accepts any valid CSS class name.
2223

2324

2425
# Future Development

0 commit comments

Comments
 (0)