Make WordPress Core

Ticket #49118: 49118.diff

File 49118.diff, 988 bytes (added by pbiron, 5 years ago)
  • src/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php

    From c57fadc2766dd98e970ea453ea764cb3f9db9b9e Mon Sep 17 00:00:00 2001
    From: Paul Biron <paul@sparrowhawkcomputing.com>
    Date: Thu, 2 Jan 2020 08:38:41 -0700
    Subject: [PATCH] REST API: minor performance improvement for
     /wp/v2/users?who=authors.
    
    ---
     .../rest-api/endpoints/class-wp-rest-users-controller.php       | 2 ++
     1 file changed, 2 insertions(+)
    
    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 a83a91b640..cd7592038a 100644
    a b class WP_REST_Users_Controller extends WP_REST_Controller { 
    205205                                if ( post_type_supports( $type->name, 'author' )
    206206                                        && current_user_can( $type->cap->edit_posts ) ) {
    207207                                        $can_view = true;
     208
     209                                        break;
    208210                                }
    209211                        }
    210212                        if ( ! $can_view ) {