All the wordpress functions for retrieving media details seem to give you the web url of a file uploaded. I want to the local server drive/folder path, ideally relative to the install of wordpress. I have the attachment id value to hand so can parse that to a function, if only I knew what it was.

Is this possible with a function built in that I’ve missed? If not does anyone have anything pre-written for this function?

2 s
2

get_attached_file returns the server path of an attachment.

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *