Automattic\WooCommerce\Blocks\BlockTypes

ProductGalleryThumbnails::generate_view_all_html()protectedWC 1.0

Generate the View All markup.

Method of the class: ProductGalleryThumbnails{}

No Hooks.

Return

String.

Usage

// protected - for code of main (parent) or child class
$result = $this->generate_view_all_html( $remaining_thumbnails_count );
$remaining_thumbnails_count(int) (required)
The number of thumbnails that are not displayed.

ProductGalleryThumbnails::generate_view_all_html() code WC 9.6.1

protected function generate_view_all_html( $remaining_thumbnails_count ) {
	$view_all_html = '<div class="wc-block-product-gallery-thumbnails__thumbnail__overlay" 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">+%1$s</span>
		<span class="wc-block-product-gallery-thumbnails__thumbnail__view-all">%2$s</span>
		</div>';

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