autosave fix ups

git-svn-id: http://svn.automattic.com/wordpress/trunk@4086 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan
2006-08-11 18:50:28 +00:00
parent d52b9b2d2a
commit 7ac67243e8
6 changed files with 36 additions and 4 deletions

View File

@@ -246,6 +246,19 @@ case 'autosave' :
}
die('0');
break;
case 'autosave-generate-nonces' :
$ID = (int) $_POST['post_ID'];
if($_POST['post_type'] == 'post') {
if(current_user_can('edit_post', $ID))
die(wp_create_nonce('update-post_' . $ID));
}
if($_POST['post_type'] == 'page') {
if(current_user_can('edit_page', $ID)) {
die(wp_create_nonce('update-page_' . $ID));
}
}
die($_POST['post_type']);
break;
default :
do_action( 'wp_ajax_' . $_POST['action'] );
die('0');