WordPress.org

Make WordPress Core

Opened 9 years ago

Closed 8 years ago

#18431 closed task (blessed) (fixed)

Delete custom posts via XMLRPC

Reported by: nprasath002 Owned by: westi
Milestone: 3.4 Priority: normal
Severity: normal Version:
Component: XML-RPC Keywords: has-patch
Focuses: Cc:

Description (last modified by westi)

Simple API to support deletion of a single post of any CPT over xmlrpc.

Attachments (2)

wp.deletePost.patch (2.7 KB) - added by nprasath002 9 years ago.
wp.deletePost.2.patch (2.2 KB) - added by nprasath002 8 years ago.

Download all attachments as: .zip

Change History (11)

#1 @westi
8 years ago

  • Description modified (diff)
  • Keywords needs-patch added; has-patch removed
  • Milestone changed from Awaiting Review to 3.4
  • Owner set to westi
  • Status changed from new to reviewing
  • 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.

#2 follow-up: @nprasath002
8 years 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

#3 @nprasath002
8 years ago

  • Keywords has-patch added; needs-patch removed

#4 in reply to: ↑ 2 ; follow-up: @maxcutler
8 years ago

  • 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.

#5 @westi
8 years ago

In [19848]:

XMLRPC: Introduce new create,read,update and delete XMLRPC apis for Posts, Pages and all Custom Post Types.
Introduces: wp.newPost, wp.editPost, wp.deletePost, wp.getPost, and wp.getPosts
See #18429, #18430, #18431, #18432, and #18433 props maxcutler and markoheijnen.

#6 in reply to: ↑ 4 @koke
8 years ago

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.

#7 @koke
8 years ago

  • Cc jbernal@… added

#8 @maxcutler
8 years ago

New bugs or enhancements on new tickets.

#9 @maxcutler
8 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed
Note: See TracTickets for help on using tickets.