Skip to:
Content
Pages
Categories
Search
Top
Bottom

Restricting Group names.


  • johnnetr
    Participant

    @johnnetr

    Hi, How to restrict group name? If there is already I group name taken, another person cannot use that name to create a new group. This is a problematic for my site. People are creating group name with exact same name.

    Any suggestion? Thank you in advance.

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

  • shanebp
    Moderator

    @shanebp

    It should be easier, and maybe it is…

    Try: [ see new gist url below ]


    valuser
    Participant

    @valuser

    Is really needed.

    Many Thanks for this @shanebp.

    However if other plugins (relating to groups) say for example (i have tested!) bp group reviews, email subscription,group blog etc etc

    this display comes up again “That name is already being used. Please use a different name.”

    when it shouldn’t

    So

    Create Group (with duplicate name)

    input name

    Create Group

    the display comes up “That name is already being used. Please use a different name.”

    brilliant!

    in new form

    input new name (non duplicate)

    Create Group

    new name accepted (and group IS created)

    next panel (https://i.imgur.com/cBbPIH0.jpg)

    click Enable group reveiws
    click Enable Gallery

    click Next Step

    BUT
    form is returned again with “That name is already being used. Please use a different name.”

    https://i.imgur.com/cBbPIH0.jpg with panels now unclicked


    @shanebp
    Really appreciate your efforts with this and hope they continue but frankly i think this should be a core function.

    Avoiding duplicates (usernames, blognames, groupnames, members email addresses, etc etc) surely is core????


    shanebp
    Moderator

    @shanebp

    I’ve deleted that gist and added a new one:
    https://gist.github.com/shanebp/72a0c6fe7ffb6f9c1424a30bdb455d4f

    It should only check for duplicate names if on the first tab – ‘Details’.

    You can always create a ticket asking for a change to core files.


    johnnetr
    Participant

    @johnnetr

    Awesome! Sorry, I am new to wordpress and php development. Zero knowledge.

    The code that you posted, should I copy and paste in an existing php file? or should I create a new php file and put it in the buddypress folder?

    Thanks!


    shanebp
    Moderator

    @shanebp

    You can put it in your theme/functions.php or in bp-custom.php.


    valuser
    Participant

    @valuser

    Many Thanks @shanebp. Works. Ticket


    peppo90
    Participant

    @peppo90

    Hi I know this is an old conversation, but the code has a little problem, if the name is the same but with a maiusc letter different for the function is ok and the user can to create group with same name.
    How can I fix this?

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.
Skip to toolbar