Make WordPress Core

Changeset 32581


Ignore:
Timestamp:
05/24/2015 07:58:54 PM (9 years ago)
Author:
DrewAPicture
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-xmlrpc-server.php

    r32579 r32581  
    11011101     * @since 3.4.0
    11021102     *
     1103     * @link http://en.wikipedia.org/wiki/RSS_enclosure for information on RSS enclosures.
     1104     *
    11031105     * @param array  $args {
    1104      *     Method arguments. Note: arguments must be ordered as documented.
    1105      *
    1106      *     @type int    $blog_id (unused)
    1107      *     @type string $username
    1108      *     @type string $password
    1109      *     @type array  $content_struct can contain:
    1110      *      - post_type (default: 'post')
    1111      *      - post_status (default: 'draft')
    1112      *      - post_title
    1113      *      - post_author
    1114      *      - post_excerpt
    1115      *      - post_content
    1116      *      - post_date_gmt | post_date
    1117      *      - post_format
    1118      *      - post_password
    1119      *      - comment_status - can be 'open' | 'closed'
    1120      *      - ping_status - can be 'open' | 'closed'
    1121      *      - sticky
    1122      *      - post_thumbnail - ID of a media item to use as the post thumbnail/featured image
    1123      *      - custom_fields - array, with each element containing 'key' and 'value'
    1124      *      - terms - array, with taxonomy names as keys and arrays of term IDs as values
    1125      *      - terms_names - array, with taxonomy names as keys and arrays of term names as values
    1126      *      - enclosure
    1127      *      - any other fields supported by wp_insert_post()
    1128      * }
    1129      * @return string|IXR_Error post_id
     1106     *     Method arguments. Note: top-level arguments must be ordered as documented.
     1107     *
     1108     *     @type int    $blog_id        Blog ID (unused).
     1109     *     @type string $username       Username.
     1110     *     @type string $password       Password.
     1111     *     @type array  $content_struct {
     1112     *         Content struct for adding a new post. See wp_insert_post() for information on
     1113     *         additional post fields
     1114     *
     1115     *         @type string $post_type      Post type. Default 'post'.
     1116     *         @type string $post_status    Post status. Default 'draft'
     1117     *         @type string $post_title     Post title.
     1118     *         @type int    $post_author    Post author ID.
     1119     *         @type string $post_excerpt   Post excerpt.
     1120     *         @type string $post_content   Post content.
     1121     *         @type string $post_date_gmt  Post date in GMT.
     1122     *         @type string $post_date      Post date.
     1123     *         @type string $post_password  Post password (20-character limit).
     1124     *         @type string $comment_status Post comment enabled status. Accepts 'open' or 'closed'.
     1125     *         @type string $ping_status    Post ping status. Accepts 'open' or 'closed'.
     1126     *         @type bool   $sticky         Whether the post should be sticky. Automatically false if
     1127     *                                      `$post_status` is 'private'.
     1128     *         @type int    $post_thumbnail ID of an image to use as the post thumbnail/featured image.
     1129     *         @type array  $custom_fields  Array of meta key/value pairs to add to the post.
     1130     *         @type array  $terms          Associative array with taxonomy names as keys and arrays
     1131     *                                      of term IDs as values.
     1132     *         @type array  $terms_names    Associative array with taxonomy names as keys and arrays
     1133     *                                      of term names as values.
     1134     *         @type array  $enclosure      {
     1135     *             Array of feed enclosure data to add to post meta.
     1136     *
     1137     *             @type string $url    URL for the feed enclosure.
     1138     *             @type int    $length Size in bytes of the enclosure.
     1139     *             @type string $type   Mime-type for the enclosure.
     1140     *         }
     1141     *     }
     1142     * }
     1143     * @return int|IXR_Error Post ID on success, IXR_Error instance otherwise.
    11301144     */
    11311145    public function wp_newPost( $args ) {
Note: See TracChangeset for help on using the changeset viewer.