-
-
Save toluaddy/bc88c70754b143f1e2aff4c7c252437f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$new_group = new BP_Groups_Group; | |
$new_group->creator_id = 1; | |
$new_group->name = 'test'; | |
$new_group->slug = 'test'; | |
$new_group->description = 'nothing'; | |
$new_group->news = 'whatever'; | |
$new_group->status = 'public'; | |
$new_group->is_invitation_only = 1; | |
$new_group->enable_wire = 1; | |
$new_group->enable_forum = 1; | |
$new_group->enable_photos = 1; | |
$new_group->photos_admin_only = 1; | |
$new_group->date_created = current_time('mysql'); | |
$new_group->total_member_count = 1; | |
$new_group->avatar_thumb = 'some kind of path'; | |
$new_group->avatar_full = 'some kind of path'; | |
$saved = $new_group -> save(); | |
if ( $saved ) { | |
$id = $new_group->id; | |
groups_update_groupmeta( $id, 'total_member_count', 1 ); | |
groups_update_groupmeta( $id, 'last_activity', time() ); | |
groups_update_groupmeta( $id, 'theme', 'buddypress' ); | |
groups_update_groupmeta( $id, 'stylesheet', 'buddypress' ); | |
} else { | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment