Shop Forums WordPress Plugins direct unsubscribe caught in wp_die_handler

This topic contains 2 replies, has 2 voices, and was last updated by  Julia Reyes 1 year, 11 months ago.

  • Author
    Posts
  • #6426

    Julia Reyes
    Participant

    Vinny,
    I have this code in my functions.php for reasons other than BBPress:

    // Custom die handler for things like insufficient permissions
    add_filter(‘wp_die_handler’,’custom_404_die_handler’);
    function custom_404_die_handler() {
    wp_safe_redirect(home_url()) ;
    die();
    }

    The problem is when I use the direct unsubscribe link in my BBPNNS email notifications, I don’t get the “successful” message as I want. I just get redirected to the homepage.

    Is this a plugin thing or do I need to update my wp_die_handler somehow? THanks!

  • #6427

    vinny
    Keymaster

    Hi Julie,

    Why exactly do you have that filter? The problem with it is that it doesn’t give you any other parameters that will allow you to decide whether to change the handler or keep the default one.

    Also, you probably shouldn’t be overriding that handler, as it is used for all sorts of things such as AJAX and XMLRPC requests.

  • #6429

    Julia Reyes
    Participant

    Yeah I’m not 100% sure. I think mainly for ‘insufficient permissions’ to various website pages. Bad documentation on my part.

    Ok. If that’s not a good idea, I’ll find another way to handle the permissions and remove the handler.

You must be logged in to reply to this topic.