#44495 closed defect (bug) (invalid)
API requires "reassign" while it's optional within WordPress core
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | minor | Version: | 4.9.6 |
Component: | REST API | Keywords: | close |
Focuses: | Cc: |
Description
https://core.trac.wordpress.org/browser/tags/4.9/src/wp-admin/includes/user.php#L289
The WordPress function wp_delete_user() has an optional value $reassign.
https://developer.wordpress.org/rest-api/reference/users/#delete-a-user
While the same functionality inside the API has a required value $reassign.
This is inconsistent. Is this for a special reason? If so please explain. Or was this simply overlooked while programming.
Change History (4)
#2
in reply to:
↑ 1
@
7 years ago
Replying to TimothyBlynJacobs:
Have you tried setting
reassign
to a falsey value like0
or'false'
? The API requires you to provide/acknowledge thereassign
parameter, but it should not require reassigning.
No, I haven't tried that.
So is it by design that you need to set the parameter, and the internal API is inconsistent for backwards compatibility reasons? Or why is it inconsistent?
Have you tried setting
reassign
to a falsey value like0
or'false'
? The API requires you to provide/acknowledge thereassign
parameter, but it should not require reassigning.This is covered with a unit test,
WP_Test_REST_Users_Controller::test_delete_item()
.