Ticket #35031: 35031.diff
File 35031.diff, 758 bytes (added by , 9 years ago) |
---|
-
src/wp-includes/query.php
4978 4978 if ( is_post_type_hierarchical( $post_type ) ) 4979 4979 return; 4980 4980 4981 // If the post already exists, we shouldn't try to redirect 4982 if ( get_posts( array( 'name' => $wp_query->query_vars['name'], 'post_type' => $post_type ) ) ) { 4983 return; 4984 } 4985 4981 4986 $query = $wpdb->prepare("SELECT post_id FROM $wpdb->postmeta, $wpdb->posts WHERE ID = post_id AND post_type = %s AND meta_key = '_wp_old_slug' AND meta_value = %s", $post_type, $wp_query->query_vars['name']); 4982 4987 4983 4988 // if year, monthnum, or day have been specified, make our query more precise