Making WordPress.org


Ignore:
Timestamp:
05/15/2015 11:34:10 PM (11 years ago)
Author:
iandunn
Message:

WordCamp Post Type: Avoid undefined index notices when restoring revisions.

File:
1 edited

Legend:

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

    r1564 r1587  
    103103            return;
    104104
     105        // Don't add/remove meta on trash, untrash, restore, etc
     106        if ( empty( $_POST['action'] ) || 'editpost' != $_POST['action'] ) {
     107            return;
     108        }
     109
    105110        // WordCamp post type only
     111        // todo return early if not type instead of indenting
    106112        if ( WCPT_POST_TYPE_ID == get_post_type() ) {
    107113            // If the venue address was changed, update its coordinates
     
    588594
    589595        // Check pending posts
     596        // todo return early if not wordcamp post type instead of checking in both of these conditions
    590597        if ( WCPT_POST_TYPE_ID == $post_data['post_type'] && 'pending' == $post_data['post_status'] && absint( $_POST['post_ID'] ) > $min_site_id ) {
    591598            foreach( $required_pending_fields as $field ) {
     
    601608
    602609        // Check published posts
    603         if ( WCPT_POST_TYPE_ID == $post_data['post_type'] && 'publish' == $post_data['post_status'] && absint( $_POST['post_ID'] ) > $min_site_id ) {
     610        if ( WCPT_POST_TYPE_ID == $post_data['post_type'] && 'publish' == $post_data['post_status'] && isset( $_POST['post_ID'] ) && absint( $_POST['post_ID'] ) > $min_site_id ) {
    604611            foreach( $required_publish_fields as $field ) {
    605612                $value = $_POST[ wcpt_key_to_str( $field, 'wcpt_' ) ];
Note: See TracChangeset for help on using the changeset viewer.