Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 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:

Description

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:

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

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

Change History (4)

#1 @tannerm
3 years ago

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

#3 @davidbaumwald
3 years ago

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

#4 @SergeyBiryukov
3 years ago

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