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

WordPress Trac noreply at wordpress.org
Sat Feb 20 22:49:36 UTC 2016

#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 has-patch has-unit-tests   |     Focuses:
  needs-testing                                  |

Comment (by ericlewis):

 In attachment:11863.5.diff:

 * Move the postname rejiggering logic into `wp_insert_post()`, which
 [https://core.trac.wordpress.org/ticket/11863#comment:105 avoids duplicate
 calls to `wp_insert_post()`]
 * Move unit tests to their own file under the `post/` component test
 * Don't rename postnames within `get_sample_permalink()`. I originally
 dropped the logic in here so that, when the AJAX request when creating a
 new post attempts to decide on a permalink, any post in the trash with the
 desired slug would be changed. The logic for deciding the slug is embedded
 in `get_sample_permalink()`, so extracting that logic would be duplicative
 higher in the stack in `wp_ajax_sample_permalink()`.
 * Relatedly, when a post goes trashed, also add the trashed slug suffix.
 This should keep the slug namespace clear.

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

More information about the wp-trac mailing list