WordPress.org

Make WordPress Core

Ticket #38435: wp_insert_post_docs.2.diff

File wp_insert_post_docs.2.diff, 6.9 KB (added by nabil_kadimi, 3 years ago)

Corrected patch.

  • wp-includes/post.php

     
    29152915 * @param array $postarr {
    29162916 *     An array of elements that make up a post to update or insert.
    29172917 *
    2918  *     @type int    $ID                    The post ID. If equal to something other than 0,
    2919  *                                         the post with that ID will be updated. Default 0.
    2920  *     @type int    $post_author           The ID of the user who added the post. Default is
    2921  *                                         the current user ID.
    2922  *     @type string $post_date             The date of the post. Default is the current time.
    2923  *     @type string $post_date_gmt         The date of the post in the GMT timezone. Default is
    2924  *                                         the value of `$post_date`.
    2925  *     @type mixed  $post_content          The post content. Default empty.
    2926  *     @type string $post_content_filtered The filtered post content. Default empty.
    2927  *     @type string $post_title            The post title. Default empty.
    2928  *     @type string $post_excerpt          The post excerpt. Default empty.
    2929  *     @type string $post_status           The post status. Default 'draft'.
    2930  *     @type string $post_type             The post type. Default 'post'.
    2931  *     @type string $comment_status        Whether the post can accept comments. Accepts 'open' or 'closed'.
    2932  *                                         Default is the value of 'default_comment_status' option.
    2933  *     @type string $ping_status           Whether the post can accept pings. Accepts 'open' or 'closed'.
    2934  *                                         Default is the value of 'default_ping_status' option.
    2935  *     @type string $post_password         The password to access the post. Default empty.
    2936  *     @type string $post_name             The post name. Default is the sanitized post title
    2937  *                                         when creating a new post.
    2938  *     @type string $to_ping               Space or carriage return-separated list of URLs to ping.
    2939  *                                         Default empty.
    2940  *     @type string $pinged                Space or carriage return-separated list of URLs that have
    2941  *                                         been pinged. Default empty.
    2942  *     @type string $post_modified         The date when the post was last modified. Default is
    2943  *                                         the current time.
    2944  *     @type string $post_modified_gmt     The date when the post was last modified in the GMT
    2945  *                                         timezone. Default is the current time.
    2946  *     @type int    $post_parent           Set this for the post it belongs to, if any. Default 0.
    2947  *     @type int    $menu_order            The order the post should be displayed in. Default 0.
    2948  *     @type string $post_mime_type        The mime type of the post. Default empty.
    2949  *     @type string $guid                  Global Unique ID for referencing the post. Default empty.
    2950  *     @type array  $post_category         Array of category names, slugs, or IDs.
    2951  *                                         Defaults to value of the 'default_category' option.
    2952  *     @type array  $tax_input             Array of taxonomy terms keyed by their taxonomy name. Default empty.
    2953  *     @type array  $meta_input            Array of post meta values keyed by their post meta key. Default empty.
     2918 *     @type int       $ID                    The post ID. If equal to something other than 0,
     2919 *                                            the post with that ID will be updated. Default 0.
     2920 *     @type int       $post_author           The ID of the user who added the post. Default is
     2921 *                                            the current user ID.
     2922 *     @type string    $post_date             The date of the post. Default is the current time.
     2923 *     @type string    $post_date_gmt         The date of the post in the GMT timezone. Default is
     2924 *                                            the value of `$post_date`.
     2925 *     @type mixed     $post_content          The post content. Default empty.
     2926 *     @type string    $post_content_filtered The filtered post content. Default empty.
     2927 *     @type string    $post_title            The post title. Default empty.
     2928 *     @type string    $post_excerpt          The post excerpt. Default empty.
     2929 *     @type string    $post_status           The post status. Default 'draft'.
     2930 *     @type string    $post_type             The post type. Default 'post'.
     2931 *     @type string    $comment_status        Whether the post can accept comments. Accepts 'open' or 'closed'.
     2932 *                                            Default is the value of 'default_comment_status' option.
     2933 *     @type string    $ping_status           Whether the post can accept pings. Accepts 'open' or 'closed'.
     2934 *                                            Default is the value of 'default_ping_status' option.
     2935 *     @type string    $post_password         The password to access the post. Default empty.
     2936 *     @type string    $post_name             The post name. Default is the sanitized post title
     2937 *                                            when creating a new post.
     2938 *     @type string    $to_ping               Space or carriage return-separated list of URLs to ping.
     2939 *                                            Default empty.
     2940 *     @type string    $pinged                Space or carriage return-separated list of URLs that have
     2941 *                                            been pinged. Default empty.
     2942 *     @type string    $post_modified         The date when the post was last modified. Default is
     2943 *                                            the current time.
     2944 *     @type string    $post_modified_gmt     The date when the post was last modified in the GMT
     2945 *                                            timezone. Default is the current time.
     2946 *     @type int       $post_parent           Set this for the post it belongs to, if any. Default 0.
     2947 *     @type int       $menu_order            The order the post should be displayed in. Default 0.
     2948 *     @type string    $post_mime_type        The mime type of the post. Default empty.
     2949 *     @type string    $guid                  Global Unique ID for referencing the post. Default empty.
     2950 *     @type array|int $post_category         A single category ID, or an array of category IDs.
     2951 *                                            Defaults to value of the 'default_category' option.
     2952 *     @type array     $tax_input             Array of taxonomy terms keyed by their taxonomy name. Default empty.
     2953 *     @type array     $meta_input            Array of post meta values keyed by their post meta key. Default empty.
    29542954 * }
    29552955 * @param bool  $wp_error Optional. Whether to return a WP_Error on failure. Default false.
    29562956 * @return int|WP_Error The post ID on success. The value 0 or WP_Error on failure.