Automattic\WooCommerce\Blocks\BlockTypes

ProductGalleryThumbnails::generate_view_all_html()protectedWC 1.0

Generate the View All markup.

Метод класса: ProductGalleryThumbnails{}

Хуков нет.

Возвращает

Строку.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->generate_view_all_html( $remaining_thumbnails_count );
$remaining_thumbnails_count(int) (обязательный)
The number of thumbnails that are not displayed.

Код ProductGalleryThumbnails::generate_view_all_html() WC 9.3.3

protected function generate_view_all_html( $remaining_thumbnails_count ) {
	$view_all_html = '<div class="wc-block-product-gallery-thumbnails__thumbnail__overlay wc-block-product-gallery-dialog-on-click" data-wc-on--click="actions.openDialog" data-wc-on--keydown="actions.onViewAllImagesKeyDown" tabindex="0">
		<span class="wc-block-product-gallery-thumbnails__thumbnail__remaining-thumbnails-count wc-block-product-gallery-dialog-on-click">+%1$s</span>
		<span class="wc-block-product-gallery-thumbnails__thumbnail__view-all wc-block-product-gallery-dialog-on-click">%2$s</span>
		</div>';

	return sprintf(
		$view_all_html,
		esc_html( $remaining_thumbnails_count ),
		esc_html__( 'View all', 'woocommerce' )
	);
}