wordpress add_query_arg how to add multiple queries to URL

Take a look at the official help on the function: https://developer.wordpress.org/reference/functions/add_query_arg/

// Parameters as array of key => value pairs
add_query_arg( array('key1' => 'value1', ...), $old_query_or_uri );

So for your example….

add_query_arg( array('booking-id' => $the_query->post->ID, 
  'user-id' => $userID),
  site_url( '/booking-form/' ) 
);

Where $userID is your user ID value (however you wish to get this)

Leave a Comment