Use WordPress add_query_arg function to build URL.