[wp-trac] [WordPress Trac] #61133: Update `get_attachment_link()` to return image URL when attachment pages are turned off.
WordPress Trac
noreply at wordpress.org
Thu May 2 23:19:14 UTC 2024
#61133: Update `get_attachment_link()` to return image URL when attachment pages
are turned off.
----------------------------+-----------------------------
Reporter: peterwilsoncc | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Media | Version: 6.4
Severity: normal | Keywords:
Focuses: sustainability |
----------------------------+-----------------------------
`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].
--
Ticket URL: <https://core.trac.wordpress.org/ticket/61133>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list