Created
September 9, 2014 13:41
-
-
Save bappi-d-great/3410541d56bca39e2255 to your computer and use it in GitHub Desktop.
Add all users in a buddypress group
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Needs php greatet than 5.3 | |
* | |
* (not for all, written for special purpose) | |
*/ | |
add_action('load-users.php',function() { | |
if(isset($_GET['action']) && isset($_GET['bp_gid']) && isset($_GET['users'])) { | |
$group_id = $_GET['bp_gid']; | |
$users = $_GET['users']; | |
foreach ($users as $user_id) { | |
groups_join_group( $group_id, $user_id ); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment