WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

WooCommerce::add_image_sizes() public WC 2.3

Add WC Image sizes to WP.

As of 3.3, image sizes can be registered via themes using add_theme_support for woocommerce and defining an array of args. If these are not defined, we will use defaults. This is handled in wc_get_image_size function.

3.3 sizes:

woocommerce_thumbnail - Used in product listings. We assume these work for a 3 column grid layout. woocommerce_single - Used on single product pages for the main image.

Это метод класса: WooCommerce{}

Хуков нет.

Возвращает

Null. Ничего.

Использование

$WooCommerce = new WooCommerce();
$WooCommerce->add_image_sizes();

Список изменений

С версии 2.3 Введена.

Код WooCommerce::add_image_sizes() WC 4.5.2

woocommerce/includes/class-woocommerce.php
<?php
public function add_image_sizes() {
	$thumbnail         = wc_get_image_size( 'thumbnail' );
	$single            = wc_get_image_size( 'single' );
	$gallery_thumbnail = wc_get_image_size( 'gallery_thumbnail' );

	add_image_size( 'woocommerce_thumbnail', $thumbnail['width'], $thumbnail['height'], $thumbnail['crop'] );
	add_image_size( 'woocommerce_single', $single['width'], $single['height'], $single['crop'] );
	add_image_size( 'woocommerce_gallery_thumbnail', $gallery_thumbnail['width'], $gallery_thumbnail['height'], $gallery_thumbnail['crop'] );

	/**
	 * Legacy image sizes.
	 *
	 * @deprecated 3.3.0 These sizes will be removed in 4.6.0.
	 */
	add_image_size( 'shop_catalog', $thumbnail['width'], $thumbnail['height'], $thumbnail['crop'] );
	add_image_size( 'shop_single', $single['width'], $single['height'], $single['crop'] );
	add_image_size( 'shop_thumbnail', $gallery_thumbnail['width'], $gallery_thumbnail['height'], $gallery_thumbnail['crop'] );
}