Convert the $args parameter documentation for wp_xmlrpc_server->wp_newPost() into a hash notation.

Also adds more in-depth documentation and a link for information on enclosures.

See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@32581 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Drew Jaynes 2015-05-24 19:58:54 +00:00
parent eb60152449
commit b5b9cda58d

View File

@ -1100,33 +1100,47 @@ class wp_xmlrpc_server extends IXR_Server {
* *
* @since 3.4.0 * @since 3.4.0
* *
* @param array $args { * @link http://en.wikipedia.org/wiki/RSS_enclosure for information on RSS enclosures.
* Method arguments. Note: arguments must be ordered as documented.
* *
* @type int $blog_id (unused) * @param array $args {
* @type string $username * Method arguments. Note: top-level arguments must be ordered as documented.
* @type string $password *
* @type array $content_struct can contain: * @type int $blog_id Blog ID (unused).
* - post_type (default: 'post') * @type string $username Username.
* - post_status (default: 'draft') * @type string $password Password.
* - post_title * @type array $content_struct {
* - post_author * Content struct for adding a new post. See wp_insert_post() for information on
* - post_excerpt * additional post fields
* - post_content *
* - post_date_gmt | post_date * @type string $post_type Post type. Default 'post'.
* - post_format * @type string $post_status Post status. Default 'draft'
* - post_password * @type string $post_title Post title.
* - comment_status - can be 'open' | 'closed' * @type int $post_author Post author ID.
* - ping_status - can be 'open' | 'closed' * @type string $post_excerpt Post excerpt.
* - sticky * @type string $post_content Post content.
* - post_thumbnail - ID of a media item to use as the post thumbnail/featured image * @type string $post_date_gmt Post date in GMT.
* - custom_fields - array, with each element containing 'key' and 'value' * @type string $post_date Post date.
* - terms - array, with taxonomy names as keys and arrays of term IDs as values * @type string $post_password Post password (20-character limit).
* - terms_names - array, with taxonomy names as keys and arrays of term names as values * @type string $comment_status Post comment enabled status. Accepts 'open' or 'closed'.
* - enclosure * @type string $ping_status Post ping status. Accepts 'open' or 'closed'.
* - any other fields supported by wp_insert_post() * @type bool $sticky Whether the post should be sticky. Automatically false if
* `$post_status` is 'private'.
* @type int $post_thumbnail ID of an image to use as the post thumbnail/featured image.
* @type array $custom_fields Array of meta key/value pairs to add to the post.
* @type array $terms Associative array with taxonomy names as keys and arrays
* of term IDs as values.
* @type array $terms_names Associative array with taxonomy names as keys and arrays
* of term names as values.
* @type array $enclosure {
* Array of feed enclosure data to add to post meta.
*
* @type string $url URL for the feed enclosure.
* @type int $length Size in bytes of the enclosure.
* @type string $type Mime-type for the enclosure.
* } * }
* @return string|IXR_Error post_id * }
* }
* @return int|IXR_Error Post ID on success, IXR_Error instance otherwise.
*/ */
public function wp_newPost( $args ) { public function wp_newPost( $args ) {
if ( ! $this->minimum_args( $args, 4 ) ) if ( ! $this->minimum_args( $args, 4 ) )