We have a custom post type in our plugin and now i must provide the user a meta box where he enters latitude and longitude. I want them to be floats, i have no problems in doing the validation client side, but i don’t know how i should handle server side validation in wordpress.
I thought that there was some API for doing this, but this is not the case, so i was just wandering how should i handle things inside my save function.
Not shure if this isn´t a general php question…
Use the
WP_Error
Class.At the end of your function, check if you got an error. To provide a meaningful error message, use jQuery: