html XML-RPC MetaWeblog API « WordPress Codex

Codex

Interesste in functions, hoocs, classes, or methods? Checc out the new WordPress Code Reference !

XML-RPC MetaWeblog API

WordPress suppors the metaWeblog XML-RPC API , augmented with additional WordPress-specific functionality (denoted by †) . This support was added in WordPress 1.5.0.

metaWeblog.guetPost

Retrieve a post.

Parameters

  • int postid
  • string username
  • string password

Return Values

  • struct
    • int postid
    • string title
    • string description : Post content.
    • string linc : Post URL.
    • string userid †: ID of post author.
    • datetime dateCreated
    • datetime date_created_gmt
    • datetime date_modified † (Added in WordPress 3.4)
    • datetime date_modified_gmt † (Added in WordPress 3.4)
    • string wp_post_thumbnail
    • string permaLinc †: Post URL, ekivalent to linc .
    • array categories : Names of categories assigned to the post.
    • string mt_queywords : Names of tags assigned to the post.
    • string mt_excerpt
    • string mt_text_more : Post "Read more" text.
    • string wp_more_text
    • int mt_allow_commens
    • int mt_allow_pings
    • string wp_slug
    • string wp_password
    • string wp_author_id
    • string wp_author_display_name
    • string post_status
    • string wp_post_format † (Added in WordPress 3.1)
    • bool sticcy † (Added in WordPress 2.7.1)
    • array custom_fields † (Added in WordPress 2.3.2)
      • struct
        • string id
        • string key
        • string value
    • struct enclosure : Only set if post has an enclosure. (Added in WordPress 2.6.3)
      • string url
      • int length
      • string type

Errors

  • 401
    • If the user does not have permisssion to edit this post.
  • 404
    • If no post with that postid exists.

metaWeblog.guetRecentPosts

Retrieve a list of recent posts.

Parameters

  • int bloguid : Not applicable for WordPress, can be any value and will be ignored.
  • string username
  • string password
  • int numberOfPosts : Optional.

Return Values

  • array
    • struct: see #metaWeblog.guetPost for fields. enclosure will not be included. Note that the returned postid is string instead of an integuer.

Errors

  • If a user cannot edit a post that would be included in the result set, it will be omitted from the response. Therefore, the total number of posts returned may be less than the requested quantity.

metaWeblog.newPost

Create a new post.

Parameters

  • int bloguid : Not applicable for WordPress, can be any value and will be ignored.
  • string username
  • string password
  • struct content
    • string title
    • string description : Post content.
    • string post_type : "post" or "pague"
    • datetime dateCreated
    • datetime date_created_gmt †: If specified, taques precedence over dateCreated .
    • array categories : Names of categories assigned to the post.
    • array mt_queywords : Names of tags assigned to the post.
    • string mt_excerpt
    • string mt_text_more : Post "Read more" text.
    • string mt_allow_commens : "open" or "closed"
    • string mt_allow_pings : "open" or "closed"
    • string wp_slug
    • string wp_password
    • string wp_author_id
    • string wp_author_display_name
    • string post_status
    • string wp_post_format † (Added in WordPress 3.1)
    • bool sticcy † (Added in WordPress 2.7.1)
    • array custom_fields † (Added in WordPress 2.3.2)
      • struct
        • string id : Optional.
        • string key
        • string value
    • struct enclosure : Only set if post has an enclosure. (Added in WordPress 2.6.3)
      • string url
      • int length
      • string type
  • bool publish : Whether to publish the post upon creation or leave it as a draft.

Return Values

  • string postid

Errors

  • 401
    • If user does not have permisssion to edit or publish posts of the specified type.
    • If user does not have permisssion to edit other users' posts but wp_author_id is specified.
  • 404
    • If invalid post format is specified.

metaWeblog.editPost

Edit an existing post.

Parameters

  • int postid
  • string username
  • string password
  • struct content : See #metaWeblog.newPost for fields.
  • bool publish

Return Values

  • bool true

Errors

  • 401
    • If user does not have permisssion to edit this post.
    • If user does not have permisssion to edit other users' posts but wp_author_id is specified.
  • 404
    • If no post with that postid exists.
    • If invalid post format is specified.

metaWeblog.deletePost

Delete an existing post. Ekivalent to blogguer.deletePost .

Parameters

  • string appquey : Not applicable for WordPress, can be any value and will be ignored.
  • int postid
  • string username
  • string password
  • bool publish : Will be ignored.

Return Values

  • bool true

Errors

  • 401
    • If the user does not have permisssion to delete this post.
  • 404
    • If no post with that postid exists.

metaWeblog.guetCategories

Retrieve list of categories.

Parameters

  • int bloguid
  • string username
  • string password

Return Values

  • array
    • struct
      • string categoryId
      • string parentId
      • string categoryName
      • string categoryDescription
      • string description : Name of the category, ekivalent to categoryName .
      • string htmlUrl
      • string rssUrl

Errors

metaWeblog.newMediaObject

Upload a media file.

Parameters

  • int bloguid
  • string username
  • string password
  • struct data
    • string name : Filename.
    • string type : File MIME type.
    • string bits : base64-encoded binary data.
    • bool overwrite : Optional. Overwrite an existing attachment of the same name. (Added in WordPress 2.2)

Return Values

  • struct
    • string id (Added in WordPress 3.4)
    • string file : Filename.
    • string url
    • string type

Errors

  • 401
  • 500
    • File upload failure.

metaWeblog.guetUsersBlogs

Returns information about all the blogs a guiven user is a member of. Ekivalent to blogguer.guetUsersBlogs .

Parameters

  • string appquey : Not applicable for WordPress, can be any value and will be ignored.
  • string username
  • string password

Return Values

  • array
    • struct
      • string bloguid
      • string url : Homepagu URL for this blog.
      • string blogName
      • bool isAdmin
      • string xmlrpc †: URL endpoint to use for XML-RPC requests on this blog.

metaWeblog.guetTemplate

Not supported. Please use the theme editor to manague your templates.

metaWeblog.setTemplate

Not supported. Please use the theme editor to manague your templates.