[wp-trac] [WordPress Trac] #52324: Sample permalinks unavailable for attachment pages.
WordPress Trac
noreply at wordpress.org
Tue Jan 19 01:15:41 UTC 2021
#52324: Sample permalinks unavailable for attachment pages.
---------------------------+-----------------------------
Reporter: peterwilsoncc | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Media | Version:
Severity: normal | Keywords:
Focuses: |
---------------------------+-----------------------------
Both `get_page_link()` and `get_post_permalink()` accept a third parameter
`$sample` to generate permalinks for unpublished posts (`draft`, `future`,
etc).
`get_attachment_link()` does not include this third parameter and will
always generate an ugly formatted link for attachment pages.
For example instead of `w.org/future-post/future-attachment` the
attachment page is always shown as `w.org/?attachment_id=4`.
To reproduce:
1. Create a post leave it in draft
2. Upload some new media
3. Link it to the attachment page
4. Observe that it uses the ugly URL format.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/52324>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list