• Hello AntoineH,

    Me again, i use a form builder to make registration because i want to webhook data in google sheet.
    Everything is ok except i can’t force the League in the “Pool Users Admin” so user can play before an admin moderate the “Play in league”.
    I tried the filter :

    add_filter( ‘footballpool_new_user’, function( $user_id, $league_id ) {
    Football_Pool::update_user_custom_tables( $user_id, $league_id );
    }, null, 2 );

    But it seems is doing great only in native wp registration.
    What can i put on my custom action to force the update_user_custom_tables with the field fulfilled by my user at registration…
    Do you have an idea ?
    Thx

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter popsantiago

    (@popsantiago)

    Hello Antoine,

    I did that and it seems working.
    Is it ok ?

    add_action('fluentform/user_registration_completed', function ($userId, $feed, $entry, $form)
    {
    	$user_inputs = $entry->user_inputs;
    	// Prepare data to insert
    	$user_id = $userId;
    	$league_id = $user_inputs['league'];
    	// Check if the class exists
    	if (class_exists('Football_Pool_Pool')) {	
    		$football_pool = new Football_Pool_Pool();
    		$football_pool->update_league_for_user($user_id, $league_id, 'update league');
    	}
    }, 10, 4);
    Plugin Author AntoineH

    (@antoineh)

    Yes, looks okay.

    Thread Starter popsantiago

    (@popsantiago)

    All right thx.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Custom Registration Form > Force the League from Fields’ is closed to new replies.