Validate post status against capabilities in press this. Props nacin. for trunk

git-svn-id: https://develop.svn.wordpress.org/trunk@17709 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2011-04-26 17:15:44 +00:00
parent 81abe55c11
commit cc9f3c8209
1 changed files with 6 additions and 1 deletions

View File

@ -56,7 +56,12 @@ function press_it() {
}
}
// set the post_content and status
$quick['post_status'] = isset($_POST['publish']) ? 'publish' : 'draft';
if ( isset( $_POST['publish'] ) && current_user_can( 'publish_posts' ) )
$quick['post_status'] = 'publish';
elseif ( isset( $_POST['review'] ) )
$quick['post_status'] = 'pending';
else
$quick['post_status'] = 'draft';
$quick['post_content'] = $content;
// error handling for media_sideload
if ( is_wp_error($upload) ) {