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
This commit is contained in:
parent
f07367d34c
commit
eb6bdb59cd
|
@ -47,7 +47,7 @@ function wp_dashboard_setup() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// QuickPress Widget
|
// 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( '<span class="hide-if-no-js">%1$s</span> <span class="hide-if-js">%2$s</span>', __( 'Quick Draft' ), __( 'Drafts' ) );
|
$quick_draft_title = sprintf( '<span class="hide-if-no-js">%1$s</span> <span class="hide-if-js">%2$s</span>', __( 'Quick Draft' ), __( 'Drafts' ) );
|
||||||
wp_add_dashboard_widget( 'dashboard_quick_press', $quick_draft_title, 'wp_dashboard_quick_press' );
|
wp_add_dashboard_widget( 'dashboard_quick_press', $quick_draft_title, 'wp_dashboard_quick_press' );
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,7 +71,7 @@ case 'post-quickdraft-save':
|
||||||
if ( ! wp_verify_nonce( $nonce, 'add-post' ) )
|
if ( ! wp_verify_nonce( $nonce, 'add-post' ) )
|
||||||
$error_msg = __( 'Unable to submit this form, please refresh and try again.' );
|
$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;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue