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.
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 theinit
action.