I'm trying to do on a CRED user registration form a validation of some fields related to a CPT. Is it possible to do related through cred_form_validate a query related to some fields of a CPT on a user form?
Thanks.
Sure it's possible, you would just use the get_posts or WP_Query of WordPress, within the hook of Toolset Forms.
Toolset's Form API is just a set of hooks, that let you fire your custom code at different points in the life of a Form.
The cred_form_validate() will provide the data from the fields, and you can then compare that data to some conditions, and either let it fail with an error which you can customize, or proceed.
To what data you compare that to, or where you get that data from, is up to the webmaster.
How could you get posts?
With the WordPress API:
https://codex.wordpress.org/Template_Tags/get_posts
https://codex.wordpress.org/Class_Reference/WP_Query
The fields from those posts can later be accessed with the WordPress API again:
https://developer.wordpress.org/reference/functions/get_post_meta/
Then, using if/else PHP native conditions and the Error array that Toolset Forms API provides, you can validate your input on the forms, using the data you pulled.