Is there a way to check if some requirements are matched before adding new instance of custom post type to database? Like custom policies for adding new posts etc?
What I want to do is to build two custom types: "Event" and "Suggestion" connected by one-to-many relationship (by Pods Framework). I want to allow admins create Events and users create Suggestions. Suggestion for specific Event can be add if admin set Post Status of this Event as "Open for suggestions". When status is changed to "Closed for suggestions", there is no way to add new Suggestion related to this Event.
Is there any way too hook to some event before inserting post, that will check matching conditions and depending on result add or not post to database?