wc_get_product_tag_list

Returns the product tags in a list.

Description

(string) wc_get_product_tag_list( (int) $product_id, (string) $sep = ', ', (string) $before = '', (string) $after = '' ); 

Returns (string)

Parameters (4)

0. $product_id (int)
The product id.
1. $sep — Optional. (string) => ', '
(default: , ).
2. $before — Optional. (string) => ''
(default: '').
3. $after — Optional. (string) => ''
(default: '').

Usage

  1. if ( !function_exists( 'wc_get_product_tag_list' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-product-functions.php'; 
  3.  
  4. // The product id. 
  5. $product_id = -1; 
  6.  
  7. // (default: ', '). 
  8. $sep = ', '; 
  9.  
  10. // (default: ''). 
  11. $before = ''; 
  12.  
  13. // (default: ''). 
  14. $after = ''; 
  15.  
  16. // NOTICE! Understand what this does before running. 
  17. $result = wc_get_product_tag_list($product_id, $sep, $before, $after); 
  18.  

Defined (1)

The function is defined in the following location(s).

/includes/wc-product-functions.php  
  1. function wc_get_product_tag_list( $product_id, $sep = ', ', $before = '', $after = '' ) { 
  2. return get_the_term_list( $product_id, 'product_tag', $before, $sep, $after );