Created groups with plugin not counted in the Group List
-
Hello! 🙂
I am using a code (see below) to create groups.
However they are not counted as groups so pages are not displaying correctly in the Group List.
Created groups with this code are displaying well in the group list BUT as they are not counted as groups, most of them are “in invisible pages”.See screenshot:
I am using this code to create groups (http://danpolant.com/how-to-create-groups-in-buddypress-with-php/ )
function create_a_group() { $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’; $new_group -> save(); groups_update_groupmeta( $new_group->id, ‘total_member_count’, 1 ); groups_update_groupmeta( $new_group->id, ‘last_activity’, time() ); groups_update_groupmeta( $new_group->id, ‘theme’, ‘buddypress’ ); groups_update_groupmeta( $new_group->id, ‘stylesheet’, ‘buddypress’ ); groups_update_groupmeta( $new_group->id, ‘invite_status’, ‘members’ ); }
What is wrong with this code? Does it miss adding a meta somewhere to show up newly created groups in the groups list?
Thank you very much 🙂
and sorry for my bad english… :S
Dor
- The topic ‘Created groups with plugin not counted in the Group List’ is closed to new replies.