Is creating new Wordpress post with custom post type and custom fields possible via XML-RPC?

帅比萌擦擦* 提交于 2019-12-08 07:40:51

问题


I've been trying to create new blog posts on my site using python and wordpress' XML-RPC API. So I came across a wrapper and tried it, but it seems it doesn't support creating posts with custom post type and fields. So I started looking for custom codes and came across this bug report. Now I am confused. Is it even possible to do this? If yes, how? As I can find to code examples, it is proving a bit tough for me.


回答1:


The WordPress XML-RPC API does not currently support custom post types. However, support will be added in the forthcoming WordPress 3.4 release. You can find documentation for that on the Codex.

I have a plugin that acts as a shim for WordPress 3.3 and earlier and adds functionality equivalent to that added in 3.4.

I have recently updated my python wrapper that you had found, and it now supports WordPress 3.4's new functionality. I have put up several examples in the library's documentation.

Essentially, you need to use the post_type field available as a parameter on the new wp.*Post XML-RPC methods.



来源:https://stackoverflow.com/questions/10052969/is-creating-new-wordpress-post-with-custom-post-type-and-custom-fields-possible

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!