Thanks to Kaiser for pointing me in the right direction:
I scrapped the agents_permalinks function and went for this for the redirect and it works as intended:
wp_redirect (home_url('agents/agent-profile/' . ($user_id))); exit;
Thanks to Kaiser for pointing me in the right direction:
I scrapped the agents_permalinks function and went for this for the redirect and it works as intended:
wp_redirect (home_url('agents/agent-profile/' . ($user_id))); exit;