From eb6bdb59cd05f433694ba7de6a3ed355446fc9a3 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Tue, 20 Oct 2015 05:48:11 +0000 Subject: [PATCH] Dashboard: use the `create_posts` cap on the post type object when determining if the Quick Press widget can be displayed. Props jim912, ocean90, chriscct7. Fixes #25681. git-svn-id: https://develop.svn.wordpress.org/trunk@35282 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/dashboard.php | 2 +- src/wp-admin/post.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp-admin/includes/dashboard.php b/src/wp-admin/includes/dashboard.php index 9fd90bae27..7f876943b6 100644 --- a/src/wp-admin/includes/dashboard.php +++ b/src/wp-admin/includes/dashboard.php @@ -47,7 +47,7 @@ function wp_dashboard_setup() { } // QuickPress Widget - if ( is_blog_admin() && current_user_can( 'edit_posts' ) ) { + if ( is_blog_admin() && current_user_can( get_post_type_object( 'post' )->cap->create_posts ) ) { $quick_draft_title = sprintf( '%1$s %2$s', __( 'Quick Draft' ), __( 'Drafts' ) ); wp_add_dashboard_widget( 'dashboard_quick_press', $quick_draft_title, 'wp_dashboard_quick_press' ); } diff --git a/src/wp-admin/post.php b/src/wp-admin/post.php index 174a949d35..5333b5f306 100644 --- a/src/wp-admin/post.php +++ b/src/wp-admin/post.php @@ -71,7 +71,7 @@ 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' ) ) { + if ( ! current_user_can( get_post_type_object( 'post' )->cap->create_posts ) ) { exit; }