[wp-trac] [WordPress Trac] #38539: Post/page stubs fail to get unique slugs (was: Auto-draft posts/pages inserted from starter content lack slugs)

WordPress Trac noreply at wordpress.org
Fri Oct 28 04:15:36 UTC 2016


#38539: Post/page stubs fail to get unique slugs
----------------------------------------+--------------------------
 Reporter:  westonruter                 |       Owner:  westonruter
     Type:  defect (bug)                |      Status:  accepted
 Priority:  normal                      |   Milestone:  4.7
Component:  Customize                   |     Version:
 Severity:  normal                      |  Resolution:
 Keywords:  has-patch needs-unit-tests  |     Focuses:
----------------------------------------+--------------------------
Changes (by westonruter):

 * keywords:   => has-patch needs-unit-tests
 * owner:   => westonruter
 * status:  new => accepted


Old description:

> I noticed that after initializing Twenty Seventeen all of the Top nav
> menu items all linked to the homepage. It turns out that the `auto-draft`
> status post/page stubs were not getting a `post_name` specified and so
> the permalink for them would point to the homepage.

New description:

 I noticed that after initializing Twenty Seventeen all of the Top nav menu
 items all linked to the homepage. It turns out that the `auto-draft`
 status post/page stubs were not getting a `post_name` specified and so the
 permalink for them would point to the homepage.

 Likewise, when adding new nav menu items, I'm able to supply titles which
 then result in pages/posts that have the same `post_name` as other items.
 This is due to `wp_publish_posts()` being used which bypasses the unique
 slug check.

--

--
Ticket URL: <https://core.trac.wordpress.org/ticket/38539#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list