WordPress.org

Make WordPress Core


Ignore:
Timestamp:
12/07/2016 10:08:52 PM (4 years 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.

File:
1 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
Note: See TracChangeset for help on using the changeset viewer.