Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 6 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 Owned by:
Priority: normal Milestone:
Component: Media Version:
Severity: normal Keywords:
Cc: Focuses:

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
6 years ago

  • Resolutionworksforme
  • Status newclosed

#3 @davidbaumwald
6 years ago

  • Component GeneralFilesystem API
  • Milestone Awaiting Review

#4 @SergeyBiryukov
6 years ago

  • Component Filesystem APIMedia
Note: See TracTickets for help on using tickets.