تابع wc_get_attachment_image_attributes دریافت ویژگی های تصویر محصول

تابع wc_get_attachment_image_attributes دریافت ویژگی های تصویر محصول

تابع ووکامرسی wc_get_attachment_image_attributes – دریافت ویژگی های تصویر محصول

Syntax – سینتکس

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

Parameters – پارامتر ها (1)

  • 1- $attr (array)

Usage – نحوه استفاده

if ( !function_exists( 'wc_get_attachment_image_attributes' ) ) { 
    require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-product-functions.php'; 
} 
  
// The attr. 
$attr = array(); 
  
// NOTICE! Understand what this does before running. 
$result = wc_get_attachment_image_attributes($attr); 
    

Defined – محل تعریف

/includes/wc-product-functions.php

function wc_get_attachment_image_attributes( $attr ) { 
    if ( strstr( $attr['src'][0], 'woocommerce_uploads/' ) ) { 
        $attr['src'][0] = wc_placeholder_img_src(); 
    } 
    return $attr; 
} 

versions – نسخه ها

از نسخه : 3.0.2

نسخه فعلی : 3.0.6

دیگر نسخه ها : 3.0.6 , 3.0.5 , 3.0.4 , 3.0.3 , 3.0.2

ارسال نظر

جهت استفاده از کد حتما از تگ pre استفاده نمایید .

contact us