mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-14 06:36:47 +01:00
REST API: Limit search_columns
for users without list_users
.
Props Vortfu, jorbin, joehoyle, timothyblynjacobs, peterwilsoncc, ehtis. Reviewed by jorbin, audrasjb. Built from https://develop.svn.wordpress.org/branches/6.3@56840 git-svn-id: http://core.svn.wordpress.org/branches/6.3@56352 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
638bbbf0a4
commit
0be4374921
@ -318,6 +318,9 @@ class WP_REST_Users_Controller extends WP_REST_Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( ! empty( $prepared_args['search'] ) ) {
|
if ( ! empty( $prepared_args['search'] ) ) {
|
||||||
|
if ( ! current_user_can( 'list_users' ) ) {
|
||||||
|
$prepared_args['search_columns'] = array( 'ID', 'user_login', 'user_nicename', 'display_name' );
|
||||||
|
}
|
||||||
$prepared_args['search'] = '*' . $prepared_args['search'] . '*';
|
$prepared_args['search'] = '*' . $prepared_args['search'] . '*';
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '6.3.2-RC1-56795';
|
$wp_version = '6.3.2-RC1-56840';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user