Add checks for WP_Error. Props filosofo. see #4809

git-svn-id: https://develop.svn.wordpress.org/trunk@6125 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2007-09-18 16:32:22 +00:00
parent 37d5915b8e
commit 5917c5458c
23 changed files with 151 additions and 29 deletions

View File

@@ -305,6 +305,8 @@ class Textpattern_Import {
'post_name' => $url_title,
'comment_count' => $comments_count)
);
if ( is_wp_error( $ret_id ) )
return $ret_id;
}
else
{
@@ -321,6 +323,8 @@ class Textpattern_Import {
'post_name' => $url_title,
'comment_count' => $comments_count)
);
if ( is_wp_error( $ret_id ) )
return $ret_id;
}
$txpposts2wpposts[$ID] = $ret_id;
@@ -498,7 +502,9 @@ class Textpattern_Import {
{
// Post Import
$posts = $this->get_txp_posts();
$this->posts2wp($posts);
$result = $this->posts2wp($posts);
if ( is_wp_error( $result ) )
return $result;
echo '<form action="admin.php?import=textpattern&amp;step=4" method="post">';
wp_nonce_field('import-textpattern');
@@ -638,7 +644,9 @@ class Textpattern_Import {
$this->import_users();
break;
case 3 :
$this->import_posts();
$result = $this->import_posts();
if ( is_wp_error( $result ) )
echo $result->get_error_message();
break;
case 4 :
$this->import_comments();