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
This commit is contained in:
parent
6315c12a84
commit
311256c02a
@ -1082,8 +1082,19 @@ function _admin_notice_post_locked() {
|
|||||||
global $post;
|
global $post;
|
||||||
$last_user = get_userdata( get_post_meta( $post->ID, '_edit_last', true ) );
|
$last_user = get_userdata( get_post_meta( $post->ID, '_edit_last', true ) );
|
||||||
$last_user_name = $last_user ? $last_user->display_name : __('Somebody');
|
$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 "<div class='error'><p>$message</p></div>";
|
echo "<div class='error'><p>$message</p></div>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user