Correct "Last Edited by" username, Updates the last edited username upon save rather than upon a edit lock being created. Props rooodini & deepak.seth. Fixes #12736

git-svn-id: http://svn.automattic.com/wordpress/trunk@14216 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
dd32 2010-04-24 04:24:38 +00:00
parent 821db5b0b0
commit 5bde56c788
1 changed files with 5 additions and 4 deletions

View File

@ -188,6 +188,8 @@ function edit_post( $post_data = null ) {
add_meta( $post_ID );
update_post_meta( $post_ID, '_edit_last', $GLOBALS['current_user']->ID );
wp_update_post( $post_data );
// Reunite any orphaned attachments with their parent
@ -538,6 +540,8 @@ function wp_write_post() {
add_meta( $post_ID );
add_post_meta( $post_ID, '_edit_last', $GLOBALS['current_user']->ID );
// Reunite any orphaned attachments with their parent
// Does this need to be udpated? ~ Mark
if ( !$draft_ids = get_user_option( 'autosave_draft_ids' ) )
@ -1194,10 +1198,7 @@ function wp_set_post_lock( $post_id ) {
$now = time();
if ( !add_post_meta( $post->ID, '_edit_lock', $now, true ) )
update_post_meta( $post->ID, '_edit_lock', $now );
if ( !add_post_meta( $post->ID, '_edit_last', $current_user->ID, true ) )
update_post_meta( $post->ID, '_edit_last', $current_user->ID );
update_post_meta( $post->ID, '_edit_lock', $now );
}
/**