[wp-trac] [WordPress Trac] #11863: Trashed items interfere with page/post slug generation

WordPress Trac noreply at wordpress.org
Thu Dec 10 00:15:02 UTC 2015


#11863: Trashed items interfere with page/post slug generation
------------------------------------+------------------------
 Reporter:  Denis-de-Bernardy       |       Owner:  ericlewis
     Type:  enhancement             |      Status:  assigned
 Priority:  normal                  |   Milestone:  4.5
Component:  Posts, Post Types       |     Version:  2.9
 Severity:  normal                  |  Resolution:
 Keywords:  make-flow dev-feedback  |     Focuses:
------------------------------------+------------------------

Comment (by ericlewis):

 Let's discuss implementation of the aforementioned including @helen's
 feedback.

 1. When creating a post (in `wp_insert_post()`?), check for slug
 collisions with the desired `post_name` in the trash, and change the slug
 for the trashed post. This is more or less the control flow of
 [https://wordpress.org/plugins/no-slug-conflicts-with-trash/ No Slug
 Conflicts with Trash].
 2. When making a slug unique (in `wp_unique_post_slug()`), ignore trashed
 posts. This is what @williamsba1 was moving towards in his last patch,
 attachment:11863.3.diff. This means there would be slug collisions between
 published and trashed posts, until a trashed post is untrashed and
 assigned a unique slug.
 3. Add a marker to a post's `post_name` when it is trashed, clearing the
 slug namespace. e.g. `about` => `about%trashed%`. If the post is
 untrashed, remove the marker.

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


More information about the wp-trac mailing list