WordPress.org

Make WordPress Core

Changeset 14497


Ignore:
Timestamp:
05/07/2010 04:35:10 AM (8 years ago)
Author:
nacin
Message:

Fix warnings in WordPress importer. props briancolinger, fixes #13263.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/import/wordpress.php

    r14492 r14497  
    473473            if ($post_parent) {
    474474                // if we already know the parent, map it to the local ID
    475                 if ( $parent = $this->post_ids_processed[$post_parent] ) {
    476                     $post_parent = $parent;  // new ID of the parent
     475                if ( isset( $this->post_ids_processed[$post_parent] ) ) {
     476                    $post_parent = $this->post_ids_processed[$post_parent];  // new ID of the parent
    477477                }
    478478                else {
     
    761761
    762762        foreach ($this->orphans as $child_id => $parent_id) {
    763             $local_child_id = $this->post_ids_processed[$child_id];
    764             $local_parent_id = $this->post_ids_processed[$parent_id];
     763            $local_child_id = $local_parent_id = false;
     764            if ( isset( $this->post_ids_processed[$child_id] ) )
     765                $local_child_id = $this->post_ids_processed[$child_id];
     766            if ( isset( $this->post_ids_processed[$parent_id] ) )
     767                $local_parent_id = $this->post_ids_processed[$parent_id];
     768
    765769            if ($local_child_id and $local_parent_id) {
    766770                $wpdb->update($wpdb->posts, array('post_parent' => $local_parent_id), array('ID' => $local_child_id) );
Note: See TracChangeset for help on using the changeset viewer.