From 0215d49d5a4a46b772c30564806b6f921ccc2ee0 Mon Sep 17 00:00:00 2001 From: "Aaron D. Campbell" Date: Sun, 28 Jul 2013 21:51:44 +0000 Subject: [PATCH] Disable ability to restore a revision if another user has the post lock props adamsilverstein. Fixes #24829 for trunk. git-svn-id: https://develop.svn.wordpress.org/trunk@24827 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/revision.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/wp-admin/revision.php b/wp-admin/revision.php index 7be2051699..c3196c635b 100644 --- a/wp-admin/revision.php +++ b/wp-admin/revision.php @@ -37,6 +37,10 @@ case 'restore' : break; } + // Don't allow revision restore when post is locked + if ( wp_check_post_lock( $post->ID ) ) + break; + check_admin_referer( "restore-post_{$revision->ID}" ); wp_restore_post_revision( $revision->ID ); @@ -170,10 +174,13 @@ require_once( './admin-header.php' ); ({{ data.attributes.dateShort }}) <# if ( 'to' === data.type && data.attributes.restoreUrl ) { #> - + ID ) ) { ?> disabled="disabled" - <# } #> + + <# if ( data.attributes.current ) { #> + disabled="disabled" + <# } #> + <# if ( data.attributes.autosave ) { #> type="button" class="restore-revision button button-primary" value="" /> <# } else { #>