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/admin-ajax.php

    r5923 r6125  
    205205        if ( $pid = wp_insert_post( array(
    206206            'post_title' => sprintf('Draft created on %s at %s', date(get_option('date_format'), $now), date(get_option('time_format'), $now))
    207         ) ) )
     207        ) ) ) {
     208            if ( is_wp_error( $pid ) )
     209                return $pid;
    208210            $mid = add_meta( $pid );
     211        }
    209212        else
    210213            die('0');
Note: See TracChangeset for help on using the changeset viewer.