本文介绍了是否可以通过XML-RPC创建具有自定义帖子类型和自定义字段的新Wordpress帖子?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试使用python和wordpress的XML-RPC API在自己的网站上创建新的博客文章。所以我遇到了,并尝试了它,但是似乎它不支持创建具有自定义帖子类型和字段的帖子。因此,我开始寻找自定义代码,并遇到了。现在我很困惑。甚至有可能这样做吗?如果是,怎么办?正如我发现的代码示例所示,这对我来说有点困难。

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.

推荐答案

WordPress XML-RPC API并不目前支持自定义帖子类型。但是,将在即将推出的WordPress 3.4版本中添加支持。您可以在上找到相关文档。

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.

我有一个充当WordPress 3.3及更早版本的填充程序,并添加了与3.4中添加的功能等效的功能。

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.

我最近更新了您发现的python包装器,并且现在支持WordPress 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.

本质上,您需要使用 post_type 字段作为新的 wp中的一个参数。* Post XML-RPC方法。

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

这篇关于是否可以通过XML-RPC创建具有自定义帖子类型和自定义字段的新Wordpress帖子?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-14 09:36