1

Is there any reason why I should use rewrite_rules_array instead of generate_rewrite_rules?

generate_rewrite_rules works out of the box, but I couldn't get rewrite_rules_array to work.

And I am told that any array actions [when adding custom rewrite rules] should be done via rewrite_rules_array and the rest of *_rewrite_rule filters (e.g. add_rewrite_rule). It's unclear why.

1 Answer 1

3

This is possibly a matter of opinion, but I would say - neither. If you're simply adding new rules, use add_rewrite_rule hooked to the init action.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.