cannot create group programmatically
-
I wrote the following function, but i still can’t create a group. I’ve made sure that the function is getting called, so that is not the issue
function start_a_new_group($profile_id, $status) {
if ( !function_exists( ‘groups_create_group’ ) ) {
require_once ‘/bp-groups/bp-groups-functions.php’;
}$defaults = array(
‘group_id’ => $profile_id,
‘creator_id’ => get_current_user_id(),
‘name’ => ”,
‘description’ => ”,
‘slug’ => ”,
‘status’ => $status,
‘enable_forum’ => 0,
‘date_created’ => bp_core_current_time()
);
return groups_create_group($defaults);
}Wordpress version 5.8.2
Buddypress verion 9.1.1
Theme is Twenty TwentyAny ideas?
- You must be logged in to reply to this topic.