Creating a new group based on gf field

I have a GF developer license with the following add-ons loaded: User Registration , Stripe, Post Creation, and of course, ItThinx Groups.

With this combination, is it possible if a new user enrols in a premium membership and creates and names their own “Group” (a custom post type), that the itThinx plugin can create a new group and apply it to their registration?
I am aware of

if ( !Groups_Group::read_by_name( $shed ) ) {
$group_id = Groups_Group::create( array( ‘name’ => $shed ) );
}

but I don’t know how to use this in conjunction with the GF plugin.

Thanks,
Torben


Comments

One response to “Creating a new group based on gf field”

  1. Hi Torben,

    Welcome to our support forum.

    What you can use is one of the GF hooks provided, but this depends on the event occurring that you wish to add the user to the user-defined group. For example, if this is only when the user registers, then the action hook gform_user_registered should be enough. Otherwise you should also check the GF documentation for dedicated hooks after a payment has occurred. Each payment method provides its own hooks when a payment is completed.

    Kind regards,
    George

Share