I want to clear the cookies so I use this code:
<?php
function wp_clear_auth_cookie() {
do_action('clear_auth_cookie');
}
wp_clear_auth_cookie();
?>
but an error occurs, what I'm doing wrong?
Please Help!
I want to clear the cookies so I use this code:
<?php
function wp_clear_auth_cookie() {
do_action('clear_auth_cookie');
}
wp_clear_auth_cookie();
?>
but an error occurs, what I'm doing wrong?
Please Help!
Where do you plan on using this? If you just want to clear your cookies, you can do this through your browser.
What you're doing wrong is creating a function that already exists. Then you made the plugin hookable using a hook that already exists. You also didn't tell that function to do anything. All you need to is call the function where you need it. Just
wp_clear_auth_cookie();
and you're done.
Where do I put
wp_clear_auth_cookie();
Thanks!
This topic has been closed to new replies.