Make WordPress Core


Ignore:
Timestamp:
09/18/2007 04:32:22 PM (18 years ago)
Author:
ryan
Message:

Add checks for WP_Error. Props filosofo. see #4809

File:
1 edited

Legend:

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

    r5087 r6125  
    9292                $postdata = compact('post_author', 'post_date', 'post_content', 'post_title', 'post_status');
    9393                $post_id = wp_insert_post($postdata);
     94                if ( is_wp_error( $post_id ) ) {
     95                    return $post_id;
     96                }
    9497                if (!$post_id) {
    9598                    _e("Couldn't get post ID");
     
    156159
    157160        $this->file = $file['file'];
    158         $this->import_posts();
     161        $result = $this->import_posts();
     162        if ( is_wp_error( $result ) )
     163            return $result;
    159164        wp_import_cleanup($file['id']);
    160165
     
    177182                break;
    178183            case 1 :
    179                 $this->import();
     184                $result = $this->import();
     185                if ( is_wp_error( $result ) )
     186                    $result->get_error_message();
    180187                break;
    181188        }
Note: See TracChangeset for help on using the changeset viewer.