wp_logout action hook is not firing
In your code, get_current_user_id() will return 0 because this hook fires after the logout has happened, ie, there is no current user ID. If you want the $user_id to be available to your function, you have to pass it in. Note: the $user_id parameter was added in WordPress 5.5.0. If you’re using an older version, … Read more