My website is set up with pages as categories, meaning that if a user publishes without choosing a category, no one can see the post unless they know the specific address.
What do I need to hook into in order to check if a category is chosen after the “publish” button is pressed but before the post is published publicly?
Try
You can hook
wp_insert_post_data
to get the data that is about to be inserted into the database. What you do with it from there is your call, but you will at least have access to it. Keep in mind that this hook is done before the new post data is inserted into the DB, so you won’t be able to interact with the post using a lot of the functions you’re used to.