Group Mods

  • Profile picture of @mercime
  • Profile picture of r-a-y
  • Profile picture of Hugo

Is bp_core_redirect() broken ? or when can I call it ? (BP 1.5) (3 posts)

Started 3 months, 2 weeks ago by: gary_mazz

  • Profile picture of gary_mazz gary_mazz said 3 months, 2 weeks ago:

    I’m calling bp_core_redirect() with a known good URL and a 302 status set. The return response is 200 and no redirect info. I’m redirecting in action ‘bp_before_group_plugin_template’.

    wp_redirect() works :)

    Is something clobbering the redirect ?

  • Profile picture of Paul Gibbs Paul Gibbs said 3 months, 2 weeks ago:

    The bp_before_group_plugin_template action is much too late for a real redirect, because you’re already outputting HTML to send to the browser. Do it higher up the stack (before the template is rendered).

  • Profile picture of gary_mazz gary_mazz said 3 months, 2 weeks ago:

    Thanks Paul.

    I’d like to hook after the URI is parsed and before the template is called. Do you know the action’s name ? I’d look it up myself, but the doc is somewhat lacking in certain areas.

    edit: I did a bit more looking at the http requests, it doesn’t appear the 302 is returning in the error code, but I’m not sure if the the tools not showing it.