Make WordPress Core


Ignore:
Timestamp:
01/15/2010 04:58:36 PM (15 years ago)
Author:
ryan
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-ajax.php

    r12597 r12728  
    10041004    check_ajax_referer( 'autosave', 'autosavenonce' );
    10051005    $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 ) )
    10081011        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}" ) ) ) ) );
    10091012    do_action('autosave_generate_nonces');
Note: See TracChangeset for help on using the changeset viewer.