Merge edit-pages.php into edit.php. see #9674

git-svn-id: https://develop.svn.wordpress.org/trunk@12728 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2010-01-15 16:58:36 +00:00
parent 2f72315628
commit b74bea8a2c
21 changed files with 321 additions and 662 deletions
+5 -2
View File
@@ -1003,8 +1003,11 @@ case 'autosave' : // The name of this action is hardcoded in edit_post()
case 'autosave-generate-nonces' :
check_ajax_referer( 'autosave', 'autosavenonce' );
$ID = (int) $_POST['post_ID'];
$post_type = ( 'page' == $_POST['post_type'] ) ? 'page' : 'post';
if ( current_user_can( "edit_{$post_type}", $ID ) )
$post_type = $_POST['post_type'];
$post_type_object = get_post_type_object($post_type);
if ( !$post_type_object )
die('0');
if ( current_user_can( $post_type_object->edit_cap, $ID ) )
die( json_encode( array( 'updateNonce' => wp_create_nonce( "update-{$post_type}_{$ID}" ), 'deleteURL' => str_replace( '&', '&', wp_nonce_url( admin_url( $post_type . '.php?action=trash&post=' . $ID ), "trash-{$post_type}_{$ID}" ) ) ) ) );
do_action('autosave_generate_nonces');
die('0');