Sync::onGroupCreate( $groupId )

Run the sync when new group is created

Description

Source

File: bp-integrations/learndash/buddypress/Sync.php

71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
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

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.