How to throw a validation error in Wordpress?
-
29-09-2019 - |
Question
Without using any JavaScript library like JQuery, how do I show an error to the user if the title of the Post exceeds 40 characters? I would like to use WordPress API/ PHP for this.
Solution
When the form is submitted, check the length of the request parameter and return an error when it's too long.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow