You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/wp-includes/abilities.php
+216Lines changed: 216 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -196,6 +196,222 @@ function wp_register_core_abilities(): void {
196
196
)
197
197
);
198
198
199
+
wp_register_ability(
200
+
'core/get-user',
201
+
array(
202
+
'label' => __( 'Get User' ),
203
+
'description' => __( 'Returns profile data for a specific user looked up by ID, username, or email. Users can view their own record; viewing others requires the list_users capability.' ),
204
+
'category' => $category_user,
205
+
'input_schema' => array(
206
+
'type' => 'object',
207
+
'oneOf' => array(
208
+
array(
209
+
'required' => array( 'id' ),
210
+
'properties' => array(
211
+
'id' => array(
212
+
'type' => 'integer',
213
+
'description' => __( 'The user ID.' ),
214
+
'minimum' => 1,
215
+
),
216
+
),
217
+
),
218
+
array(
219
+
'required' => array( 'username' ),
220
+
'properties' => array(
221
+
'username' => array(
222
+
'type' => 'string',
223
+
'description' => __( 'The user login name.' ),
224
+
),
225
+
),
226
+
),
227
+
array(
228
+
'required' => array( 'email' ),
229
+
'properties' => array(
230
+
'email' => array(
231
+
'type' => 'string',
232
+
'description' => __( 'The user email address.' ),
233
+
),
234
+
),
235
+
),
236
+
),
237
+
'properties' => array(
238
+
'id' => array(
239
+
'type' => 'integer',
240
+
'description' => __( 'The user ID.' ),
241
+
'minimum' => 1,
242
+
),
243
+
'username' => array(
244
+
'type' => 'string',
245
+
'description' => __( 'The user login name.' ),
246
+
),
247
+
'email' => array(
248
+
'type' => 'string',
249
+
'description' => __( 'The user email address.' ),
250
+
),
251
+
'include_capabilities' => array(
252
+
'type' => 'boolean',
253
+
'description' => __( 'Whether to include the user\'s capabilities in the response.' ),
0 commit comments