[wp-trac] [WordPress Trac] #24237: Draft Pages Missing Parent Slug In Permalink

WordPress Trac noreply at wordpress.org
Tue Jul 1 02:52:52 UTC 2014

#24237: Draft Pages Missing Parent Slug In Permalink
 Reporter:  lucasstark    |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Permalinks    |     Version:
 Severity:  minor         |  Resolution:
 Keywords:  has-patch     |     Focuses:
Changes (by chriseverson):

 * keywords:  needs-patch => has-patch


 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.

Ticket URL: <https://core.trac.wordpress.org/ticket/24237#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list