woocommerce_display_product_attributes
Hook: woocommerce_display_product_attributes.
Usage
add_filter( 'woocommerce_display_product_attributes', 'wp_kama_woocommerce_display_product_attributes_filter', 10, 2 ); /** * Function for `woocommerce_display_product_attributes` filter-hook. * * @param array $product_attributes Array of attributes to display; label, value. * @param WC_Product $product Showing attributes for this product. * * @return array */ function wp_kama_woocommerce_display_product_attributes_filter( $product_attributes, $product ){ // filter... return $product_attributes; }
- $product_attributes(array)
- Array of attributes to display; label, value.
- $product(WC_Product)
- Showing attributes for this product.
Changelog
Since 3.6.0. | Introduced. |
Where the hook is called
woocommerce/includes/wc-template-functions.php 3628
$product_attributes = apply_filters( 'woocommerce_display_product_attributes', $product_attributes, $product );