BP_LearnDash_Admin_Integration_Tab::registerBuddypressSettings()
Register Buddypress related settings
Description
Source
File: bp-integrations/learndash/bp-admin-learndash-tab.php
public function registerBuddypressSettings() {
$this->current_section = 'buddypress';
$this->add_section(
'bp_ld_sync-buddypress',
__('Social groups <span>→ LearnDash groups</span>', 'buddyboss')
);
$this->add_checkbox_field(
'enabled',
__('Social Group Sync', 'buddyboss'),
[
'input_text' => sprintf(
__('Enable group sync functionality <b>FROM</b> <a href="%s">BuddyBoss Social Groups</a> <b>TO</b> <a href="%s">LearnDash Groups</a>', 'buddyboss'),
add_query_arg([
'page' => 'bp-groups',
], admin_url('admin.php')),
add_query_arg([
'post_type' => 'groups',
], admin_url('edit.php'))
),
'input_run_js' => 'buddypress_enabled',
]
);
$this->add_checkbox_field(
'show_in_bp_create',
__('Create LearnDash Group', 'buddyboss'),
[
'input_text' => __('Allow social group organizers to create associated LearnDash groups during the group creation process', 'buddyboss'),
'input_run_js' => 'buddypress_show_in_bp_create',
'class' => 'js-show-on-buddypress_enabled',
]
);
$this->add_checkbox_field(
'show_in_bp_manage',
__('Manage LearnDash Group', 'buddyboss'),
[
'input_text' => __('Allow social group organizers to manage associated LearnDash groups after the group creation process', 'buddyboss'),
'class' => 'js-show-on-buddypress_enabled',
]
);
$this->add_select_field(
'tab_access',
__('Course Tab Visibility', 'buddyboss'),
[
'input_options' => [
'anyone' => __('Anyone', 'buddyboss'),
'loggedin' => __('Loggedin Users', 'buddyboss'),
'member' => __('Group Members', 'buddyboss'),
'noone' => __('No one', 'buddyboss'),
],
'input_default' => 'admin',
'input_description' => __('Select who can see the course tab in social groups', 'buddyboss'),
'class' => 'js-show-on-buddypress_enabled',
]
);
$this->add_checkbox_field(
'default_auto_sync',
__('Auto Create LearnDash Group', 'buddyboss'),
[
'input_text' => __('Automatically create and associate a LearnDash group upon creation', 'buddyboss'),
'input_description' => __('Required if you want an associated LearnDash group, and course tab is disabled during creation', 'buddyboss'),
'class' => 'js-show-on-buddypress_enabled',
]
);
$this->add_checkbox_field(
'delete_ld_on_delete',
__('Auto Delete LearnDash Group', 'buddyboss'),
[
'input_text' => __('Automatically delete the associated LearnDash group when the social group is deleted', 'buddyboss'),
'input_description' => __('Uncheck this to delete the group manually', 'buddyboss'),
'class' => 'js-show-on-buddypress_enabled',
]
);
$this->add_select_field(
'default_admin_sync_to',
__('Sync Organizers', 'buddyboss'),
[
'input_options' => [
'admin' => __('Group Leader', 'buddyboss'),
'user' => __('Group User', 'buddyboss'),
'none' => __('None', 'buddyboss'),
],
'input_default' => 'admin',
'input_description' => __('Social group "Organizers" will be assigned to the above role in LearnDash groups', 'buddyboss'),
'class' => 'js-show-on-buddypress_enabled',
]
);
$this->add_select_field(
'default_mod_sync_to',
__('Sync Moderators', 'buddyboss'),
[
'input_options' => [
'admin' => __('Group Leader', 'buddyboss'),
'user' => __('Group User', 'buddyboss'),
'none' => __('None', 'buddyboss'),
],
'input_default' => 'admin',
'input_description' => __('Social group "Moderators" will be assigned to the above role in LearnDash groups', 'buddyboss'),
'class' => 'js-show-on-buddypress_enabled',
]
);
$this->add_select_field(
'default_user_sync_to',
__('Sync Members', 'buddyboss'),
[
'input_options' => [
'user' => __('Group User', 'buddyboss'),
'none' => __('None', 'buddyboss'),
],
'input_default' => 'user',
'input_description' => __('Social group "Members" will be assigned to the above role in LearnDash groups', 'buddyboss'),
'class' => 'js-show-on-buddypress_enabled',
]
);
// Register View Tutorial button.
$this->add_field( 'bp-privacy-tutorial-bb-to-ld-sync','', [$this, 'bp_privacy_tutorial_bb_to_ld_sync' ] );
}
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.