// Remove parenthesized timezone string if it exists, as this confuses strtotime().
$ddate =
preg_replace( '!\s*\(.+\)\s*$!', '',
$ddate );
$ddate_timestamp =
strtotime( $ddate );
$post_date =
gmdate( 'Y-m-d H:i:s',
$ddate_timestamp +
$time_difference );
$post_date_gmt =
gmdate( 'Y-m-d H:i:s',
$ddate_timestamp );
} } } // Set $post_status based on $author_found and on author's publish_posts capability.
if ( $author_found ) { $user =
new WP_User( $post_author );
$post_status =
( $user->
has_cap( 'publish_posts'
) ) ? 'publish' : 'pending';
} else { // Author not found in DB, set status to pending. Author already set to admin.
$post_status = 'pending';
} $subject =
trim( $subject );
if ( 'multipart/alternative' ===
$content_type ) { $content =
explode( '--' .
$boundary,
$content );
$content =
$content[2
];