Sync::onGroupCreate( $groupId )
Run the sync when new group is created
Description
Source
File: bp-integrations/learndash/buddypress/Sync.php
public function onGroupCreate($groupId)
{
if (! $this->preCheck()) {
return;
}
$settings = bp_ld_sync('settings');
// on the group creation first step, and create tab is enabled, we create sync group in later step
if ('group-details' == bp_get_groups_current_create_step() && $settings->get('buddypress.show_in_bp_create')) {
return false;
}
// if auto sync is turn off
if (! $settings->get('buddypress.default_auto_sync')) {
return false;
}
// admin is added BEFORE this hook is called, so we need to manually sync admin
// src/bp-groups/bp-groups-functions.php:194
$this->generator($groupId)->associateToLearndash()->syncBpAdmins();
}
Changelog
| Version | Description |
|---|---|
| BuddyBoss 1.0.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.