Skip to content

Commit efda0d0

Browse files
committed
* 1.0.7 - shortcode url link correction, link to slug instead of brand name.
1 parent 55201c9 commit efda0d0

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

includes/class-product-brand-shortcode.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,12 @@ public function product_brand_list_shortcode($atts) {
3939
foreach ($brands as $brand) {
4040
$brand_id = $brand->term_id;
4141
$brand_name = $brand->name;
42+
$brand_slug = $brand->slug;
4243
$brand_image_id = get_term_meta($brand_id, 'product_brand_image', true);
4344
$brand_image_url = wp_get_attachment_url($brand_image_id);
4445

4546
$output .= '<div class="brand-item carousel-cell">';
46-
$output .= '<a href="' . esc_url(add_query_arg('product_brand', $brand_name, get_permalink(wc_get_page_id('shop')))) . '">';
47+
$output .= '<a href="' . esc_url(add_query_arg('product_brand', $brand_slug, get_permalink(wc_get_page_id('shop')))) . '">';
4748
$output .= '<img src="' . $brand_image_url . '" alt="' . $brand_name . '" />';
4849
$output .= '</a>';
4950
$output .= '</div>';

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.6
6+
Version: 1.0.7
77
Author: Fry Digital
88
Author URI: https://frydigital.com/
99
License: GPLv3

readme.md

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ To use this shortcode, you can simply add `[product_brand_list]` to any post or
1414
* 1.0.4 - Update display styles and default options
1515
* 1.0.5 - Remove private key for updates (push to public repo)
1616
* 1.0.6 - Responsive CSS update, enable draggable
17+
* 1.0.7 - shortcode url link correction, link to slug instead of brand name.
1718

1819

1920
# Future Development

0 commit comments

Comments
 (0)