Can’t add external rewrites
First off, don’t ever do this: add_action(‘init’, ‘flush_rewrite_rules’); Every time WordPress loads, you are going to flush the rewrite rules. You only need to do this once to make sure your rewrite shows up. Second, add_rewrite_tag only takes two arguments, the tag and the regex. If you want to specify a query variable directly, you’ll … Read more