Admin::saveGroupSyncMetaBox( $groupId )
Save group sync metabox value when bp group is saved from admin
Description
Source
File: bp-integrations/learndash/buddypress/Admin.php
public function saveGroupSyncMetaBox($groupId)
{
// created from backend
if (bp_ld_sync()->isRequestExists('bp-ld-sync-enable') && ! bp_ld_sync()->getRequest('bp-ld-sync-enable')) {
bp_ld_sync('buddypress')->sync->generator($groupId)->desyncFromLearndash();
return false;
}
$newGroup = bp_ld_sync()->getRequest('bp-ld-sync-id', null);
$generator = bp_ld_sync('buddypress')->sync->generator($groupId);
if ($generator->hasLdGroup() && $generator->getLdGroupId() == $newGroup) {
return false;
}
$generator->associateToLearndash($newGroup)
->syncBpAdmins()
->syncBpMods()
->syncBpUsers();
}
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.