wc_prepare_attachment_for_js( array $response )
Prepare attachment for JavaScript.
Description Description
Parameters Parameters
- $response
-
(Required) JS version of a attachment post object.
Return Return
(array)
Source Source
File: includes/wc-product-functions.php
function wc_prepare_attachment_for_js( $response ) { if ( isset( $response['url'] ) && strstr( $response['url'], 'woocommerce_uploads/' ) ) { $response['full']['url'] = wc_placeholder_img_src(); if ( isset( $response['sizes'] ) ) { foreach ( $response['sizes'] as $size => $value ) { $response['sizes'][ $size ]['url'] = wc_placeholder_img_src(); } } } return $response; }