Skip to:
Content
Pages
Categories
Search
Top
Bottom

”Create a Group” button only allow admin to see

  • Hi everyone I was wondering which bp/wp permission function needs to be called in order to hide the “Create a Group” button on a group for regular users and make it visible for admins

    in my index.php in wp-content/themes/bp-addata/groups/

    i have tried adding is_super_admin() around line 6 but the button is not available for any users at this point. I might be making it harder than what I am trying to accomplish. sorry for the sloppy posting of code, i still don’t know how to post on these forums. Basically i just need to know which condition I need for the if statement to show the a href button.

    if ( is_user_logged_in() && is_super_admin() ) Group button endif;

    Thank you for any help,

Viewing 10 replies - 1 through 10 (of 10 total)
  • Avatar of Nm
    nm
    Participant

    @nahummadrid

    removing the button from the groups index page alone will not stop your members from being able to create groups…

    have you seen this…to limit group creation to admins

    http://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/limit-group-creation-to-admin/

    If you just want to hide the button…maybe something like

    `<?php if (is_user_logged_in() && current_user_can('administrator')):?>
    your button stuff
    `

    Avatar of @modemlooper
    @modemlooper
    Moderator

    @modemlooper

    No need for this hack anymore as there is an option in he BuddyPress admin to limit group creation

    Thanks for the replys, @nahummadrid i’ll try that and let you know if that works. How else can they create a group? I’ve done a lot of mods and made my version very simple and locked out a bunch of items and screens.

    @modemlooper I’m using an older version of bp 1.2.9 because I needed the universal search with highlighting that i wrote. I could not get unified searching to work with 1.5.1. Also I was told by the bp developers that site wide forum notifications do not post on activity as well on 1.5.1 which I need. If you know a way for unified search to work on 1.5.1 I’m all ears. thanks again :)

    @nahummadrid that did the trick. Thank you,

    I forgot to post my test url

    http://chr313.powweb.com/1.2.9/

    Avatar of Nm
    nm
    Participant

    @nahummadrid

    by going directly to the /groups/create page url….would be a way that they could access creating a group.

    yep there it is in the settings of bp… Restrict page creation to Site Admins? Yes/No — that should do it if you’re running in default mode.

    i have other variables to consider when letting users create groups like achievements and roles….so I must have been blinded to that setting….hehe

    @nahummadrid i see, our user base will not know that url so i think were safe there. I don’t see that setting under bp, I’m guessing only on the newer version?

    download the older version of restrict group creation – that should work on 1.2.9

    @etivite thank you. I will try that out.

    try v0.3.0 – it will remove the direct link access as well

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

You must be logged in to reply to this topic.