#27222 closed defect (bug) (fixed)
get_uploaded_header_images() returns the incorrect image URL
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 3.9 | Priority: | normal |
Severity: | normal | Version: | 3.2 |
Component: | Customize | Keywords: | has-patch dev-feedback commit |
Focuses: | Cc: |
Description
When using a CDN (e.g. S3 ) and a plugin that modifies the File URL for an attachment (e.g. Amazon S3 and CloudFront), the get_uploaded_header_images()
function returns an array with the unmodified URL instead of the new URL.
In the case of this particular plugin, we have the option of removing the media from the media folder and using the media strictly on the CDN; however, the result is a blank image (by looking in the empty media library) instead of the image on the CDN.
The attached patch uses wp_get_attachment_url( $header->ID )
in lieu of $header->guid
to return the correct URL.
Attachments (1)
Change History (7)
#2
@
11 years ago
- Keywords commit added
- Milestone changed from Awaiting Review to 3.9
- Version changed from trunk to 3.2
This ticket was mentioned in IRC in #wordpress-dev by nacin. View the logs.
11 years ago
#4
@
11 years ago
I can't really think of anything that can go wrong with 27222.patch and it kinda makes sense.
A workaround could be changing the guid during attachment insert, especially if the original file is not saved locally, in which case you'll end up with a guid pointing to a file that does not exist, regardless of what wp_get_attachment_url()
or get_uploaded_header_images()
return.
Introduced in [17757].