Publish a post using XML-RPC WordPress API and Python with category

不羁的心 提交于 2019-12-04 06:30:13
E Hong

XML-RPC WordPress API Document says:

struct terms: Taxonomy names as keys, array of term IDs as values.
struct terms_names: Taxonomy names as keys, array of term names as values.

This means terms and terms_names are directory, the key name is the name of taxonomy you want, and the value is an array list.

If you want to set a category, you should set

‘terms‘:{‘my-category’:[4]} 

or

‘terms_names’:{‘my-category’:["Wordpress"]} 

in the post structure, where "my-category" is the name of your taxonomy.

Some information from:解决Python发布wordpress内容返回抱歉,文章类型不支持您的分类法.错误

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