pony

抄袭是一种美德

Wordpress XML-RPC协议说明

原文地址:http://codex.wordpress.org/XML-RPC_wp

XML-RPC wp

Note: This API is current as of the 2.7.1 release.

Contents

[hide]

wp.getUsersBlogs

Retrieve the blogs of the users.

Parameters

  • string username
  • string password

Return Values

  • array
    • struct
      • boolean isAdmin
      • string url
      • string blogid
      • string blogName
      • string xmlrpc

wp.getTags

Get list of all tags.

Parameters

  • int blog_id
  • string username
  • string password

Return Values

  • array
    • struct
      • int tag_id
      • string name
      • int count
      • string slug
      • string html_url
      • string rss_url

wp.getCommentCount

Retrieve comment count for a specific post.

Parameters

  • int blog_id
  • string username
  • string password
  • string post_id

Return Values

  • array
    • struct
      • int approved
      • int awaiting_moderation
      • int spam
      • int total_comments

wp.getPostStatusList

Retrieve post statuses.

Parameters

  • int blog_id
  • string username
  • string password

Return Values

  • array
    • const string 'draft'
    • const string 'pending'
    • const string 'private'
    • const string 'publish'

wp.getPageStatusList

Retrieve all of the WordPress supported page statuses.

Parameters

  • int blog_id
  • string username
  • string password

Return Values

  • struct
    • const string 'draft'
    • const string 'private'
    • const string 'publish'

wp.getPageTemplates

Retrieve page templates.

Parameters

  • int blog_id
  • string username
  • string password

Return Values

  • array
    • struct
      • string name
      • string description

wp.getOptions

Retrieve blog options. If passing in an array, search for options listed within it.

Parameters

  • int blog_id
  • string username
  • string password
  • array
    • string option

Return Values

  • array
    • struct
      • string option
      • string value

wp.setOptions

Update blog options. Returns array of structs showing updated values.

Parameters

  • int blog_id
  • string username
  • string password
  • array
    • struct
      • string name
      • string value

Return Values

  • array
    • struct
      • string option
      • string value

wp.deleteComment

Remove comment.

Parameters

  • int blog_id
  • string username
  • string password
  • int comment_id

Return Values

  • boolean status

wp.editComment

Edit comment.

Parameters

  • int blog_id
  • string username
  • string password
  • int comment_id
  • struct comment
    • string status
    • date date_created_gmt
    • string content
    • string author
    • string author_url
    • string author_email

Return Values

  • boolean status

wp.newComment

Create new comment.

If you want to send anonymous comments, leave the second and third parameter blank and install a filter to xmlrpc_allow_anonymous_comments to return true.

See this WordPress forum post for more details.

Parameters

  • int blog_id
  • string username
  • string password
  • int post_id
  • struct comment
    • int comment_parent
    • string content
    • string author
    • string author_url
    • string author_email

Return Values

  • int comment_id

wp.getCommentStatusList

Retrieve all of the comment status.

Parameters

  • int blog_id
  • string username
  • string password

Return Values

  • struct
    • string hold
    • string approve
    • string spam

wp.getPage

Get the page identified by the page id.

Parameters

  • int blog_id
  • int page_id
  • string username
  • string password

Return Values

  • struct
    • datetime dateCreated (ISO.8601)
    • int userid
    • int page_id
    • string page_status
    • string description
    • string title
    • string link
    • string permaLink
    • array categories
      • string Category Name
      • ...
    • string excerpt
    • string text_more
    • int mt_allow_comments
    • int mt_allow_pings
    • string wp_slug
    • string wp_password
    • string wp_author
    • int wp_page_parent_id
    • string wp_page_parent_title
    • int wp_page_order
    • int wp_author_id
    • string wp_author_display_name
    • datetime date_created_gmt
    • array custom_fields
      • struct
        • string id
        • string key
        • string value
      • ...
    • string wp_page_template

wp.getPages

Get an array of all the pages on a blog.

Parameters

  • int blog_id
  • string username
  • string password

Return Values


wp.getPageList

Get an array of all the pages on a blog. Just the minimum details, lighter than wp.getPages.

Parameters

  • int blog_id
  • string username
  • string password

Return Values

  • array
    • struct
      • int page_id
      • string page_title
      • int page_parent_id
      • datetime dateCreated
    • ...

wp.newPage

Create a new page. Similar to metaWeblog.newPost.

Parameters

  • bool publish

Return Values

  • int page_id



wp.deletePage

Removes a page from the blog.

Parameters

  • int blog_id
  • string username
  • string password
  • int page_id

Return Values

  • bool true



wp.editPage

Make changes to a blog page.

Parameters

Return Values

  • bool true

wp.getAuthors

Get an array of users for the blog.

Parameters

  • int blog_id
  • string username
  • string password

Return Values

  • array
    • struct
      • int user_id
      • string user_login
      • string display_name
      • string meta_value (Serialized PHP data)
    • ...

wp.getCategories

Get an array of available categories on a blog.

Parameters

  • int blog_id
  • string username
  • string password

Return Values

  • array
    • struct
      • int categoryId
      • int parentId
      • string description
      • string categoryName
      • string htmlUrl
      • string rssUrl
    • ...

wp.newCategory

Create a new category.

Parameters

  • int blog_id
  • string username
  • string password
  • struct
    • string name
    • string slug
    • int parent_id
    • string description

Return Values

  • int category_id

wp.deleteCategory

Delete a category.

Parameters

  • int blog_id
  • string username
  • string password
  • int category_id

Return Values

  • ?

wp.suggestCategories

Get an array of categories that start with a given string.

Parameters

  • int blog_id
  • string username
  • string password
  • string category
  • int max_results

Return Values

  • array
    • struct
      • int category_id
      • string category_name
    • ...

wp.uploadFile

Upload a file.

Parameters

  • int blog_id
  • string username
  • string password
  • struct data
    • string name
    • string type
    • base64 bits
    • bool overwrite

Return Values

  • struct
    • string file
    • string url
    • string type

wp.getComment

Gets a comment, given it's comment ID. Note that this isn't in 2.6.1, but is in the HEAD (so should be in anything newer than 2.6.1)

Parameters

  • int blog_id
  • string username
  • string password
  • int comment_id

Return Values

  • struct
    • datetime dateCreated (ISO.8601, always GMT)
    • string user_id
    • string comment_id
    • string parent
    • string status
    • string content
    • string link
    • string post_id
    • string post_title
    • string author
    • string author_url
    • string author_email
    • string author_ip

wp.getComments

Gets a set of comments for a given post.

Parameters

  • int blog_id
  • string username
  • string password
  • struct
    • post_id
    • status (defaults to approve)
    • offset
    • number

Return Values

Returns an array of the comment structure (see wp.getComment)

  • struct
    • datetime dateCreated (ISO.8601, always GMT)
    • string user_id
    • string comment_id
    • string parent
    • string status
    • string content
    • string link
    • string post_id
    • string post_title
    • string author
    • string author_url
    • string author_email
    • string author_ip

posted on 2011-07-28 11:54  马森  阅读(1627)  评论(0编辑  收藏  举报

导航