Capabilities: When creating an auto-draft, ensure that the current user still has permission to do so.

git-svn-id: https://develop.svn.wordpress.org/trunk@33357 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Gary Pendergast
2015-07-22 04:01:53 +00:00
parent 2533d76203
commit 7439dd7354
4 changed files with 20 additions and 3 deletions
+3 -2
View File
@@ -120,8 +120,9 @@ case 'post-quickdraft-save':
if ( ! wp_verify_nonce( $nonce, 'add-post' ) )
$error_msg = __( 'Unable to submit this form, please refresh and try again.' );
if ( ! current_user_can( 'edit_posts' ) )
$error_msg = __( 'Oops, you don’t have access to add new drafts.' );
if ( ! current_user_can( 'edit_posts' ) ) {
exit;
}
if ( $error_msg )
return wp_dashboard_quick_press( $error_msg );