Skip to content

Commit eb6bdb5

Browse files
committed
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
1 parent f07367d commit eb6bdb5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/wp-admin/includes/dashboard.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function wp_dashboard_setup() {
4747
}
4848

4949
// QuickPress Widget
50-
if ( is_blog_admin() && current_user_can( 'edit_posts' ) ) {
50+
if ( is_blog_admin() && current_user_can( get_post_type_object( 'post' )->cap->create_posts ) ) {
5151
$quick_draft_title = sprintf( '<span class="hide-if-no-js">%1$s</span> <span class="hide-if-js">%2$s</span>', __( 'Quick Draft' ), __( 'Drafts' ) );
5252
wp_add_dashboard_widget( 'dashboard_quick_press', $quick_draft_title, 'wp_dashboard_quick_press' );
5353
}

src/wp-admin/post.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
if ( ! wp_verify_nonce( $nonce, 'add-post' ) )
7272
$error_msg = __( 'Unable to submit this form, please refresh and try again.' );
7373

74-
if ( ! current_user_can( 'edit_posts' ) ) {
74+
if ( ! current_user_can( get_post_type_object( 'post' )->cap->create_posts ) ) {
7575
exit;
7676
}
7777

0 commit comments

Comments
 (0)