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:
parent
87f9d112c0
commit
c168ef72cc
|
@ -37,6 +37,10 @@ case 'restore' :
|
||||||
break;
|
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}" );
|
check_admin_referer( "restore-post_{$revision->ID}" );
|
||||||
|
|
||||||
wp_restore_post_revision( $revision->ID );
|
wp_restore_post_revision( $revision->ID );
|
||||||
|
@ -170,10 +174,13 @@ require_once( './admin-header.php' );
|
||||||
<span class="date">({{ data.attributes.dateShort }})</span>
|
<span class="date">({{ data.attributes.dateShort }})</span>
|
||||||
</div>
|
</div>
|
||||||
<# if ( 'to' === data.type && data.attributes.restoreUrl ) { #>
|
<# if ( 'to' === data.type && data.attributes.restoreUrl ) { #>
|
||||||
<input
|
<input <?php if ( wp_check_post_lock( $post->ID ) ) { ?>
|
||||||
<# if ( data.attributes.current ) { #>
|
|
||||||
disabled="disabled"
|
disabled="disabled"
|
||||||
<# } #>
|
<?php } else { ?>
|
||||||
|
<# if ( data.attributes.current ) { #>
|
||||||
|
disabled="disabled"
|
||||||
|
<# } #>
|
||||||
|
<?php } ?>
|
||||||
<# if ( data.attributes.autosave ) { #>
|
<# if ( data.attributes.autosave ) { #>
|
||||||
type="button" class="restore-revision button button-primary" value="<?php esc_attr_e( 'Restore This Autosave' ); ?>" />
|
type="button" class="restore-revision button button-primary" value="<?php esc_attr_e( 'Restore This Autosave' ); ?>" />
|
||||||
<# } else { #>
|
<# } else { #>
|
||||||
|
|
Loading…
Reference in New Issue