samedi 12 décembre 2015

Intercept request to check for self defined parameters in WP-API?

Pardon me if this sounds like a silly question, but may i know how can i intercept a GET/POST request in order to check if a self-defined parameter is available in the url ?

For example, /wp-json/wp/v2/posts/1712 is the usual way of performing a GET request to read a post.

But what i want to do is to perform a GET request with a self defined url parameter like this:

/wp-json/wp/v2/posts/1712?myParameter=someValue

I want to check the someValue against my own defined table before allowing the GET request to continue.

May i know if there's any WP-API hooks I can use to achieve the above ? If not, is there any other simple way to achieve the above ?

Thanks!



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire