[wp-trac] [WordPress Trac] #45357: filter wp_unique_post_slug > doesn't pass original_slug

WordPress Trac noreply at wordpress.org
Thu Nov 15 11:08:41 UTC 2018


#45357: filter wp_unique_post_slug > doesn't pass original_slug
-------------------------------+----------------------
 Reporter:  preliot            |       Owner:  (none)
     Type:  defect (bug)       |      Status:  closed
 Priority:  normal             |   Milestone:
Component:  Posts, Post Types  |     Version:  5.0
 Severity:  minor              |  Resolution:  invalid
 Keywords:                     |     Focuses:
-------------------------------+----------------------
Changes (by swissspidy):

 * keywords:  needs-patch needs-testing =>
 * resolution:   => invalid
 * status:  new => closed
 * component:  General => Posts, Post Types
 * milestone:  Awaiting Review =>


Comment:

 Hi there and welcome to WordPress Trac!

 The value of `$original_slug` isn't the old slug of the post, but the
 original value of the `$slug` at the beginning of the
 `wp_unique_post_slug` function, before it was modified.

 When you edit the post in the editor, you tell WordPress your new slug. To
 make sure the new value is unique across posts, it's ran through
 `wp_unique_post_slug`. The old value of the slug is not involved in this
 process at all.

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


More information about the wp-trac mailing list