woocommerce_gallery_image_size

FILTER woocommerce\includes\wc-template-functions.php (ligne 1752) github
Get HTML for a gallery image. Hooks: woocommerce_gallery_thumbnail_size, woocommerce_gallery_image_size and woocommerce_gallery_full_size accept name based image sizes, or an array of width/height values.

Paramètres

Entrée :
$flexslider || $main_image ? 'woocommerce_single' : $thumbnail_size
Sortie :
@param int  $attachment_id Attachment ID.
@param bool $main_image Is this the main image or a thumbnail?.
@param int  $image_index The image index in the gallery.
@return string

Utilisation

// Modifier la valeur avec le filtre 'woocommerce_gallery_image_size'
add_filter('woocommerce_gallery_image_size', 'ma_fonction_filtre', 10, 1);

function ma_fonction_filtre($flexslider || $main_image ? 'woocommerce_single' : $thumbnail_size) {
    // Modifier la valeur
    return $flexslider || $main_image ? 'woocommerce_single' : $thumbnail_size;
}

Actualités

Chargement des actualités...