Skip to content

Commit

Permalink
Coding Standards: Use WP_User_Query::get_results() instead of a pri…
Browse files Browse the repository at this point in the history
…vate property.

This resolves an issue where the private property `WP_User_Query::$results` is accessed directly in `WP_REST_Users_Controller::get_items()` instead of via the `::get_results()` method.

Follow-up to [38832].

Props justlevine.
See #52217.

git-svn-id: https://develop.svn.wordpress.org/trunk@59357 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov committed Nov 5, 2024
1 parent 982832e commit da9a28d
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ public function get_items( $request ) {

$users = array();

foreach ( $query->results as $user ) {
foreach ( $query->get_results() as $user ) {
$data = $this->prepare_item_for_response( $user, $request );
$users[] = $this->prepare_response_for_collection( $data );
}
Expand Down

0 comments on commit da9a28d

Please sign in to comment.