I’ve read this post
http://wordpress.org/support/topic/query-vars-in-admin
and although it’s quite an old question, it suits me perfectly. I’m trying to accomplish what I already posted here:
Rewrite rule for admin-ajax.php
But in the code below, only the first filter gets called while in wp-admin:
add_action('init', array('MYCLASS', 'add_custom_rewrite_rules'), 10, 1);
add_action('query_vars', array('MYCLASS', 'add_custom_query_vars'), 10, 1);
add_action('parse_request', array('MYCLASS', 'add_custom_parse_request'), 10, 1);
I can’t get this to work. It seems the two last filters are not called while navigating inside wp-admin. Is that true? How can I get around this?
I think this does what you’re trying to achieve. Regarding multisite 404s, you have to flush rewrite rules on every site within multisite where you want this rule to get added. A quick method for testing purposes is to visit the permalinks settings page for each site you’re testing. Also note, I removed the
.php
extension from your rule. I think you’ll otherwise get strange behavior –REQUEST
will curiously be an empty array.