Ticket #18431 (reviewing task (blessed))
Delete custom posts via XMLRPC
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | 3.4 |
| Component: | XML-RPC | Version: | |
| Severity: | normal | Keywords: | has-patch |
| Cc: | max@…, jbernal@… |
Description (last modified by westi) (diff)
Simple API to support deletion of a single post of any CPT over xmlrpc.
Attachments
Change History
- Status changed from new to reviewing
- Description modified (diff)
- Owner set to westi
- Milestone changed from Awaiting Review to 3.4
- Keywords needs-patch added; has-patch removed
- Type changed from feature request to task (blessed)
Marking this as a Blessed Task for 3.4 - This is part of the first iteration of XML-RPC new features we will be working on.
There are a number of issues with this current patch:
- Doesn't follow the argument convention of other functions
- Support for multiple deletion is not needed
- You can't tell what did/didn't succeed when an error is returned.
We should have a simple wp.deletePost which mimics wp.deletePage but supports all CPTs (and then we can probably re-work wp.deletePage to call it.
comment:2
follow-up:
↓ 4
nprasath002 — 4 weeks ago
The patch fixed the issues mentioned above
I dont think we need to have blog_id here. Just id of a post is enough to delete even in a multisite. Correct if i am wrong
- Cc max@… added
Replying to nprasath002:
I dont think we need to have blog_id here. Just id of a post is enough to delete even in a multisite.
While technically true, it should still follow the convention that other methods use. In fact, none of the methods actually use the blog_id parameter, but to remove it on some methods and not others is probably not a good idea.
Whitespace issues aside, the new patch looks good.
Replying to maxcutler:
While technically true, it should still follow the convention that other methods use. In fact, none of the methods actually use the blog_id parameter, but to remove it on some methods and not others is probably not a good idea.
Yes, please stick to (blog_id, username, password) as first parameters as much as possible. It's already enough of a mess.
Example:
- wp.newPage (username,password,...)
- wp.deletePage (blog_id,username,password,page_id)
- wp.editPage (blog_id,page_id,username,password,...)
- wp.getPage (blog_id,page_id,username,password)
That means instead of clients reusing code to build a common set of parameters, you have to take it case by case.

