I installed Monkey Man Rewrite Analyzer, i got a rule installed, it shows in the list, if i test it with monkey man it says it will fire but it doesn’t in reality, whats wrong?
add_action('init', array($this, 'register_crr_jsonwebservice'), 99);
public function register_crr_jsonwebservice() {
//Add the rewrite rule for this specific json controller
add_rewrite_tag( '%ticket%', '([a-zA-Z0-9]+)');
add_rewrite_rule( 'cjson/fullticket/([a-zA-Z0-9]+)/', 'index.php?p=1312&ticket=$matches[1]', 'top' );
flush_rewrite_rules();
}
Test this rule in MMRA:
cjson/fullticket/231412tgsxcasfasdfas/
Works fine, test it out on wordpress directly copying the same url? 404, not found… what am i doing wrong?
Honestly, can not debug your code, but this one works:
Do not call flush_rewrite_rules(); from this function – will lead to an error. And maybe add_rewrite_tag will have to be caled from separate function on init – have’t tested that.