Limit number of custom posts per taxonomy

In this specific case it is better to have some handling of bad configuration than trying to prevent it from happening, as there are just too many possible ways in which it can happen without coming from the post edit page. Short list that comes to my mind right now

  • quick edit from the post list
  • bulk update from the post list
  • any plugin that may combine terms
  • remote publishing via xml-rpc or the rest api

Blocking the save, especially for users that do not use the post edit screen, is going to end in bad UX as the user will not know why the save fails.