Ticket #15130: lock.diff
| File lock.diff, 1.4 KB (added by , 16 years ago) |
|---|
-
wp-admin/includes/post.php
1130 1130 return false; 1131 1131 1132 1132 $lock = get_post_meta( $post->ID, '_edit_lock', true ); 1133 $last = get_post_meta( $post->ID, '_edit_l ast', true );1133 $last = get_post_meta( $post->ID, '_edit_lock_user', true ); 1134 1134 1135 1135 $time_window = apply_filters( 'wp_check_post_lock_window', AUTOSAVE_INTERVAL * 2 ); 1136 1136 … … 1156 1156 $now = time(); 1157 1157 1158 1158 update_post_meta( $post->ID, '_edit_lock', $now ); 1159 update_post_meta( $post->ID, '_edit_lock_user', get_current_user_id() ); 1159 1160 } 1160 1161 1161 1162 /** … … 1166 1167 */ 1167 1168 function _admin_notice_post_locked() { 1168 1169 global $post; 1169 $l ast_user = get_userdata( get_post_meta( $post->ID, '_edit_last', true ) );1170 $l ast_user_name = $last_user ? $last_user->display_name : __('Somebody');1170 $lock_user = get_userdata( get_post_meta( $post->ID, '_edit_lock_user', true ) ); 1171 $lock_user_name = $lock_user ? $lock_user->display_name : __('Somebody'); 1171 1172 1172 1173 switch ($post->post_type) { 1173 1174 case 'post': … … 1180 1181 $message = __( 'Warning: %s is currently editing this.' ); 1181 1182 } 1182 1183 1183 $message = sprintf( $message, esc_html( $l ast_user_name ) );1184 $message = sprintf( $message, esc_html( $lock_user_name ) ); 1184 1185 echo "<div class='error'><p>$message</p></div>"; 1185 1186 } 1186 1187
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)