Changeset 6125 for trunk/wp-admin/import/wordpress.php
- Timestamp:
- 09/18/2007 04:32:22 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/import/wordpress.php
r6026 r6125 251 251 echo '<ol>'; 252 252 253 foreach ($this->posts as $post) 254 $this->process_post($post); 253 foreach ($this->posts as $post) { 254 $result = $this->process_post($post); 255 if ( is_wp_error( $result ) ) 256 return $result; 257 } 255 258 256 259 echo '</ol>'; … … 304 307 $post_parent = (int) $post_parent; 305 308 if ($parent = $this->posts_processed[$post_parent]) { 306 if (!$parent[1]) $this->process_post($parent[0]); // If not yet, process the parent first. 309 if (!$parent[1]) { 310 $result = $this->process_post($parent[0]); // If not yet, process the parent first. 311 if ( is_wp_error( $result ) ) 312 return $result; 313 } 307 314 $post_parent = $parent[1]; // New ID of the parent; 308 315 } … … 315 322 $postdata = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_excerpt', 'post_status', 'post_name', 'comment_status', 'ping_status', 'post_modified', 'post_modified_gmt', 'guid', 'post_parent', 'menu_order', 'post_type'); 316 323 $comment_post_ID = $post_id = wp_insert_post($postdata); 324 if ( is_wp_error( $post_id ) ) 325 return $post_id; 317 326 318 327 // Memorize old and new ID. … … 383 392 $this->get_entries(); 384 393 $this->process_categories(); 385 $this->process_posts(); 394 $result = $this->process_posts(); 395 if ( is_wp_error( $result ) ) 396 return $result; 386 397 } 387 398 … … 403 414 case 2: 404 415 check_admin_referer('import-wordpress'); 405 $this->import(); 416 $result = $this->import(); 417 if ( is_wp_error( $result ) ) 418 echo $result->get_error_message(); 406 419 break; 407 420 }
Note: See TracChangeset
for help on using the changeset viewer.