Disable ability to restore a revision if another user has the post lock

props adamsilverstein. Fixes #24829 for trunk.


git-svn-id: http://core.svn.wordpress.org/trunk@24827 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Aaron Campbell 2013-07-28 21:51:44 +00:00
parent 87f9d112c0
commit c168ef72cc
1 changed files with 10 additions and 3 deletions

View File

@ -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' );
<span class="date">({{ data.attributes.dateShort }})</span>
</div>
<# if ( 'to' === data.type && data.attributes.restoreUrl ) { #>
<input
<# if ( data.attributes.current ) { #>
<input <?php if ( wp_check_post_lock( $post->ID ) ) { ?>
disabled="disabled"
<# } #>
<?php } else { ?>
<# if ( data.attributes.current ) { #>
disabled="disabled"
<# } #>
<?php } ?>
<# if ( data.attributes.autosave ) { #>
type="button" class="restore-revision button button-primary" value="<?php esc_attr_e( 'Restore This Autosave' ); ?>" />
<# } else { #>