通用API文档

💡 云策文档标注

概述

XML-RPC API 是 WordPress 提供的远程过程调用接口,用于替代旧的 Blogger、MovableType 和 metaWeblog API,支持多种编程语言的客户端。

关键要点

  • XML-RPC API 包含多个组件,如 Posts(用于文章、页面和自定义文章类型)、Taxonomies(用于分类、标签和自定义分类法)、Media、Comments、Options 和 Users,各组件在特定 WordPress 版本中添加。
  • 部分组件已过时,如 Categories、Tags 和 Pages,建议使用 Taxonomies 和 Posts 组件替代,通过指定参数如 taxonomy='category' 或 post_type='page' 实现相同功能。
  • 存在多种编程语言的客户端库,如 Ruby、PHP、C# 的 XML-RPC 客户端,以及 Jetpack 和 JSON API 插件提供的 JSON API 支持。

📄 原文内容

XML-RPC API that supersedes the legacy Blogger, MovableType, and metaWeblog APIs. Some clients also exist for different programming languages.

Components

Obsolete Components

  • Categories – use Taxonomies instead, with taxonomy=’category’
    • wp.getCategories
    • wp.suggestCategories
    • wp.newCategory
    • wp.deleteCategory
  • Tags – use Taxonomies instead, with taxonomy=’post_tag’
    • wp.getTags
  • Pages – use Posts instead, with post_type=’page’
    • wp.getPage
    • wp.getPages
    • wp.getPageList
    • wp.newPage
    • wp.editPage
    • wp.deletePage
    • wp.getPageStatusList
    • wp.getPageTemplates

Clients

  • rubypress: WordPress XML-RPC client for Ruby projects. Mirrors this documentation closely, full test suite built in
  • wordpress-xmlrpc-client: PHP client with full test suite. This library implement WordPress API closely to this documentation.
  • WordPressSharp: XML-RPC Client for C#.net
  • plugins/jetpack: Jetpack by WordPress.com enables a JSON API for sites that run the plugin
  • plugins/json-api: WordPress JSON api