Inserts or update a post. Description If the $postarr parameter has ‘ID’ set to a value, then post will be updated. You can set the post date manually, by 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. See alsosanitize_post() Parameters $postarrarrayrequired
![wp_insert_post() – Function | Developer.WordPress.org](https://cdn-ak-scissors.b.st-hatena.com/image/square/7969d74a2c29bc3eb55f9ef6436d7aba5d0342ea/height=288;version=1;width=512/https%3A%2F%2Fdeveloper.wordpress.org%2Fwp-content%2Fthemes%2Fwporg-developer-2023%2Fimages%2Fopengraph-image.png)