Skip to:
Content
Pages
Categories
Search
Top
Bottom

a script to allow site admins to join any group

  • Profile photo of Dwenaus
    Dwenaus
    Participant

    @dwenaus

    I found it strange that site admins could alter the admin settings of any group, but they can’t join any group. The script below creates a new join button for logged in site admins (super admins) right beside the other button. The new button only appears if the group is private or hidden and they are not a member.

    `// creates a new join button to allow site admins to join any group
    function my_site_admin_group_join_button( $group = false ) {
    global $bp, $groups_template;

    if ( !$group )
    $group =& $groups_template->group;

    // leave if they’re not super admin
    if ( !$bp->loggedin_user->is_site_admin )
    return false;

    if ( !$group->is_member && $group->status != ‘public’ )
    echo ‘

    ‘;

    }
    add_action( ‘bp_group_header_meta’, ‘my_site_admin_group_join_button’, 1);`

    i hope someone finds it helpful.

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘a script to allow site admins to join any group’ is closed to new replies.
Skip to toolbar