diff --git a/wp-admin/admin-ajax.php b/wp-admin/admin-ajax.php
index 4232b05096..013e37502c 100644
--- a/wp-admin/admin-ajax.php
+++ b/wp-admin/admin-ajax.php
@@ -204,8 +204,11 @@ case 'add-meta' :
$now = current_time('timestamp', 1);
if ( $pid = wp_insert_post( array(
'post_title' => sprintf('Draft created on %s at %s', date(get_option('date_format'), $now), date(get_option('time_format'), $now))
- ) ) )
+ ) ) ) {
+ if ( is_wp_error( $pid ) )
+ return $pid;
$mid = add_meta( $pid );
+ }
else
die('0');
} else if ( !$mid = add_meta( $id ) ) {
diff --git a/wp-admin/import/blogger.php b/wp-admin/import/blogger.php
index 20585d5c59..b518cd73a8 100644
--- a/wp-admin/import/blogger.php
+++ b/wp-admin/import/blogger.php
@@ -380,7 +380,9 @@ class Blogger_Import {
$entry = "$entry";
$AtomParser = new AtomParser();
$AtomParser->parse( $entry );
- $this->import_post($AtomParser->entry);
+ $result = $this->import_post($AtomParser->entry);
+ if ( is_wp_error( $result ) )
+ return $result;
unset($AtomParser);
}
} else break;
@@ -518,6 +520,8 @@ class Blogger_Import {
$post = compact('post_date', 'post_content', 'post_title', 'post_status');
$post_id = wp_insert_post($post);
+ if ( is_wp_error( $post_id ) )
+ return $post_id;
wp_create_categories( array_map( 'addslashes', $entry->categories ), $post_id );
@@ -531,6 +535,7 @@ class Blogger_Import {
++$this->blogs[$importing_blog]['posts_done'];
}
$this->save_vars();
+ return;
}
function import_comment( $entry ) {
@@ -767,7 +772,9 @@ class Blogger_Import {
if ( isset( $_REQUEST['blog'] ) ) {
$blog = is_array($_REQUEST['blog']) ? array_shift( array_keys( $_REQUEST['blog'] ) ) : $_REQUEST['blog'];
$blog = (int) $blog;
- $this->import_blog( $blog );
+ $result = $this->import_blog( $blog );
+ if ( is_wp_error( $result ) )
+ echo $result->get_error_message();
} elseif ( isset($_GET['token']) )
$this->auth();
elseif ( $this->token && $this->token_is_valid() )
diff --git a/wp-admin/import/blogware.php b/wp-admin/import/blogware.php
index 27b4785d84..d85fd92107 100644
--- a/wp-admin/import/blogware.php
+++ b/wp-admin/import/blogware.php
@@ -91,6 +91,9 @@ class BW_Import {
printf(__('Importing post %s...'), 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 '';
@@ -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 '
';
@@ -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;
}
diff --git a/wp-admin/import/dotclear.php b/wp-admin/import/dotclear.php
index f17df9d8ed..1bf0486015 100644
--- a/wp-admin/import/dotclear.php
+++ b/wp-admin/import/dotclear.php
@@ -364,6 +364,8 @@ class Dotclear_Import {
'ping_status' => $comment_status_map[$post_open_tb],
'comment_count' => $post_nb_comment + $post_nb_trackback)
);
+ if ( is_wp_error( $ret_id ) )
+ return $ret_id;
}
else
{
@@ -382,6 +384,8 @@ class Dotclear_Import {
'ping_status' => $comment_status_map[$post_open_tb],
'comment_count' => $post_nb_comment + $post_nb_trackback)
);
+ if ( is_wp_error( $ret_id ) )
+ return $ret_id;
}
$dcposts2wpposts[$post_id] = $ret_id;
@@ -562,7 +566,9 @@ class Dotclear_Import {
{
// Post Import
$posts = $this->get_dc_posts();
- $this->posts2wp($posts);
+ $result = $this->posts2wp($posts);
+ if ( is_wp_error( $result ) )
+ return $result;
echo '