Changeset 39411 for trunk/src/wp-includes/post.php
- Timestamp:
- 12/02/2016 12:24:19 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/post.php
r39346 r39411 3674 3674 if ( 'attachment' == $post_type ) { 3675 3675 // Attachment slugs must be unique across all types. 3676 $check_sql = "SELECT post_name FROM $wpdb->posts WHERE post_ name = %s AND ID != %d LIMIT 1";3676 $check_sql = "SELECT post_name FROM $wpdb->posts WHERE post_status != 'auto-draft' AND post_name = %s AND ID != %d LIMIT 1"; 3677 3677 $post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $slug, $post_ID ) ); 3678 3678 … … 3702 3702 * namespace than posts so page slugs are allowed to overlap post slugs. 3703 3703 */ 3704 $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";3704 $check_sql = "SELECT post_name FROM $wpdb->posts WHERE post_status != 'auto-draft' AND post_name = %s AND post_type IN ( %s, 'attachment' ) AND ID != %d AND post_parent = %d LIMIT 1"; 3705 3705 $post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $slug, $post_type, $post_ID, $post_parent ) ); 3706 3706 … … 3726 3726 } else { 3727 3727 // Post slugs must be unique across all posts. 3728 $check_sql = "SELECT post_name FROM $wpdb->posts WHERE post_ name = %s AND post_type = %s AND ID != %d LIMIT 1";3728 $check_sql = "SELECT post_name FROM $wpdb->posts WHERE post_status != 'auto-draft' AND post_name = %s AND post_type = %s AND ID != %d LIMIT 1"; 3729 3729 $post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $slug, $post_type, $post_ID ) ); 3730 3730
Note: See TracChangeset
for help on using the changeset viewer.