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:
parent
821db5b0b0
commit
5bde56c788
|
@ -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 );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue