تابع ووکامرسی wc_prepare_attachment_for_js آماده سازی تصویر برای جاوا اسکریپت

تابع ووکامرسی wc_prepare_attachment_for_js – آماده سازی تصویر برای جاوا اسکریپت
Syntax – سینتکس
(array) wc_prepare_attachment_for_js( (array) $response );
Parameters – پارامتر ها (1)
- 1- $response (array)
Usage – نحوه استفاده
if ( !function_exists( 'wc_prepare_attachment_for_js' ) ) {
require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-product-functions.php';
}
// The response.
$response = array();
// NOTICE! Understand what this does before running.
$result = wc_prepare_attachment_for_js($response);
Defined – محل تعریف
/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;
}
versions – نسخه ها
از نسخه : 3.0.2
نسخه فعلی : 3.0.6
دیگر نسخه ها : 3.0.6 , 3.0.5 , 3.0.4 , 3.0.3 , 3.0.2
ارسال نظر