2012/07/11

워드프레스 API, wp.newPost(글쓰기)

Parameters
  • int blog_id
  • string username
  • string password
  • struct content
    • string post_type
    • string post_status
    • string post_title
    • int post_author
    • string post_excerpt
    • string post_content
    • datetime post_date_gmt | post_date
    • string post_format
    • string post_password
    • string comment_status
    • string ping_status
    • bool sticky
    • int post_thumbnail
    • int post_parent
    • array custom_fields
      • struct
        • string key
        • string value
    • struct terms: Taxonomy names as keys, array of term IDs as values.
    • struct terms_names: Taxonomy names as keys, array of term names as values.
    • struct enclosure
      • string url
      • int length
      • string type
    • any other fields supported by wp_insert_post

Return Values

  • string post_id

Errors

  • 401
    • If the user does not have the edit_posts cap for this post type.
    • If user does not have permission to create post of the specified post_status.
    • If post_author is different than the user's ID and the user does not have the edit_others_posts cap for this post type.
    • If sticky=true and user does not have permission to make the post sticky.
    • If a taxonomy in terms or terms_names is not supported by this post type.
    • If terms or terms_names is set but user does not have assign_terms cap.
    • If an ambiguous term name is used in terms_names.
  • 403
    • If invalid post_type is specified.
    • If an invalid term ID is specified in terms.
  • 404
    • If no author with that post_author ID exists.
    • If no attachment with that post_thumbnail ID exists.
http://codex.wordpress.org/XML-RPC_WordPress_API/Posts http://codex.wordpress.org/Function_Reference/wp_insert_post  

댓글 없음:

댓글 쓰기

가장 많이 본 글