Private variables don’t work with rewrite rules
-
Hi,
it seems that private (= user defined) variables are excluded from rewriting.this code:
//testing code for Polyglot plugin
add_filter('rewrite_rules_array', 'polyglot_generate_rewrite');$polyglot_rewrite_tag = '%lang%';
$polyglot_query_var = 'lp_lang_view';
$polyglot_link_base = 'lang';function polyglot_generate_rewrite($rewrite) {
global $polyglot_rewrite_tag, $polyglot_query_var, $polyglot_link_base,$wp_rewrite;$wp_rewrite->add_rewrite_tag($polyglot_rewrite_tag, '([^/]{2,2})', "{$polyglot_query_var}=");
$structure = $wp_rewrite->root . $polyglot_link_base . "/{$polyglot_rewrite_tag}/%post_id%";
$rules = $wp_rewrite->generate_rewrite_rule($structure);return ($rules + $rewrite);
}creates proper rules in $wp_rewrite object and they work but varible $_REQUEST[‘lp_lang_view’] is not set:( Is it bug? Do you know any workaround?
- The topic ‘Private variables don’t work with rewrite rules’ is closed to new replies.