Ticket #1231: do-not-feed-the-post-title.diff
| File do-not-feed-the-post-title.diff, 937 bytes (added by , 20 years ago) |
|---|
-
wp-includes/post.php
591 591 if ( 'draft' != $post_status ) { 592 592 $post_name_check = $wpdb->get_var("SELECT post_name FROM $wpdb->posts WHERE post_name = '$post_name' AND post_type = '$post_type' AND ID != '$post_ID' AND post_parent = '$post_parent' LIMIT 1"); 593 593 594 if ($post_name_check ) {594 if ($post_name_check || in_array($post_name, $wp_rewrite->feeds) ) { 595 595 $suffix = 2; 596 while ($post_name_check){596 do { 597 597 $alt_post_name = $post_name . "-$suffix"; 598 598 $post_name_check = $wpdb->get_var("SELECT post_name FROM $wpdb->posts WHERE post_name = '$alt_post_name' AND post_type = '$post_type' AND ID != '$post_ID' AND post_parent = '$post_parent' LIMIT 1"); 599 599 $suffix++; 600 } 600 } while ($post_name_check); 601 601 $post_name = $alt_post_name; 602 602 } 603 603 }