I’m trying to use wordpress’ add_query_arg function to add multiple queries to my url.
I can successfully add one query as follows:
esc_url(add_query_arg( 'booking-id', $the_query->post->ID, site_url( '/booking-form/' ) ))
However, I want my URL to read something like: www.yoursite.com/booking-form/?booking-id=xxx&user-id=xxx
How can I add a second query in to the existing function?
Take a look at the official help on the function: https://developer.wordpress.org/reference/functions/add_query_arg/
So for your example….
Where $userID is your user ID value (however you wish to get this)
I referred add_query_arg code reference and written this, I hope this will be helpful, please try and let me know.