Block themes
The plugin registers a Gallery Photo block template (WordPress 6.7+). It uses the theme’s header and footer template parts around the Gallery Photo block, which is full width with no space above it. A version edited in the Site Editor comes first, then a theme’s own template with the slug lh-image-gallery-photo, then the plugin’s. The template is never offered in the editor’s Template control.
The Gallery Photo block is server-rendered and hidden from the inserter, because it only makes sense on a photo page. It shows the photo edge to edge, at most as tall as the screen, then its caption, Previous and Next links, a link back to the post and a View full size link. The text stays inset by --lh-image-gallery-gutter (default 5%). Its page heading is the photo’s label (caption, alt text or “Photo n of N”), hidden on screen but there for screen readers and search engines. Its styles set layout only; colours and type come from the theme.
The block has the id photo, and every link to a photo page (gallery links, Previous and Next, the prerendered next page, old lh-image-url redirects) ends in #photo, so the page opens with the photo at the top of the screen. Canonical, Open Graph and structured data URLs leave it off. A theme with a sticky header can keep it clear of the photo by setting the --lh-image-gallery-scroll-margin CSS custom property (default 0).
Classic themes
A classic theme shows the photo in place of the post content in its normal single template. A theme can supply its own lh-image-gallery-photo.php.
Filters
All filter names start with lh_image_gallery_.
lh_image_gallery_is_indexable: whether a photo page may be indexed. Receives the default (true when the photo has a caption or alt text), the attachment ID and the post.lh_image_gallery_return_endpoint: the endpoint,photoby default. Change it if a page has a child page with that slug.lh_image_gallery_return_anchor: the fragment links to photo pages end with and the photo block’s id,photoby default. Return an empty string to link without one.lh_image_gallery_return_linked_destinations: which image link settings get a photo page,mediaandattachmentby default.lh_image_gallery_return_template_content: the block markup of the registered template.lh_image_gallery_return_template_slugandlh_image_gallery_return_block_name: the template slug and the block name.lh_image_gallery_return_cache_versionandlh_image_gallery_return_rewrite_schema: bump to rebuild every cached gallery list, or to flush rewrite rules once on every site.lh_image_gallery_init_plugin: return false to switch the plugin off without deactivating it.

