Opened 9 years ago
Last modified 6 years ago
#33963 new enhancement
New function: `upload_url()`
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | |
Component: | Upload | Keywords: | reporter-feedback needs-refresh has-patch |
Focuses: | Cc: |
Description
Retrieve the url to the uploads directory.
Attachments (2)
Change History (9)
#2
follow-up:
↓ 4
@
9 years ago
- Component changed from General to Upload
- Keywords reporter-feedback added
- Type changed from defect (bug) to enhancement
Thanks for the patch, Sebastian.
What's the use case for needing the URL for the uploads directory?
#3
@
9 years ago
- Keywords needs-refresh added
@sebastian.pisula, minor nitpick: the second part, you can just set it to $upload_dir['url']
instead of adding the string
#4
in reply to:
↑ 2
@
9 years ago
What's the use case for needing the URL for the uploads directory?
Perhaps we could use this function at various places in core where $upload_dir['url']
is accessed directly?
$url = upload_url()
isn't much of an improvement over $upload_dir = wp_upload_dir(); $url = $upload_dir['url']
though.
This ticket was mentioned in Slack in #core by sebastian.pisula. View the logs.
9 years ago
Note: See
TracTickets for help on using
tickets.
#33964 was marked as a duplicate.