Multisite: Remove redundant is_super_admin() when checking for edit_others_posts.

The super admin on multisite as well as the administrator on non-multisite both have this capability already. For custom post types using different capabilities this change ensures that only users with that capability have permissions.

Fixes #39059. See #37616.


git-svn-id: https://develop.svn.wordpress.org/trunk@39539 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Felix Arntz 2016-12-07 22:08:52 +00:00
parent 7417527b4b
commit 6e02c370bf
2 changed files with 3 additions and 4 deletions

View File

@ -308,9 +308,8 @@ if ( in_array( get_post_status( $post ), $stati ) ) {
if ( ! ( 'pending' == get_post_status( $post ) && ! current_user_can( $post_type_object->cap->publish_posts ) ) )
add_meta_box('slugdiv', __('Slug'), 'post_slug_meta_box', null, 'normal', 'core');
if ( post_type_supports($post_type, 'author') ) {
if ( is_super_admin() || current_user_can( $post_type_object->cap->edit_others_posts ) )
add_meta_box('authordiv', __('Author'), 'post_author_meta_box', null, 'normal', 'core');
if ( post_type_supports( $post_type, 'author' ) && current_user_can( $post_type_object->cap->edit_others_posts ) ) {
add_meta_box( 'authordiv', __( 'Author' ), 'post_author_meta_box', null, 'normal', 'core' );
}
/**

View File

@ -1420,7 +1420,7 @@ class WP_Posts_List_Table extends WP_List_Table {
if ( post_type_supports( $screen->post_type, 'author' ) ) :
$authors_dropdown = '';
if ( is_super_admin() || current_user_can( $post_type_object->cap->edit_others_posts ) ) :
if ( current_user_can( $post_type_object->cap->edit_others_posts ) ) :
$users_opt = array(
'hide_if_only_one_author' => false,
'who' => 'authors',