Post locks and autosave:

- Move nonces refreshing from autosave to lock checking.
- Do autosave only when there is something to save.
See #23295

git-svn-id: https://develop.svn.wordpress.org/trunk@24209 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz
2013-05-08 22:52:55 +00:00
parent db72372fcc
commit 701a2d23f9
4 changed files with 39 additions and 25 deletions
+11
View File
@@ -623,6 +623,17 @@ function wp_refresh_post_lock( $response, $data, $screen_id ) {
$send['new_lock'] = implode( ':', $new_lock );
}
if ( ! empty( $received['post_nonce'] ) && 2 === wp_verify_nonce( $received['post_nonce'], 'update-post_' . $post_id ) ) {
$send['update_nonces'] = array(
'replace-autosavenonce' => wp_create_nonce('autosave'),
'replace-getpermalinknonce' => wp_create_nonce('getpermalink'),
'replace-samplepermalinknonce' => wp_create_nonce('samplepermalink'),
'replace-closedpostboxesnonce' => wp_create_nonce('closedpostboxes'),
'replace-_ajax_linking_nonce' => wp_create_nonce( 'internal-linking' ),
'replace-_wpnonce' => wp_create_nonce( 'update-post_' . $post_id ),
);
}
$response['wp-refresh-post-lock'] = $send;
}