bp_has_groups() function doesn’t recognize the slug parameter
-
Hi everyone,
I’m trying to set up a conditional statement like the following: If member is in group-1, then display this data. I’m trying to accomplish this using the bp_has_groups() function, but the ‘slug’ paramater is being ignored. (I found this ticket, so maybe I’m doing something wrong http://buddypress.trac.wordpress.org/ticket/2698).
Here’s my code:
`
<?phpglobal $current_user;
get_currentuserinfo();$arrrr = array(
‘slug’ => ‘gibberish’,
‘max’ => ‘1’,
‘user_id’ => $current_user->ID
);if ( bp_has_groups ( $arrrr ) ) {
echo ‘Your ID is ‘ . ($current_user->ID );
echo ‘
Yarrr matey!
‘;
echo bp_groups_pagination_count() . “
“;
} else {
echo ‘you’re not a member of this group
‘;
}
?>
`
There is no such slug as “gibberish” and the if statement always returns true no matter what I pass in for the slug. Any suggestions?Thanks!
- The topic ‘bp_has_groups() function doesn’t recognize the slug parameter’ is closed to new replies.