problem with query_vars
-
I seem to be having a problem with query vars and 3.0. In the past, I used a few filters to add a custom query variable. Now, the custom rewrite rule is confirmed to be there, but WordPress redirects straight back to the category in this case.
Example
path category/products
adding query variable product giving me
path category/products/product/someproductCode used:
function leprechaun_query($vars) { $vars[] = 'product'; return $vars; } function leprechaun_flush_rewrite() { global $wp_rewrite; $wp_rewrite->flush_rules(); } function leprechaun_add_rewrite_rules($rules) { $new_rules = array(); $new_rules['category/products/(.+?)/page/?([0-9]{1,})/?$'] = 'index.php?category_name=products&product=$matches[1]&paged=$matches[2]'; $new_rules['category/products/(.+?)/?$'] = 'index.php?category_name=products&product=$matches[1]'; return $new_rules + $rules; }
Any ideas what is happening. This code worked previously on two web sites, both seem to be suffering from same problem.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘problem with query_vars’ is closed to new replies.