Skip to:
Content
Pages
Categories
Search
Top
Bottom

My action hooked on ‘template_redirect’ is not fired anymore

  • Avatar of Grosbouff
    grosbouff
    Participant

    @grosbouff

    Hi; i’ve made a plugin for WP (one-quick-post).
    I’m trying to make it compatible with BP but I got this strange error.
    In my plugin, I have two functions hooked on template_redirect.
    When BP is activated, they are not fired anymore.
    Any idea ?

    Thanks !

Viewing 1 replies (of 1 total)
  • When hooking into template_redirect make sure that the priority is set (third arg):

    `add_action(‘template_redirect’, ‘my_function’, 1);`

    The priority argument defaults to 10 – BuddyPress uses a priority of 2 when hooking into template_redirect. Set the priority of your function to a number less than 2, so your hook is executed before BuddyPress catches the URL.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.