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

One click lightbox option for all single images #19562

Closed
bizanimesh opened this issue Apr 18, 2021 · 8 comments
Closed

One click lightbox option for all single images #19562

bizanimesh opened this issue Apr 18, 2021 · 8 comments
Labels
[Closed] Won't Fix wontfix. This issue will not be addressed. Customer Report Issues or PRs that were reported via Happiness. aka "Happiness Request", or "User Report" [Feature] Carousel A fullscreen modal appearing when clicking on an image in a gallery or tiled gallery. [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it

Comments

@bizanimesh
Copy link

bizanimesh commented Apr 18, 2021

Is your feature request related to a problem? Please describe.

In Jetpack, we have a one-click Carousel option that provides a full-screen photo browsing experience. But for a single image, users need to link the image with the attachment page to make a single image open in its own lightbox.

Describe the solution you'd like

Similar to the one-click Carousel option, we can provide a one-click lightbox option for all single images. This way users will not need to manually link all images with their attachment page to enable lightbox.

If we have any user who doesn't want the lightbox for all single images and wants this feature for only selected images, they can disable the one-click lightbox option and manually link selected images with their respective attachment page.

@bobmatyas
Copy link
Contributor

More from the person suggesting this -

WordPress by default shows resized images based on screen sizes. It doesn't let the users view full resolution images. Whereas we can view the full resolution with the lightbox and use pinch to zoom method to clearly see the image.

My site would be grateful to you if somehow you could implement the lightbox for single images. An author has been repeatedly asking for it including his past images, only possible way is an automated solution.

As an example they gave the example of: https://www.xda-developers.com/android-12-app-ui-translation/

@jeherve jeherve added [Closed] Won't Fix wontfix. This issue will not be addressed. [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Feature] Carousel A fullscreen modal appearing when clicking on an image in a gallery or tiled gallery. and removed [Type] Feature Request labels Apr 19, 2021
@jeherve
Copy link
Member

jeherve commented Apr 19, 2021

I'll mark this as "won't fix". As you mentioned, this is already an option today:

for a single image, users need to link the image with the attachment page to make a single image open in its own lightbox.

If one wanted this to apply to all images on their site, they could change the default link attachment settings for all images. While I have not tested this myself, something like this should help:
https://wordpress.stackexchange.com/a/251437/27574

@jeherve jeherve closed this as completed Apr 19, 2021
@bizanimesh
Copy link
Author

👋 Hi @jeherve, I tried both methods that are listed there, but they didn't work. Then I tried the steps provided here but again no result. It looks like image_default_link_type still being ignored by Gutenberg?

@jeherve
Copy link
Member

jeherve commented Apr 20, 2021

It worked well for me. When using this:

add_action( 'after_setup_theme', 'my_new_default_image_settings' );

function my_new_default_image_settings() {
    update_option( 'image_default_link_type', 'attachment' );
}

Posts created after I added the snippet link to the attachment page by default, and Jetpack's Carousel is triggered.

@bizanimesh
Copy link
Author

bizanimesh commented Apr 22, 2021

👋 Hi @jeherve, It didn't work when I added in functions.php

Posts created after I added the snippet link to the attachment page by default, and Jetpack's Carousel is triggered.

Could you please provide the steps? 🤔

My steps:

I enabled the Carousel then I went to Appearance > Theme Editor (Twenty Twenty) > functions.php and used this:

add_action( 'after_setup_theme', 'my_new_default_image_settings' );

function my_new_default_image_settings() {
    update_option( 'image_default_link_type', 'attachment' );
}

As the next step, for testing, I went to post and clicked on a single image but it didn't open in the lightbox.

@jeherve
Copy link
Member

jeherve commented Apr 23, 2021

Here is a quick screen recording, if that helps clarify things a bit:

Screen.Recording.2021-04-23.at.9.43.24.mov

@bizanimesh
Copy link
Author

👋 Hi @jeherve, thank you so much for the recording. 🤗 Here's what we found:

If we add code in functions.php or using the Code Snippets plugin, it will only work for future posts/pages (as you also mentioned).

Can we do something that can change settings for all old posts/pages (including the old ones), or if we can add this feature in Jetpack? 🙂

3911676-zen

@matticbot matticbot added the Customer Report Issues or PRs that were reported via Happiness. aka "Happiness Request", or "User Report" label Apr 26, 2021
@jeherve
Copy link
Member

jeherve commented Apr 26, 2021

Can we do something that can change settings for all old posts/pages (including the old ones), or if we can add this feature in Jetpack?

No, that's most likely something you'd have to do on your own, either via a plugin or via a query that will edit all your posts. We don't typically modify post content in all your existing posts for you in Jetpack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Closed] Won't Fix wontfix. This issue will not be addressed. Customer Report Issues or PRs that were reported via Happiness. aka "Happiness Request", or "User Report" [Feature] Carousel A fullscreen modal appearing when clicking on an image in a gallery or tiled gallery. [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it
Projects
None yet
Development

No branches or pull requests

4 participants