WordPress.org

Make WordPress Core

Changeset 39539


Ignore:
Timestamp:
12/07/2016 10:08:52 PM (18 months ago)
Author:
flixos90
Message:

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.

Location:
trunk/src/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/edit-form-advanced.php

    r39326 r39539  
    309309    add_meta_box('slugdiv', __('Slug'), 'post_slug_meta_box', null, 'normal', 'core');
    310310
    311 if ( post_type_supports($post_type, 'author') ) {
    312     if ( is_super_admin() || current_user_can( $post_type_object->cap->edit_others_posts ) )
    313         add_meta_box('authordiv', __('Author'), 'post_author_meta_box', null, 'normal', 'core');
     311if ( post_type_supports( $post_type, 'author' ) && current_user_can( $post_type_object->cap->edit_others_posts ) ) {
     312    add_meta_box( 'authordiv', __( 'Author' ), 'post_author_meta_box', null, 'normal', 'core' );
    314313}
    315314
  • trunk/src/wp-admin/includes/class-wp-posts-list-table.php

    r39210 r39539  
    14211421            $authors_dropdown = '';
    14221422
    1423             if ( is_super_admin() || current_user_can( $post_type_object->cap->edit_others_posts ) ) :
     1423            if ( current_user_can( $post_type_object->cap->edit_others_posts ) ) :
    14241424                $users_opt = array(
    14251425                    'hide_if_only_one_author' => false,
Note: See TracChangeset for help on using the changeset viewer.