jetpack icon indicating copy to clipboard operation
jetpack copied to clipboard

Tiled Gallery removes photon link when gallery links to media file

Open proudfoot opened this issue 8 years ago • 3 comments

Create a gallery with link to "media file" selected and with Photon and Tiled Galleries on.

When any tiled gallery type is selected for the gallery, the thumbnail image link ignores photon and links to the original image instead.

When the "thumbnail grid" type is selected for the gallery layout or Tiled Galleries is deselected in Jetpack settings, the thumbnail image link uses Photon as expected.

proudfoot avatar Apr 01 '18 14:04 proudfoot

I was able to make the photonized link show up by editing https://github.com/Automattic/jetpack/blob/master/modules/tiled-gallery/tiled-gallery/tiled-gallery-item.php#L22 and using jetpack_photon_url the same way it is used in line 32

Line 22 is then: $this->link = $needs_attachment_link ? get_attachment_link( $this->image->ID ) : jetpack_photon_url( $this->orig_file );

Is that useful as a way to patch this?

proudfoot avatar Apr 27 '18 19:04 proudfoot

@proudfoot Feel free to submit a Pull Request with that change, we'll test it and review it!

Thank you!

jeherve avatar Apr 29 '18 14:04 jeherve

@jeherve Thanks- I've given it a try.

Pull request differs from my comment above to add test that Photon setting is active, since it's possible to have Tiled Galleries on and Photon off.

I hope that helps!

proudfoot avatar May 01 '18 14:05 proudfoot