My requirement is something like:

Let's say I have a client side app/website. There will be logout link and on clicking Logout link, it will also remotely logout wordpress site.

I believe WP has a hook like

add_action('wp_logout', function(){
wp_set_current_user( 0 );

I can get access_token from WP Oauth Server plugin but how can I call above hook using rest api.

Most examples I found about getting posts/users using rest authentication api but not about logout.

What will be good secured way to achieve it?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.