diff --git a/wp-admin/includes/dashboard.php b/wp-admin/includes/dashboard.php index 7179aa3480..b7dda1323d 100644 --- a/wp-admin/includes/dashboard.php +++ b/wp-admin/includes/dashboard.php @@ -418,6 +418,10 @@ function wp_network_dashboard_right_now() { function wp_dashboard_quick_press( $error_msg = false ) { global $post_ID; + if ( ! current_user_can( 'edit_posts' ) ) { + return; + } + /* Check if a new auto-draft (= no new post_ID) is needed or if the old can be used */ $last_post_id = (int) get_user_option( 'dashboard_quick_press_last_post_id' ); // Get the last post_ID if ( $last_post_id ) { diff --git a/wp-admin/post.php b/wp-admin/post.php index 0c38b5631e..52f1bda297 100644 --- a/wp-admin/post.php +++ b/wp-admin/post.php @@ -115,8 +115,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 ); diff --git a/wp-includes/capabilities.php b/wp-includes/capabilities.php index 588432dcfc..8a3d335030 100644 --- a/wp-includes/capabilities.php +++ b/wp-includes/capabilities.php @@ -1143,8 +1143,10 @@ function map_meta_cap( $cap, $user_id ) { case 'edit_post': case 'edit_page': $post = get_post( $args[0] ); - if ( empty( $post ) ) + if ( empty( $post ) ) { + $caps[] = 'do_not_allow'; break; + } if ( 'revision' == $post->post_type ) { $post = get_post( $post->post_parent );