single-brand.php
39 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Single Brand |
| 4 | * |
| 5 | * This template can be overridden by copying it to yourtheme/woocommerce/brands/shortcodes/single-brand.php. |
| 6 | * |
| 7 | * HOWEVER, on occasion WooCommerce will need to update template files and you |
| 8 | * (the theme developer) will need to copy the new files to your theme to |
| 9 | * maintain compatibility. We try to do this as little as possible, but it does |
| 10 | * happen. When this occurs the version of the template file will be bumped and |
| 11 | * the readme will list any important changes. |
| 12 | * |
| 13 | * |
| 14 | * @see WC_Brands::output_product_brand() |
| 15 | * |
| 16 | * @var WP_Term $term The term object. |
| 17 | * @var string $thumbnail The URL to the brand thumbnail. |
| 18 | * @var string $class The class to apply to the thumbnail image. |
| 19 | * @var string $width The width of the image. |
| 20 | * @var string $height The height of the image. |
| 21 | * |
| 22 | * Ignore space indent sniff for this file, as it is used for alignment rather than actual indents. |
| 23 | * phpcs:ignoreFile Generic.WhiteSpace.DisallowSpaceIndent |
| 24 | * |
| 25 | * @see https://woocommerce.com/document/template-structure/ |
| 26 | * @package WooCommerce\Templates |
| 27 | * @usedby [product_brand] |
| 28 | * @version 9.4.0 |
| 29 | */ |
| 30 | |
| 31 | declare( strict_types = 1); |
| 32 | ?> |
| 33 | <a href="<?php echo esc_url( get_term_link( $term, 'product_brand' ) ); ?>"> |
| 34 | <img src="<?php echo esc_url( $thumbnail ); ?>" |
| 35 | alt="<?php echo esc_attr( $term->name ); ?>" |
| 36 | class="<?php echo esc_attr( $class ); ?>" |
| 37 | style="width: <?php echo esc_attr( $width ); ?>; height: <?php echo esc_attr( $height ); ?>;"/> |
| 38 | </a> |
| 39 |