Opened 5 months ago
Last modified 3 months ago
#61133 reviewing defect (bug)
Update `get_attachment_link()` to return image URL when attachment pages are turned off.
Reported by: | peterwilsoncc | Owned by: | antpb |
---|---|---|---|
Milestone: | 6.7 | Priority: | normal |
Severity: | normal | Version: | 6.4 |
Component: | Media | Keywords: | has-patch |
Focuses: | sustainability | Cc: |
Description (last modified by )
get_attachment_link()
returns the URL for the attachment page. As these pages have been removed on new installs of WordPress the returned URL links to a page that subsequently redirects to the image. This produces unnecessary computing cycles and delays visitors reaching the eventual destination.
When attachment pages are turned off, the function should return the same value as wp_get_attachment_url()
.
Follow up to #57913.
Change History (6)
This ticket was mentioned in PR #6728 on WordPress/wordpress-develop by @deepakrohilla.
4 months ago
#2
- Keywords has-patch added; needs-patch removed
This ticket was mentioned in Slack in #core-media by antpb. View the logs.
3 months ago
@deepakrohilla commented on PR #6728:
3 months ago
#6
@peterwilsoncc : Thanks for the review. Suggested changes has been done.
Yep, makes sense to avoid the redirect and improve performance. Could potentially be a little unexpected when the link is not to an image but to another type of file, but seems this is the case already.
Also fixed a typo in the description, assuming the link is to ticket 57913 where this was implemented.