WordPress core and third-party plugins can trigger events during the execution of their respective code. When you call add_action
on um_members_just_after_name
, you’re saying: Whenever this um_members_just_after_name
action runs, go ahead and run my function my_members_after_user_name
, too. That said, $user_id
must be supplied by um_members_just_after_name
, in other words, if um_members_just_after_name
doesn’t exist or doesn’t supply $user_id
, it will never be set– it’s not something you can set unless you are the creator of the um_members_just_after_name
action.