Ticket #11863: conflict.5.patch
File conflict.5.patch, 1.6 KB (added by , 15 years ago) |
---|
-
wp-admin/includes/post.php
1067 1067 * @return string intended to be used for the inplace editor of the permalink post slug on in the post (and page?) editor. 1068 1068 */ 1069 1069 function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) { 1070 global $wpdb; 1070 1071 $post = &get_post($id); 1072 $orig_permalink = sanitize_title($post->post_title); 1071 1073 list($permalink, $post_name) = get_sample_permalink($post->ID, $new_title, $new_slug); 1072 1074 1073 1075 if ( 'publish' == $post->post_status ) { … … 1110 1112 } 1111 1113 } 1112 1114 1115 if ( $orig_permalink != $post_name_abridged && !$post->post_name ) { 1116 //check if post is trashed 1117 $orig_ID = $wpdb->get_var($wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_name = %s AND post_status='trash';",$orig_permalink)); 1118 if ( $orig_ID ) { 1119 ?> 1120 <div id="message" class="error"> 1121 <?php _e('There was a permalink conflict with an item in the trash. <a href="edit.php?post_status=trash&post_type='.$post->post_type.'">View Trash</a>'); ?> 1122 </div> 1123 <?php 1124 } 1125 } 1126 1113 1127 $post_name_html = '<span id="editable-post-name" title="' . $title . '">' . $post_name_abridged . '</span>'; 1114 1128 $display_link = str_replace(array('%pagename%','%postname%'), $post_name_html, $permalink); 1115 1129 $view_link = str_replace(array('%pagename%','%postname%'), $post_name, $permalink); … … 1198 1212 1199 1213 $now = time(); 1200 1214 1201 update_post_meta( $post->ID, '_edit_lock', $now ); 1215 update_post_meta( $post->ID, '_edit_lock', $now ); 1202 1216 } 1203 1217 1204 1218 /**