Buddypress Groups Send E-mail
-
Hello there,
I found the Buddypress function pretty amazing, but it was only working for 1 single group. If a user is a member of many groups, the query returns only the first row.
For this, I have used the below code and it is working to pull every group:
Just replace that on the wp-email-users.php file, on the form build section.
if(isset($weu_arconf_buff[‘weu_arconfig_buddypress’]) && $weu_arconf_buff[‘weu_arconfig_buddypress’]==’yes’)
{
$table_name = $wpdb->prefix.’bp_groups_members’;$group_id = $wpdb->get_results( “SELECT group_id FROM $table_name WHERE is_confirmed = ‘1’ and user_id=”.$user->ID );
echo ‘<td>
- ‘;
- ‘ . $myrows . ‘
foreach ($group_id as $group_id_2) {
$group3 = $group_id_2->group_id;
$table_name = $wpdb->prefix.’bp_groups’;
$myrows = $wpdb->get_var( “SELECT name FROM $table_name WHERE id =”.$group3 );echo ‘
‘; }
echo ‘</td>’;
} else {
echo ‘<td>–</td>’;
}
- The topic ‘Buddypress Groups Send E-mail’ is closed to new replies.