Search code examples
phpwordpressvalidationpodscms

Validate advanced post types in pods framework on save in backend


Which is the most correct way to validate inputs on new pod save from wordpress backend if the pod is an advanced post type with is own table?

I also want to return an error message if the inputs are not fixable.

Thanks!


Solution

  • Probably the pre_save filter is our best bet. http://pods.io/docs/code/filter-reference/pods_api_pre_save_pod_item/

    Not sure yet how to return an error, but the pods_error method should handle the bits of the different circumstances.