Skip to:
Content
Pages
Categories
Search
Top
Bottom

Plugin Initialization on BP Links

  • Having some issues getting plugins to initiatize on any BP generated link. Wondering if anyone has some clues! Recently Andy changed the priority on which bp_catch_uri comes up and it seems to be trumping my plugins now on any BP generated pages.

    The plugin in question is a “members-only” plugin that checks if a user is logged in and if not, gives them the login page. The action that is loaded is:

    add_action('init', 'members_only_init');

    Since that loads after template_loaded, I tried that:

    add_action('template_loaded', 'members_only_init');

    Still didn’t work, so I even tried to go to the very first loaded action!

    add_action('plugins_loaded', 'members_only_init');

    Changing priority on any of these doesn’t help.

    Afraid to say that it must be something else that is trumping my plugin from loading. It works on pages that bp_catch_uri isn’t loading including the main home page, any actual blog link (off the “news” page) and all blog pages on the network. Just not the BP pages.

    Plugin in question if you want to look at it is:

    http://wordpress.org/extend/plugins/members-only/

    If anyone has a clue on this, let me know!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Avatar of Burt Adsit
    Burt Adsit
    Participant

    @burtadsit

    Lemme go take a look at this Trent.

    (10 min later) Oh. I see what you mean. Going to look at how this little goodie works. :)

    (15 min later than the previous later) Try this Trent. It seems to work:

    add_action('template_redirect', 'members_only',1); On line number 662. Setting the priority to ‘1’ allows this plugin to sneak in before add_action( 'template_redirect', 'bp_core_do_catch_uri', 2 ); which lives at priority ‘2’.

    Thanks Burt…I am an idiot! I was adding priority to even single action, but forget the first one….the template redirect for the main plugin file… :)

    Thanks,

    Trent

    Avatar of Burt Adsit
    Burt Adsit
    Participant

    @burtadsit

    Sometimes it just takes a different pair of eyes.

    Avatar of Joss Winn
    Joss Winn
    Participant

    @josswinn

    Thanks, Burt and Trent, for posting this. Really, really helpful when you have to create a private social network, as I do, at a university.

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

The topic ‘Plugin Initialization on BP Links’ is closed to new replies.