• 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!

Viewing 2 replies - 1 through 2 (of 2 total)
  • 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!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Clear cookies in WordPress’ is closed to new replies.