Heartbeat: Ensure post locks are released.

git-svn-id: https://develop.svn.wordpress.org/trunk@33542 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dominik Schilling (ocean90) 2015-08-03 21:11:35 +00:00
parent d834719f34
commit ad74207fa7
2 changed files with 2 additions and 1 deletions

View File

@ -1568,7 +1568,7 @@ function _admin_notice_post_locked() {
// Allow plugins to prevent some users overriding the post lock
if ( $override ) {
?>
<a class="button button-primary wp-tab-last" href="<?php echo esc_url( add_query_arg( 'get-post-lock', '1', get_edit_post_link( $post->ID, 'url' ) ) ); ?>"><?php _e('Take over'); ?></a>
<a class="button button-primary wp-tab-last" href="<?php echo esc_url( add_query_arg( 'get-post-lock', '1', wp_nonce_url( get_edit_post_link( $post->ID, 'url' ), 'lock-post_' . $post->ID ) ) ); ?>"><?php _e('Take over'); ?></a>
<?php
}

View File

@ -165,6 +165,7 @@ case 'edit':
wp_die( __( 'You can&#8217;t edit this item because it is in the Trash. Please restore it and try again.' ) );
if ( ! empty( $_GET['get-post-lock'] ) ) {
check_admin_referer( 'lock-post_' . $post_id );
wp_set_post_lock( $post_id );
wp_redirect( get_edit_post_link( $post_id, 'url' ) );
exit();