wp_insert_post: array only. wp_update_post: array|object (?)
Array’s are technically preferred for both, but it actually doesn’t matter that much. PHP is not casting the object to an array, worpress is. wp_insert_post(), like a lot of wordpress functions, runs it’s “array” parameter through wp_parse_args() which will cast an object passed to it to an array and will always returns an array. You … Read more