Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image lightbox: Add support for external urls in the lightbox #51278

Merged
merged 1 commit into from
Jun 6, 2023

Conversation

SantosGuillamot
Copy link
Contributor

What?

Fixes #51276 : Image: Lightbox doesn't work on image inserted from URL.

Why?

Right now, the lightbox functionality, currently in experimental, doesn't work with image that point to an external url.

How?

I added a conditional that checks if the image id exists. If it does, the lightbox gets the URL from the attachment URL and, if not, it does use the external URL.

Testing Instructions

  • Enable the Interactivity API experiment in Gutenberg->Experiment.
  • Add an image with a source URL.
  • Check that the lightbox works as expected.

Copy link
Contributor

@artemiomorales artemiomorales left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works and looks good to me 👍
We should also add a test for this. I'll do that in a follow up PR.

@artemiomorales artemiomorales merged commit 4ed9a02 into trunk Jun 6, 2023
@artemiomorales artemiomorales deleted the fix/image-lightbox-external-urls branch June 6, 2023 21:26
@github-actions github-actions bot added this to the Gutenberg 16.0 milestone Jun 6, 2023
@ndiego ndiego added the [Type] Experimental Experimental feature or API. label Jun 7, 2023
@ramonjd ramonjd added the Needs PHP backport Needs PHP backport to Core label Jun 8, 2023
@cbravobernal cbravobernal removed the Needs PHP backport Needs PHP backport to Core label Jun 15, 2023
sethrubenstein pushed a commit to pewresearch/gutenberg that referenced this pull request Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Image Affects the Image Block [Feature] Interactivity API API to add frontend interactivity to blocks. [Type] Experimental Experimental feature or API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Image: Lightbox doesn't work on image inserted from URL
5 participants