WordPress.org

Make WordPress Core

Changeset 11851


Ignore:
Timestamp:
08/20/2009 04:57:11 PM (12 years ago)
Author:
ryan
Message:

Add autosave_generate_nonces action. Props prettyboymp. fixes #10634

File:
1 edited

Legend:

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

    r11841 r11851  
    958958    check_ajax_referer( 'autosave', 'autosavenonce' );
    959959    $ID = (int) $_POST['post_ID'];
    960     if($_POST['post_type'] == 'post') {
    961         if(current_user_can('edit_post', $ID))
     960    if ( $_POST['post_type'] == 'post' ) {
     961        if ( current_user_can('edit_post', $ID) )
    962962            die(wp_create_nonce('update-post_' . $ID));
    963     }
    964     if($_POST['post_type'] == 'page') {
    965         if(current_user_can('edit_page', $ID)) {
     963    } elseif ( $_POST['post_type'] == 'page' ) {
     964        if ( current_user_can('edit_page', $ID) )
    966965            die(wp_create_nonce('update-page_' . $ID));
    967         }
    968     }
     966    }
     967    do_action('autosave_generate_nonces');
    969968    die('0');
    970969break;
Note: See TracChangeset for help on using the changeset viewer.