Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Product Gallery Thumbnails: Refactor View all html to make it more re…
Browse files Browse the repository at this point in the history
…adable
  • Loading branch information
danieldudzic committed Oct 9, 2023
1 parent 6f726be commit 0dac111
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/BlockTypes/ProductGalleryThumbnails.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,16 @@ protected function get_block_type_uses_context() {
* @return string
*/
protected function generate_view_all_html( $remaining_thumbnails_count ) {
return '<div class="wc-block-product-gallery-thumbnails__thumbnail__overlay wc-block-product-gallery-dialog-on-click" data-wc-on--click="actions.woocommerce.handleClick"><span class="wc-block-product-gallery-thumbnails__thumbnail__remaining-thumbnails-count wc-block-product-gallery-dialog-on-click">+' . esc_html( $remaining_thumbnails_count ) . '</span><span class="wc-block-product-gallery-thumbnails__thumbnail__view-all wc-block-product-gallery-dialog-on-click">' . __( 'View all', 'woo-gutenberg-products-block' ) . '</span></div>';
$view_all_html = '<div class="wc-block-product-gallery-thumbnails__thumbnail__overlay wc-block-product-gallery-dialog-on-click" data-wc-on--click="actions.woocommerce.handleClick">'
. '<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 ),
__( 'View all', 'woo-gutenberg-products-block' )
);
}

/**
Expand Down

0 comments on commit 0dac111

Please sign in to comment.