Basically I have a large part of the plugin dedicated to taking routes like { language }/audiobooks/stories, translating them, and generating the regex needed for add_rewrite_rule.
This is all due to a pretty complex home-grown routing system... You wouldn't know of any good examples of other people abstracting routing in a WordPress plugin?
That was it. I was already filtering the redirect, and I wasn't including the query string in what I returned. I feel like I've overcomplicated my solution. =P
Any tips on preventing a rewrite rule from removing a query var? I've got a rewrite rule for /the/page, but visiting /the/page?my_var=value ends up at just /the/page without the query string.
Two different URLs, the correct rewrite rule is matched in both cases, and the correct query strings are generated. But with one URL page_id isn't included in the query, so the page isn't found, while with the other URL it is included and the page loads properly.
Quick question: Developing a plugin, and need to know in php whether the plugin is currently in my dev environment or not, so I can toggle Twig caching accordingly. What's the best way to do that?