wc_get_attachment_image_attributes( array $attr )

Get attachment image attributes.


Description Description


Parameters Parameters

$attr

(Required) Image attributes.


Top ↑

Return Return

(array)


Top ↑

Source Source

File: includes/wc-product-functions.php

function wc_get_attachment_image_attributes( $attr ) {
	if ( isset( $attr['src'] ) && strstr( $attr['src'], 'woocommerce_uploads/' ) ) {
		$attr['src'] = wc_placeholder_img_src();

		if ( isset( $attr['srcset'] ) ) {
			$attr['srcset'] = '';
		}
	}
	return $attr;
}


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.