How to filter the names of new groups during group creation?
-
WP-3.5.2 BP-1.8 Site-http://mikestumpf.com/mu-cbox/
Hello,
I am trying to make a simple function to filter out “bad” group names and names that are already taken, similar to the filtering done when creating a group blog, but I cannot make sense of the BuddyPress-specific pieces of the code.
I have the files I probably need narrowed down to:
…/wp-content/plugins/buddypress/bp-themes/bp-default/groups/create.php (for inserting the function call)
&
…/wp-content/plugins/buddypress/bp-themes/bp-default/groups/groups-loop.php (for using the methods for retrieving groups, like on the Group Directory page)I am stuck on finding where exactly in the code the group is being created and making sense of calls like: ” do_action( ‘bp_after_group_details_creation_step’ );” in create.php.
Currently, when groups are created with the same name, the second group has a “-” and a string of number appended to it. I cannot find where this is happening in the code either.
Can anybody help me with this?
Here is what I have of the function so far:
// Validate new group name function group_name_check($groupNameToCheck) { while (bp_groups() ) : bp_the_group(); if(bp_get_group_name() = $groupNameToCheck) { $error = "something here" } endif; return $error; endwhile; }
- The topic ‘How to filter the names of new groups during group creation?’ is closed to new replies.