query_vars doesn’t return query string (trying to get data from $wpdb)
I think the issue may be that you think query_vars can pick up the query string arguments from a URL, but you don’t need to do it that way. That’s primarily used if you’re needing to get this into the WP Query (which isn’t what you’re doing here). It’s much easier to simply check for … Read more