Skip to:
Content
Pages
Categories
Search
Top
Bottom

Conditional bp_register_group_extension – how?


  • dpolant
    Participant

    @dpolant

    I am trying to only register my groups extension if the user is a site admin. My problem is that bp_register_group_extension doesn’t want to run inside functions or if statements. I’ve tried putting it in functions that hook to wp, init and plugins_loaded but nothing seems to work.

    Any ideas?

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

  • Anonymous User 96400
    Inactive

    @anonymized-96400

    You could do something like this instead of your normal registration function:

    function activate_extension()
    {
    global $bp;
    if( is_site_admin() )
    {
    $extension = new Your_Group_Extension_Class_Name;
    add_action( "wp", array( &$extension, "_register" ), 2 );
    }
    }
    add_action( 'plugins_loaded', 'activate_extension' );


    dpolant
    Participant

    @dpolant

    Good call. I need to learn more about some of the things add_action can do.

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Conditional bp_register_group_extension – how?’ is closed to new replies.
Skip to toolbar