Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have created a site where new users are required to create a new group. I'm working with the rules module and I want to create a condition where by if the current user has not yet created a group, they are redirected to a certain page.
So my question is, what php snippet would return either the number of groups created by the current user, or a true/false value based on whether the current user has created a group or not.
Comments
Comment #1
Grayside CreditAttribution: Grayside commentedThat should be enough to get you going.
Comment #3
amitaibuGenerally, it's better to user_load() the user so if it's cached already you don't hit the db again.
Comment #4
Grayside CreditAttribution: Grayside commenteduser_load() does not have a static cache in D6... yeah.