I'm building a membership based website that will use custom post types to store data. I came across a problem which is if two users happen to create a post using the same exact name, WordPress would add -2, to one of the users posts. I'd like to keep permalinks on and have a unique ID added to the end of the permalink so that the URL's appear as example.com/postname-XXX, where XXX is a unique ID.
I thought about using the post ID, but if a user is submitting from a form which is creating the custom post types am I able to insert the post ID before the post or permalink are set and if so how?
If this isn't possible what is another method to add a unique ID to the permalink from the form?