From 311256c02a3e2bd533ca26765b3fa7abb30b77f7 Mon Sep 17 00:00:00 2001 From: Peter Westwood Date: Sun, 13 Sep 2009 21:18:55 +0000 Subject: [PATCH] Use the old strings which are more translator friendly and add a generic default string to aid re-use by plugins adding post_types. See #10729. git-svn-id: https://develop.svn.wordpress.org/trunk@11925 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/post.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php index 467b11dba3..0a633e49f7 100644 --- a/wp-admin/includes/post.php +++ b/wp-admin/includes/post.php @@ -1082,8 +1082,19 @@ function _admin_notice_post_locked() { global $post; $last_user = get_userdata( get_post_meta( $post->ID, '_edit_last', true ) ); $last_user_name = $last_user ? $last_user->display_name : __('Somebody'); - $post_type_name = ('page' == $post->post_type) ? _x('page', 'Used to describe page in admin_notice when other user editing.') : _x('post','Used to describe post in admin_notice when other user editing.'); - $message = sprintf( __( 'Warning: %1$s is currently editing this %2$s' ), esc_html( $last_user_name ), esc_html( $post_type_name ) ); + + switch ($post->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 "

$message

"; }