如何在 Wordpress 中获取带有 XML-RPC 的帖子?
经过一番挖掘 Wordpress XML-RPC 文档后,似乎没有通过XML-RPC接口远程获取“帖子”(例如新闻文章)的方式。文档仅提到 wp.getPage - 如果我尝试将 PostID 传递给此方法,它会返回:
[faultCode] => 404 [faultString] => Sorry, no such page.
...但是当我传递有效的 PageID 时,wp.GetPage 显然可以工作。有谁知道我如何解决这个问题?理想情况下,无需在远程站点上扩展 XML-RPC 机制(因为访问这些机制可能很棘手)
After some digging around with the Wordpress XML-RPC documentation, it seems that there isn't a way to remotely obtain a "post" (such as a news article) through the XML-RPC interface. The documentation only mentions wp.getPage - if I try and pass in a PostID to this method, it returns:
[faultCode] => 404 [faultString] => Sorry, no such page.
... but wp.GetPage obviously does work when I pass a valid PageID. Does anyone have any ideas how I might go about solving this? Ideally, without extending the XML-RPC mechanism on the remote site (as access to these could be tricky)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我设法弄清楚了这一点。您可以使用“blogger.getPost”方法来完成此操作。 Wordpress 站点上对此没有太多文档,但是如果您查看 Wordpress 根目录中的 xmlrpc.php,您将找到 XML-RPC 函数的完整列表,包括:
希望这对遇到此问题的任何人有所帮助未来。
I managed to figure this out. You can do this by using the "blogger.getPost" method. There isn't much documentation for this on the Wordpress site, but if you check out xmlrpc.php in the root of the Wordpress directory you will find a complete list of XML-RPC functions, including:
Hope this helps anyone who struggles with this in future.
检查这个网站。它解释了 Blogger API 以及每个方法使用的参数:
http://xmlrpc.free -conversant.com/docs/bloggerAPI#newPost
Check this site out. It explains the Blogger API, and the parameters that each method consumes:
http://xmlrpc.free-conversant.com/docs/bloggerAPI#newPost
我将 elWpAPI 重新定位到其自己的域。并对其进行了很多改进,包括媒体上传和 的完全 WordPress 3.2.1 兼容性核心 API 和 rFC/rSQL 插件。 只是说...;)
道德上不相容的浏览器“错误”消失了。未能强制人们进入最低限度的隐私保护模式。
I relocated elWpAPI to its own domain. And improved it a lot, including media uploads and full WordPress 3.2.1 compatibility of both the Core API and the rFC/rSQL plugin. Just saying... ;)
And the morally incompatible browser 'error' is gone. Failed forcing people into minimal privacy defense mode.
请参阅:
Wordpress XMLRPC API |远程控制Wordpress
See:
Wordpress XMLRPC API | Remote Control Wordpress