diff options
Diffstat (limited to 'wp-admin/import/blogware.php')
-rw-r--r-- | wp-admin/import/blogware.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/wp-admin/import/blogware.php b/wp-admin/import/blogware.php index c9e281c..0083230 100644 --- a/wp-admin/import/blogware.php +++ b/wp-admin/import/blogware.php @@ -91,6 +91,9 @@ class BW_Import { printf(__('Importing post <i>%s</i>...'), stripslashes($post_title));
$postdata = compact('post_author', 'post_date', 'post_content', 'post_title', 'post_status');
$post_id = wp_insert_post($postdata);
+ if ( is_wp_error( $post_id ) ) {
+ return $post_id;
+ }
if (!$post_id) {
_e("Couldn't get post ID");
echo '</li>';
@@ -155,7 +158,9 @@ class BW_Import { }
$this->file = $file['file'];
- $this->import_posts();
+ $result = $this->import_posts();
+ if ( is_wp_error( $result ) )
+ return $result;
wp_import_cleanup($file['id']);
echo '<h3>';
@@ -176,7 +181,9 @@ class BW_Import { $this->greet();
break;
case 1 :
- $this->import();
+ $result = $this->import();
+ if ( is_wp_error( $result ) )
+ $result->get_error_message();
break;
}
|