Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author itthinx

    (@itthinx)

    Thread Starter rthakrar

    (@rthakrar)

    Thanks, @itthinx.

    I’m not very good with PHP objects, so went for the ‘long but simple’ route.

    $userid = $current_user->ID;
    
    $user = new Groups_User( $userid );
    $groups = $user->__get( 'groups' );
    
    $gr1 = (get_object_vars($groups[1]));
    $gr2 = (get_object_vars($gr1[group]));
    
    if ($gr2 != "Team members" && $gr2 != "Associates")
    {
    	wp_die('This function is only for Team members and Associates.  Would you like to <a href="'.wp_logout_url( $redirect ).'">log in as another user</a>?');
    }

    Thanks again,

    R

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Groups] Is there a PHP function like get_user_group()?’ is closed to new replies.