I can't find much documentation on using XML-RPC and custom post types.
I have a specific requirement that remote posting and management (the client has an in-house cms) must be used for a custom post type.
|
I can't find much documentation on using XML-RPC and custom post types. I have a specific requirement that remote posting and management (the client has an in-house cms) must be used for a custom post type. |
||||
|
|
@keatch is correct that out-of-the-box WP XML-RPC does not support post types other than 'post' and 'page'. However, a quick stroll through the code indicates that this may be relatively easy to change. In WP 3.0.4, And ... that's about it for insert. At line 2196 the data is wrapped up and inserted, and at line 2213 the custom fields are attached to the post and nothing else seems to care about There are probably a few more places to extend for other commands, but just search on Note well: this is a core WP file and any hacks thereto are going to get overwritten by the next update to core. On the other hand, these are mostly trivial changes and you could make sure that the client notifies you before they do an update to core. Reply to Comment: Life is more complicated than Rarst's comment would make it seem. And the excellent answer he pointed to is solving a problem significantly simpler that what your question appears to be asking about. In kongo09's comment to Rarst's own answer in that thread he observed that 'there is probably no help' coming in this area. Custom Posts are a bit of an afterthought in the WP code. When you look at the logic in a number of places you see code that originally said "do this thing with a post". When pages came along that code had to be expanded to deal with posts and pages. And then it had to be expanded again to deal with customs posts. This is a classic programming evolution: 1, 2, many. The xmlrpc code is one of the places that is stuck at "2" (and sometimes even at "1"). In trying to add functionality to core code, you are stuck choosing between several possible paths, all of which have their downsides.
You're probably going to be forced to do #3 or #2 in spades because the more you look at the WP section of xmlrpc, the more you realize how haphazard it is regarding what you can do with what type of objects E.g. using the WP xml interface you can only create a page, but the MW method Update - 2 weeks later: So a friend just asked me a question that was almost exactly the same as Jeremy's. It forced me to take a really hard look at the XMLRPC code to see how we can make the changes but avoid the "modify core" problem raised by Rarst. It turns out that there are a very large number of undocumented I still maintain that the XMLRPC code is a swamp, but this particular |
|||||||||||
|
|
http://codex.wordpress.org/XML-RPC_wp report the documentation of XML-RPC and is a little outdated. http://core.trac.wordpress.org/browser/trunk/wp-includes/class-wp-xmlrpc-server.php is the actual XML-RPC server. At a quick look, seems that posting to a custom post type is not supported! |
|||
|
|
|
Even if it's not supported out of the box XML-RPC is extensible. See this excellent answer on similar question for example how to add your own method to it. |
|||
|
|
|
It has been included in Wordpress 3.4. You can access custom type post through thoses functions :
|
|||
|
|