I’m looking for a way to only allow users to create new subpages once there are nine pages that are parents/root pages. Once there are nine parent pages when trying to create a new parent the users will get an error message.
Edit:
Moved from the comments to @brasofilo s answer below:
when I press submit it processes as it should but when the page refreshes I get the message: “Page updated” rather than “Page published. View page”. So it’s only saved as a draft, not actually published.
So the goal is to have the post status behave like it would for a default post type, when the new limit isn’t triggering.
Ideas?
Thanks
Code based in Bainternet’s answer to this question: Make Categories and Tags required in admin
See code comments.