Skip to content

Commit daf3589

Browse files
committed
REST API: Change which users are shown in the users endpoint.
Only show users that have authored a post of a post type that has `show_in_rest` set to true. Props rachelbaker, jnylen0. See #38878. Built from https://develop.svn.wordpress.org/trunk@39843 git-svn-id: http://core.svn.wordpress.org/trunk@39781 1a063a9b-81f0-0310-95a4-ce76da25c4cd
1 parent 8eff927 commit daf3589

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Diff for: wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ public function get_items( $request ) {
249249
}
250250

251251
if ( ! current_user_can( 'list_users' ) ) {
252-
$prepared_args['has_published_posts'] = true;
252+
$prepared_args['has_published_posts'] = get_post_types( array( 'show_in_rest' => true ), 'names' );
253253
}
254254

255255
if ( ! empty( $prepared_args['search'] ) ) {

Diff for: wp-includes/version.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* @global string $wp_version
66
*/
7-
$wp_version = '4.8-alpha-39831';
7+
$wp_version = '4.8-alpha-39843';
88

99
/**
1010
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

0 commit comments

Comments
 (0)