[wp-trac] [WordPress Trac] #38539: Post/page stubs fail to get unique slugs

WordPress Trac noreply at wordpress.org
Fri Oct 28 04:25:12 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:
----------------------------------------+--------------------------
Description changed by westonruter:

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.
>
> 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.

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.

 See #38114, #38013, #34923

--

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


More information about the wp-trac mailing list