Opened 11 years ago
Closed 10 years ago
#24237 closed defect (bug) (duplicate)
Draft Pages Missing Parent Slug In Permalink
Reported by: | lucasstark | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | minor | Version: | |
Component: | Editor | Keywords: | has-patch |
Focuses: | administration | Cc: |
Description
Draft pages are missing the direct parent's slug as part of the permalink. When the page is published it does receive the correct full permalink.
To reproduce:
Create a new page.
Select a parent.
Save draft ( do not publish yet ).
Review the permalink that is displayed. It will be missing the parent slug.
The permalink should include "contact" at this point. It will not until it is published.
Attachments (1)
Change History (8)
#4
@
10 years ago
Hi,
We are seeing this issue on one of our sites after a recent upgrade to version 3.8.1. Any chance there is a fix on its way or am I echoing into the ether?
Thanks,
Kia
#6
@
10 years ago
- Keywords has-patch added; needs-patch removed
Slugs aren't saved on drafts until the post is either published or the slug is manually updated. To display the sample permalink, we temporarily generate a post_name
then pass the object through get_page_uri( )
, however once it hits get_page_uri()
, the function then pulls a fresh copy of the WP_Post object from the database, which was overwriting the temporary post_name
value. This patch resolves that issue while still allowing get_page_uri()
to accept either a WP_Post object or ID.
Previously reported in #13932.