For the case mentioned, I have decided to create forms for the registration of users where I define the league and in this way the user does not see or choose the league, which was the point that interested me and I was able to solve.
Now when users register I can see in the plugin that the value “footballpool_registeredforleague” is working fine although I can’t get it to activate in the league and it requires admin approval.
I used the following snippets shared by you in the help section but it only works if they use the native wordpress registration and not with the form that I created.
<?php
// don't use admin approval for league registration of new users
// just put them in the league they chose
add_filter( 'footballpool_new_user', function( $user_id, $league_id ) {
Football_Pool::update_user_custom_tables( $user_id, $league_id );
}, null, 2 );
?>
I tried changing the second parameter ($league_id) to $user_footballpool_registeredforleague, but it doesn’t work for me either… could you help me just assign this parameter and avoid having to manually approve league registrations?
Thank you very much!