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

One Response to Creating a new group based on gf field

  1. George November 20, 2023 at 5:54 pm #

    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

We use cookies to optimize your experience on our site and assume you're OK with that if you stay.
OK, hide this message.

Affiliates · Contact · Jobs · Terms & Conditions · Privacy Policy · Documentation · Downloads · Useful Plugins · My Account

Share