• Hello,

    I have an upload field in an option page. I use the wp_upload_bits function to upload the file, which goes to wp-content/upload/[year]/[month]/[filename]. Great.

    But I failed to find a function that deletes this file, preferably based on the file URL, so that I don’t have to save the local path as well. I noticed that wordpress only saves the url of it’s attachments so I goes there is such a function. Any directions is greatly appreciated.

Viewing 1 replies (of 1 total)
  • Anonymous User

    (@anonymized-3085)

    there isn’t one, it looks like all the deletes are handled by the standard unlink. Which I believe can’t be done via a url (for obvious reasons).

Viewing 1 replies (of 1 total)

The topic ‘WordPress function for deleting a file’ is closed to new replies.