WordPress.org

Make WordPress Core

Opened 12 months ago

Last modified 12 months ago

#24019 new enhancement

Allow user to specify image size when selecting "Media File" as "Link To" target for image attachments.

Reported by: dfcowell Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 3.6
Component: Media Keywords: has-patch
Focuses: Cc:

Description

Currently selecting "Media File" as the "Link To" target causes an embedded image to link to the originally uploaded file. These files can be very large and there is no way to non-destructively resize them on upload while retaining this "Link To" functionality.

This enhancement patch adds a drop down list of available image sizes to the form (defaulting to Full Size - the existing behaviour) when "Media File" is selected, allowing the user to link to custom image sizes as specified in their themes or plugins if desired.

http://dfcowell.net/wp-content/uploads/2013/04/attachdisplay.png

http://dfcowell.net/wp-content/uploads/2013/04/attachdisplay2.png

This is a significant improvement over default functionality, especially when used in conjunction with a lightbox plugin. It allows the user to retain the full-size image on the server while being able to specify a link to a smaller size if desired.

Attachments (1)

media.patch (3.4 KB) - added by dfcowell 12 months ago.
Media File Patch

Download all attachments as: .zip

Change History (5)

dfcowell12 months ago

Media File Patch

comment:1 SergeyBiryukov12 months ago

#15668 was marked as a duplicate.

comment:2 follow-up: dfcowell12 months ago

Not strictly a duplicate of #15660 as it references the existing Size field used to generate img tags and handling the registration of custom/default image sizes.

This enhancement creates a new field under "Link To" which affects the anchor tag generated when an image is embedded.

Version 0, edited 12 months ago by dfcowell (next)

comment:3 in reply to: ↑ 2 SergeyBiryukov12 months ago

Replying to dfcowell:

Not strictly a duplicate of #15668 as it references the existing Size field used to generate img tags and handling the registration of custom/default image sizes.

Indeed, thanks. Reopened that ticket.

comment:4 SergeyBiryukov12 months ago

#21114 was marked as a duplicate.

Note: See TracTickets for help on using tickets.