Making WordPress.org

Changeset 8133


Ignore:
Timestamp:
01/24/2019 08:32:29 AM (6 years ago)
Author:
vedjain
Message:

WCPT: Move post type check to before nonce check.

This was giving an error sometimes while submitting a post, looks like because metabox_save is getting enqueued some other place as well.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-event/class-event-admin.php

    r8085 r8133  
    413413        }
    414414
    415         // Make sure the requset came from the edit post screen.
     415        if ( $this->get_event_type() !== $post->post_status ) {
     416            return;
     417        }
     418
     419        // Make sure the request came from the edit post screen.
    416420        if ( empty( $_POST['_wpnonce'] ) || ! wp_verify_nonce( $_POST['_wpnonce'], 'update-post_' . $post_id ) ) {
    417421            die( 'Unable to verify nonce' );
     
    420424        // Don't add/remove meta on trash, untrash, restore, etc.
    421425        if ( empty( $_POST['action'] ) || 'editpost' !== $_POST['action'] ) {
    422             return;
    423         }
    424 
    425         if ( $this->get_event_type() !== get_post_type() ) {
    426426            return;
    427427        }
Note: See TracChangeset for help on using the changeset viewer.