<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1060,6 +1060,32 @@ function wp_set_post_lock( $post_id ) {
 }
 
 /**
+ * Outputs the notice message to say that someone else is editing this post at the moment.
+ * 
+ * @since 2.8.5
+ * @return none
+ */
+function _admin_notice_post_locked() {
+	global $post;
+	$last_user = get_userdata( get_post_meta( $post-&gt;ID, '_edit_last', true ) );
+	$last_user_name = $last_user ? $last_user-&gt;display_name : __('Somebody');
+	
+	switch ($post-&gt;post_type) {
+		case 'post':
+			$message = __( 'Warning: %s is currently editing this post' );
+			break;
+		case 'page':
+			$message = __( 'Warning: %s is currently editing this page' );
+			break;
+		default:
+			$message = __( 'Warning: %s is currently editing this.' );
+	}
+	
+	$message = sprintf( $message, esc_html( $last_user_name ) );
+	echo &quot;&lt;div class='error'&gt;&lt;p&gt;$message&lt;/p&gt;&lt;/div&gt;&quot;;	
+}
+
+/**
  * Creates autosave data for the specified post from $_POST data.
  *
  * @package WordPress</diff>
      <filename>wp-admin/includes/post.php</filename>
    </modified>
    <modified>
      <diff>@@ -98,11 +98,7 @@ case 'edit':
 
 	if ( current_user_can('edit_page', $page_ID) ) {
 		if ( $last = wp_check_post_lock( $post-&gt;ID ) ) {
-			$last_user = get_userdata( $last );
-			$last_user_name = $last_user ? $last_user-&gt;display_name : __('Somebody');
-			$message = sprintf( __( 'Warning: %s is currently editing this page' ), esc_html( $last_user_name ) );
-			$message = str_replace( &quot;'&quot;, &quot;\'&quot;, &quot;&lt;div class='error'&gt;&lt;p&gt;$message&lt;/p&gt;&lt;/div&gt;&quot; );
-			add_action('admin_notices', create_function( '', &quot;echo '$message';&quot; ) );
+			add_action('admin_notices', '_admin_notice_post_locked' );
 		} else {
 			wp_set_post_lock( $post-&gt;ID );
 			wp_enqueue_script('autosave');</diff>
      <filename>wp-admin/page.php</filename>
    </modified>
    <modified>
      <diff>@@ -133,11 +133,7 @@ case 'edit':
 
 	if ( current_user_can('edit_post', $post_ID) ) {
 		if ( $last = wp_check_post_lock( $post-&gt;ID ) ) {
-			$last_user = get_userdata( $last );
-			$last_user_name = $last_user ? $last_user-&gt;display_name : __('Somebody');
-			$message = sprintf( __( 'Warning: %s is currently editing this post' ), esc_html( $last_user_name ) );
-			$message = str_replace( &quot;'&quot;, &quot;\'&quot;, &quot;&lt;div class='error'&gt;&lt;p&gt;$message&lt;/p&gt;&lt;/div&gt;&quot; );
-			add_action('admin_notices', create_function( '', &quot;echo '$message';&quot; ) );
+			add_action('admin_notices', '_admin_notice_post_locked' );
 		} else {
 			wp_set_post_lock( $post-&gt;ID );
 			wp_enqueue_script('autosave');</diff>
      <filename>wp-admin/post.php</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>be00063619760eaac4e4927f3cb798f6583edca9</id>
    </parent>
  </parents>
  <author>
    <name>westi</name>
    <email>westi@1a063a9b-81f0-0310-95a4-ce76da25c4cd</email>
  </author>
  <url>http://github.com/blowery/wordpress/commit/aeaafa32d2762a1f208281f27a544df74e11bc20</url>
  <id>aeaafa32d2762a1f208281f27a544df74e11bc20</id>
  <committed-date>2009-10-20T10:00:34-07:00</committed-date>
  <authored-date>2009-10-20T10:00:34-07:00</authored-date>
  <message>Backport of the switch of the post|page being editing message from a create_function call to a normal function and reduce the duplicated code. See #10729 for 2.8 branch.

git-svn-id: http://svn.automattic.com/wordpress/branches/2.8@12068 1a063a9b-81f0-0310-95a4-ce76da25c4cd</message>
  <tree>562a47a4fe38752da75cfdad42f37a24c6ec8512</tree>
  <committer>
    <name>westi</name>
    <email>westi@1a063a9b-81f0-0310-95a4-ce76da25c4cd</email>
  </committer>
</commit>
