pantheon-systems/wp-saml-auth

Provide a wp_saml_auth_pre_logout hook, custom wp_logout function never called

bwaltz opened this issue · 3 comments

I'm trying to do something simple such as remove a custom cookie in a plugin. Here's my function:

function logout_function($user_id) {
  setcookie('ColbyAuth', '', time() - 3600);
}
add_action('wp_logout', 'logout_function');

but when the WP SAML Auth plugin is enabled this function is never called. I suspect this is because you're redirecting and calling the provider->logout() function before it gets called.

Is there a way you can provide a wp_saml_auth_pre_logout hook or advise on the best way to have my function invoked?

@bwaltz Would something like #274 work for you?

That would do it! Thanks!

👍 Tagged v1.2.7 with the action.