wc_get_attachment_image_attributes

Get attachment image attributes.

Description

(array) wc_get_attachment_image_attributes( (array) $attr ); 

Returns (array)

Parameters (1)

0. $attr (array)
The attr.

Usage

  1. if ( !function_exists( 'wc_get_attachment_image_attributes' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-product-functions.php'; 
  3.  
  4. // The attr. 
  5. $attr = array(); 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wc_get_attachment_image_attributes($attr); 
  9.  

Defined (1)

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

/includes/wc-product-functions.php  
  1. function wc_get_attachment_image_attributes( $attr ) { 
  2. if ( strstr( $attr['src'][0], 'woocommerce_uploads/' ) ) { 
  3. $attr['src'][0] = wc_placeholder_img_src(); 
  4. return $attr;