The seam
Both editions replace WooCommerce's woocommerce_show_product_images on woocommerce_before_single_product_summary at priority 20 with their own render callback, decided on the wp action. They stand aside when:
wp_is_block_theme()is true and the resolved Single Product block template (viaget_block_templates()withsingle-product-<slug>preferred oversingle-product) containswoocommerce/product-image-galleryorwoocommerce/product-gallery, directly or inside acore/pattern(followed up to three levels deep) — statusblocks;- or
woocommerce_show_product_imagesis no longer on the hook at priority 20 — statustheme.
Inside their own gallery, both editions fire WooCommerce's woocommerce_product_thumbnails action, so items other plugins hook there (videos, viewers, badges) still render. Core's woocommerce_show_product_thumbnails callback is removed for the length of that call and re-added at the priority it held.
To keep the classic gallery on the page entirely, remove the plugin's callback after wp, or (full edition) use gmpg_enabled.
Free edition
The free edition applies no filters or actions of its own.
| What | Name |
|---|---|
| Options | gmpgf_settings (enabled, thumbnails, lightbox), gmpgf_theme_status (ok, theme or blocks) |
| Script data | gmpgfL10n (close) |
| Assets | assets/css/gallery.css, assets/js/gallery.js, loaded only where the gallery took over |
Full edition: filters
| Filter | Arguments | Default | What it tunes |
|---|---|---|---|
gmpg_enabled |
true, $product |
true |
Whether the gallery is taken over on this product. |
gmpg_image_ids |
$ids, $product |
product image + gallery | The attachment IDs a product shows. |
gmpg_image_size |
'woocommerce_single' |
— | The slide image size. |
gmpg_thumbnail_size |
'woocommerce_gallery_thumbnail' |
— | The thumbnail image size. |
gmpg_full_size |
'full' |
— | The size the lightbox and zoom load. |
gmpg_zoom_level |
2.5 |
— | How far hover zoom magnifies. |
gmpg_settings |
$settings |
— | The merged settings. |
gmpg_modules |
$modules |
— | The module list. |
gmpg_license_api_url, gmpg_update_cache_ttl |
— | — | The licence endpoint and update cache lifetime. |
// Keep WooCommerce's own gallery on products in the "artwork" category.
add_filter( 'gmpg_enabled', function ( $enabled, $product ) {
return $enabled && ! ( $product && has_term( 'artwork', 'product_cat', $product->get_id() ) );
}, 10, 2 );
// Put a size chart image at the end of every gallery.
add_filter( 'gmpg_image_ids', function ( $ids ) {
$ids[] = 1234; // attachment ID
return $ids;
} );
Full edition: actions
| Action | Arguments | When |
|---|---|---|
gmpg_booted |
$container |
The plugin has finished booting. |
Full edition: data
| What | Name |
|---|---|
| Options | gmpg_settings (enabled, thumbnails, lightbox, zoom, variation_images, loop), gmpg_theme_status, gmpg_license |
| Variation meta | _gmpg_images — the variation's own attachment IDs |
| Cron | gmpg_license_check |
| Transient | gmpg_update_payload |
CSS classes
Free edition (the wrapper also carries WooCommerce's images class):
.gmpgf— the wrapper, with.gmpgf-thumbs-bottomor.gmpgf-thumbs-none, and.gmpgf-emptywhen the product has no images.gmpgf-stage,.gmpgf-slides,.gmpgf-slide,.gmpgf-placeholder.gmpgf-nav,.gmpgf-prev,.gmpgf-next.gmpgf-thumbs,.gmpgf-thumb-item,.gmpgf-thumb(.is-activeon the current one)
Full edition: the same names with the gmpg- prefix, with .gmpg-thumbs-bottom, .gmpg-thumbs-left or .gmpg-thumbs-none on the wrapper, and .gmpg-zoom, .is-zoomable and .is-zooming for hover zoom.
