Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] BP_Group_Extension For Single Group?

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

  • shanebp
    Moderator

    @shanebp

    Which file are you using to load the extensions?

    If it’s a plugin, have you tried a simple include based on whether the group in question is being viewed?

    Maybe using something like:

    if ( bp_is_groups_component() && 'my-group' == bp_current_item() ) :


    coreymcollins
    Participant

    @coreymcollins

    I came across this post which helped a bit: https://buddypress.org/support/topic/conditional-bp_register_group_extension-how/

    I updated my gist above to reflect that, and I now have new pages added ONLY to the specific group ID I specified. Awesome!


    shanebp
    Moderator

    @shanebp

    Cool, a 4 year old thread that is still useful.

    minor stuff:
    You don’t need the $bp global
    I’d put the foreach in the ‘if ( $group_id == 1 )’ conditional

    I’m a bit surprised that it runs on ‘init’ rather than bp_loaded or bp_init because init seems very early – but the load order in some situations still surprises me.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] BP_Group_Extension For Single Group?’ is closed to new replies.
Skip to toolbar