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: https://develop.svn.wordpress.org/trunk@14216 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
310a7bcf05
commit
e9ca3c961f
@ -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
Block a user