WordPress.org

Make WordPress Core

Ticket #42202: 42202.2.diff

File 42202.2.diff, 759 bytes (added by danielbachhuber, 3 years ago)
  • src/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php

    diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php
    index c452b30472..a9aff62651 100644
    a b class WP_REST_Users_Controller extends WP_REST_Controller { 
    196196                        $can_view = false;
    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                                }
    202203                        }