Make WordPress Core

Opened 12 years ago

Closed 11 years ago

Last modified 11 years ago

#21114 closed enhancement (duplicate)

Add Link to Large Image in Add Media Window

Reported by: robertstaddon's profile robertstaddon Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.4
Component: Media Keywords: has-patch ux-feedback
Focuses: Cc:

Description

Usually when an image thumbnail is inserted into a post, I would like the thumbnail to link to the large version of the image, not the full size version. Often the full size version is straight from a user's high-megapixel camera and takes a while to load, while the large version has been automatically downsized by Wordpress according to its media settings and works beautifully with a lightbox plugin or script.

Wordpress automatically creates a large version of the image, but unfortunately it does not support linking to the large version very easily at all from the Add Media window. This patch adds the option to link to either the Full Size Image or the Large Image from the Add Media window.

I've used the attached patch to the Wordpress core ever since the version 2 era. I thought I'd try submitting it as an enhancement so I that I won't have to keep manually applying it every time that I upgrade Wordpress.

One note: The line that says "$url = $fileLarge;" makes the large file the default link for an image. This may be too drastic of a change for Wordpress. However, most of my clients would vote that it should be the default, so I thought I'd try submitting it anyway. :) If other people disagree, then I could certainly remove that line of code so that the large image would be an option but not the default option.

Attachments (5)

media.php.patch (2.0 KB) - added by robertstaddon 12 years ago.
add-link-to-large-image.php (1.7 KB) - added by SergeyBiryukov 12 years ago.
In plugin form
media.php.2.patch (2.1 KB) - added by robertstaddon 12 years ago.
21114.after.png (20.3 KB) - added by SergeyBiryukov 12 years ago.
21114.after.disabled.png (20.5 KB) - added by SergeyBiryukov 12 years ago.

Download all attachments as: .zip

Change History (12)

#1 @knutsp
12 years ago

  • Cc knut@… added

+1

This a practical problem for me and clients. As the ticket author wants, I usually want to link to the large image and not the full size from camera. The full size will often be too large for a normal screen resolution, the resolution higher then needed on the web. I don't want to always have to resize the image in WordPress, or before upload, lazy as I am. This would be a nice enhancement.

Patch should make the users latest choice as the default for the next insert.

Last edited 12 years ago by knutsp (previous) (diff)

#2 @scribu
12 years ago

  • Component changed from General to Media

@SergeyBiryukov
12 years ago

In plugin form

#3 @SergeyBiryukov
12 years ago

I thought I'd try submitting it as an enhancement so I that I won't have to keep manually applying it every time that I upgrade Wordpress.

It's also currently possible to turn your patch into a plugin (add-link-to-large-image.php), so you don't have to edit the core file.

#4 follow-up: @robertstaddon
12 years ago

Wow, Sergey, thank you so much for writing that plugin! Beautifully written. It will be a real help.

Perhaps I should release your plugin publicly before suggesting a patch to the Wordpress core. Somehow, though, I still think that this would be a really helpful addition to Wordpress. What do you think? The above +1 from knutsp seemed to reinforce this idea. I've rewritten the patch with your updated plugin code and also disabled the "Large Image" button if it is the same as the "Full Size" image.

What do you think about media.php.2.patch?

Thank you again!

#5 in reply to: ↑ 4 @SergeyBiryukov
12 years ago

  • Keywords ux-feedback added; needs-testing removed

Related: #19181 (suggests a filter for image_link_input_fields()).

Replying to robertstaddon:

Perhaps I should release your plugin publicly before suggesting a patch

Sure, go ahead. Glad you liked it.

What do you think about media.php.2.patch?

A change like this needs UX feedback. I've attached the screenshots after the patch.

#6 @lekiend
11 years ago

I tried but it doesn't work with WP 3.5.1.
Should it be possible to get a compatible version for WP 3.5.1 ?

Dimitri

#7 @SergeyBiryukov
11 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

I'm not yet familiar enough with the new Media API to update the plugin, but #24019 has a patch for the new media modal that covers this. Going to close as a duplicate of that ticket.

Last edited 11 years ago by SergeyBiryukov (previous) (diff)
Note: See TracTickets for help on using tickets.