Ticket #12634: 12634.diff
File 12634.diff, 955 bytes (added by , 14 years ago) |
---|
-
wp-includes/post.php
2787 2787 } 2788 2788 } elseif ( in_array( $post_type, $hierarchical_post_types ) ) { 2789 2789 // Page slugs must be unique within their own trees. Pages are in a separate 2790 // namespace than posts so page slugs are allowed to overlap post slugs. 2790 // namespace than posts so page slugs are allowed to overlap post slugs. But they must not 2791 // overlap slugs of attachments sharing the same parent. 2792 $hierarchical_post_types['attachment'] = 'attachment'; 2793 2791 2794 $check_sql = "SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND post_type IN ( '" . implode( "', '", esc_sql( $hierarchical_post_types ) ) . "' ) AND ID != %d AND post_parent = %d LIMIT 1"; 2792 2795 $post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $slug, $post_ID, $post_parent ) ); 2793 2796