WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 8 weeks ago

Last modified 8 weeks ago

#21959 closed enhancement (wontfix)

No way to override the name of an image when that is being resized

Reported by: jkmassel Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.4.2
Component: Media Keywords: needs-docs needs-refresh
Focuses: Cc:

Description

The most obvious solution is to add a hook to allow the destination file name to be modified.

The solution attached gives pretty much all the information you could possibly want to modify the filename as you might need to.

Attachments (2)

media_destination_file_name_hook.diff (707 bytes) - added by jkmassel 3 years ago.
A fix for this issue
21959.patch (559 bytes) - added by SergeyBiryukov 3 years ago.

Download all attachments as: .zip

Change History (8)

@jkmassel3 years ago

A fix for this issue

comment:1 @jkmassel3 years ago

  • Cc jeremy.massel@… added

@SergeyBiryukov3 years ago

comment:2 follow-up: @SergeyBiryukov3 years ago

$destfilename needs to be a string, not an array. Additional information can be passed as extra arguments.

comment:3 in reply to: ↑ 2 @jkmassel3 years ago

Replying to SergeyBiryukov:

$destfilename needs to be a string, not an array. Additional information can be passed as extra arguments.

Ah interesting. Thanks for the info!

comment:4 @DrewAPicture12 months ago

  • Keywords needs-refresh close added; has-patch needs-codex removed

As of 3.5, the code the patch modifies has been deprecated.

If this is still something you'd like to pursue, I suggest looking at the _save() methods in WP_Image_Editor_GD and WP_Image_Editor_Imagick as a starting place.

comment:5 @wonderboymusic8 weeks ago

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

image_make_intermediate_size = "Filter the name of the saved image file."

Note: See TracTickets for help on using tickets.