diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php index 1c9921a78e..91abc1eeaf 100644 --- a/wp-admin/edit-form-advanced.php +++ b/wp-admin/edit-form-advanced.php @@ -274,7 +274,11 @@ require_once('./admin-header.php');
' . __('Incoming Links - Shows links to your site found by Google Blog Search.') . '
'; -if ( current_user_can( 'edit_posts' ) ) { +if ( current_user_can( 'create_posts' ) ) { $help .= '' . __('QuickPress - Allows you to create a new post and either publish it or save it as a draft.') . '
'; $help .= '' . __('Recent Drafts - Displays links to the 5 most recent draft posts you’ve started.') . '
'; } diff --git a/wp-admin/post-new.php b/wp-admin/post-new.php index deb41907e2..f5b9097bcb 100644 --- a/wp-admin/post-new.php +++ b/wp-admin/post-new.php @@ -36,7 +36,7 @@ $title = $post_type_object->labels->add_new_item; $editing = true; -if ( ! current_user_can( $post_type_object->cap->edit_posts ) ) +if ( ! current_user_can( $post_type_object->cap->edit_posts ) || ! current_user_can( $post_type_object->cap->create_posts ) ) wp_die( __( 'Cheatin’ uh?' ) ); // Schedule auto-draft cleanup diff --git a/wp-admin/press-this.php b/wp-admin/press-this.php index e3660be25f..d5282b5a79 100644 --- a/wp-admin/press-this.php +++ b/wp-admin/press-this.php @@ -13,7 +13,7 @@ require_once('./admin.php'); header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset')); -if ( ! current_user_can('edit_posts') ) +if ( ! current_user_can( 'edit_posts' ) || ! current_user_can( 'create_posts' ) ) wp_die( __( 'Cheatin’ uh?' ) ); /** diff --git a/wp-includes/post.php b/wp-includes/post.php index febc33384a..7c2020df55 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -1411,8 +1411,6 @@ function get_post_type_capabilities( $args ) { 'edit_others_posts' => 'edit_others_' . $plural_base, 'publish_posts' => 'publish_' . $plural_base, 'read_private_posts' => 'read_private_' . $plural_base, - // Post creation capability simply maps to edit_posts by default: - 'create_posts' => 'edit_' . $plural_base, ); // Primitive capabilities used within map_meta_cap(): @@ -1431,6 +1429,10 @@ function get_post_type_capabilities( $args ) { $capabilities = array_merge( $default_capabilities, $args->capabilities ); + // Post creation capability simply maps to edit_posts by default: + if ( ! isset( $capabilities['create_posts'] ) ) + $capabilities['create_posts'] = $capabilities['edit_posts']; + // Remember meta capabilities for future reference. if ( $args->map_meta_cap ) _post_type_meta_capabilities( $capabilities );