Changeset 12728 for trunk/wp-admin/admin-ajax.php
- Timestamp:
- 01/15/2010 04:58:36 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-ajax.php
r12597 r12728 1004 1004 check_ajax_referer( 'autosave', 'autosavenonce' ); 1005 1005 $ID = (int) $_POST['post_ID']; 1006 $post_type = ( 'page' == $_POST['post_type'] ) ? 'page' : 'post'; 1007 if ( current_user_can( "edit_{$post_type}", $ID ) ) 1006 $post_type = $_POST['post_type']; 1007 $post_type_object = get_post_type_object($post_type); 1008 if ( !$post_type_object ) 1009 die('0'); 1010 if ( current_user_can( $post_type_object->edit_cap, $ID ) ) 1008 1011 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}" ) ) ) ) ); 1009 1012 do_action('autosave_generate_nonces');
Note: See TracChangeset
for help on using the changeset viewer.