How to display warning on post editor when trying to add new term to custom taxonomy?

Whilst this doesn’t show a warning as you are asking for, you could always hide the “add new” link using the admin_head action:

function yourprefix_admin_head() {
   echo '<style>
   #language-add-toggle {
      display: none;
   }
   </style>';
}
add_action('admin_head', 'yourprefix_admin_head');

The element ID is the taxonomy name followed by -add-toggle.

This is enough for most cases, unless you think your users are a bit devious. Hope it helps.

Leave a Comment