Insert a post.
If the $postarr parameter has 'ID' set to a value, then post will be updated.
You can set the post date manually, but setting the values for 'post_date'
and 'post_date_gmt' keys. You can close the comments or open the comments by
setting the value for 'comment_status' key.
The defaults for the parameter $postarr are:
'post_status' - Default is 'draft'.
'post_type' - Default is 'post'.
'post_author' - Default is current user ID ($user_ID). The ID of the user who added the post.
'ping_status' - Default is the value in 'default_ping_status' option.
Whether the attachment can accept pings.
'post_parent' - Default is 0. Set this for the post it belongs to, if any.
'menu_order' - Default is 0. The order it is displayed.
'to_ping' - Whether to ping.
'pinged' - Default is empty string.
'post_password' - Default is empty string. The password to access the attachment.
'guid' - Global Unique ID for referencing the attachment.
'post_content_filtered' - Post content filtered.
'post_excerpt' - Post excerpt.