Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#51841 closed feature request (worksforme)

Please add a wordpress function to convert a given file name string into what it would turn into if uploaded to the media library

Reported by: tannerm's profile tannerm Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Media Keywords:
Focuses: Cc:


When writing import scripts, it can be very difficult trying to set post thumbnails on posts if the client gives us files named things like:

Ranked Choice Voting and Women_s Representation. Cambridge, MA THUMBNAIL.png

I'd like to be able to take that string and put it into a wordpress function that converts it to the filename that wordpress creates when it is successfully added to the media library:


If this function already exists somewhere I would greatly appreciate being directed to it.

Change History (4)

#1 @tannerm
4 years ago

  • Resolution set to worksforme
  • Status changed from new to closed

#3 @davidbaumwald
4 years ago

  • Component changed from General to Filesystem API
  • Milestone Awaiting Review deleted

#4 @SergeyBiryukov
4 years ago

  • Component changed from Filesystem API to Media
Note: See TracTickets for help on using tickets.