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

Lightbox: caption missing when opening lightbox image #60469

Open
mamaretti opened this issue Apr 4, 2024 · 6 comments
Open

Lightbox: caption missing when opening lightbox image #60469

mamaretti opened this issue Apr 4, 2024 · 6 comments
Labels
[Block] Image Affects the Image Block [Type] Bug An existing feature does not function as intended

Comments

@mamaretti
Copy link

Description

hello

since #58835 figcaption is missing on opened lightbox image

(WP 6.5)

Step-by-step reproduction instructions

add an image with caption and trigger lightbox link

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@mamaretti mamaretti added the [Type] Bug An existing feature does not function as intended label Apr 4, 2024
@jordesign jordesign added the [Block] Image Affects the Image Block label Apr 4, 2024
@annezazu
Copy link
Contributor

annezazu commented Apr 9, 2024

@artemiomorales can you look into this?

@annezazu annezazu changed the title Missing figcaption on Lightbox (WP 6.5) Lightbox: caption missing when opening lightbox image Apr 9, 2024
@annezazu
Copy link
Contributor

annezazu commented Apr 9, 2024

Pulling in feedback and a question from a separate issue:

I am the developer of an image caption plugin for publishers who need to show image attributions for legal reasons.
With WordPress 6.5, lightboxes no longer show the caption I added to images in the post content since lightbox HTML is not rendered separately.

Ideally, I could add a placeholder for the caption into block_core_image_print_lightbox_overlay() using a filter, but there is none.
Would you be able to provide one?

In a next step, I would need to figure out how to fill it, but the render_block_core/image filter might just be good for that.

@artemiomorales
Copy link
Contributor

@annezazu Thanks for the ping! I'm not sure I have bandwidth to look at this for the upcoming release. To clarify @webzunft, do you need to render the caption inside the lightbox overlay itself? And this was working prior to 6.5?

@webzunft
Copy link

webzunft commented May 3, 2024

@artemiomorales

do you need to render the caption inside the lightbox overlay itself? And this was working prior to 6.5?

Yes and yes. In 6.4, I just had to place my caption markup close to the image and it was showing up with it in the lightbox.

@gziolo
Copy link
Member

gziolo commented May 7, 2024

It might be related to this refactoring that uses a shared HTML for all Lightbox overlays:

@andreawetzel
Copy link

Our photographers would also like the caption to appear when the lightbox is expanded for an image.

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 [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

7 participants