automattic / buddypress-auto-group-join-request
Automatically sends join requests to BuddyPress groups based on user profile field values.
Installs: 4
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Type:wordpress-plugin
Requires
- php: >=8.2
- composer/installers: ^2
Requires (Dev)
This package is auto-updated.
Last update: 2025-05-12 11:44:06 UTC
README
Contributors: garyj
Tags: BuddyPress, BuddyBoss, groups, automatic join requests, profile fields
Requires at least: 6.6
Tested up to: 6.8
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Automatically sends join requests to BuddyPress groups based on any profile field value.
Description
This plugin automatically sends join requests to BuddyPress groups when users have specific profile field values. It's particularly useful for:
- Automatically adding users to relevant groups based on any profile field (name, location, interests, profile type, etc.)
- Streamlining the group membership process
- Ensuring users are connected to the right communities based on their profile information
The plugin integrates with BuddyPress/BuddyBoss's profile fields and group management to provide a seamless user experience.
Features
- Automatic group join requests based on any profile field value
- Configurable profile-field-to-group mapping
- Handles multiple group configurations
- Prevents duplicate requests
- Logs all actions for troubleshooting
Installation
- Upload the
buddypress-auto-group-join-request
folder to the/wp-content/plugins/
directory - Activate the plugin through the 'Plugins' menu in WordPress
- Configure the profile-field-to-group mapping (see Configuration section below)
Configuration
The plugin uses a simple array-based configuration for mapping profile field values to groups. Add the following code to your theme's functions.php
file or in a custom plugin:
add_filter( 'bp_auto_group_join_config', function( $config ) { // Example 1: Add users with profile type "Partner" to group 2 $config['partners'] = array( 'profile_field_name' => 'Profile Type', 'profile_field_value' => 47, 'group_id' => 2, ); // Example 2: Add users named "Dave" to group 3 $config['daves'] = array( 'profile_field_name' => 'Name', 'profile_field_value' => 'Dave', 'group_id' => 3, ); return $config; } );
Finding the Required Values
-
Profile Field Name:
- Go to BuddyPress → Settings → Profile Fields
- Find the field you want to use
- The name is exactly as shown in the admin interface
-
Profile Field Value:
- In the same Profile Fields section
- For dropdown/radio/checkbox fields, the value is the ID of the option
- For text fields, use the exact text value
- For name fields, use the exact name as it appears in the profile
-
Group ID:
- Go to the group's page in wp-admin
- Look at the URL - it will contain something like
group_id=123
- The number is your group ID
You can add multiple configurations by adding more entries to the $config
array:
$config['partner'] = array( 'profile_field_name' => 'Profile Type', 'profile_field_value' => 47, 'group_id' => 2, ); $config['student'] = array( 'profile_field_name' => 'Profile Type', 'profile_field_value' => 48, 'group_id' => 3, ); $config['daves'] = array( 'profile_field_name' => 'Name', 'profile_field_value' => 'Dave', 'group_id' => 4, );
Requirements
- WordPress 6.6 or higher
- BuddyPress or BuddyBoss Platform
- Member types and profile fields configured in BuddyPress/BuddyBoss
- Groups created in BuddyPress/BuddyBoss
Troubleshooting
The plugin logs all actions to the WordPress error log. If something isn't working as expected:
- Check your WordPress error log
- Verify the profile field name matches exactly
- Confirm the profile field value is correct
- Ensure the group ID exists
- Check that the user isn't already a member or has a pending request
Changelog
See CHANGELOG.md for a complete list of changes.
License
This plugin is licensed under the GPLv2 or later. See LICENSE for details.