首页 > 其他分享 >WordPress extended XML-RPC MetaWeblog API

WordPress extended XML-RPC MetaWeblog API

时间:2023-04-29 22:45:16浏览次数:64  
标签:XML extended MetaWeblog Parameters metaWeblog WordPress Values post string

XML-RPC MetaWeblog API « WordPress Codex

Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

XML-RPC MetaWeblog API

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

Contents

metaWeblog.getPost

Retrieve a post.

Parameters

  • int postid
  • string username
  • string password

Return Values

  • struct
    • int postid
    • string title
    • string description: Post content.
    • string link: 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 permaLink†: Post URL, equivalent to link.
    • array categories: Names of categories assigned to the post.
    • string mt_keywords: 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_comments
    • 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 sticky† (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 permission to edit this post.
  • 404
    • If no post with that postid exists.

metaWeblog.getRecentPosts

Retrieve a list of recent posts.

Parameters

  • int blogid: 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.getPost for fields. enclosure will not be included. Note that the returned postid is string instead of an integer.

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 blogid: 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 "page"
    • datetime dateCreated
    • datetime date_created_gmt†: If specified, takes precedence over dateCreated.
    • array categories: Names of categories assigned to the post.
    • array mt_keywords: Names of tags assigned to the post.
    • string mt_excerpt
    • string mt_text_more: Post "Read more" text.
    • string mt_allow_comments: "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 sticky† (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 permission to edit or publish posts of the specified type.
    • If user does not have permission 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 permission to edit this post.
    • If user does not have permission 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. Equivalent to blogger.deletePost.

Parameters

  • string appkey: 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 permission to delete this post.
  • 404
    • If no post with that postid exists.

metaWeblog.getCategories

Retrieve list of categories.

Parameters

  • int blogid
  • string username
  • string password

Return Values

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

Errors

  • 401

metaWeblog.newMediaObject

Upload a media file.

Parameters

  • int blogid
  • 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.getUsersBlogs

Returns information about all the blogs a given user is a member of. Equivalent to blogger.getUsersBlogs.

Parameters

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

Return Values

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

metaWeblog.getTemplate

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

metaWeblog.setTemplate

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

Retrieved from "https://codex.wordpress.org/index.php?title=XML-RPC_MetaWeblog_API&oldid=158715" Categories:

Codex Resources

标签:XML,extended,MetaWeblog,Parameters,metaWeblog,WordPress,Values,post,string
From: https://www.cnblogs.com/lywon/p/17364585.html

相关文章

  • The GitHub Project xm-rpc-el/xml-rpc-el README.org
    Commentary:ThisisanXML-RPCclientimplementationinelisp,capableofbothsynchronousandasynchronousmethodcalls(usingtheurlpackage'sasyncretrievalfunctionality).XML-RPCisremoteprocedurecallsoverHTTPusingXMLtodescribethefu......
  • XML-RPC Specification
    转载于http://xmlrpc.com/spec.md。:::{#idMenubar.divMenubar}:::{.topbar-wrapperstyle="z-index:5;"}:::{.navbar.navbar-fixed-topdropdown="dropdown"}:::divVersionNumber[]{#idPublishStatus}[]{#idSavedStatus} []{#idVersionNumber}......
  • MFC-GetExtendedStyle获取扩展样式
     DWORDExStyles=mylist4.GetExtendedStyle();//获取扩展样式DWORDoldstyle=mylist4.SetExtendedStyle(ExStyles|LVS_EX_FULLROWSELECT);//设置扩展样式/*指定的扩展样式LVS_EX_GRIDLINES//绘制表格LVS_EX_SUBITEMIMAGES//......
  • xml 序列化
    usingSystem.Text;usingSystem.Xml;usingSystem.Xml.Serialization;varp=newPerson{Id=1,Name="Furion",Items=newList<string>{"Furion","百小僧"}};varxml=XmlSerialize(p);Console.ReadKe......
  • MAVEN 配置nexus setting.xml 配置
    MAVEN配置nexussetting.xml配置 <mirror> <id>nexus</id> <mirrorOf>*</mirrorOf> <url>http://192.168.1.104:8081/nexus/content/groups/public/</url> </mirror> <profile> <id>nexus&......
  • web.xml报错
    web.xml报错 Thecontentofelementtype"web-app"mustmatch"(icon?,display-name?,description?,distributable?,context-param*,filter*,filter-mapping*,listener*,servlet*,servlet-mapping*,session-config?,mime-mapping*,welcome-file-list?,err......
  • XMLHttpRequest发请求的步骤
    /*具体来说,AJAX包括以下几个步骤。以下是AJAX发请求的步骤1.创建XMLHttpRequest实例2.发出HTTP请求3.接收服务器传回的数据4.更新网页数据*///实例化一个对象xhrvarxhr=newXMLHttpRequest(),method="GET",url="https://www.baidu......
  • Spring XML配置的12个技巧
    Spring是一个强有力的java程序框架,其被广泛应用于java的程序中。它用POJO提供了企业级服务。Spring利用依赖注入可以获得简单而有效的测试能力。Springbeans,依赖关系,以及服务所需要的bean都将在配置文件中予以描述,配置文件一般采用XML格式。然而XML配置文件冗长而不易使用,在你进......
  • 【解决】axios 下载文件 Failed to read the 'responseText' property from 'XMLHttp
    主要解决以下两个问题问题一:idm一些网站不允许请求同一文件两次故障原因:IDM在发神经因为它检测到浏览器集成插件未安装,所以诱导你安装。实际上,装了插件问题也会出现。改参数都没用。1.很可能是你点击网页的下载链接有问题(换个网页下载试试,就不提示了),Edge浏览器一直会欺......
  • API 架构风格演化史:CORBA-XMLRPC(SOAP)-REST-JSONRPC-GraphQL-gRPC
    我们先来看一张 TwitterArchitecture2022CodeFirstv.sAPIFirst软件开发理念的改变下图显示了代码优先开发和API优先开发之间的差异。为什么我们要考虑API优先设计?微服务增加了系统的复杂性。我们有单独的服务来服务系统的不同功能。尽管这种体系结构促进了职责的脱钩和分......