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.

Built from https://develop.svn.wordpress.org/trunk@35282


git-svn-id: http://core.svn.wordpress.org/trunk@35248 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2015-10-20 05:49:24 +00:00
parent f89b90a1c9
commit b0561ed6e4
3 changed files with 3 additions and 3 deletions

View File

@ -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( '<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' );
}

View File

@ -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;
}

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.4-alpha-35281';
$wp_version = '4.4-alpha-35282';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.