#44495 closed defect (bug) (invalid)
API requires "reassign" while it's optional within WordPress core
| Reported by: | apermo | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | REST API | Version: | 4.9.6 |
| Severity: | minor | Keywords: | close |
| Cc: | Focuses: |
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
@
8 years ago
Replying to TimothyBlynJacobs:
Have you tried setting
reassignto a falsey value like0or'false'? The API requires you to provide/acknowledge thereassignparameter, 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?
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Have you tried setting
reassignto a falsey value like0or'false'? The API requires you to provide/acknowledge thereassignparameter, but it should not require reassigning.This is covered with a unit test,
WP_Test_REST_Users_Controller::test_delete_item().