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
This commit is contained in:
Aaron D. Campbell 2013-07-28 21:51:44 +00:00
parent e09aaf8cf5
commit 0215d49d5a

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 { #>