[wp-trac] [WordPress Trac] #43001: Page Slug and Attachment - Conflict

WordPress Trac noreply at wordpress.org
Fri Dec 29 21:15:32 UTC 2017


#43001: Page Slug and Attachment - Conflict
-------------------------------+-----------------------------
 Reporter:  sebastian.pisula   |      Owner:
     Type:  defect (bug)       |     Status:  new
 Priority:  normal             |  Milestone:  Awaiting Review
Component:  Posts, Post Types  |    Version:  trunk
 Severity:  normal             |   Keywords:
  Focuses:                     |
-------------------------------+-----------------------------
 I found problem. My attachment have post_name "test" and I want set for my
 new page post_name "test" and WordPress generate "test-2". I think that
 problem is with wp_unique_post_slug function in file: wp-
 includes/post.php:3950:

 {{{
 $check_sql  = "SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND
 post_type IN ( %s, 'attachment' ) AND ID != %d AND post_parent = %d LIMIT
 1";
 }}}

 I attach fix

--
Ticket URL: <https://core.trac.wordpress.org/ticket/43001>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list