How can I logout from every where else this place in wordpress? [not wp_logout()
because it destroys current session only]
I used this function but it did not work:
WP_User_Meta_Session_Tokens::destroy_other_sessions();
How can I logout from every where else this place in wordpress? [not wp_logout()
because it destroys current session only]
I used this function but it did not work:
WP_User_Meta_Session_Tokens::destroy_other_sessions();
You must be logged in to post a comment.
You must first get the user id, then get the token, protect it and destroy the other sessions. Here’s a working example:
Here is a working version hooked to the
init
action.