Support » Plugin: Redirection » Correct hook for after plugin has considered all redirects

  • Resolved TCBarrett

    (@tcbarrett)


    Hullo

    I would like to send a header() response after Redirection has made it’s considerations (and is not going to to redirect).

    It is a network and browser based redirect, so not so easy to add as a fallback in Redirect itself.

    Could you point me to the hook and value checks for this? Here’s a bit of pseudo code:

    
    add_action( 'redirections_considered', function( $is_redirecting ) {
    
      if ( ! $is_redirecting && blog_id_check() && browser_check() ) {
        header( 'Location: /subsite' );
        exit;
      }
    } ) ;
    
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author John Godley

    (@johnny5)

    You can find all hooks here:

    https://redirection.me/developer/wordpress-hooks/

    I dont think there is anything that matches what you want, and you’d probably be better hooking a standard WordPress action that occurs after a redirect takes place.

    TCBarrett

    (@tcbarrett)

    I have seen the hooks, as you say there is nothing obvious. Would you be able to specify a point where all the Redirect redirection hooks are done by? Say template_redirect, 999 ?

    Plugin Author John Godley

    (@johnny5)

    That sounds like a good place to start. You can experiment a bit to see if it’s the right place.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Correct hook for after plugin has considered all redirects’ is closed to new replies.