Make WordPress Core

Changeset 43137 for trunk


Ignore:
Timestamp:
05/03/2018 06:51:38 AM (5 years ago)
Author:
SergeyBiryukov
Message:

REST API: When handling who=authors query parameter for GET wp/v2/users, only check edit_posts for post types that support author.

Props danielbachhuber.
Fixes #42202.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php

    r43087 r43137  
    197197            $types = get_post_types( array( 'show_in_rest' => true ), 'objects' );
    198198            foreach ( $types as $type ) {
    199                 if ( current_user_can( $type->cap->edit_posts ) ) {
     199                if ( post_type_supports( $type->name, 'author' )
     200                    && current_user_can( $type->cap->edit_posts ) ) {
    200201                    $can_view = true;
    201202                }
Note: See TracChangeset for help on using the changeset viewer.