WordPress.org

Make WordPress Core


Ignore:
Timestamp:
03/13/2013 10:08:16 AM (8 years ago)
Author:
azaozz
Message:

Autosave to the browser's sessionStorage, compare this autosave to the post content on page load and let the user restore it when the data is not the same. First run, see #23220

File:
1 edited

Legend:

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

    r23663 r23683  
    10511051    $id = $revision_id = 0;
    10521052
    1053     $post_ID = (int) $_POST['post_ID'];
    1054     $_POST['ID'] = $post_ID;
    1055     $post = get_post($post_ID);
     1053    $post_id = (int) $_POST['post_id'];
     1054    $_POST['ID'] = $_POST['post_ID'] = $post_id;
     1055    $post = get_post($post_id);
    10561056    if ( 'auto-draft' == $post->post_status )
    10571057        $_POST['post_status'] = 'draft';
     
    10691069
    10701070    if ( 'page' == $post->post_type ) {
    1071         if ( !current_user_can('edit_page', $post_ID) )
     1071        if ( !current_user_can('edit_page', $post->ID) )
    10721072            wp_die( __( 'You are not allowed to edit this page.' ) );
    10731073    } else {
    1074         if ( !current_user_can('edit_post', $post_ID) )
     1074        if ( !current_user_can('edit_post', $post->ID) )
    10751075            wp_die( __( 'You are not allowed to edit this post.' ) );
    10761076    }
Note: See TracChangeset for help on using the changeset viewer.