Re: Group Administration
I found the answer with:
https://buddypress.org/forums/topic/how-do-i-disable-members-from-creating-groups
This is how it goes.
You ned to edit your child template.
Using the “BuddyPress Template Pack” plugin, or using the instruction in http://irishpinkadoptions.com/wp-content/themes/dkret3/readme.html#filters you have created a child theme.
You can find the files in: /site/wp-content/themes/<your theme>/groups/
You can edit 2 files:
– index.php to remove the button to create group
– create.php so peopel cannot just go and use the goup/create shortcut.
The idea is that you need to be logged in and “&& current_user_can(‘level_10’)” to be allowed to do soemthimg.
INDEX.PHP before the modif:
<form action="" method="post" id="groups-directory-form" class="dir-form">
<h3><?php _e( 'Groups Directory', 'buddypress' ) ?><?php if ( is_user_logged_in()) : ?> Â <a class="button" href="<?php echo bp_get_root_domain() . '/' . BP_GROUPS_SLUG . '/create/' ?>"><?php _e( 'Create a Group', 'buddypress' ) ?></a><?php endif; ?></h3>
INDEX.PHP after the modif:
<form action="" method="post" id="groups-directory-form" class="dir-form">
<h3><?php _e( 'Groups Directory', 'buddypress' ) ?><?php if ( is_user_logged_in() && current_user_can('level_10')) : ?> Â <a class="button" href="<?php echo bp_get_root_domain() . '/' . BP_GROUPS_SLUG . '/create/' ?>"><?php _e( 'Create a Group', 'buddypress' ) ?></a><?php endif; ?></h3>
CREATE.PHP before
<?php if ( is_user_logged_in() ) : ?>
<form action="<?php bp_group_creation_form_action() ?>" method="post" id="create-group-form" class="standard-form" enctype="multipart/form-data">
......
...very long form...
......
<?php do_action( 'bp_after_create_group' ) ?>
</form>
<?php endif; ?>
CREATE.PHP after
<?php if ( is_user_logged_in() && current_user_can('level_10')) : ?>
<form action="<?php bp_group_creation_form_action() ?>" method="post" id="create-group-form" class="standard-form" enctype="multipart/form-data">
......
...very long form...
......
<?php do_action( 'bp_after_create_group' ) ?>
</form>
<?php endif; ?>
<?php if ( is_user_logged_in() && !current_user_can('level_10')) : ?>
<?php echo '<h3>You do not have authority. And it is not nice to trying to break into the code... it makes the code cry.<h3>'; ?>
<?php endif; ?>