Ticket #4599 (closed enhancement: fixed)

Opened 5 years ago

Last modified 2 years ago

XMLRPC should implement a method for deleting categories

Reported by: redsweater Owned by: josephscott
Priority: normal Milestone: 2.5
Component: XML-RPC Version: 2.2.1
Severity: normal Keywords: has-patch
Cc: redsweater, josephscott

Description

The wp.newCategory method is a great addition to the remote API. But it seems like it's missing its counterpart: wp.deleteCategory, or some similarly named method.

I've also been wondering whether it would have been a good idea to make the "newCategory" method a plural? If we were dealing in wp.newCategories and wp.deleteCategories it would reduce the number of separate network requests that are required when multiples are being manipulated.

Attachments

xml-rpc.php.diff Download (1.5 KB) - added by josephscott 4 years ago.

Change History

  • Owner changed from anonymous to josephscott
  • Milestone set to 2.4 (future)

Every ticket should have a milestone.

comment:3   matt5 years ago

+1, triple-check the SQL and escaping.

The attached diff adds a new method, wp.deleteCategory(blog_id, username, password, category_id). Will return a 0 (zero) or a 1.

Forgot the mention, this contains a small clean up item for wp.newCategory as well.

  • Cc josephscott added

Joe Cheng brought up a good point, when a category that is deleted has children be aware that all of the children will be bumped up a level.

  • Keywords has-patch added

comment:9   ryan4 years ago

  • Status changed from new to closed
  • Resolution set to fixed

(In [6417]) wp.deleteCategory xmlrpc method from josephscott. fixes #4599

Note: See TracTickets for help on using tickets.